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
+
+
+(a)
+
+
+(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.
+
+
+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.
+
+
+
+
+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.
+
+
+
+# 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
+
+
+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.
+
+
+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.
+
+
+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
+
+
+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.
+
+
+
+
+
+
+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.
+
+
+
+
+
+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.
+
+
+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.
+
+
+
+
+
+
+Figure C.10: Information planes for 4-bit quantized TANH network (left) and RELU network (right). The mean of 30 runs is plotted.
+
+
+
+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.
+
+
+Figure C.11: Information planes for 32-bit quantized TANH network (left) and RELU network (right). The mean of 30 runs is plotted.
+
+
+
+
+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.
+
+
+
+# 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.
+
+
+
+
+
+
+Figure E.13: Information planes for the additional networks trained on MNIST. Note for HOURGLASS that the three last hidden layers almost coincide completely.
+
+
+
+# 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
+
+
+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.
+
+
+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).
+
+
+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:
+
+
+Figure 1: An example of our new node labeling strategy.
+
+
+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.
+
+
+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.
+
+
| Method | Cora | Citeseer | PubMed | Reddit | ogbn-arxiv |
| Random | 78.8(±0.8) | 70.8(±0.9) | 78.9(±0.6) | 91.1(±0.5) | 68.2(±0.4) |
| AGE | 82.5(±0.6) | 71.4(±0.6) | 79.4(±0.4) | 91.6(±0.3) | 68.9(±0.3) |
| ANRMAB | 82.4(±0.5) | 70.6(±0.6) | 78.2(±0.3) | 91.5(±0.3) | 68.7(±0.2) |
| GPA | 82.8(±0.4) | 71.6(±0.4) | 79.9(±0.5) | 91.8(±0.2) | 69.2(±0.3) |
| SEAL | 83.2(±0.5) | 72.1(±0.4) | 80.3(±0.4) | 92.1(±0.3) | 69.5(±0.1) |
| ALG | 83.6(±0.6) | 73.6(±0.5) | 80.9(±0.3) | 92.4(±0.3) | 70.1(±0.2) |
| GRAIN | 84.2(±0.3) | 74.2(±0.3) | 81.8(±0.2) | 92.5(±0.1) | 70.3(±0.2) |
| IGP | 86.4(±0.6) | 75.8(±0.3) | 83.6(±0.5) | 93.4(±0.2) | 70.9(±0.3) |
+
+
+(a) Cora
+
+
+(b) Citeseer
+
+
+(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.
+
+| Method | SGC | APPNP | GCN | MVGRL |
| Random | 77.6(±0.8) | 79.2(±0.6) | 78.9(±0.6) | 79.3(±0.5) |
| AGE | 78.8(±0.5) | 79.9(±0.5) | 79.4(±0.4) | 79.9(±0.4) |
| ANRMAB | 77.8(±0.4) | 78.7(±0.5) | 78.2(±0.3) | 78.9(±0.3) |
| GPA | 79.5(±0.6) | 80.2(±0.4) | 79.9(±0.5) | 80.4(±0.3) |
| SEAL | 79.8(±0.5) | 80.5(±0.5) | 80.3(±0.4) | 80.7(±0.3) |
| ALG | 80.5(±0.4) | 81.2(±0.5) | 80.9(±0.3) | 81.3(±0.2) |
| GRAIN | 81.1(±0.3) | 82.0(±0.4) | 81.8(±0.2) | 82.1(±0.1) |
| IGP | 83.2(±0.6) | 83.7(±0.5) | 83.6(±0.5) | 83.9(±0.4) |
+
+Table 3: Influence of different components in test accuracy(%)
+
+| Method | Cora | Δ | Citeseer | Δ | PubMed | Δ |
| No IT | 84.1(±0.7) | -2.3 | 73.2(±0.3) | -2.6 | 80.7(±0.5) | -2.9 |
| No IS | 83.9(±0.5) | -2.5 | 73.1(±0.4) | -2.7 | 80.4(±0.4) | -3.2 |
| No IM | 84.5(±0.6) | -1.9 | 73.6(±0.5) | -2.2 | 81.5(±0.6) | -2.1 |
| No NL | 84.4(±0.5) | -2.0 | 73.4(±0.3) | -2.4 | 81.3(±0.4) | -2.3 |
| IGP | 86.4(±0.6) | - | 75.8(±0.3) | - | 83.6(±0.5) | - |
+
+
+Figure 5: The node distribution with different labels of different methods on the Cora dataset.
+
+
+
+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/Test | Task type | Description |
| Cora | 2,708 | 1,433 | 5,429 | 7 | 1,208/500/1,000 | Transductive | citation network |
| Citeseer | 3,327 | 3,703 | 4,732 | 6 | 1,827/500/1,000 | Transductive | citation network |
| Pubmed | 19,717 | 500 | 44,338 | 3 | 18,217/500/1,000 | Transductive | citation network |
| ogbn-arxiv | 169,343 | 128 | 1,166,243 | 40 | 90,941/29,799/48,603 | Transductive | citation network |
| Reddit | 232,965 | 602 | 11,606,919 | 41 | 155,310/23,297/54,358 | Inductive | social 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
+
+
+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.
+
+| Method | ANRMAB | GPA | AGE | SEAL | ALG | IGP | IG | GRAIN |
| Relative Running Time | 340.00 | 331.25 | 8.25 | 4.00 | 1.63 | 1.38 | 1.25 | 1.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 |
| SGC | 79.6(±0.7) | 82.8(±0.6) | 83.2(±0.6) | 82.9(±0.5) |
| APPNP | 80.4(±0.6) | 83.4(±0.4) | 83.7(±0.5) | 83.6(±0.5) |
| GCN | 80.7(±0.4) | 83.5(±0.5) | 83.6(±0.5) | 83.4(±0.6) |
| MVGRL | 80.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.
+
+
+(a) The influence of soft label.
+
+
+(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 Degree | 0 | 5 | 10 | 15 |
| 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
+
+
+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
+
+
+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.
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+# 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
+
+
+
+
+
+
+
+
+
+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.
+
+InfoPower dreamer cdreamer tia dbc deepmpdp
+
+
+
+
+
+
+
+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
+
+
+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.
+
+
+
+
+
+
+
+
+
+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.
+
+InfoPower NWJ InfoPower NCE InfoPower NWJ - Policy InfoPower NCE - Policy
+
+
+
+
+
+
+
+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.
+
+
+
+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)}
+$$
+
+
+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.
+
+
+
+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}
+$$
+
+
+
+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.
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+
+L1
+
+
+L2
+
+
+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.
+
+| Name | Levels | Rew@500k | Rew@1M | Sim@500k | Sim@1M |
| Dreamer | L1 | 197 ± 31 | 240 ± 27 | 0.73±0.02 | 0.74±0.01 |
| DBC | L1 | 261 ± 25 | 390 ± 34 | 0.75±0.03 | 0.74±0.02 |
| C-Dreamer | L1 | 291 ± 34 | 590 ± 26 | 0.73±0.02 | 0.79±0.01 |
| DeepMDP | L1 | 263 ± 31 | 340 ± 22 | 0.74±0.02 | 0.75±0.03 |
| InfoPower | L1 | 397 ± 22 | 650 ± 100 | 0.82 ± 0.01 | 0.84 ± 0.03 |
| Dreamer | L2 | 180 ± 36 | 197 ± 20 | 0.56±0.03 | 0.59±0.02 |
| DBC | L2 | 221 ± 28 | 320 ± 33 | 0.65±0.02 | 0.66±0.02 |
| C-Dreamer | L2 | 282 ± 30 | 550 ± 66 | 0.63±0.01 | 0.71±0.02 |
| DeepMDP | L2 | 213 ± 34 | 300 ± 25 | 0.59±0.02 | 0.61±0.04 |
| InfoPower | L2 | 394 ± 30 | 644 ± 101 | 0.77 ± 0.03 | 0.77 ± 0.03 |
| Dreamer | L3 | 140 ± 52 | 157 ± 10 | 0.32±0.02 | 0.33±0.03 |
| DBC | L3 | 165 ± 20 | 221 ± 24 | 0.45±0.01 | 0.48±0.01 |
| C-Dreamer | L3 | 231 ± 39 | 485 ± 86 | 0.58±0.02 | 0.64±0.01 |
| DeepMDP | L3 | 153 ± 23 | 212 ± 28 | 0.44±0.02 | 0.49±0.01 |
| InfoPower | L3 | 389 ± 20 | 624 ± 80 | 0.71 ± 0.01 | 0.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.
+
+ | TIA | DBC | InfoPower |
| 500k | 800k | 500k | 800k | 500k | 800k |
| Walker-Run | 389±45 | 602±40 | 165±92 | 210±32 | 417±22 | 630±33 |
| Cheetah-Run | 384±149 | 579±172 | 261±64 | 277±81 | 425±97 | 572±158 |
| Hopper-Stand | 338±221 | 581±214 | 110±92 | 207±120 | 395±140 | 615±176 |
| Ball-in-a-Cup | 201±197 | 115±110 | - | - | 255±104 | 263±116 |
| Walker-Walk | 878±37 | 948±28 | 545±57 | 630±68 | 925±18 | 972±26 |
| Finger-Spin | 371±96 | 487±107 | 801±10 | 832±4 | 795±34 | 787±58 |
| Hopper-Hop | 47±44 | 72±68 | 5±12 | 0±0 | 85±26 | 77±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
+
+
+Figure 10: Illustration of the distractor setting for results in Table 3.
+
+
+
+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-shifted | Cheetah-Run-shifted |
| 500k | 1M | 500k | 1M |
| DBC | 35±15 | 104±28 | 41±10 | 78±38 |
| CDreamer | 108±36 | 164±45 | 73±44 | 110±52 |
| TIA | 79±42 | 152±33 | 65±24 | 115±28 |
| InfoPower | 168±48 | 278±42 | 130±46 | 207±35 |
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+
+
+# 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.
+
+ | Dreamer | InfoPower |
| Rew @ 500k | Rew @ 1M | Rew @ 500k | 1M |
| Walker Walk | 890±52 | 985±10 | 910±41 | 980±17 |
| Cheetah Run | 580±190 | 811±95 | 586±142 | 810±102 |
| Finger Spin | 570±187 | 573±96 | 590±172 | 598±85 |
| Quadruped Walk | 592±45 | 646±50 | 623±65 | 666±47 |
| Hopper Stand | 701±68 | 906±33 | 715±60 | 930±39 |
| Ball in a Cup | 871±102 | 910±48 | 913±67 | 939±52 |
| Cart-Pole Sparse | 742±58 | 849±88 | 776±40 | 866±80 |
| Quadruped Run | 450±47 | 515±65 | 468±42 | 510±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
+
+| Name | Obs bound | Rew@500k | Rew@1M | Sim@500k | Sim@1M |
| Dreamer | BA | 140 ± 52 | 157 ± 10 | 0.32±0.02 | 0.33±0.03 |
| Contrastive-Dreamer | NCE | 231 ± 39 | 485 ± 86 | 0.58±0.02 | 0.64±0.01 |
| NonGenerative-Dreamer | NWJ | 280 ± 25 | 480 ± 93 | 0.59±0.01 | 0.62±0.05 |
| InfoPower | NCE | 254 ± 27 | 481 ± 30 | 0.69±0.03 | 0.72±0.02 |
| InfoPower | NWJ | 389 ± 20 | 624 ± 80 | 0.71±0.01 | 0.74±0.03 |
| Inverse only | None | 282 ± 70 | 367 ± 24 | 0.63±0.04 | 0.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
+
+
+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
+
+
+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.
+
+
+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.
+
+
+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.
+
+
+
+
+
+
+
+# 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.
+
+
+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.
+
+
+
+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
+
+
+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 |
| Configuration | Network: FC-[100,100], base epoch ne=1, bs: 128, mbs: 128, M=100, sgd |
| Methods | Hyper-parameters |
| RS, WRS(var), CBRS | lr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [0.3, 1.] |
| GSS, FSS-Clust | lr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [0.3, 1.], Memory batch size for gss: 10 |
| Coreset | lr: [0.001, 0.003, 0.01, 0.03], α: [0.1, 0.3, 1.], β: [0.3], nrSlots: 10 |
| InfoGS | lr: [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 |
| InfoRS | lr: [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 |
| Configuration | Network: 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] |
| Methods | Hyper-parameters |
| RS, WRS(var), CBRS | lr: [0.01, 0.03], α: [0.3, 1.], β: [1., 3.] |
| InfoGS | lr: [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 |
| InfoRS | lr: [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.
+
+
+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$ .
+
+
+
+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.
+
+
+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.
+
+
+
+
+
+
+
+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.
+
+
+Figure 9: Test performances against data imbalances over continual learning benchmarks. We compare InfoGS, InfoRS, and the InfoGS with reservoir sampling (InfoGS-RS).
+
+
+
+
+
+
+
+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.
+
+| Method | imbalance=1 | imbalance=3 | imbalance=10 | imbalance=30 |
| Permuted MNIST (M=100) |
| RS (Buzzega et al., 2020) | 75.41 ± 0.32 | 74.90 ± 0.42 | 72.90 ± 0.47 | 66.35 ± 0.41 |
| WRS | 73.76 ± 0.41 | 73.97 ± 0.43 | 71.92 ± 0.50 | 69.44 ± 0.77 |
| CBRS (Chrysakis & Moens, 2020) | 76.86 ± 0.31 | 75.07 ± 0.42 | 71.02 ± 0.44 | 65.73 ± 0.72 |
| GSS (Aljundi et al., 2019b) | 64.46 ± 0.48 | 63.45 ± 0.64 | 61.74 ± 1.11 | 59.36 ± 1.59 |
| FSS-Clust (Aljundi et al., 2019b) | 70.53 ± 0.33 | 70.12 ± 0.57 | 68.35 ± 0.82 | 65.82 ± 0.90 |
| InfoGS | 79.10 ± 0.36 | 79.03 ± 0.29 | 76.51 ± 0.39 | 72.59 ± 0.69 |
| InfoRS | 77.50 ± 0.19 | 77.07 ± 0.32 | 73.97 ± 0.48 | 67.67 ± 0.62 |
| Split MNIST (M=100) |
| RS (Buzzega et al., 2020) | 81.49 ± 0.72 | 78.74 ± 1.17 | 71.94 ± 1.87 | 52.76 ± 1.41 |
| WRS | 75.75 ± 1.24 | 73.90 ± 0.97 | 68.82 ± 2.39 | 65.87 ± 2.92 |
| CBRS(Chrysakis & Moens, 2020) | 80.96 ± 1.43 | 79.71 ± 0.55 | 79.43 ± 2.28 | 75.08 ± 2.73 |
| GSS (Aljundi et al., 2019b) | 45.36 ± 0.95 | 45.10 ± 0.96 | 44.16 ± 1.15 | 49.54 ± 2.57 |
| FSS-Clust (Aljundi et al., 2019b) | 52.85 ± 1.13 | 54.59 ± 1.69 | 54.36 ± 2.11 | 55.33 ± 2.89 |
| Coreset (Borsos et al., 2020) | 69.77 ± 0.75 | 63.47 ± 2.21 | 50.30 ± 2.97 | 42.05 ± 2.19 |
| InfoGS | 78.55 ± 1.37 | 78.35 ± 1.56 | 69.90 ± 2.18 | 67.19 ± 3.52 |
| InfoRS | 80.02 ± 1.53 | 81.48 ± 0.98 | 73.81 ± 2.43 | 63.70 ± 2.63 |
| Split CIFAR10 (M=200) |
| RS(Buzzega et al., 2020) | 50.32 ± 0.30 | 48.31 ± 0.54 | 40.59 ± 0.67 | 32.88 ± 1.43 |
| WRS | 34.14 ± 0.59 | 37.66 ± 0.30 | 37.64 ± 0.68 | 36.65 ± 0.76 |
| CBRS(Chrysakis & Moens, 2020) | 48.35 ± 0.55 | 48.64 ± 0.39 | 47.65 ± 0.31 | 48.90 ± 0.56 |
| InfoGS | 44.99 ± 1.37 | 48.02 ± 0.65 | 44.59 ± 0.77 | 46.18 ± 0.82 |
| InfoRS | 52.61 ± 0.36 | 51.11 ± 0.35 | 46.66 ± 0.76 | 42.10 ± 0.71 |
| Split MiniImageNet (M=1000) |
| RS(Buzzega et al., 2020) | 23.48 ± 0.24 | 23.19 ± 0.30 | 20.93 ± 0.51 | 16.89 ± 0.67 |
| WRS | 17.24 ± 0.27 | 17.04 ± 0.21 | 16.93 ± 0.39 | 15.87 ± 0.25 |
| CBRS(Chrysakis & Moens, 2020) | 21.74 ± 0.07 | 21.41 ± 0.11 | 21.10 ± 0.16 | 20.52 ± 0.26 |
| InfoGS | 20.05 ± 0.15 | 19.89 ± 0.17 | 19.51 ± 0.26 | 19.16 ± 0.33 |
| InfoRS | 23.83 ± 0.14 | 23.35 ± 0.22 | 22.03 ± 0.39 | 19.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.
+
+| Method | imbalance=1 | imbalance=3 | imbalance=10 | imbalance=30 |
| Permuted MNIST (M=100) |
| RS(Buzzega et al., 2020) | 0.88 ± 0.27 | 0.73 ± 0.24 | 0.74 ± 0.24 | 0.75 ± 0.27 |
| WRS | 0.86 ± 0.28 | 0.65 ± 0.22 | 0.84 ± 0.25 | 0.80 ± 0.25 |
| CBRS(Chrysakis & Moens, 2020) | 0.90 ± 0.22 | 0.84 ± 0.30 | 0.72 ± 0.33 | 0.81 ± 0.22 |
| GSS (Aljundi et al., 2019b) | 0.74 ± 0.26 | 0.64 ± 0.29 | 0.77 ± 0.25 | 0.55 ± 0.25 |
| FSS-Clust (Aljundi et al., 2019b) | 1.91 ± 0.23 | 1.89 ± 0.28 | 1.74 ± 0.28 | 1.74 ± 0.34 |
| InfoGS | 0.75 ± 0.26 | 0.67 ± 0.32 | 0.78 ± 0.29 | 0.58 ± 0.28 |
| InfoRS | 0.64 ± 0.30 | 0.92 ± 0.25 | 0.82 ± 0.25 | 0.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.
+
+| Method | imbalance=1 | imbalance=3 | imbalance=10 | imbalance=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.
+
+
+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.
+
+
+
+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.
+
+
+
+
+
+
+Figure 11: The evolution of test accuracies. The first task is trained for 30 times longer than others.
+
+
+
+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.
+
+
+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.
+
+
+
+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.
+
+
+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$ .
+
+
+
+# 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}
+$$
+
+
+
+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}
+$$
+
+
+
+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)
+$$
+
+
\ 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.
+
+
+(a) Training Loss
+
+
+(b) SGD
+
+
+(c) SGLD
+
+
+(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.
+
+
+(a) Truth
+
+
+(b) SGLD
+(c) cycSGLD
+
+
+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).
+
+
+(d) SVGD
+
+
+(e) reSGLD
+
+
+(f) CSGLD
+
+
+(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.
+
+
+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.
+
+| MODEL | ResNet20 | ResNet32 |
| ACC (%) | NLL | Brier (%) | ACC (%) | NLL | Brier (%) |
| cycSGHMC×T4 | 75.41±0.10 | 8437±30 | 2.91±0.13 | 77.93±0.17 | 7658±19 | 3.29±0.13 |
| cycSWAG×T4 | 75.46±0.11 | 8419±26 | 2.78±0.12 | 77.91±0.15 | 7656±22 | 3.19±0.14 |
| M-SGD×P4 | 76.01±0.12 | 8175±25 | 2.58±0.08 | 78.41±0.12 | 7501±23 | 2.77±0.15 |
| reSGHMC×P4 | 76.15±0.16 | 8196±27 | 2.73±0.10 | 78.57±0.07 | 7454±15 | 3.04±0.09 |
| ICSGHMC×P4 | 76.34±0.15 | 8076±31 | 2.54±0.14 | 78.72±0.16 | 7406±29 | 2.76±0.15 |
| MODEL | ResNet56 | WRN-16-8 |
| ACC (%) | NLL | Brier (%) | ACC (%) | NLL | Brier (%) |
| cycSGHMC×T4 | 81.23±0.19 | 6770±59 | 3.18±0.08 | 82.98±0.03 | 6384±11 | 2.17±0.05 |
| cycSWAG×T4 | 81.14±0.11 | 6744±55 | 3.06±0.09 | 83.05±0.04 | 6359±14 | 2.04±0.07 |
| M-SGD×P4 | 81.03±0.14 | 6847±22 | 2.86±0.08 | 82.57±0.07 | 6821±21 | 1.77±0.06 |
| reSGHMC×P4 | 81.11±0.16 | 6915±40 | 2.92±0.12 | 82.72±0.08 | 6452±19 | 1.92±0.04 |
| ICSGHMC×P4 | 81.51±0.18 | 6630±38 | 2.88±0.09 | 83.12±0.10 | 6338±36 | 1.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})$ .
+
+
+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}$ .
+
+
+Figure 6: Estimation KL divergence versus time steps for ICSGLD and baseline methods. We repeat experiments 20 times.
+
+
+
+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.
+
+| ALGORITHM | LEARNING RATE | Temperature | RMSprop | IS | Train | Dropout | ε-Greedy |
| EPSGreEDY×P4 | 5e-7 (0.999) | 0 | YES | NO | 16 | NO | 0.3% |
| CONSTSGD×P4 | 1e-6 | 0 | NO | NO | 16 | NO | NO |
| DROPOUT×P4 | 1e-6 | 0 | NO | NO | 16 | YES (50%) | NO |
| PCSGLD×T4 | 5e-8 | 0.3 | YES | YES | 64 | NO | NO |
| PSGLD×P4 | 3e-7 | 0.3 | YES | NO | 16 | No | NO |
| PICSGLD×P4 | 3e-7 | 0.3 | YES | YES | 16 | No | NO |
+
+# 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.
+
+
+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,
+
+
+(a)
+
+
+(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.
+
+
+(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
+
+
+
+
+(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.
+
+
+(b) VAE
+
+
+(f) MCC on synthetic data
+
+
+
+
+(c) iVAE
+(g) MCC on CMNIST
+
+
+
+
+(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).
+
+| METHOD | TRAIN | TEST |
| ERM | 83.17 ± 1.01 | 22.46 ± 0.68 |
| ERM 1 | 81.33 ± 1.35 | 33.34 ± 8.85 |
| ERM 2 | 84.39 ± 1.89 | 13.16 ± 0.82 |
| ROBUST MIN MAX | 82.81 ± 0.11 | 29.22 ± 8.56 |
| F-IRM GAME | 62.31 ± 2.35 | 69.25 ± 5.82 |
| V-IRM GAME | 68.96 ± 0.95 | 70.19 ± 1.47 |
| IRM | 75.01 ± 0.25 | 55.25 ± 12.42 |
| iCaRL (ours) | 74.96 ± 0.37 | 73.61 ± 0.63 |
| ERM GRYSCALE | 74.79 ± 0.37 | 74.67 ± 0.48 |
| OPTIMAL | 75 | 75 |
+
+Table 2: VLCS. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation).
+
+| METHOD | TEST |
| ERM | 77.4 ± 0.3 |
| IRM | 78.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}
+$$
+
+
+(a)
+
+
+
+
+
+
+(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.
+
+
+(h)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(i)
+
+
+(j)
+
+
+(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.
+
+
+
+# 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.
+
+
+
+# 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(·) | METHOD | TRAIN
+(σ3 = {0.2,2}) | TEST
+(σ3 = 100) |
| Identity | ERM | 0.00 ± 0.00 | 0.00 ± 0.00 |
| IRM | 0.00 ± 0.00 | 0.00 ± 0.00 |
| F-IRM GAME | 0.98 ± 0.23 | 1.03 ± 0.04 |
| V-IRM GAME | 0.99 ± 2.74 | 1.07 ± 2.26 |
| iCaRL (ours) | 0.01 ± 0.03 | 1.00 ± 0.01 |
| Linear | ERM | 0.00 ± 0.00 | 0.00 ± 0.00 |
| IRM | 0.00 ± 0.00 | 0.00 ± 0.00 |
| F-IRM GAME | 0.99 ± 0.01 | 1.08 ± 0.06 |
| V-IRM GAME | 1.00 ± 5.98 | 1.05 ± 0.04 |
| iCaRL (ours) | 0.01 ± 0.03 | 1.01 ± 0.04 |
| Nonlinear | ERM | 0.06 ± 0.01 | 220.79 ± 229.97 |
| IRM | 0.08 ± 0.01 | 149.60 ± 104.85 |
| F-IRM GAME | 1.06 ± 0.09 | 196.59 ± 150.71 |
| V-IRM GAME | 1.00 ± 0.01 | 170.46 ± 125.62 |
| iCaRL (ours) | 0.29 ± 0.04 | 28.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.
+
+| METHOD | Assumption 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-iVAE | pT,λ(Z|Y, E) = Q(Z)/C(Y, E) exp[T(Z)^Tλ(Y, E)] |
+
+
+(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}
+$$
+
+
+(a) Data generating model
+
+
+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.
+
+
+(b)
+
+
+(b) VAE
+(d) ICE-BeeM
+
+
+(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).
+
+| METHOD | TRAIN | TEST |
| ERM | 84.88 ± 0.16 | 10.45 ± 0.66 |
| ERM 1 | 84.84 ± 0.21 | 10.86 ± 0.52 |
| ERM 2 | 84.95 ± 0.20 | 10.05 ± 0.23 |
| ROBUST MIN MAX | 84.25 ± 0.43 | 15.24 ± 2.45 |
| F-IRM GAME | 63.37 ± 1.14 | 59.91 ± 2.69 |
| V-IRM GAME | 63.97 ± 1.03 | 49.06 ± 3.43 |
| IRM | 59.27 ± 4.39 | 62.75 ± 9.59 |
| iCaRL (ours) | 70.56 ± 0.81 | 68.75 ± 1.45 |
| ERM GRAYSCALE | 71.81 ± 0.47 | 71.36 ± 0.65 |
| OPTIMAL | 75 | 75 |
+
+Table 6: PACS. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation).
+
+| METHOD | TEST |
| ERM | 85.7 ± 0.5 |
| IRM | 84.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
+
+
+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.
+
+
+
+
+
+
+
+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
+
+
+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.
+
+| Problem | Input | Target 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
+
+
+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:
+
+
+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.
+
+
+Figure 5: Changing Focuses. Predicted weights of different covariates at two-year time intervals.
+
+
+
+
+
+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
+
+
+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).
+
+| Method | AUC ↑ | APS ↑ |
| BC-Linear | 0.798 ± 0.002 | 0.647 ± 0.001 |
| BC-Deep | 0.803 ± 0.002 | 0.655 ± 0.001 |
| RCAL | 0.797 ± 0.008 | 0.662 ± 0.003 |
| CIRL | 0.553 ± 0.008 | 0.510 ± 0.002 |
| IOL (Ours) | 0.824 ± 0.006 | 0.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
+
+| AGE | Recipient's age at transplant |
| AGE_DON | Donor's age at transplant |
| ALBUMIN_TX | Recipient's albumin concentration at transplant |
| ASCITES_TX | Recipient had ascites at the time of transplant |
| BMI_CALC | Recipient's BMI |
| COD_CAD_DON | Cause of death of the donor |
| COLD_ISCH | Cold ischemia time - length of time from the donor being recovered until it is transplanted |
| CREAT_DON | Donor's creatinine concentration |
| CREAT_TX | Recipient's creatinine concentration at transplant |
| DIAL_TX | Whether recipient was on dialysis before transplant |
| ETHCAT | Recipient's ethnicity |
| ETHCAT_DON | Donor's ethnicity |
| EXC_HCC | Whether the recipient received a hepatocellular carcinoma exception point |
| FUNC_STAT_TRR | Recipient's functional status at the time of transplant |
| HCV_SEROSTATUS | Whether the recipient has hepatitis C |
| INR_TX | Recipient's INR value at the time transplant |
| LIFE_SUP_TRR | Whether the recipient was on life support at the time of transplant |
| MED_COND_TRR | Whether the recipient was in an icu, hospital bed, or came from home before transplant |
| MELD_PELDLAB_SCORE | Recipient MELD score |
| NON_HRT_DON | Whether the donor was a DCD (donation after cardiac death) |
| NUM_PREV_TX | Number of previous liver transplants the recipient has had |
| ON_VENT_TRR | Whether the recipient was on a mechanical ventilator before transplant |
| PORTAL_VEIN_TRR | Whether the recipient had a portal vein thrombosis at the time of transplant |
| PREV_ABSURG_TRR | Whether the recipient had prior abdominal surgery before the liver transplant |
| PREV_TX | Whether the recipient had any previous transplant |
| SHARE_TX | Whether the donor is local, regional, or national |
| TBILI_TX | Recipient's bilirubin at the time of transplant |
| TXLIV | Whether the graft is whole or segmental |
| death_mech_don_group | Donor mechanism of death |
| deathcirc | Donor circumstance of death |
| diag1 | Recipient's primary cause of liver disease |
| meldstat | Whether the recipient is status 1a |
| statushcc | Whether the recipient has hcc |
| status1 | Whether 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).
+
+ | ICU | CF | Wards |
| Metric | AUC | APS | AUC | APS | AUC | APS |
| BC-L | 0.681 ± 0.001 | 0.655 ± 0.000 | 0.830 ± 0.010 | 0.797 ± 0.009 | 0.896 ± 0.006 | 0.853 ± 0.002 |
| BC-D | 0.668 ± 0.003 | 0.654 ± 0.001 | 0.952 ± 0.010 | 0.834 ± 0.003 | 0.845 ± 0.010 | 0.811 ± 0.013 |
| RCAL | 0.396 ± 0.018 | 0.563 ± 0.007 | 0.689 ± 0.022 | 0.745 ± 0.008 | 0.942 ± 0.003 | 0.920 ± 0.004 |
| IOL | 0.686 ± 0.092 | 0.631 ± 0.065 | 0.942 ± 0.031 | 0.943 ± 0.026 | 0.965 ± 0.031 | 0.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
+
+
+
+
+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)
+$$
+
+
+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.
+
+
+
+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 → | Balanced | Imbalanced | Balanced | Imbalanced |
| Objective → | Margin · Distance | Margin · Semi-hard |
| UPSTREAM EMBEDDING | Recall@1 | 0.017 ± 0.007 | 0.212 ± 0.029 | 0.02 ± 0.007 | 0.187 ± 0.031 |
| NMI | -0.001 ± 0.004 | 0.112 ± 0.012 | -0.004 ± 0.004 | 0.092 ± 0.017 |
| \(U_{\text{KL}}\) | -0.042 ± 0.003 | 0.0 ± 0.002 | -0.048 ± 0.004 | 0.002 ± 0.004 |
| DOWNSTREAM CLASSIFICATION | Precision | 0.339 ± 0.007 | 0.39 ± 0.014 | 0.33 ± 0.004 | 0.393 ± 0.015 |
| Recall | 0.36 ± 0.007 | 0.424 ± 0.018 | 0.351 ± 0.005 | 0.43 ± 0.016 |
| Accuracy | 0.014 ± 0.002 | 0.131 ± 0.027 | 0.016 ± 0.005 | 0.131 ± 0.031 |
| Objective → | Triplet · Distance | Triplet · Semi-hard |
| UPSTREAM EMBEDDING | Recall@1 | 0.019 ± 0.006 | 0.159 ± 0.031 | 0.019 ± 0.006 | 0.168 ± 0.036 |
| NMI | -0.001 ± 0.004 | 0.103 ± 0.016 | -0.004 ± 0.006 | 0.082 ± 0.016 |
| \(U_{\text{KL}}\) | -0.054 ± 0.006 | -0.004 ± 0.009 | -0.051 ± 0.006 | 0.014 ± 0.011 |
| DOWNSTREAM CLASSIFICATION | Precision | 0.336 ± 0.005 | 0.41 ± 0.014 | 0.338 ± 0.007 | 0.384 ± 0.014 |
| Recall | 0.357 ± 0.004 | 0.459 ± 0.016 | 0.359 ± 0.007 | 0.426 ± 0.016 |
| Accuracy | 0.016 ± 0.003 | 0.179 ± 0.031 | 0.02 ± 0.005 | 0.134 ± 0.031 |
+
+
+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.
+
+
+
+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 Datasets | CelebA (skintone) | LFW (race) |
| PARADE | Margin · Distance | PARADE | Margin · Distance |
| UPSTREAM EMBEDDING | Recall@1 | 0.085 ± 0.009 | 0.122 ± 0.005 | 0.075 ± 0.014 | 0.068 ± 0.013 |
| NMI | -0.012 ± 0.003 | -0.002 ± 0.003 | 0.041 ± 0.003 | 0.048 ± 0.003 |
| \( U_{\text{KL}} \) | -0.04 ± 0.011 | -0.03 ± 0.007 | 0.163 ± 0.003 | 0.165 ± 0.005 |
| DOWNSTREAM CLASSIFICATION | Precision | 0.146 ± 0.006 | 0.1 ± 0.007 | 0.004 ± 0.002 | 0.005 ± 0.005 |
| Recall | 0.141 ± 0.007 | 0.098 ± 0.007 | 0.003 ± 0.001 | 0.007 ± 0.006 |
| Accuracy | 0.131 ± 0.006 | 0.082 ± 0.005 | 0.009 ± 0.003 | 0.012 ± 0.009 |
+
+(b)
+
+| CUB200-2011 color | PARADE (M · D) | Margin · Distance | PARADE (T · D) | Triplet · Distance |
| UPSTREAM EMBEDDING | Recall@1 | 0.172 ± 0.021 | 0.176 ± 0.041 | 0.172 ± 0.027 | 0.195 ± 0.051 |
| NMI | 0.349 ± 0.031 | 0.326 ± 0.184 | 0.372 ± 0.291 | 0.359 ± 0.024 |
| \( U_{KL} \) | 0.167 ± 0.013 | 0.153 ± 0.013 | 0.174 ± 0.035 | 0.159 ± 0.018 |
| DOWNSTREAM CLASSIFICATION | Precision | 0.317 ± 0.046 | 0.333 ± 0.049 | 0.248 ± 0.038 | 0.308 ± 0.119 |
| Recall | 0.352 ± 0.039 | 0.363 ± 0.046 | 0.276 ± 0.042 | 0.337 ± 0.123 |
| Accuracy | 0.163 ± 0.018 | 0.153 ± 0.028 | 0.148 ± 0.049 | 0.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
+
+
+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.
+
+
+
+
+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.
+
+
+
+ | Black | Blue | Brown | Buff | Green | Grey | Iridescent | Olive | Orange | Red | White | Yellow |
| Train | 21.20 | 5.58 | 18.08 | 3.01 | 0.37 | 19.20 | 0.51 | 0.49 | 1.02 | 3.52 | 13.35 | 13.65 |
| Test | 21.17 | 5.56 | 18.11 | 3.04 | 0.39 | 19.21 | 0.51 | 0.51 | 1.01 | 3.52 | 13.29 | 13.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
+
+
+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.
+
+
+
+ | I | II | III | IV | V | VI |
| Train | 1.10 | 32.04 | 47.92 | 15.12 | 3.20 | 0.61 |
| Test | 1.24 | 32.09 | 48.09 | 14.81 | 3.22 | 0.55 |
+
+
+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.
+
+
+
+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.
+
+ | Asian | Black | Indian | White |
| Train | 8.43 | 4.17 | 1.71 | 85.70 |
| Test | 6.27 | 4.61 | 1.79 | 87.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\)Distance | Overall |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced |
| UPSTREAM EMBEDDING | | Recall@1 | 0.861±0.003 | 0.83±0.005 | 0.854±0.002 | 0.819±0.008 | 0.83±0.002 | 0.811±0.006 |
| NMI | 0.909±0.003 | 0.879±0.003 | 0.894±0.003 | 0.867±0.005 | 0.876±0.004 | 0.861±0.007 |
| \(U_{KL}\) | 0.433±0.004 | 0.457±0.008 | 0.096±0.002 | 0.091±0.002 | 0.133±0.004 | 0.133±0.003 |
| DOWNSTREAM CLASSIFICATION | LR | Accuracy | 0.878±0.002 | 0.848±0.006 | 0.88±0.002 | 0.861±0.004 | 0.858±0.005 | 0.853±0.005 |
| Precision | 0.877±0.002 | 0.848±0.007 | 0.883±0.002 | 0.864±0.004 | 0.86±0.005 | 0.856±0.005 |
| Recall | 0.876±0.002 | 0.846±0.006 | 0.879±0.002 | 0.86±0.004 | 0.856±0.005 | 0.852±0.005 |
| RF | Accuracy | 0.855±0.002 | 0.832±0.006 | 0.816±0.003 | 0.758±0.011 | 0.819±0.005 | 0.79±0.006 |
| Precision | 0.859±0.003 | 0.835±0.006 | 0.82±0.003 | 0.763±0.01 | 0.822±0.005 | 0.794±0.006 |
| Recall | 0.855±0.003 | 0.831±0.006 | 0.815±0.003 | 0.757±0.011 | 0.817±0.005 | 0.788±0.005 |
| SVM | Accuracy | 0.876±0.002 | 0.852±0.006 | 0.882±0.002 | 0.863±0.004 | 0.863±0.005 | 0.86±0.004 |
| Precision | 0.875±0.002 | 0.855±0.007 | 0.888±0.002 | 0.875±0.003 | 0.867±0.005 | 0.867±0.004 |
| Recall | 0.874±0.002 | 0.85±0.006 | 0.881±0.002 | 0.863±0.004 | 0.863±0.005 | 0.86±0.004 |
| Overall |
| Multisimilarity | Proxy-NCA | Triplet \(\cdot\) Distance | Triplet \(\cdot\) Semi-hard |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | | Recall@1 | 0.858±0.002 | 0.839±0.005 | 0.887±0.001 | 0.858±0.005 | 0.866±0.003 | 0.848±0.006 | 0.794±0.003 |
| NMI | 0.898±0.003 | 0.881±0.004 | 0.915±0.003 | 0.89±0.005 | 0.903±0.001 | 0.884±0.005 | 0.849±0.001 |
| \(U_{KL}\) | 0.151±0.002 | 0.155±0.003 | 0.083±0.001 | 0.094±0.003 | 0.304±0.003 | 0.293±0.003 | 0.397±0.009 |
| DOWNSTREAM CLASSIFICATION | LR | Accuracy | 0.886±0.001 | 0.875±0.005 | 0.898±0.003 | 0.877±0.005 | 0.885±0.002 | 0.872±0.004 | 0.828±0.004 |
| Precision | 0.889±0.001 | 0.878±0.004 | 0.901±0.002 | 0.879±0.005 | 0.888±0.002 | 0.874±0.003 | 0.829±0.003 |
| Recall | 0.885±0.001 | 0.873±0.005 | 0.898±0.003 | 0.876±0.005 | 0.883±0.002 | 0.87±0.004 | 0.825±0.003 |
| RF | Accuracy | 0.825±0.004 | 0.794±0.005 | 0.852±0.003 | 0.823±0.007 | 0.858±0.003 | 0.836±0.004 | 0.808±0.004 |
| Precision | 0.831±0.004 | 0.797±0.006 | 0.857±0.003 | 0.825±0.008 | 0.861±0.003 | 0.838±0.004 | 0.811±0.004 |
| Recall | 0.824±0.004 | 0.793±0.005 | 0.852±0.003 | 0.823±0.008 | 0.857±0.003 | 0.835±0.004 | 0.807±0.004 |
| SVM | Accuracy | 0.888±0.001 | 0.876±0.004 | 0.894±0.002 | 0.871±0.003 | 0.887±0.002 | 0.878±0.004 | 0.835±0.003 |
| Precision | 0.893±0.001 | 0.886±0.004 | 0.902±0.001 | 0.887±0.003 | 0.892±0.002 | 0.884±0.004 | 0.839±0.003 |
| Recall | 0.887±0.001 | 0.876±0.004 | 0.894±0.002 | 0.871±0.003 | 0.886±0.003 | 0.877±0.003 | 0.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\)Distance | Subgroup Gap |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | | Recall@1 | 0.861±0.003 | 0.83±0.005 | 0.854±0.002 | 0.819±0.008 | 0.83±0.002 | | |
| NMI | -0.013±0.004 | 0.106±0.013 | -0.016±0.005 | 0.124±0.014 | -0.018±0.006 | 0.11±0.016 | |
| \(U_{KL}\) | -0.093±0.004 | 0.011±0.011 | -0.033±0.002 | 0.01±0.003 | -0.038±0.006 | 0.012±0.005 | |
| DOWNSTREAM CLASSIFICATION | LR | Accuracy | 0.002±0.003 | 0.147±0.023 | 0.003±0.003 | 0.12±0.013 | 0.004±0.007 | 0.115±0.018 | |
| Precision | 0.336±0.004 | 0.407±0.013 | 0.355±0.008 | 0.402±0.013 | 0.353±0.008 | 0.403±0.013 | |
| Recall | 0.351±0.004 | 0.439±0.016 | 0.368±0.008 | 0.426±0.015 | 0.367±0.008 | 0.431±0.014 | |
| RF | Accuracy | 0.001±0.006 | 0.115±0.021 | 0.002±0.004 | 0.315±0.022 | 0.002±0.008 | 0.231±0.024 | |
| Precision | 0.358±0.005 | 0.396±0.013 | 0.374±0.006 | 0.441±0.013 | 0.362±0.007 | 0.429±0.014 | |
| Recall | 0.373±0.005 | 0.409±0.015 | 0.387±0.006 | 0.502±0.013 | 0.376±0.008 | 0.481±0.016 | |
| SVM | Accuracy | 0.003±0.004 | 0.086±0.022 | 0.002±0.003 | 0.039±0.013 | 0.002±0.006 | 0.055±0.018 | |
| Precision | 0.33±0.006 | 0.332±0.023 | 0.35±0.008 | 0.283±0.024 | 0.347±0.011 | 0.328±0.018 | |
| Recall | 0.347±0.004 | 0.338±0.027 | 0.363±0.008 | 0.27±0.027 | 0.361±0.011 | 0.327±0.018 | |
| Multisimilarity | Proxy-NCA | Triplet\(\cdot\)Distance | Triplet\(\cdot\)Semi-hard |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | Recall@1 | 0.858±0.002 | 0.839±0.005 | 0.887±0.001 | 0.858±0.005 | 0.866±0.003 | 0.848±0.006 | 0.794±0.003 | 0.778±0.006 |
| NMI | -0.014±0.004 | 0.116±0.014 | -0.011±0.004 | 0.148±0.014 | -0.013±0.001 | 0.109±0.016 | -0.018±0.002 | 0.083±0.015 |
| \(U_{KL}\) | -0.03±0.003 | 0.005±0.004 | -0.129±0.002 | 0.005±0.005 | -0.047±0.005 | 0.011±0.006 | -0.034±0.013 | 0.023±0.011 |
| DOWNSTREAM CLASSIFICATION | LR | Accuracy | 0.002±0.002 | 0.117±0.018 | 0.003±0.005 | 0.155±0.019 | 0.001±0.004 | 0.004±0.005 | 0.12±0.016 |
| Precision | 0.352±0.006 | 0.396±0.014 | 0.334±0.006 | 0.438±0.012 | 0.343±0.005 | 0.357±0.004 | 0.392±0.009 |
| Recall | 0.365±0.006 | 0.418±0.018 | 0.347±0.006 | 0.46±0.016 | 0.356±0.005 | 0.431±0.013 | 0.421±0.01 |
| RF | Accuracy | 0.0±0.006 | 0.26±0.023 | 0.221±0.022 | 0.0±0.004 | 0.168±0.015 | 0.003±0.005 | 0.141±0.02 |
| Precision | 0.378±0.005 | 0.441±0.011 | 0.379±0.005 | 0.458±0.01 | 0.361±0.006 | 0.361±0.004 | 0.393±0.012 |
| Recall | 0.389±0.005 | 0.485±0.009 | 0.39±0.005 | 0.476±0.011 | 0.375±0.006 | 0.45±0.009 | 0.426±0.012 |
| SVM | Accuracy | 0.002±0.002 | 0.047±0.015 | 0.0±0.003 | 0.076±0.013 | 0.0±0.004 | 0.063±0.018 | 0.073±0.02 |
| Precision | 0.349±0.006 | 0.267±0.03 | 0.335±0.006 | 0.29±0.026 | 0.339±0.007 | 0.297±0.03 | 0.364±0.015 |
| Recall | 0.362±0.005 | 0.258±0.032 | 0.349±0.006 | 0.273±0.029 | 0.353±0.007 | 0.295±0.03 | 0.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. | ProxyNCA | Triplet (D) | Triplet (S) |
| Overall |
| ACCURACY | 0.812 ± 0.011 | 0.834 ± 0.009 | 0.820 ± 0.008 | 0.842 ± 0.008 | 0.869 ± 0.005 | 0.836 ± 0.007 | 0.742 ± 0.007 |
| PRECISION | 0.834 ± 0.009 | 0.861 ± 0.004 | 0.847 ± 0.004 | 0.872 ± 0.004 | 0.878 ± 0.005 | 0.865 ± 0.009 | 0.804 ± 0.008 |
| RECALL | 0.811 ± 0.011 | 0.833 ± 0.009 | 0.818 ± 0.008 | 0.840 ± 0.008 | 0.869 ± 0.005 | 0.834 ± 0.008 | 0.740 ± 0.008 |
| Gap |
| ACCURACY | 0.001 ± 0.027 | 0.010 ± 0.018 | 0.017 ± 0.021 | 0.018 ± 0.018 | 0.120 ± 0.018 | 0.022 ± 0.017 | 0.094 ± 0.021 |
| PRECISION | 0.304 ± 0.021 | 0.275 ± 0.021 | 0.313 ± 0.019 | 0.247 ± 0.027 | 0.398 ± 0.015 | 0.236 ± 0.022 | 0.289 ± 0.016 |
| RECALL | 0.260 ± 0.024 | 0.218 ± 0.022 | 0.258 ± 0.018 | 0.182 ± 0.027 | 0.398 ± 0.018 | 0.175 ± 0.022 | 0.177 ± 0.016 |
+
+(b) Oversampling
+
+| METRIC ↓ | Contr. (D) | Margin (D) | Margin (Sem.) | Msim. | ProxyNCA | Triplet (D) | Triplet (S) |
| Overall |
| ACCURACY | 0.851 ± 0.007 | 0.862 ± 0.004 | 0.853 ± 0.006 | 0.875 ± 0.004 | 0.878 ± 0.004 | 0.875 ± 0.005 | 0.820 ± 0.005 |
| PRECISION | 0.854 ± 0.006 | 0.864 ± 0.004 | 0.855 ± 0.006 | 0.877 ± 0.004 | 0.880 ± 0.005 | 0.876 ± 0.004 | 0.822 ± 0.005 |
| RECALL | 0.853 ± 0.006 | 0.862 ± 0.004 | 0.853 ± 0.006 | 0.875 ± 0.004 | 0.878 ± 0.004 | 0.875 ± 0.004 | 0.821 ± 0.005 |
| Gap |
| ACCURACY | 0.128 ± 0.023 | 0.099 ± 0.014 | 0.102 ± 0.020 | 0.097 ± 0.019 | 0.136 ± 0.017 | 0.108 ± 0.018 | 0.109 ± 0.019 |
| PRECISION | 0.398 ± 0.012 | 0.386 ± 0.017 | 0.391 ± 0.014 | 0.383 ± 0.015 | 0.422 ± 0.014 | 0.387 ± 0.013 | 0.387 ± 0.011 |
| RECALL | 0.423 ± 0.015 | 0.403 ± 0.017 | 0.414 ± 0.014 | 0.396 ± 0.019 | 0.436 ± 0.017 | 0.406 ± 0.015 | 0.413 ± 0.012 |
+
+
+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.
+
+
+
+
+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\)Distance | Imbalanced\(\cdot\)Distance | Margin \(\cdot\)Distance | Margin \(\cdot\)Semi-hard |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Imbalanced |
| UPSTREAM EMBEDDING | LR | Recall@1 | 0.79 ± 0.002 | 0.782 ± 0.005 | 0.786 ± 0.003 | 0.78 ± 0.005 | 0.775 ± 0.006 | 0.766 ± 0.006 | |
| NMI | 0.872 ± 0.002 | 0.859 ± 0.003 | 0.861 ± 0.003 | 0.856 ± 0.004 | 0.856 ± 0.003 | 0.85 ± 0.005 | |
| \(U_{KL}\) | 0.397 ± 0.003 | 0.449 ± 0.007 | 0.076 ± 0.001 | 0.076 ± 0.001 | 0.113 ± 0.003 | 0.113 ± 0.002 | |
| DOWNSTREAM CLASSIFICATION | RF | Accuracy | 0.815 ± 0.002 | 0.81 ± 0.005 | 0.815 ± 0.002 | 0.827 ± 0.006 | 0.809 ± 0.004 | 0.818 ± 0.005 | |
| Precision | 0.817 ± 0.002 | 0.811 ± 0.005 | 0.822 ± 0.001 | 0.831 ± 0.006 | 0.815 ± 0.004 | 0.822 ± 0.005 | |
| Recall | 0.815 ± 0.002 | 0.81 ± 0.005 | 0.816 ± 0.002 | 0.827 ± 0.006 | 0.81 ± 0.004 | 0.818 ± 0.005 | |
| SVM | Accuracy | 0.776 ± 0.002 | 0.787 ± 0.007 | 0.757 ± 0.003 | 0.735 ± 0.009 | 0.768 ± 0.002 | 0.758 ± 0.004 | |
| Precision | 0.785 ± 0.003 | 0.793 ± 0.006 | 0.762 ± 0.003 | 0.737 ± 0.01 | 0.774 ± 0.002 | 0.762 ± 0.004 | |
| Recall | 0.776 ± 0.002 | 0.787 ± 0.007 | 0.757 ± 0.003 | 0.735 ± 0.009 | 0.769 ± 0.002 | 0.758 ± 0.004 | |
| Accuracy | 0.813 ± 0.002 | 0.811 ± 0.007 | 0.81 ± 0.002 | 0.82 ± 0.007 | 0.808 ± 0.004 | 0.815 ± 0.004 | |
| Precision | 0.823 ± 0.003 | 0.821 ± 0.007 | 0.827 ± 0.002 | 0.843 ± 0.005 | 0.818 ± 0.003 | 0.829 ± 0.004 | |
| Recall | 0.813 ± 0.002 | 0.811 ± 0.007 | 0.811 ± 0.002 | 0.82 ± 0.006 | 0.808 ± 0.003 | 0.815 ± 0.004 | |
| Overall |
| Multisimilarity | Proxy-NCA | Triplet \(\cdot\) Distance | Triplet \(\cdot\) Semi-hard |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | LR | Recall@1 | 0.779 ± 0.006 | 0.788 ± 0.005 | 0.807 ± 0.004 | 0.8 ± 0.007 | 0.792 ± 0.003 | 0.795 ± 0.007 | 0.761 ± 0.004 |
| NMI | 0.857 ± 0.003 | 0.857 ± 0.004 | 0.873 ± 0.003 | 0.86 ± 0.005 | 0.866 ± 0.002 | 0.861 ± 0.005 | 0.848 ± 0.005 |
| \(U_{KL}\) | 0.139 ± 0.001 | 0.146 ± 0.002 | 0.056 ± 0.001 | 0.073 ± 0.001 | 0.274 ± 0.005 | 0.277 ± 0.005 | 0.336 ± 0.004 |
| DOWNSTREAM CLASSIFICATION | Accuracy | 0.813 ± 0.004 | 0.833 ± 0.004 | 0.824 ± 0.003 | 0.828 ± 0.005 | 0.82 ± 0.001 | 0.828 ± 0.005 | 0.802 ± 0.003 |
| Precision | 0.82 ± 0.004 | 0.836 ± 0.004 | 0.828 ± 0.003 | 0.833 ± 0.005 | 0.826 ± 0.001 | 0.833 ± 0.006 | 0.808 ± 0.003 |
| Recall | 0.814 ± 0.004 | 0.833 ± 0.004 | 0.824 ± 0.003 | 0.828 ± 0.005 | 0.82 ± 0.001 | 0.828 ± 0.005 | 0.803 ± 0.003 |
| RF | Accuracy | 0.754 ± 0.003 | 0.754 ± 0.005 | 0.761 ± 0.006 | 0.768 ± 0.007 | 0.786 ± 0.004 | 0.789 ± 0.008 | 0.776 ± 0.003 |
| Precision | 0.76 ± 0.004 | 0.755 ± 0.005 | 0.768 ± 0.007 | 0.774 ± 0.006 | 0.794 ± 0.004 | 0.792 ± 0.009 | 0.782 ± 0.003 |
| Recall | 0.754 ± 0.003 | 0.755 ± 0.005 | 0.762 ± 0.006 | 0.768 ± 0.007 | 0.786 ± 0.004 | 0.789 ± 0.008 | 0.777 ± 0.003 |
| SVM | Accuracy | 0.812 ± 0.002 | 0.828 ± 0.006 | 0.818 ± 0.002 | 0.816 ± 0.005 | 0.819 ± 0.002 | 0.83 ± 0.005 | 0.798 ± 0.001 |
| Precision | 0.825 ± 0.003 | 0.848 ± 0.005 | 0.834 ± 0.002 | 0.852 ± 0.004 | 0.829 ± 0.003 | 0.845 ± 0.004 | 0.806 ± 0.002 |
| Recall | 0.812 ± 0.002 | 0.828 ± 0.006 | 0.819 ± 0.002 | 0.817 ± 0.005 | 0.819 ± 0.002 | 0.831 ± 0.005 | 0.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\)Distance | Subgroup Gap |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | Recall@1 | 0.011 ± 0.004 | 0.168 ± 0.028 | 0.008 ± 0.005 | 0.212 ± 0.029 | 0.01 ± 0.008 | 0.187 ± 0.031 | | |
| NMI | -0.009 ± 0.002 | 0.109 ± 0.015 | -0.008 ± 0.005 | 0.112 ± 0.012 | -0.009 ± 0.003 | 0.092 ± 0.017 | | |
| \(U_{KL}\) | -0.112 ± 0.004 | 0.004 ± 0.011 | -0.043 ± 0.002 | 0.0 ± 0.002 | -0.05 ± 0.004 | 0.002 ± 0.004 | | |
| DOWNSTREAM CLASSIFICATION | LR Accuracy | 0.014 ± 0.004 | 0.181 ± 0.029 | 0.008 ± 0.003 | 0.131 ± 0.027 | 0.009 ± 0.006 | 0.131 ± 0.031 | | |
| Precision | 0.333 ± 0.003 | 0.417 ± 0.012 | 0.337 ± 0.005 | 0.39 ± 0.014 | 0.331 ± 0.006 | 0.393 ± 0.015 | | |
| Recall | 0.354 ± 0.004 | 0.462 ± 0.016 | 0.356 ± 0.005 | 0.424 ± 0.018 | 0.351 ± 0.007 | 0.43 ± 0.016 | | |
| RF Accuracy | 0.013 ± 0.004 | 0.121 ± 0.026 | 0.009 ± 0.005 | 0.325 ± 0.035 | 0.01 ± 0.006 | 0.255 ± 0.031 | | |
| Precision | 0.339 ± 0.007 | 0.386 ± 0.014 | 0.347 ± 0.006 | 0.428 ± 0.011 | 0.342 ± 0.007 | 0.418 ± 0.014 | | |
| Recall | 0.359 ± 0.006 | 0.391 ± 0.015 | 0.365 ± 0.006 | 0.495 ± 0.01 | 0.362 ± 0.007 | 0.478 ± 0.014 | | |
| SVM Accuracy | 0.014 ± 0.003 | 0.106 ± 0.032 | 0.009 ± 0.004 | 0.043 ± 0.028 | 0.009 ± 0.006 | 0.058 ± 0.029 | | |
| Precision | 0.326 ± 0.008 | 0.36 ± 0.021 | 0.332 ± 0.008 | 0.301 ± 0.023 | 0.329 ± 0.006 | 0.329 ± 0.017 | | |
| Recall | 0.345 ± 0.007 | 0.362 ± 0.024 | 0.348 ± 0.008 | 0.278 ± 0.027 | 0.348 ± 0.006 | 0.323 ± 0.02 | | |
| Multisimilarity | Subgroup Gap |
| Balanced | Imbalanced | Proxy-NCA | Triplet\(\cdot\) Distance | Triplet\(\cdot\) Semi-hard |
| Balanced | Imbalanced | Balanced | Imbalanced | Balanced |
| UPSTREAM EMBEDDING | Recall@1 | 0.008 ± 0.009 | 0.187 ± 0.031 | 0.01 ± 0.005 | 0.256 ± 0.03 | 0.009 ± 0.004 | 0.159 ± 0.031 | 0.009 ± 0.006 | 0.168 ± 0.036 |
| NMI | -0.008 ± 0.004 | 0.113 ± 0.016 | -0.009 ± 0.004 | 0.142 ± 0.015 | -0.007 ± 0.003 | 0.103 ± 0.016 | -0.01 ± 0.006 | 0.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.005 | 0.014 ± 0.011 |
| DOWNSTREAM CLASSIFICATION | LR Accuracy | 0.009 ± 0.006 | 0.141 ± 0.032 | 0.007 ± 0.005 | 0.169 ± 0.027 | 0.011 ± 0.002 | 0.179 ± 0.031 | 0.011 ± 0.005 | 0.134 ± 0.031 |
| Precision | 0.337 ± 0.008 | 0.391 ± 0.016 | 0.337 ± 0.005 | 0.428 ± 0.018 | 0.335 ± 0.005 | 0.41 ± 0.014 | 0.336 ± 0.006 | 0.384 ± 0.014 |
| Recall | 0.356 ± 0.008 | 0.427 ± 0.019 | 0.356 ± 0.006 | 0.455 ± 0.019 | 0.355 ± 0.004 | 0.459 ± 0.016 | 0.357 ± 0.006 | 0.426 ± 0.016 |
| RF Accuracy | 0.009 ± 0.006 | 0.282 ± 0.034 | 0.009 ± 0.009 | 0.214 ± 0.026 | 0.01 ± 0.005 | 0.192 ± 0.035 | 0.011 ± 0.004 | 0.175 ± 0.03 |
| Precision | 0.348 ± 0.006 | 0.428 ± 0.011 | 0.355 ± 0.01 | 0.436 ± 0.009 | 0.347 ± 0.006 | 0.409 ± 0.014 | 0.341 ± 0.007 | 0.393 ± 0.013 |
| Recall | 0.365 ± 0.005 | 0.48 ± 0.012 | 0.372 ± 0.01 | 0.443 ± 0.01 | 0.364 ± 0.007 | 0.44 ± 0.014 | 0.36 ± 0.006 | 0.437 ± 0.015 |
| SVM Accuracy | 0.009 ± 0.003 | 0.048 ± 0.027 | 0.009 ± 0.003 | 0.063 ± 0.026 | 0.011 ± 0.003 | 0.071 ± 0.027 | 0.012 ± 0.002 | 0.082 ± 0.03 |
| Precision | 0.335 ± 0.005 | 0.307 ± 0.02 | 0.33 ± 0.006 | 0.347 ± 0.022 | 0.334 ± 0.006 | 0.324 ± 0.014 | 0.334 ± 0.005 | 0.34 ± 0.012 |
| Recall | 0.352 ± 0.004 | 0.284 ± 0.023 | 0.347 ± 0.004 | 0.299 ± 0.022 | 0.353 ± 0.006 | 0.315 ± 0.017 | 0.355 ± 0.005 | 0.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. | ProxyNCA | Triplet (D) | Triplet (S) |
| Overall |
| ACCURACY | 0.782 ± 0.008 | 0.809 ± 0.004 | 0.794 ± 0.005 | 0.805 ± 0.004 | 0.823 ± 0.006 | 0.798 ± 0.005 | 0.749 ± 0.006 |
| PRECISION | 0.805 ± 0.011 | 0.840 ± 0.006 | 0.827 ± 0.005 | 0.847 ± 0.005 | 0.836 ± 0.006 | 0.842 ± 0.005 | 0.806 ± 0.006 |
| RECALL | 0.782 ± 0.008 | 0.809 ± 0.004 | 0.795 ± 0.005 | 0.805 ± 0.004 | 0.823 ± 0.006 | 0.798 ± 0.004 | 0.749 ± 0.005 |
| Gap |
| ACCURACY | 0.034 ± 0.033 | 0.003 ± 0.030 | 0.014 ± 0.031 | 0.024 ± 0.031 | 0.140 ± 0.030 | 0.024 ± 0.030 | 0.077 ± 0.031 |
| PRECISION | 0.340 ± 0.024 | 0.304 ± 0.031 | 0.301 ± 0.022 | 0.264 ± 0.028 | 0.410 ± 0.022 | 0.262 ± 0.032 | 0.270 ± 0.018 |
| RECALL | 0.308 ± 0.027 | 0.253 ± 0.035 | 0.249 ± 0.025 | 0.189 ± 0.031 | 0.415 ± 0.024 | 0.188 ± 0.036 | 0.177 ± 0.021 |
+
+(b) Oversampling
+
+| METRIC ↓ | Contr. (D) | Margin (D) | Margin (Sem.) | Msim. | ProxyNCA | Triplet (D) | Triplet (S) |
| Overall |
| ACCURACY | 0.811 ± 0.005 | 0.828 ± 0.005 | 0.818 ± 0.004 | 0.832 ± 0.005 | 0.828 ± 0.005 | 0.829 ± 0.006 | 0.806 ± 0.005 |
| PRECISION | 0.814 ± 0.005 | 0.831 ± 0.005 | 0.822 ± 0.004 | 0.835 ± 0.005 | 0.833 ± 0.005 | 0.832 ± 0.006 | 0.811 ± 0.004 |
| RECALL | 0.812 ± 0.005 | 0.828 ± 0.005 | 0.819 ± 0.004 | 0.833 ± 0.005 | 0.828 ± 0.005 | 0.829 ± 0.006 | 0.807 ± 0.005 |
| Gap |
| ACCURACY | 0.182 ± 0.027 | 0.131 ± 0.028 | 0.129 ± 0.030 | 0.142 ± 0.035 | 0.170 ± 0.026 | 0.177 ± 0.032 | 0.135 ± 0.032 |
| PRECISION | 0.421 ± 0.011 | 0.386 ± 0.015 | 0.391 ± 0.016 | 0.391 ± 0.016 | 0.428 ± 0.016 | 0.409 ± 0.015 | 0.385 ± 0.013 |
| RECALL | 0.464 ± 0.015 | 0.420 ± 0.018 | 0.428 ± 0.018 | 0.426 ± 0.020 | 0.455 ± 0.017 | 0.457 ± 0.017 | 0.427 ± 0.015 |
+
+(a) Domain-Independent Training
+
+| METRIC ↓ | Margin (D) |
| Overall |
| ACCURACY | 0.490 ± 0.005 |
| PRECISION | 0.896 ± 0.003 |
| RECALL | 0.489 ± 0.006 |
| Gap |
| ACCURACY | 0.426 ± 0.017 |
| PRECISION | 0.185 ± 0.108 |
| RECALL | 0.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 |
| ACCURACY | 0.802 ± 0.002 |
| PRECISION | 0.816 ± 0.002 |
| RECALL | 0.802 ± 0.002 |
| Gap |
| ACCURACY | 0.143 ± 0.019 |
| PRECISION | 0.323 ± 0.063 |
| RECALL | 0.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
+
+| Color | overall | overall | black | black | blue | blue | brown | brown |
| Method | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) |
| Recall@1 | 0.785 ± 0.003 | 0.786 ± 0.003 | 0.780 ± 0.006 | 0.777 ± 0.005 | 0.837 ± 0.016 | 0.841 ± 0.010 | 0.773 ± 0.005 | 0.779 ± 0.008 |
| NMI | 0.860 ± 0.001 | 0.861 ± 0.003 | 0.832 ± 0.005 | 0.837 ± 0.004 | 0.840 ± 0.025 | 0.863 ± 0.026 | 0.831 ± 0.013 | 0.838 ± 0.007 |
| \(U_{KL}\) | 0.071 ± 0.002 | 0.076 ± 0.001 | 0.164 ± 0.002 | 0.153 ± 0.003 | 0.296 ± 0.004 | 0.275 ± 0.007 | 0.156 ± 0.004 | 0.148 ± 0.003 |
| Precision | 0.819 ± 0.003 | 0.822 ± 0.001 | 0.403 ± 0.007 | 0.412 ± 0.016 | 0.399 ± 0.053 | 0.401 ± 0.022 | 0.396 ± 0.005 | 0.390 ± 0.016 |
| Recall | 0.812 ± 0.003 | 0.816 ± 0.002 | 0.375 ± 0.007 | 0.384 ± 0.014 | 0.367 ± 0.052 | 0.366 ± 0.022 | 0.357 ± 0.008 | 0.351 ± 0.016 |
| Accuracy | 0.812 ± 0.003 | 0.815 ± 0.002 | 0.790 ± 0.009 | 0.798 ± 0.004 | 0.867 ± 0.009 | 0.877 ± 0.011 | 0.804 ± 0.001 | 0.812 ± 0.006 |
| Color | buff | buff | green | green | grey | grey | iridescent | iridescent |
| Method | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) |
| Recall@1 | 0.787 ± 0.008 | 0.792 ± 0.006 | 1.000 ± 0.000 | 1.000 ± 0.000 | 0.751 ± 0.015 | 0.754 ± 0.010 | 1.000 ± 0.000 | 1.000 ± 0.000 |
| NMI | 0.789 ± 0.005 | 0.808 ± 0.015 | -0.000 ± 0.000 | -0.000 ± 0.000 | 0.853 ± 0.009 | 0.849 ± 0.004 | 1.000 ± 0.000 | 0.800 ± 0.447 |
| \(U_{KL}\) | 0.349 ± 0.003 | 0.343 ± 0.004 | 0.262 ± 0.024 | 0.252 ± 0.021 | 0.142 ± 0.005 | 0.137 ± 0.002 | 0.369 ± 0.013 | 0.318 ± 0.017 |
| Precision | 0.250 ± 0.006 | 0.253 ± 0.013 | 1.000 ± 0.000 | 1.000 ± 0.000 | 0.337 ± 0.014 | 0.338 ± 0.022 | 1.000 ± 0.000 | 1.000 ± 0.000 |
| Recall | 0.209 ± 0.005 | 0.212 ± 0.012 | 1.000 ± 0.000 | 1.000 ± 0.000 | 0.292 ± 0.013 | 0.297 ± 0.021 | 1.000 ± 0.000 | 1.000 ± 0.000 |
| Accuracy | 0.824 ± 0.003 | 0.824 ± 0.011 | 1.000 ± 0.000 | 1.000 ± 0.000 | 0.790 ± 0.007 | 0.796 ± 0.006 | 1.000 ± 0.000 | 1.000 ± 0.000 |
| Color | olive | orange | orange | red | red | white | white | yellow |
| Method | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade |
| Recall@1 | 0.620 ± 0.087 | 0.839 ± 0.010 | 0.863 ± 0.040 | 0.917 ± 0.018 | 0.919 ± 0.017 | 0.729 ± 0.012 | 0.706 ± 0.011 | 0.846 ± 0.003 |
| NMI | 0.000 ± 0.000 | 0.701 ± 0.060 | 0.657 ± 0.036 | 0.839 ± 0.032 | 0.830 ± 0.033 | 0.792 ± 0.008 | 0.787 ± 0.010 | 0.842 ± 0.011 |
| \(U_{KL}\) | 0.151 ± 0.005 | 0.295 ± 0.004 | 0.277 ± 0.009 | 0.445 ± 0.003 | 0.411 ± 0.011 | 0.176 ± 0.003 | 0.166 ± 0.003 | 0.215 ± 0.005 |
| Precision | 0.240 ± 0.063 | 0.302 ± 0.027 | 0.303 ± 0.079 | 0.555 ± 0.052 | 0.559 ± 0.048 | 0.387 ± 0.018 | 0.380 ± 0.012 | 0.530 ± 0.022 |
| Recall | 0.160 ± 0.049 | 0.261 ± 0.024 | 0.263 ± 0.076 | 0.542 ± 0.053 | 0.544 ± 0.049 | 0.357 ± 0.018 | 0.342 ± 0.011 | 0.481 ± 0.011 |
| Accuracy | 0.660 ± 0.060 | 0.867 ± 0.017 | 0.860 ± 0.028 | 0.923 ± 0.017 | 0.927 ± 0.009 | 0.752 ± 0.004 | 0.737 ± 0.002 | 0.879 ± 0.001 |
+
+
+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.
+
+
+
+
+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.
+
+ | Arcface | Overall | N-Pair · N-Pair |
| PARADE | Standard | Margin · Distance |
| UPSTREAM EMBEDDING | Recall@1 | 0.897 ± 0.002 | 0.888 ± 0.002 | 0.885 ± 0.002 | 0.922 ± 0.001 | 0.11 ± 0.002 |
| NMI | 0.91 ± 0.0 | 0.902 ± 0.001 | 0.901 ± 0.003 | 0.929 ± 0.0 | 0.61 ± 0.0 |
| \(U_{KL}\) | 0.019 ± 0.001 | 0.017 ± 0.0 | 0.336 ± 0.013 | 0.237 ± 0.006 | 2.595 ± 0.055 |
| DOWNSTREAM CLASSIFICATION LR | Accuracy | 0.891 ± 0.0 | 0.89 ± 0.001 | 0.692 ± 0.004 | 0.831 ± 0.002 | 0.017 ± 0.0 |
| Precision | 0.721 ± 0.0 | 0.721 ± 0.001 | 0.55 ± 0.003 | 0.652 ± 0.003 | 0.004 ± 0.0 |
| Recall | 0.74 ± 0.0 | 0.741 ± 0.001 | 0.546 ± 0.003 | 0.674 ± 0.003 | 0.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
+
+ | Arcface | Subgroup Gap | N-Pair · N-Pair |
| PARADE | Standard | Margin · Distance |
| UPSTREAM EMBEDDING | Recall@1 | 0.135 ± 0.008 | 0.128 ± 0.003 | 0.085 ± 0.009 | 0.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 CLASSIFICATION | LR Accuracy | 0.068 ± 0.002 | 0.069 ± 0.002 | 0.131 ± 0.006 | 0.082 ± 0.005 | 0.006 ± 0.002 |
| Precision | 0.087 ± 0.003 | 0.087 ± 0.004 | 0.146 ± 0.006 | 0.1 ± 0.007 | 0.001 ± 0.001 |
| Recall | 0.084 ± 0.002 | 0.083 ± 0.003 | 0.141 ± 0.007 | 0.098 ± 0.007 | 0.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 |
| | PARADE | Standard |
| UPSTREAM | Recall@1 | -0.035 ± 0.006 | 0.005 ± 0.004 |
| EMBEDDING | NMI | -0.004 ± 0.003 | 0.004 ± 0.002 |
| \(U_{KL}\) | 0.04 ± 0.011 | 0.084 ± 0.006 |
| DOWNSTREAM | Precision | 0.021 ± 0.006 | 0.039 ± 0.002 |
| CLASSIFICATION (LR) | Recall | 0.018 ± 0.006 | 0.029 ± 0.002 |
| Accuracy | 0.011 ± 0.005 | 0.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.
+
+| Skintones | Overall | Overall | Skintone 1 | Skintone 1 | Skintone 2 | Skintone 2 | Skintone 3 |
| Method | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade |
| Recall@1 | 0.885 ± 0.002 | 0.922 ± 0.001 | 0.738 ± 0.005 | 0.858 ± 0.011 | 0.887 ± 0.004 | 0.930 ± 0.001 | 0.907 ± 0.001 |
| NMI@1 | 0.901 ± 0.003 | 0.929 ± 0.000 | 0.933 ± 0.007 | 0.961 ± 0.000 | 0.923 ± 0.004 | 0.947 ± 0.001 | 0.927 ± 0.002 |
| \(U_{\text{KL}}\) | 0.336 ± 0.013 | 0.237 ± 0.006 | 0.436 ± 0.020 | 0.419 ± 0.002 | 0.350 ± 0.014 | 0.260 ± 0.004 | 0.350 ± 0.012 |
| Precision | 0.550 ± 0.003 | 0.652 ± 0.003 | 0.398 ± 0.011 | 0.639 ± 0.005 | 0.566 ± 0.003 | 0.696 ± 0.002 | 0.558 ± 0.003 |
| Recall | 0.546 ± 0.003 | 0.674 ± 0.003 | 0.421 ± 0.014 | 0.656 ± 0.005 | 0.604 ± 0.003 | 0.739 ± 0.003 | 0.578 ± 0.003 |
| Accuracy | 0.692 ± 0.004 | 0.831 ± 0.002 | 0.578 ± 0.009 | 0.783 ± 0.004 | 0.707 ± 0.004 | 0.843 ± 0.002 | 0.716 ± 0.004 |
| Skintones | Skintone 3 | Skintone 4 | Skintone 4 | Skintone 5 | Skintone 5 | Skintone 6 | Skintone 6 |
| Method | Margin (D) | Parade | Margin (D) | Parade | Margin (D) | Parade | Margin (D) |
| Recall@1 | 0.937 ± 0.003 | 0.850 ± 0.002 | 0.893 ± 0.003 | 0.785 ± 0.017 | 0.838 ± 0.004 | 0.642 ± 0.018 | 0.628 ± 0.006 |
| NMI@1 | 0.947 ± 0.001 | 0.927 ± 0.002 | 0.946 ± 0.000 | 0.943 ± 0.002 | 0.957 ± 0.004 | 0.948 ± 0.004 | 0.960 ± 0.009 |
| \(U_{\text{KL}}\) | 0.241 ± 0.006 | 0.339 ± 0.012 | 0.240 ± 0.008 | 0.371 ± 0.012 | 0.288 ± 0.013 | 0.547 ± 0.010 | 0.483 ± 0.014 |
| Precision | 0.672 ± 0.003 | 0.471 ± 0.005 | 0.644 ± 0.003 | 0.355 ± 0.011 | 0.570 ± 0.001 | 0.258 ± 0.005 | 0.492 ± 0.021 |
| Recall | 0.708 ± 0.003 | 0.518 ± 0.005 | 0.695 ± 0.002 | 0.386 ± 0.011 | 0.602 ± 0.001 | 0.275 ± 0.005 | 0.511 ± 0.019 |
| Accuracy | 0.842 ± 0.003 | 0.632 ± 0.005 | 0.798 ± 0.002 | 0.545 ± 0.009 | 0.747 ± 0.002 | 0.430 ± 0.010 | 0.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.
+
+
+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).
+
+
+
+ | Arcface | Overall | N-Pair · N-Pair |
| PARADE | Standard | Margin · Distance | Standard |
| UPSTREAM EMBEDDING | Recall@1 | 0.268 ± 0.01 | 0.306 ± 0.008 | 0.329 ± 0.002 | 0.381 ± 0.004 | 0.187 ± 0.006 |
| NMI | 0.849 ± 0.005 | 0.859 ± 0.002 | 0.865 ± 0.001 | 0.869 ± 0.001 | 0.854 ± 0.001 |
| \(U_{KL}\) | 0.118 ± 0.021 | 0.089 ± 0.014 | 0.129 ± 0.001 | 0.103 ± 0.001 | 1.815 ± 0.011 |
| DOWNSTREAM CLASSIFICATION | RF | Accuracy | 0.8 ± 0.0 | 0.804 ± 0.017 | 0.762 ± 0.002 | 0.8 ± 0.003 |
| Precision | 0.789 ± 0.003 | 0.793 ± 0.016 | 0.767 ± 0.001 | 0.788 ± 0.004 |
| Recall | 0.827 ± 0.0 | 0.831 ± 0.015 | 0.801 ± 0.003 | 0.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.
+
+ | Arcface | Subgroup Gap | N-Pair · N-Pair |
| PARADE | Standard | Margin · Distance |
| UPSTREAM EMBEDDING | Recall@1 | 0.039 ± 0.017 | 0.061 ± 0.017 | 0.075 ± 0.014 | 0.068 ± 0.013 | 0.054 ± 0.01 |
| NMI | 0.048 ± 0.011 | 0.057 ± 0.003 | 0.041 ± 0.003 | 0.048 ± 0.003 | 0.048 ± 0.003 |
| \(U_{KL}\) | 0.176 ± 0.019 | 0.157 ± 0.011 | 0.163 ± 0.003 | 0.165 ± 0.005 | 0.357 ± 0.012 |
| DOWNSTREAM CLASSIFICATION | RF | Accuracy | 0.04 ± 0.01 | 0.038 ± 0.012 | 0.049 ± 0.005 | 0.038 ± 0.005 |
| Precision | 0.036 ± 0.018 | 0.041 ± 0.014 | 0.04 ± 0.005 | 0.037 ± 0.007 |
| Recall | 0.066 ± 0.017 | 0.076 ± 0.015 | 0.066 ± 0.006 | 0.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.
+
+ | Asian | Black | Indian | White |
| PARADE | Standard | PARADE | Standard | PARADE | Standard | PARADE | Standard |
| UPSTREAM EMBEDDING | Recall@1 | 0.262 ± 0.028 | 0.31 ± 0.014 | 0.289 ± 0.011 | 0.331 ± 0.016 | 0.238 ± 0.027 | 0.325 ± 0.032 | 0.338 ± 0.004 | 0.39 ± 0.004 |
| NMI | 0.894 ± 0.003 | 0.914 ± 0.005 | 0.858 ± 0.001 | 0.882 ± 0.005 | 0.948 ± 0.007 | 0.951 ± 0.007 | 0.862 ± 0.001 | 0.868 ± 0.0 |
| \( U_{KL} \) | 0.304 ± 0.003 | 0.265 ± 0.003 | 0.456 ± 0.009 | 0.417 ± 0.013 | 0.141 ± 0.002 | 0.133 ± 0.005 | 0.137 ± 0.002 | 0.107 ± 0.001 |
| DOWNSTREAM CLASSIFICATION | RF Accuracy | 0.81 ± 0.007 | 0.828 ± 0.008 | 0.827 ± 0.005 | 0.853 ± 0.007 | 0.772 ± 0.011 | 0.814 ± 0.012 | 0.754 ± 0.002 | 0.794 ± 0.003 |
| Precision | 0.715 ± 0.012 | 0.726 ± 0.013 | 0.743 ± 0.008 | 0.759 ± 0.014 | 0.664 ± 0.006 | 0.711 ± 0.01 | 0.747 ± 0.002 | 0.769 ± 0.004 |
| Recall | 0.713 ± 0.013 | 0.72 ± 0.014 | 0.751 ± 0.008 | 0.758 ± 0.01 | 0.657 ± 0.008 | 0.702 ± 0.011 | 0.773 ± 0.002 | 0.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 ↓ | ArcFace | Margin (D) | N-Pair |
| Overall |
| ACCURACY | 0.759 ± 0.017 | 0.753 ± 0.002 | 0.861 ± 0.005 |
| PRECISION | 0.793 ± 0.010 | 0.786 ± 0.003 | 0.872 ± 0.003 |
| RECALL | 0.799 ± 0.012 | 0.792 ± 0.003 | 0.889 ± 0.003 |
| Gap |
| ACCURACY | 0.093 ± 0.011 | 0.095 ± 0.006 | 0.029 ± 0.009 |
| PRECISION | 0.030 ± 0.011 | 0.020 ± 0.009 | 0.029 ± 0.010 |
| RECALL | 0.040 ± 0.012 | 0.044 ± 0.008 | 0.026 ± 0.010 |
+
+(b) Oversampling
+
+| METRIC ↓ | ArcFace | Margin (D) | N-Pair |
| Overall |
| ACCURACY | 0.775 ± 0.017 | 0.767 ± 0.004 | 0.881 ± 0.004 |
| PRECISION | 0.771 ± 0.014 | 0.762 ± 0.002 | 0.873 ± 0.005 |
| RECALL | 0.815 ± 0.014 | 0.807 ± 0.002 | 0.909 ± 0.004 |
| Gap |
| ACCURACY | 0.070 ± 0.012 | 0.072 ± 0.006 | 0.032 ± 0.006 |
| PRECISION | 0.020 ± 0.013 | 0.024 ± 0.009 | 0.027 ± 0.009 |
| RECALL | 0.023 ± 0.013 | 0.031 ± 0.011 | 0.036 ± 0.008 |
+
+
+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).
+
+
+
+| Dataset | Protected Attribute | Protected Attribute Values |
| CUB200-2011 | Color | Black, Blue, Brown, Buff, Green, Grey, Iridescent Olive, Orange, Red, White, Yellow |
| CelebA | Fitzpatrick Skintone Category | I, II, III, IV, V, VI |
| LFW | Race | Asian, 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).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+# 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 Range | Fitzpatrick Category | Description |
| 50 ≤ ITA | I | Extremely Light |
| 40 ≤ ITA < 50 | II | Very Light |
| 30 ≤ ITA < 40 | III | Light / Somewhat Light |
| 20 ≤ ITA < 30 | IV | Dark / Somewhat Dark |
| 10 ≤ ITA < 20 | V | Very Dark |
| ITA < 10 | VI | Extremely 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.
+
+
+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.
+
+
+
+
+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.
+
+| metric | method | acrobot | finger turn | hopper hop | reacher | walker | avg. |
| μ | baseline | 122.0 | 278.6 | 176.2 | 678.0 | 769.1 | 404.8 |
| μ | self-supervised 10k | 141.4 | 456.2 | 176.5 | 671.6 | 677.1 | 424.6 |
| μ | self-supervised 20k | 159.4 | 325.3 | 209.5 | 659.6 | 773.8 | 425.5 |
| μ | pretrain | 160.0 | 303.7 | 153.3 | 620.8 | 581.4 | 363.8 |
| μ | pretrain + small lr | 157.3 | 358.8 | 124.8 | 679.0 | 674.2 | 398.8 |
| σ | baseline | 76.0 | 221.2 | 90.3 | 167.3 | 350.1 | 181.0 |
| σ | self-supervised 10k | 68.4 | 276.1 | 104.6 | 222.4 | 425.9 | 219.5 |
| σ | self-supervised 20k | 67.7 | 191.9 | 71.6 | 164.8 | 374.4 | 174.1 |
| σ | pretrain | 39.8 | 146.7 | 86.8 | 168.7 | 429.1 | 174.2 |
| σ | pretrain + small lr | 71.8 | 204.6 | 102.7 | 165.4 | 393.5 | 187.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})) =$
+
+
+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.
+
+
+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.
+
+| metric | method | acrobot | finger turn | hopper hop | reacher | walker | avg. |
| μ | baseline | 122.0 | 278.6 | 176.2 | 678.0 | 769.1 | 404.8 |
| μ | penalty | 128.0 | 431.6 | 241.7 | 584.6 | 956.3 | 468.4 |
| μ | actor pnorm | 117.8 | 372.7 | 240.5 | 701.7 | 956.7 | 477.9 |
| μ | both pnorm | 192.2 | 605.8 | 188.7 | 892.7 | 961.5 | 568.2 |
| μ | layer norm | 43.5 | 661.2 | 218.6 | 659.7 | 952.4 | 507.1 |
| μ | lr warmup | 150.3 | 265.4 | 173.7 | 660.9 | 670.4 | 384.1 |
| μ | grad clip 1 | 138.2 | 214.0 | 206.0 | 520.0 | 675.6 | 350.7 |
| μ | grad clip 10 | 79.3 | 166.2 | 157.7 | 548.4 | 678.7 | 326.0 |
| μ | spectral | 104.0 | 101.0 | 201.0 | 213.6 | 775.6 | 279.1 |
| μ | scale down | 127.2 | 258.4 | 111.7 | 508.7 | 386.4 | 278.5 |
| μ | output norm | 13.3 | 306.3 | 216.9 | 699.4 | 952.1 | 437.6 |
| σ | baseline | 76.0 | 221.2 | 90.3 | 167.3 | 350.1 | 181.0 |
| σ | penalty | 42.1 | 160.6 | 46.5 | 236.8 | 15.4 | 100.3 |
| σ | actor pnorm | 39.9 | 227.9 | 42.7 | 101.9 | 8.0 | 84.1 |
| σ | both pnorm | 60.1 | 193.4 | 78.4 | 122.5 | 7.0 | 92.3 |
| σ | layer norm | 57.2 | 228.4 | 112.5 | 297.1 | 13.5 | 141.7 |
| σ | lr warmup | 53.8 | 133.6 | 98.2 | 133.4 | 423.4 | 168.5 |
| σ | grad clip 1 | 60.6 | 127.1 | 92.4 | 231.9 | 425.3 | 187.5 |
| σ | grad clip 10 | 56.1 | 143.9 | 113.6 | 243.2 | 426.3 | 196.6 |
| σ | spectral | 37.0 | 61.4 | 75.0 | 224.8 | 128.0 | 105.2 |
| σ | scale down | 27.8 | 186.9 | 96.6 | 241.3 | 444.0 | 199.3 |
| σ | output norm | 16.6 | 190.4 | 21.4 | 180.4 | 17.2 | 85.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.
+
+| metric | method | acrobot | finger turn | hopper hop | reacher | walker | avg. |
| μ | baseline | 122.0 | 278.6 | 176.2 | 678.0 | 769.1 | 404.8 |
| μ | combined | 227.7 | 653.5 | 231.1 | 893.4 | 964.2 | 594.0 |
| σ | baseline | 76.0 | 221.2 | 90.3 | 167.3 | 350.1 | 181.0 |
| σ | combined | 59.0 | 183.1 | 40.8 | 120.0 | 6.2 | 81.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.
+
+
+
+
+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.
+
+
+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.
+
+
+
+
+
+
+
+# 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 hard | 0.74 | 268.90 | 198.36 |
| walker walk | 0.48 | 769.66 | 371.48 |
| hopper hop | 0.36 | 221.13 | 80.63 |
| finger turn easy | 0.31 | 558.52 | 174.19 |
| acrobot swingup | 0.31 | 177.65 | 54.77 |
| reacher hard | 0.22 | 628.29 | 135.57 |
| walker run | 0.20 | 538.59 | 110.02 |
| cup catch | 0.13 | 909.95 | 118.06 |
| finger spin | 0.12 | 860.30 | 104.18 |
| quadruped run | 0.12 | 446.49 | 53.51 |
| quadruped walk | 0.12 | 732.52 | 87.19 |
| cartpole balance sparse | 0.12 | 962.30 | 113.10 |
| reach duplo | 0.08 | 202.51 | 16.99 |
| cartpole swingup sparse | 0.08 | 760.11 | 60.11 |
| cheetah run | 0.07 | 710.24 | 52.43 |
| reacher easy | 0.05 | 931.54 | 50.86 |
| pendulum swingup | 0.04 | 838.49 | 36.38 |
| hopper stand | 0.02 | 917.85 | 20.45 |
| cartpole swingup | 0.02 | 864.68 | 15.47 |
| walker stand | 0.01 | 980.72 | 5.21 |
| cartpole balance | 0.01 | 993.45 | 5.00 |
+
+
+
+
+
+
+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.
+
+
+
+Table 5: Hyperparameters used throughout the paper. These follow Yarats et al. (2021b) for the medium tasks.
+
+| parameter | value |
| learning rate | 1e-4 |
| soft-update τ | 1e-2 |
| update frequency | 2 |
| stddev. schedule | linear(1.0, 0.1, 500000) |
| stddev. clip | 0.3 |
| action repeat | 2 |
| seed frames | 4e3 |
| batch size | 256 |
| n-step returns | 3 |
| discount γ | 0.99 |
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+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.
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+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.
+
+
+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.
+
+
+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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+# 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.
+
+| metric | method | cartpole sparse | finger turn hard | pendulum | reacher hard | avg |
| μ | baseline | 641.8 | 596.5 | 648.0 | 872.6 | 689.7 |
| μ | avg actor | 80.9 | 422.2 | 776.0 | 672.6 | 487.9 |
| μ | avg both | 393.0 | 432.4 | 647.6 | 548.4 | 505.4 |
| μ | avg critic | 761.5 | 811.3 | 639.0 | 939.2 | 787.8 |
| σ | baseline | 321.5 | 292.4 | 283.5 | 95.5 | 248.2 |
| σ | avg actor | 242.6 | 258.8 | 138.9 | 164.8 | 201.3 |
| σ | avg both | 393.3 | 171.9 | 323.1 | 312.0 | 300.1 |
| σ | avg critic | 127.5 | 89.4 | 318.6 | 37.3 | 143.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.
+
+| metric | method | cartpole sparse | finger turn | pendulum | reacher hard |
| μ | baseline | 641.8 | 596.5 | 648.0 | 872.6 |
| μ | ssl+ac | 802.5 | 788.0 | 828.0 | 930.2 |
| μ | ssl+nz | 607.6 | 659.4 | 813.5 | 869.3 |
| μ | ac+nz | 561.4 | 770.6 | 624.6 | 860.9 |
| μ | nz | 618.2 | 663.4 | 657.2 | 882.9 |
| μ | ac | 761.5 | 811.3 | 639.0 | 939.2 |
| μ | ssl | 235.0 | 574.6 | 686.7 | 882.7 |
| μ | ssl+nz +ac | 742.7 | 729.8 | 758.0 | 922.7 |
| σ | baseline | 321.5 | 292.4 | 283.5 | 95.5 |
| σ | ssl+ac | 29.4 | 135.6 | 24.2 | 47.6 |
| σ | ssl+nz | 286.1 | 173.4 | 29.8 | 78.4 |
| σ | ac+nz | 306.2 | 150.4 | 330.0 | 80.3 |
| σ | nz | 267.5 | 192.1 | 252.5 | 117.7 |
| σ | ac | 127.5 | 89.4 | 318.6 | 37.3 |
| σ | ssl | 359.7 | 236.7 | 272.5 | 80.1 |
| σ | ssl+nz +ac | 151.2 | 130.9 | 220.8 | 45.3 |
+
+
+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.
+
+
+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.
+
+
+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.
+
+| metric | method | 1e-4 | 3e-4 | 1e-3 | 3e-3 |
| μ | baseline | 769.1 | 330.2 | 26.8 | 25.5 |
| μ | combined | 964.2 | 962.2 | 954.9 | 960.1 |
| σ | baseline | 350.1 | 415.3 | 3.9 | 6.4 |
| σ | combined | 6.2 | 4.7 | 5.6 | 5.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.
+
+| metric | method | acrobot | finger turn | hopper hop | reacher | avg |
| μ | baseline | 27.8 | 50.1 | 0.0 | 1.4 | 19.8 |
| μ | combined | 137.4 | 618.6 | 227.0 | 727.2 | 427.6 |
| σ | baseline | 35.6 | 49.9 | 0.0 | 2.0 | 21.9 |
| σ | combined | 33.9 | 176.6 | 24.1 | 151.0 | 96.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).
+
+| method | walker | hopper hop | finger turn | acrobot | reacher |
| sample | 1922.1 | 450.6 | 143763.0 | 11182.9 | 176211.9 |
| alg | 80002.6 | 9774.0 | 55215.6 | 5710.9 | 35231.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.
+
+
+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.
+
+| Method | Chameleon (h = 0.23) | Squirrel (h = 0.22) |
| GCN | 67.96 ± 1.82 | 54.47 ± 1.17 |
| H2GCN-1 | 57.11 ± 1.58 | 36.42 ± 1.89 |
| H2GCN-2 | 59.39 ± 1.98 | 37.90 ± 2.02 |
| CPGNN-MLP | 54.53 ± 2.37 | 29.13 ± 1.57 |
| CPGNN-Cheby | 65.17 ± 3.17 | 29.25 ± 4.17 |
| GPRGNN | 66.31 ± 2.05 | 50.56 ± 1.51 |
| MLP | 48.11 ± 2.23 | 31.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
+
+
+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
+
+
+(a) Synthetic graphs generated from Cora
+
+
+(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}'\}$
+
+
+(a) $\gamma = 0$ Acc: $86\%$
+
+
+(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$ .
+
+
+(c) $\gamma = 0.8$ , Acc: $44\%$
+
+
+(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.
+
+ | Cora | Citeseer | Pubmed | Chameleon | Squirrel | Actor | Cornell | Wisconsin | Texas |
| GCN | 87.12 ± 1.38 | 76.50 ± 1.61 | 88.52 ± 0.41 | 67.96 ± 1.82 | 54.47 ± 1.17 | 30.31 ± 0.98 | 59.35 ± 4.19 | 61.76 ± 6.15 | 63.81 ± 5.27 |
| MLP | 75.04 ± 1.97 | 72.40 ± 1.97 | 87.84 ± 0.30 | 48.11 ± 2.23 | 31.68 ± 1.90 | 36.17 ± 1.09 | 84.86 ± 6.04 | 86.29 ± 4.50 | 83.30 ± 4.54 |
+
+
+(a) Cora
+
+
+(b) Chameleon
+Figure 5: Cross-class neighborhood similarity on homophilous graphs and heterophilous graphs.
+
+
+(c) Actor
+
+
+(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.
+
+
+
+# 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.
+
+
+
+# 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.
+
+| K | 1003 | 2006 | 3009 | 4012 | 6018 | 8024 | 10030 | 12036 | 16048 | 20060 | 24072 |
| h | 0.740 | 0.681 | 0.630 | 0.587 | 0.516 | 0.460 | 0.415 | 0.378 | 0.321 | 0.279 | 0.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
+
+| K | 1204 | 2408 | 3612 | 4816 | 7224 | 9632 | 12040 | 14448 | 19264 | 24080 | 28896 |
| h | 0.650 | 0.581 | 0.527 | 0.481 | 0.410 | 0.357 | 0.317 | 0.284 | 0.236 | 0.202 | 0.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.
+
+| K | 12343 | 24686 | 37030 | 49374 | 61716 | 74060 | 86404 | 98746 | 111090 | 12434 | 135776 |
| h | 0.215 | 0.209 | 0.203 | 0.197 | 0.192 | 0.187 | 0.182 | 0.178 | 0.173 | 0.169 | 0.165 |
+
+Table 6: # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Chameleon.
+
+| K | 1932 | 3866 | 5798 | 7730 | 9964 | 11596 | 13528 | 15462 | 17394 | 19326 | 21260 |
| h | 0.223 | 0.217 | 0.210 | 0.205 | 0.199 | 0.194 | 0.189 | 0.184 | 0.180 | 0.176 | 0.172 |
+
+
+(a) Synthetic graphs generated from Squirrel
+
+
+(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.
+
+| K | 28084 | 32096 | 36108 | 40120 | 44132 | 48144 | 52156 | 56168 | 80240 |
| h | 0.272 | 0.248 | 0.228 | 0.211 | 0.196 | 0.183 | 0.172 | 0.162 | 0.120 |
+
+
+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.
+
+ | Cora | Citeseer | Pubmed | Chameleon | Squirrel | Actor | Cornell | Wisconsin | Texas |
| # Nodes (|V|) | 2708 | 3327 | 19717 | 2277 | 5201 | 7600 | 183 | 251 | 183 |
| # Edges (|E|) | 5278 | 4676 | 44327 | 31421 | 198493 | 26752 | 280 | 466 | 295 |
| Homophily Ratio (h) | 0.81 | 0.74 | 0.80 | 0.23 | 0.22 | 0.22 | 0.3 | 0.21 | 0.11 |
| # Classes (|C|) | 7 | 6 | 3 | 5 | 5 | 5 | 5 | 5 | 5 |
+
+# 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
+
+ | Cora | Citeseer | Pubmed | Chameleon | Squirrel | Actor | Cornell | Wisconsin | Texas |
| GCN | 87.12 ± 1.38 | 76.50 ± 1.61 | 88.52 ± 0.41 | 67.96 ± 1.82 | 54.47 ± 1.17 | 30.31 ± 0.98 | 59.35 ± 4.19 | 61.76 ± 6.15 | 63.81 ± 5.27 |
| MLP | 75.04 ± 1.97 | 72.40 ± 1.97 | 87.84 ± 0.30 | 48.11 ± 2.23 | 31.68 ± 1.90 | 36.17 ± 1.09 | 84.86 ± 6.04 | 86.29 ± 4.50 | 83.30 ± 4.54 |
| MLP + GCN | 87.01 ± 1.35 | 76.35 ± 1.85 | 89.77 ± 0.39 | 68.04 ± 1.86 | 54.48 ± 1.11 | 36.24 ± 1.09 | 84.82 ± 4.87 | 86.43 ± 4.00 | 83.60 ± 6.04 |
| H2GCN-1 | 86.92 ± 1.37 | 77.07 ± 1.64 | 89.40 ± 0.34 | 57.11 ± 1.58 | 36.42 ± 1.89 | 35.86 ± 1.03 | 82.16 ± 6.00 | 86.67 ± 4.69 | 84.86 ± 6.77 |
| H2GCN-2 | 87.81 ± 1.35 | 76.88 ± 1.77 | 89.59 ± 0.33 | 59.39 ± 1.98 | 37.90 ± 2.02 | 35.62 ± 1.30 | 82.16 ± 6.00 | 85.88 ± 4.22 | 82.16 ± 5.28 |
| CPGNN-MLP | 85.84 ± 1.20 | 74.80 ± 0.92 | 86.58 ± 0.37 | 54.53 ± 2.37 | 29.13 ± 1.57 | 35.76 ± 0.92 | 79.93 ± 6.12 | 84.58 ± 2.72 | 82.62 ± 6.88 |
| CPGNN-Cheby | 87.23 ± 1.31 | 76.64 ± 1.43 | 88.41 ± 0.33 | 65.17 ± 3.17 | 29.25 ± 4.17 | 34.28 ± 0.77 | 75.08 ± 7.51 | 79.19 ± 2.80 | 75.96 ± 5.66 |
| GPR-GNN | 86.79 ± 1.27 | 75.55 ± 1.56 | 86.79 ± 0.55 | 66.31 ± 2.05 | 50.56 ± 1.51 | 33.94 ± 0.95 | 79.27 ± 6.03 | 83.73 ± 4.02 | 84.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.
+
+
+(a) Citeseer
+
+
+(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
+
+
+(a) Squirrel
+
+
+(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.
+
+
+(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.
+
+
+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.
+
+
+(a) Euclidean Distance
+
+
+(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]).
+
+
+Figure 12: Performance of GCN on synthetic graphs from Cora. Graphs are generated following Cora Neighborhood Distribution Pattern 1
+
+
+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])$
+
+
+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 ]),
+$$
+
+
+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} ]),
+$$
+
+
+(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).
+
+
+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 ]),
+$$
+
+
+(a) Performance of GCN on synthetic graphs from Cora. Graphs are generated following all neighborhood distribution.
+
+
+(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).
+
+
+(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
+
+
+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
+
+
+(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.
+
+
+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
+
+
+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
+
+
+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.
+
+
+
+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
+
+
+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
+
+
+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
+
+
+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.
+
+
+
+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
+
+| Dataset | | Setting | Cross Entropy | Poly-tailed Loss | p-value |
| mean | std. err. | mean | std. err. |
| Subsampled CelebA | Early-stopped | IW | 79.3% | 0.4% | 80.7% | 0.6% | 0.014 |
| IW-ES | 84.9% | 0.7% | 84.0% | 0.9% | 0.762 |
| IW-Exp-ES | 85.1% | 0.7% | 85.9% | 0.8% | 0.202 |
| Interpolating | IW | 79.3% | 0.4% | 80.7% | 0.6% | 0.014 |
| IW-Exp | 78.7% | 0.4% | 82.7% | 0.4% | 0.000 |
| No IW | 79.6% | 0.4% | 78.5% | 0.4% | 0.999 |
| Binary CIFAR10 | Early-stopped | IW | 57.8% | 0.4% | 60.4% | 0.3% | 0.000 |
| IW-ES | 62.5% | 0.7% | 63.4% | 0.5% | 0.022 |
| IW-Exp-ES | 61.2% | 0.8% | 63.5% | 0.6% | 0.001 |
| Interpolating | IW | 57.8% | 0.4% | 60.4% | 0.3% | 0.000 |
| IW-Exp | 57.4% | 0.6% | 63.0% | 0.6% | 0.000 |
| No IW | 60.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$ .
+
+| Setting | Summary of method | Best settings | Mean test acc | Std err |
| Cross Entropy | | N/A | 60.5% | 0.8% |
| Cross Entropy + IW | Classical importance weight-ing | N/A | 57.8% | 0.4% |
| Cross Entropy + Class undersampling | Balance the classes by throwing away majority data | N/A | 58.5% | 1.4% |
| LDAM | Add class dependent constants to logits | largest margin=1.0 | 58.7% | 1.6% |
| CDT | Multiply class dependent constants by logits | γ = 0.5 | 60.2% | 1.6% |
| LA Loss | Add class dependent constants to logits | τ = 3 | 66.9% | 2.1% |
| VS Loss (best setting around range suggested by paper) | Multiply by and add class dependent constants to logits | τ = 1, γ = 0.05 | 58.6% | 1.4% |
| VS Loss (our own tuning) | Multiply by and add class dependent constants to logits | τ = 3, γ = 0.3 | 69.3% | 0.9% |
| Poly-tailed Loss | Change loss function and exponentiate importance weights | α = 2, w3 | 67.3% | 0.8% |
+
+Table 2: Results on imbalanced binary CIFAR10, corresponding to Figure 4 (left).
+
+| Setting | Method summary | Best set-tings | Mean test acc | Std err | Worst group test acc | Std err |
| Cross Entropy | | N/A | 79.6% | 1.2% | 43.1% | 2.9% |
| Cross Entropy + Group undersampling | Balance the groups by throwing away overrepresented data | N/A | 82.3% | 3.2% | 72.1% | 8.6% |
| Cross Entropy + IW | Classical importance weighting | N/A | 79.3% | 0.4% | 43.1% | 2.9% |
| VS Loss | Multiply by and add class dependent constants to logits | γ = 0.4 | 82.6% | 0.7% | 51.3% | 1.5% |
| Poly-tailed Loss | Change loss function and exponentiate importance weights | α = 2, w2.5 | 82.4% | 0.8% | 53.3% | 1.5% |
| Cross Entropy + DRO | | N/A | 84.8% | 0.9% | 60.4% | 2.4% |
| VS Loss + DRO | Change loss function and use DRO | γ = 0.4 | 83.2% | 0.9% | 58.2% | 2.0% |
| Poly-tailed Loss + DRO | Change loss function and use DRO | α = 2 | 86.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.
+
+
+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.
+
+
+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.
+
+| Domain | InfoPG | Adv. InfoPG | MOA | CU | NC-A2C | PR2-AC |
| R | #Steps | R | #Steps | R | #Steps | R | #Steps | R | #Steps | R | #Steps |
| Co-op Pong | 0.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) |
| Pistonball | 7.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) |
| Multiwalker | 3.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 II | 4.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.
+
+
+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.
+
+
+
+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
+
+
+
+
+(a) Action distributions for pistons at $t = 0$
+
+
+
+
+
+
+
+
+
+
+(b) Action distributions for pistons at $t = 10$
+
+
+(c) Action distributions for pistons at $t = 25$
+
+
+
+
+
+
+
+
+(d) Action distributions for pistons at $t = 32$
+
+
+
+
+
+
+
+
+
+
+(e) Action distributions for pistons at $t = 37$
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+
+
+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.
+
+
+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.
+
+
+
+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
+
+
+(a) InfoPG, k=1
+
+
+(b) InfoPG, k=2
+
+
+(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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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.
+
+
+
+
+
+
+
+
+
+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
+
+
+(a) Individual agent performances in Co-op Pong.
+
+
+(b) Individual agent performances in Pistonball.
+
+
+
+
+
+
+
+
+(c) Individual agent performances in Multiwalker.
+
+
+(d) Individual agent performances in StarCraft II (3M).
+
+
+
+
+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.
+
+
+
+
+
+
+(a) Pistonball
+
+
+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.
+
+
+(b) Co-op Pong
+
+
+(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.
+
+| Experiments | Pong |
| InfoPG | Adv InfoPG | NC-A2C | CU | MOA | PR2-AC |
| Learning Rate | 4e-4 | 4e-4 | 4e-4 | 4e-4 | 4e-4 | 4e-4 |
| Size of Latent Vector | 30 | 30 | 30 | 30 | 30 | 30 |
| Type of Com. Network | VRNN | VRNN | - | - | GRU | - |
| Epochs | 4000 | 4000 | 4000 | 4000 | 4000 | 4000 |
| MOA Loss Weight | - | - | - | - | 0.1 | - |
| Discount Factor | 0.95 | 0.95 | 0.95 | 0.95 | 0.95 | 0.99 |
| Batch Size | 16 | 16 | 16 | 16 | 16 | 16 |
| Max Gradient Norm | 10 | 10 | 10 | 10 | 10 | 10 |
| Replay Buffer Size | - | - | - | - | - | 1e5 |
| Number of Particles | - | - | - | - | - | 16 |
+
+Table 3: Pistonball Training Hyperparameters.
+
+| Experiments | Pistonball |
| InfoPG | Adv. InfoPG | NC-A2C | CU | MOA | PR2-AC |
| Learning Rate | 1e-3 | 1e-3 | 1e-3 | 1e-3 | 1e-3 | 1e-3 |
| Size of Latent Vector | 20 | 20 | 20 | 20 | 20 | 20 |
| Type of Com. Network | GRU | GRU | - | - | GRU | - |
| Epochs | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 |
| MOA Loss Weight | - | - | - | - | 1.0 | - |
| Discount Factor | 0.99 | 0.99 | 0.99 | 0.99 | 0.99 | 0.99 |
| Batch Size | 4 | 4 | 4 | 4 | 4 | 4 |
| Max Gradient Norm | 0.75 | 0.75 | 0.75 | 0.75 | 0.75 | 4.0 |
| Replay Buffer Size | - | - | - | - | - | 1e5 |
| Number of Particles | - | - | - | - | - | 16 |
+
+Table 4: Multiwalker Training Hyperparameters.
+
+| Experiments | Multiwalker |
| InfoPG | Adv. InfoPG | NC-A2C | CU | MOA | PR2-AC |
| Learning Rate | 4e-4 | 4e-4 | 4e-4 | 4e-4 | 4e-4 | 4e-4 |
| Size of Latent Vector | 30 | 30 | 30 | 30 | 30 | 30 |
| Type of Com. Network | GRU | GRU | - | - | GRU | - |
| Epochs | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 |
| MOA Loss Weight | - | - | - | - | 0.1 | - |
| Discount Factor | 0.95 | 0.95 | 0.95 | 0.95 | 0.95 | 0.95 |
| Batch Size | 16 | 16 | 16 | 16 | 16 | 16 |
| Max Gradient Norm | 5 | 5 | 5 | 5 | 5 | 5 |
| Replay Buffer Size | - | - | - | - | - | 1e5 |
| Number of Particles | - | - | - | - | - | 16 |
+
+Table 5: StarCraft II Mini-game (The 3M Challenge) Training Hyperparameters.
+
+| Experiments | StarCraft II (3M Challenge) |
| InfoPG | Adv. InfoPG | NC-A2C | CU | MOA | PR2-AC |
| Learning Rate | 1e-4 | 1e-4 | 1e-4 | 1e-4 | 1e-4 | 1e-4 |
| Size of Latent Vector | 50 | 50 | 50 | 50 | 50 | 50 |
| Type of Com. Network | GRU | GRU | - | - | GRU | - |
| Epochs | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 |
| MOA Loss Weight | - | - | - | - | 0.1 | - |
| Discount Factor | 0.99 | 0.99 | 0.99 | 0.99 | 0.99 | 0.99 |
| Batch Size | 64 | 64 | 64 | 64 | 64 | 64 |
| Max Gradient Norm | 6 | 6 | 6 | 6 | 6 | 6 |
| Replay Buffer Size | - | - | - | - | - | 1e5 |
| Number of Particles | - | - | - | - | - | 16 |
+
+Table 6: Pistonball Training Hyperparameters for the fraudulent agent experiment.
+
+| Experiments | Fraud Pistonball |
| InfoPG | Adv InfoPG | MOA |
| Learning Rate | 1e-3 | 1e-3 | 1e-3 |
| Size of Latent Vector | 20 | 20 | 20 |
| Type of Com. Network | GRU | GRU | GRU |
| Epochs | 1000 | 1000 | 1000 |
| MOA Loss Weight | - | - | 1.0 |
| Discount Factor | 0.99 | 0.99 | 0.99 |
| Batch Size | 2 | 2 | 2 |
| Max Gradient Norm | 0.5 | 0.5 | 0.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.
+
+
+(a) Self Play
+
+
+(b) Asymmetric Self Play
+
+
+(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
+
+
+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.
+
+
+
+
+
+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.
+
+(a) SAC without regret updates at 2500 and 5000 steps. (b) SAC with regret updates at 2500 and 5000 steps.
+
+
+
+
+
+
+
+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 Feasibility | Progressive Diversity | Anti-Forgotten |
| Entropy Regularization | | ✓ | |
| Regret Replay Buffer | | | ✓ |
| Dynamic Regret Updates | ✓ | | ✓ |
| Symmetrization | ✓ | | ✓ |
+
+
+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.
+
+
+Gid Good
+
+
+
+
+
+
+
+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
+
+
+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.
+
+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.
+
+
+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.
+
+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.
+
+
+(a) CuSP
+(b) Domain Randomization
+
+
+
+
+(c) GoalGAN
+
+
+(d) $\mathrm{ASP + BC}$
+
+
+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.
+
+| Env | Reward | Use HER (Andrychowicz et al., 2017) | ε |
| Point Mass Maze | -L2 | | .05 |
| Walker | -L2 | | .1 |
| Reach | -L2 | ✓ | .1 |
| Toss | -L2 | ✓ | .1 |
| Pick and Reach | 0 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
+
+| Env | Gid | Good |
| 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.
+
+| Parameter | Value |
| γ | .99 |
| Initial α | .1 |
| α LR | 1e-4 |
| Actor LR | 1e-4 |
| Critic LR | 1e-4 |
| Batch size | 1024 |
| Critic hidden dim | 1024 |
| Critic hidden depth | 2 |
| Actor hidden dim | 1024 |
| Actor hidden depth | 2 |
+
+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.
+
+
+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.
+
+
+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.
+
+
+
+
+
+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.
+
+
+
+
+
+
+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.
+
+
+
+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.
+
+
+Figure 12: Comparison of CuSP with separately initialized and updated Alice and Bob, or a single Alice. Success rates are averaged across 3 seeds.
+
+
+
+# B.5.2 ASP ABLATIONS
+
+
+(a) ASP Sparse
+
+
+(b) ASP Dense
+
+
+(c) ASP Dense with SAC Bob
+
+
+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.
+
+
+
+
+
+
+Rounds $(\times 100)$
+
+
+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.,
+
+
+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'$ .
+
+| Loss | ANCHOR | POS/NEG | τ(x) | σ+(x) | σ-(x) | ρ+(x) | ρ-(x) |
| Contrastive (Hadsell et al., 2006) | X | X | x | x | x | -x | [x-m]+ |
| Lifted structure (Hermans et al., 2017) | X | X | [x]+ | log(x) | log(x) | e-x | ex-m |
| Binomial deviance (Yi et al., 2014) | X | X | x | log(1+x) | log(1+x) | e-β(x-m) | eγ(x-m) |
| Multi-similarity (Wang et al., 2019) | X | X | x | 1/β log(1+x) | 1/γ log(1+x) | e-β(x-m) | eγ(x-m) |
| Proxy anchor (Kim et al., 2020c) | proxy | X | x | 1/β log(1+x) | 1/γ log(1+x) | e-β(x-m) | eγ(x-m) |
| NCA (Goldberger et al., 2005) | X | X | x | -log(x) | log(x) | ex | ex |
| ProxyNCA (Movshovitz-Attias et al., 2017) | X | proxy | x | -log(x) | log(x) | ex | ex |
| ProxyNCA++ (Teh et al., 2020) | X | proxy | x | -log(x) | log(x) | ex/T | ex/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
+
+
+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.
+
+ | CUB200 | CARS196 | SOP | IN-SHOP |
| METHOD | R@1 | R@2 | R@4 | R@1 | R@2 | R@4 | R@1 | R@10 | R@100 | R@1 | R@10 | R@20 |
| Triplet (Weinberger & Saul, 2009) | 63.5 | 75.6 | 84.4 | 77.3 | 85.4 | 90.8 | 70.5 | 85.6 | 94.3 | 85.3 | 96.6 | 97.8 |
| LiftedStructure (Oh Song et al., 2016) | 65.9 | 75.8 | 84.5 | 81.4 | 88.3 | 92.4 | 76.1 | 88.6 | 95.2 | 88.6 | 97.6 | 98.4 |
| ProxyNCA (Movshovitz-Attias et al., 2017) | 65.2 | 75.6 | 83.8 | 81.2 | 87.9 | 92.6 | 73.2 | 87.0 | 94.4 | 86.2 | 95.9 | 97.0 |
| Margin (Wu et al., 2017) | 65.0 | 76.2 | 84.6 | 82.1 | 88.7 | 92.7 | 74.8 | 87.8 | 94.8 | 88.6 | 97.0 | 97.8 |
| SoftTriple (Qian et al., 2019) | 67.3 | 77.7 | 86.2 | 86.5 | 91.9 | 95.3 | 79.8 | 91.2 | 96.3 | 91.0 | 97.6 | 98.3 |
| D&C (Sanakoyeu et al., 2019)* | 65.9 | 76.6 | 84.4 | 84.6 | 90.7 | 94.1 | 75.9 | 88.4 | 94.9 | 85.7 | 95.5 | 96.9 |
| EPSHN (Xuan et al., 2020)* | 64.9 | 75.3 | 83.5 | 82.7 | 89.3 | 93.0 | 78.3 | 90.7 | 96.3 | 87.8 | 95.7 | 96.8 |
| Cont (Hadsell et al., 2006) | 64.7 | 75.9 | 84.6 | 81.6 | 88.2 | 92.7 | 74.9 | 87.0 | 93.9 | 86.4 | 94.7 | 96.2 |
| +Metrix | 67.4 | 77.9 | 85.7 | 85.1 | 91.1 | 94.6 | 77.5 | 89.1 | 95.5 | 89.1 | 95.7 | 97.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.8 | 77.8 | 85.6 | 87.8 | 92.7 | 95.3 | 76.9 | 89.8 | 95.9 | 90.1 | 97.6 | 98.4 |
| +Metrix | 71.4 | 80.6 | 86.8 | 89.6 | 94.2 | 96.0 | 81.0 | 92.0 | 97.2 | 92.2 | 98.5 | 98.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.7 | 80.0 | 87.0 | 87.7 | 92.9 | 95.8 | - | - | - | - | - | - |
| PA (Kim et al., 2020c) | 69.5 | 79.3 | 87.0 | 87.6 | 92.3 | 95.5 | 79.1 | 90.8 | 96.2 | 90.0 | 97.4 | 98.2 |
| +Metrix | 71.0 | 81.8 | 88.2 | 89.1 | 93.6 | 96.7 | 81.3 | 91.7 | 96.9 | 91.9 | 98.2 | 98.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.0 | 79.8 | 87.3 | 86.5 | 92.5 | 95.7 | 80.7 | 92.0 | 96.7 | 90.4 | 98.1 | 98.8 |
| ProxyNCA++ (Teh et al., 2020) | 69.1 | 79.5 | 87.7 | 86.6 | 92.1 | 95.4 | 80.4 | 91.7 | 96.7 | 90.2 | 97.6 | 98.4 |
| +Metrix | 70.4 | 80.6 | 88.7 | 88.5 | 93.4 | 96.5 | 81.3 | 92.7 | 97.1 | 91.9 | 98.1 | 98.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.
+
+ | CUB200 | CARS196 | SOP | IN-SHOP |
| METHOD | MIXING PAIRS | R@1 | R@2 | R@4 | R@1 | R@2 | R@4 | R@1 | R@10 | R@100 | R@1 | R@10 | R@20 | | | |
| Cont (Hadsell et al., 2006) | - | 64.7 | 75.9 | 84.6 | 81.6 | 88.2 | 92.7 | 74.9 | 87.0 | 93.9 | 86.4 | 94.7 | 96.3 | | | |
| + i-Mix (Lee et al., 2021) | anc-neg | 65.8 | 76.2 | 84.9 | 82.0 | 88.5 | 93.2 | 75.2 | 87.3 | 94.2 | 87.1 | 95.4 | 96.1 | | | |
| + Metrix/Input | pos-neg / anc-neg | 66.3 | 77.1 | 85.2 | 82.9 | 89.3 | 93.7 | 75.8 | 87.8 | 94.6 | 87.7 | 95.9 | 96.5 | | | |
| +MoCHi (Kalantidis et al., 2020) | neg-neg | 63.1 | 74.3 | 83.8 | 76.3 | 84.0 | 89.3 | 68.9 | 83.1 | 91.8 | 81.8 | 91.9 | 93.9 | | | |
| +MoCHi (Kalantidis et al., 2020) | anc-neg | 65.2 | 75.8 | 84.2 | 82.5 | 88.0 | 92.9 | 75.8 | 87.1 | 94.8 | 87.2 | 92.8 | 94.9 | | | |
| +Metrix/embed | pos-neg / anc-neg | 66.4 | 77.6 | 85.4 | 83.9 | 90.3 | 94.1 | 76.7 | 88.6 | 95.2 | 88.4 | 95.4 | 96.9 | | | |
| PA (Kim et al., 2020c) | - | 69.7 | 80.0 | 87.0 | 87.6 | 92.3 | 95.5 | 79.1 | 90.8 | 96.2 | 90.0 | 97.4 | 98.2 | | | |
| +PS (Gu et al., 2021) | pos-neg / neg-neg | 70.0 | 79.8 | 87.2 | 87.9 | 92.8 | 95.6 | 79.6 | 90.9 | 96.4 | 90.3 | 97.4 | 98.0 | | | |
| +Metrix/embed | pos-neg / anc-neg | 70.4 | 81.1 | 87.9 | 88.9 | 93.3 | 96.4 | 80.6 | 91.7 | 96.6 | 91.6 | 98.3 | 98.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}
+$$
+
+
+(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).
+
+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
+
+| DATASET | CUB200 (Wah et al., 2011) | CARS196 (Krause et al., 2013) | SOP (Oh Song et al., 2016) | IN-SHOP (Liu et al., 2016) |
| Objects | birds | cars | household furniture | clothes |
| # classes | 200 | 196 | 22, 634 | 7, 982 |
| # training images | 5, 894 | 8, 092 | 60, 026 | 26, 356 |
| # testing images | 5, 894 | 8, 093 | 60, 027 | 26, 356 |
| # training classes | 100 | 98 | 11, 318 | 3991 |
| # testing classes | 100 | 98 | 11, 318 | 3991 |
| sampling | random | random | balanced | balanced |
| samples per class | - | - | 5 | 5 |
| classes per batch | \(65^{\dagger}\) | \(70^{\dagger}\) | 20 | 20 |
| 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)$
+
+ | CUB200 | CARS196 | SOP | IN-SHOP |
| Method | 1 | 2 | 4 | 1 | 2 | 4 | 1 | 10 | 100 | 1 | 10 | 20 |
| Triplet (Weinberger & Saul, 2009) | 63.5 | 75.6 | 84.4 | 77.3 | 85.4 | 90.8 | 70.5 | 85.6 | 94.3 | 85.3 | 96.6 | 97.8 |
| LiftedStructure (Oh Song et al., 2016) | 65.9 | 75.8 | 84.5 | 81.4 | 88.3 | 92.4 | 76.1 | 88.6 | 95.2 | 88.6 | 97.6 | 98.4 |
| ProxyNCA (Movshovitz-Attias et al., 2017) | 65.2 | 75.6 | 83.8 | 81.2 | 87.9 | 92.6 | 73.2 | 87.0 | 94.4 | 86.2 | 95.9 | 97.0 |
| Margin (Wu et al., 2017) | 65.0 | 76.2 | 84.6 | 82.1 | 88.7 | 92.7 | 74.8 | 87.8 | 94.8 | 88.6 | 97.0 | 97.8 |
| SoftTriple (Qian et al., 2019) | 67.3 | 77.7 | 86.2 | 86.5 | 91.9 | 95.3 | 79.8 | 91.2 | 96.3 | 91.0 | 97.6 | 98.3 |
| D&C (Sanakoyeu et al., 2019)* | 65.9 | 76.6 | 84.4 | 84.6 | 90.7 | 94.1 | 75.9 | 88.4 | 94.9 | 85.7 | 95.5 | 96.9 |
| EPSHN (Xuan et al., 2020)* | 64.9 | 75.3 | 83.5 | 82.7 | 89.3 | 93.0 | 78.3 | 90.7 | 96.3 | 87.8 | 95.7 | 96.8 |
| ProxyNCA++ (Teh et al., 2020)* | 69.0 | 79.8 | 87.3 | 86.5 | 92.5 | 95.7 | 80.7 | 92.0 | 96.7 | 90.4 | 98.1 | 98.8 |
| Cont (Hadsell et al., 2006) | 64.7 | 75.9 | 84.6 | 81.6 | 88.2 | 92.7 | 74.9 | 87.0 | 93.9 | 86.4 | 94.7 | 96.2 |
| +Matrix/Input | 66.3 | 77.1 | 85.2 | 82.9 | 89.3 | 93.7 | 75.8 | 87.8 | 94.6 | 87.7 | 95.9 | 96.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 |
| +Matrix | 67.4 | 77.9 | 85.7 | 85.1 | 91.1 | 94.6 | 77.5 | 89.1 | 95.5 | 89.1 | 95.7 | 97.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/embed | 66.4 | 77.6 | 85.4 | 83.9 | 90.3 | 94.1 | 76.7 | 88.6 | 95.2 | 88.4 | 95.4 | 96.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.8 | 77.8 | 85.6 | 87.8 | 92.7 | 95.3 | 76.9 | 89.8 | 95.9 | 90.1 | 97.6 | 98.4 |
| +Matrix/Input | 69.0 | 79.1 | 86.0 | 89.0 | 93.4 | 96.0 | 77.9 | 90.6 | 95.9 | 91.8 | 98.0 | 98.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 |
| +Matrix | 71.4 | 80.6 | 86.8 | 89.6 | 94.2 | 96.0 | 81.0 | 92.0 | 97.2 | 92.2 | 98.5 | 98.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/embed | 70.2 | 80.4 | 86.7 | 88.8 | 92.9 | 95.6 | 78.5 | 91.3 | 96.7 | 91.9 | 98.3 | 98.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.7 | 80.0 | 87.0 | 87.7 | 92.9 | 95.8 | - | - | - | - | - | - |
| PA (Kim et al., 2020c) | 69.5 | 79.3 | 87.0 | 87.6 | 92.3 | 95.5 | 79.1 | 90.8 | 96.2 | 90.0 | 97.4 | 98.2 |
| +Matrix/Input | 70.5 | 81.2 | 87.8 | 88.2 | 93.2 | 96.2 | 79.8 | 91.4 | 96.5 | 90.9 | 98.1 | 98.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 |
| +Matrix | 71.0 | 81.8 | 88.2 | 89.1 | 93.6 | 96.7 | 81.3 | 91.7 | 96.9 | 91.9 | 98.2 | 98.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/embed | 70.4 | 81.1 | 87.9 | 88.9 | 93.3 | 96.4 | 80.6 | 91.7 | 96.6 | 91.6 | 98.3 | 98.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.0 | 79.8 | 87.3 | 86.5 | 92.5 | 95.7 | 80.7 | 92.0 | 96.7 | 90.4 | 98.1 | 98.8 |
| ProxyNCA++ (Teh et al., 2020) | 69.1 | 79.5 | 87.7 | 86.6 | 92.1 | 95.4 | 80.4 | 91.7 | 96.7 | 90.2 | 97.6 | 98.4 |
| +Matrix/Input | 69.7 | 79.9 | 88.3 | 87.5 | 92.9 | 96.0 | 80.9 | 92.2 | 96.9 | 91.4 | 98.1 | 98.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 |
| +Matrix | 70.4 | 80.6 | 88.7 | 88.5 | 93.4 | 96.5 | 81.3 | 92.7 | 97.1 | 91.9 | 98.1 | 98.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/ embed | 70.2 | 80.2 | 88.2 | 88.1 | 93.0 | 96.2 | 81.1 | 92.4 | 97.0 | 91.6 | 98.1 | 98.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.
+
+
+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.
+
+
+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.
+
+| STUDY | HARD NEGATIVES k | MIXING PAIRS | MIXUP TYPE | R@1 | R@2 | R@4 | R@8 |
| baseline | | | | 81.6 | 88.2 | 92.7 | 95.8 |
| hard negatives | 1 | pos-neg / anc-neg | input | 82.0 | 89.1 | 93.1 | 96.1 |
| 2 | pos-neg / anc-neg | input | 82.5 | 89.2 | 93.4 | 96.2 |
| 3 | pos-neg / anc-neg | input | 82.9 | 89.3 | 93.7 | 95.5 |
| 20 | pos-neg / anc-neg | feature | 83.5 | 90.1 | 94.0 | 96.5 |
| 40 | pos-neg / anc-neg | feature | 84.0 | 90.4 | 94.2 | 96.8 |
| all | pos-neg / anc-neg | feature | 85.1 | 91.1 | 94.6 | 97.0 |
| 20 | pos-neg / anc-neg | embed | 82.7 | 89.2 | 93.4 | 96.1 |
| 40 | pos-neg / anc-neg | embed | 83.0 | 90.0 | 93.8 | 96.4 |
| all | pos-neg / anc-neg | embed | 83.4 | 89.9 | 94.1 | 96.4 |
| mixing pairs | - | pos-pos | input | 81.0 | 88.2 | 92.6 | 95.6 |
| 3 | pos-neg | input | 82.4 | 89.1 | 93.3 | 95.6 |
| 3 | anc-neg | input | 81.8 | 89.0 | 93.6 | 95.4 |
| - | pos-pos | feature | 81.1 | 88.3 | 92.9 | 95.8 |
| all | pos-neg | feature | 84.0 | 90.2 | 94.2 | 96.6 |
| all | anc-neg | feature | 83.7 | 90.1 | 94.4 | 96.7 |
| - | pos-pos | embed | 78.3 | 85.7 | 90.8 | 94.4 |
| all | pos-neg | embed | 83.1 | 90.0 | 93.9 | 96.6 |
| all | anc-neg | embed | 82.7 | 89.5 | 93.5 | 96.3 |
| mixup type combinations | {1, all} | pos-neg / anc-neg | {input, feature} | 83.7 | 94.2 | 95.9 | 96.7 |
| {3, all} | pos-neg / anc-neg | {input, embed} | 83.0 | 90.9 | 94.1 | 96.4 |
| {all, all} | pos-neg / anc-neg | {feature, embed} | 84.7 | 90.6 | 94.4 | 96.9 |
| {1, all, all} | pos-neg / anc-neg | {input, feature, embed} | 85.3 | 94.9 | 96.2 | 97.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.
+
+
+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.
+
+| STUDY | HARD NEGATIVES k | MIXING PAIRS | MIXUP TYPE | R@1 | R@2 | R@4 | R@8 |
| baseline | | | | 61.6 | 73.7 | 83.6 | 90.1 |
| hard negatives | 1 | pos-neg / anc-neg | input | 62.4 | 73.9 | 83.0 | 89.7 |
| 2 | pos-neg / anc-neg | input | 62.7 | 74.2 | 83.6 | 90.0 |
| 3 | pos-neg / anc-neg | input | 63.1 | 74.5 | 83.5 | 90.3 |
| 20 | pos-neg / anc-neg | feature | 63.9 | 75.0 | 83.9 | 89.9 |
| 40 | pos-neg / anc-neg | feature | 63.5 | 75.2 | 83.5 | 89.8 |
| all | pos-neg / anc-neg | feature | 64.5 | 75.4 | 84.3 | 90.6 |
| 20 | pos-neg / anc-neg | embed | 63.1 | 74.3 | 83.1 | 90.0 |
| 40 | pos-neg / anc-neg | embed | 63.5 | 74.7 | 83.6 | 90.1 |
| all | pos-neg / anc-neg | embed | 64.0 | 75.1 | 84.8 | 90.9 |
| mixing pairs | - | pos-pos | input | 58.7 | 70.7 | 80.1 | 87.1 |
| 3 | pos-neg | input | 62.9 | 75.1 | 83.4 | 90.6 |
| 3 | anc-neg | input | 62.8 | 74.7 | 83.6 | 90.1 |
| - | pos-pos | feature | 61.0 | 73.1 | 82.5 | 89.7 |
| all | pos-neg | feature | 63.9 | 75.0 | 83.9 | 89.9 |
| all | anc-neg | feature | 63.8 | 74.8 | 83.6 | 90.2 |
| - | pos-pos | embed | 59.7 | 72.2 | 82.7 | 89.5 |
| all | pos-neg | embed | 63.8 | 75.1 | 83.3 | 90.5 |
| all | anc-neg | embed | 63.5 | 75.0 | 83.9 | 90.5 |
| mixup type combinations | {1, all} | pos-neg / anc-neg | {input, feature} | 63.9 | 75.1 | 84.9 | 90.5 |
| {3, all} | pos-neg / anc-neg | {input, embed} | 63.4 | 74.9 | 84.5 | 90.1 |
| {all, all} | pos-neg / anc-neg | {feature, embed} | 64.2 | 75.2 | 84.1 | 90.7 |
| {1, all, all} | pos-neg / anc-neg | {input, feature, embed} | 65.3 | 76.2 | 84.4 | 91.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
+
+| T | v | Shapley (k=1) | φSI | φGS | φAV | φST (vm; k) | φJ (vm; k) |
| k=2 | k=3 | k=2 | k=3 |
| The majority game: vm(T) = 1 when t ≥ 2, and is equal to 0 otherwise |
| i | 0 | 1/3 | 1/3 | 1/3 | -1/3 | 0 | 0 | 1/9 | 2/21 |
| i, j | 1 | | 0 | 1/2 | 1/3 | 1/3 | 1 | 2/9 | 4/21 |
| N | 1 | | -2 | 1 | 0 | | -2 | | 3/21 |
| A linear model with crosses: vc(T) = ∑i∈T 1 + c max {0, t-2} for c ∈ R |
| i | 1 | 1/3 (3+c) | 1/3 (3+c) | 1/3 (3+c) | -1/12c | 1 | 1 | 5/18 (2+c) | 5/21 (2+c) |
| i, j | 2 | | 1/3c | 1/2 (4+c) | -1/6c | 1/3c | 0 | 1/18 (8+c) | 1/21 (8+c) |
| N | 3+c | | c | 3+c | 3/4c | | c | | 3/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$
+
+ | x1 | x2 | x3 | x1, x2 | x1, x3 | x2, x3 | x1, x2, x3 |
| independent features |
| f1(x) = x1 | 0.122 | 0 | 0 | 0.049 | 0.049 | 0 | 0.037 |
| f2(x) = x1 + x2 | 0.122 | 0.114 | 0 | 0.061 | 0.049 | 0.045 | 0.046 |
| f3(x) = x1 - x2 | 0.122 | 0.114 | 0 | 0.062 | 0.049 | 0.045 | 0.047 |
| correlated features: x2 = 1 - x1 |
| f2(x) | 0.122 | 0.122 | 0 | 0 | 0.049 | 0.049 | 0 |
| f3(x) | 0.122 | 0.122 | 0 | 0.098 | 0.049 | 0.049 | 0.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) | x1 | x2 | x3 | x1,x2 | x1,x3 | x2,x3 | x1,x2,x3 |
| f1(x) = x1 | 5/21 | 0 | 0 | 1/21 | 1/21 | 0 | 1/56 |
| f2(x) = x1 + x2 | 5/21 | 5/21 | 0 | 2/21 | 1/21 | 1/21 | 1/28 |
| f4(x) = x1x2 | 5/42 | 5/42 | 0 | 1/14 | 1/42 | 1/42 | 3/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=2 | k=3 | k=2 | k=3 |
| RM: 2.57 | RM: 3.12 | RM: 3.12 | LSTAT: 0.63 | LSTAT: 0.42 |
| LSTAT: 2.47 | LSTAT: 2.04 | LSTAT: 2.04 | RM: 0.56 | RM: 0.34 |
| AGE: 0.81 | DIS: 1.55 | DIS: 1.55 | LSTAT, RM: 0.30 | AGE: 0.11 |
| DIS: 0.63 | CRIM: 1.37 | CRIM: 1.37 | AGE, LSTAT: 0.21 | LSTAT, RM: 0.11 |
| CRIM: 0.46 | B: 1.31 | DIS, LSTAT: 1.33 | AGE, RM: 0.20 | NOX: 0.10 |
| NOX: 0.44 | NOX: 1.15 | B: 1.31 | DIS, RM: 0.19 | DIS: 0.08 |
| PTRATIO: 0.27 | : | : | : | : |
| B: 0.24 | CHAS, RM: 0.15 | AGE, CRIM, RM: 0.21 | CHAS, TAX: 0.02 | RAD, TAX, ZN: 0.00 |
| TAX: 0.22 | LSTAT, TAX: 0.15 | AGE, DIS, PTRATIO: 0.21 | RAD, ZN: 0.01 | CHAS: 0.00 |
| INDUS: 0.19 | INDUS, RAD: 0.15 | DIS, LSTAT, PTRATIO: 0.21 | CHAS, RAD: 0.01 | CHAS, RAD, TAX: 0.00 |
| RAD: 0.13 | NOX, TAX: 0.14 | AGE, LSTAT, PTRATIO: 0.20 | ZN: 0.01 | CHAS, RAD, ZN: 0.00 |
| ZN: 0.07 | DIS, INDUS: 0.13 | AGE, NOX, RM: 0.20 | CHAS: 0.01 | CHAS, TAX, ZN: 0.00 |
| CHAS: 0.07 | DIS, PTRATIO: 0.12 | B, CRIM, LSTAT: 0.19 | CHAS, ZN: 0.01 | CHAS, 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$ ).
+
+
+Figure 1: Sampled $\phi^J$ converges to exact $\phi^J$ with $L^2$ norm $\approx 1.45$ ; $k = 2$ Boston
+
+
+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
+
+| Review | joint 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=1 | terrific | both | excellent | won’t | crisp | youthful | a | inspiring | disappointed | John |
| k=2 | terrific | both | excellent | won’t | a | youthful | inspiring | crisp | disappointed | John |
+
+# 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)$ .
+
+
+
+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).
+
+
+
+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.
+
+
+
+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
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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
+
+
+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.
+
+
+
+
+
+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.
+
+| Model | Target Domain | Average |
| M15 | M30 | M45 | M60 | M75 |
| ERM | 97.5±0.2 | 84.1±0.8 | 53.9±0.7 | 34.2±0.4 | 22.3±0.5 | 58.4 |
| ERM (prob) | 96.8±0.3 | 83.2±1.6 | 51.3±0.9 | 31.4±1.1 | 20.7±0.7 | 56.7 |
| DANN | 97.3±0.4 | 90.6±1.1 | 68.7±4.2 | 30.8±0.6 | 19.0±0.6 | 61.3 |
| MMD | 97.5±0.1 | 95.3±0.4 | 73.6±2.1 | 44.2±1.8 | 32.1±2.1 | 68.6 |
| CORAL | 97.1±0.3 | 82.3±0.3 | 56.0±2.4 | 30.8±0.2 | 27.1±1.7 | 58.7 |
| WD | 96.7±0.3 | 93.1±1.2 | 64.1±3.3 | 41.4±7.6 | 27.6±2.0 | 64.6 |
| KL (ours) | 97.8±0.1 | 97.1±0.2 | 93.4±0.8 | 75.5±2.4 | 68.1±1.8 | 86.4 |
+
+Table 2: DIGITS and VisDA17 experiments.
+
+| Model | DIGITS | VisDA17 |
| M → U | U → M | S → M | Average | S → R |
| ERM | 73.1±4.2 | 54.8±6.2 | 65.9±1.4 | 64.6 | 39.1±0.5 |
| ERM (prob) | 70.3±3.2 | 59.0±8.3 | 67.6±1.3 | 65.6 | 37.2±2.2 |
| DANN | 90.7±0.4 | 91.2±0.8 | 71.1±0.5 | 84.3 | 57.7±1.3 |
| MMD | 91.8±0.3 | 94.4±0.5 | 82.8±0.3 | 89.7 | 62.8±1.1 |
| CORAL | 88.0±1.9 | 83.3±0.1 | 69.3±0.6 | 80.2 | 39.5±4.5 |
| WD | 88.2±0.6 | 60.2±1.8 | 68.4±2.5 | 72.3 | 38.9±4.8 |
| KL (ours) | 98.2±0.2 | 97.3±0.5 | 92.5±0.9 | 96.0 | 70.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)
+
+
+
+# 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\%$
+
+
+
+
+
+
+
+
+
+
+(a) KL
+
+
+(c) DANN
+
+
+(d) ERM
+
+
+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.
+
+| Experiments | Model |
| ERM | ERM (prob) | DANN | MMD | CORAL | WD | KL (ours) |
| A → C | 66.1±1.3 | 63.5±0.8 | 71.0±3.2 | 79.5±0.4 | 62.7±10.4 | 76.2±0.9 | 73.1±3.4 |
| A → P | 94.3±0.6 | 93.5±1.3 | 94.5±0.5 | 94.5±1.1 | 86.3±6.8 | 92.4±1.3 | 95.4±1.2 |
| A → S | 53.6±0.8 | 60.9±3.5 | 58.6±12.8 | 62.1±2.0 | 46.2±3.5 | 53.9±2.7 | 67.4±1.9 |
| C → A | 69.7±1.1 | 70.8±2.3 | 76.4±1.7 | 79.5±3.0 | 75.9±0.9 | 69.0±2.1 | 83.3±1.1 |
| C → P | 82.0±0.9 | 81.5±2.1 | 78.6±3.4 | 80.8±2.3 | 78.3±3.6 | 72.9±8.6 | 83.1±7.4 |
| C → S | 72.2±1.4 | 70.4±1.5 | 76.1±1.0 | 74.1±1.3 | 56.9±11.0 | 48.7±6.1 | 68.2±0.5 |
| P → A | 65.7±2.3 | 63.3±1.2 | 68.0±2.7 | 67.7±1.8 | 70.0±1.5 | 62.6±1.5 | 75.5±2.5 |
| P → C | 29.1±1.9 | 27.2±3.3 | 50.7±5.0 | 47.4±0.8 | 47.5±8.6 | 56.1±1.4 | 67.7±1.2 |
| P → S | 38.0±1.0 | 35.9±2.3 | 29.3±9.8 | 59.7±4.8 | 15.8±5.3 | 22.3±15.0 | 64.5±2.1 |
| S → A | 41.3±6.5 | 40.9±3.9 | 39.2±3.5 | 40.0±3.3 | 39.1±4.8 | 36.1±9.5 | 48.2±2.4 |
| S → C | 66.7±1.0 | 67.9±1.4 | 64.3±2.0 | 65.7±2.3 | 59.9±1.5 | 60.5±2.0 | 63.5±0.4 |
| S → P | 49.3±3.3 | 46.0±4.7 | 44.3±4.0 | 45.1±0.9 | 37.4±2.7 | 38.5±5.6 | 39.1±3.4 |
| Average | 60.6 | 60.2 | 62.6 | 66.3 | 56.3 | 57.4 | 69.1 |
+
+Table 4: Office-31 experiments
+
+| Model | A→D | A→W | D→A | D→W | W→A | W→D | Average |
| DANN | 79.7±0.4 | 82.0±0.4 | 68.2±0.4 | 96.9±0.2 | 67.4±0.5 | 99.1±0.1 | 82.2 |
| MMD | 75.5±0.6 | 73.4±0.4 | 60.8±1.0 | 97.4±0.5 | 61.5±1.1 | 99.5±0.2 | 78.0 |
| KL | 85.6±0.6 | 87.9±0.4 | 70.1±1.1 | 99.0±0.2 | 69.3±0.7 | 100.0±0.0 | 85.3 |
+
+Table 5: Ablation study: Effect of batch size. Rotated MNIST experiments with ${\mathcal{M}}_{0}$ source and ${\mathcal{M}}_{45}$ target.
+
+| Batch size | 256 | 128 | 64 | 32 |
| KL (ours) | 93.4±0.8 | 93.4±1.2 | 93.3±0.3 | 89.5±0.9 |
+
+Table 6: Ablation study: Effect of auxiliary term. RotatedMNIST.
+
+| Model | M15 | M30 | M45 | M60 | M75 | Average |
| KL (βaux = 0) | 97.8±0.5 | 96.6±0.4 | 92.0±0.4 | 68.8±4.6 | 62.3±4.2 | 83.5 |
| KL (reported in the paper) | 97.8±0.1 | 97.1±0.2 | 93.4±0.8 | 75.5±2.4 | 68.1±1.8 | 86.4 |
+
+Table 7: Ablation study: Effect of auxiliary term. DIGITS and VisDA17.
+
+| Model | DIGITS | VisDA17 |
| M → U | U → M | S → M | Average | S → R |
| KL (βaux = 0) | 98.2±0.2 | 97.1±0.4 | 90.0±1.1 | 95.1 | 67.8 |
| KL (reported in the paper) | 98.2±0.2 | 97.3±0.52 | 92.5±0.9 | 96.0 | 70.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)
+
+
+Step 1. Knowledge Retrieval
+
+
+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$ .
+
+
+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_{5\%$ improvement over the next-best performance. We also annotate the performance reported by published state-of-the-art models to date (- means missing official reports).
+
+| Existing Method | ELI5 | MSMARCO | ROC | αNLG | WoW | MuTual |
| B-1 | R-L | B-1 | R-L | B-1 | R-L | B-1 | R-L | F-1 | R-L | MRRG | R-L |
| GPT2-M [345M]* | 14.6 | 16.1 | 28.8 | 30.1 | 12.0 | 13.9 | 13.2 | 15.0 | 9.3 | 10.8 | 29.7 | 7.1 |
| - FT + Beam | 22.9 | 24.6 | 44.1 | 50.6 | 26.4 | 20.6 | 19.4 | 25.7 | 10.3 | 12.1 | 47.9 | 11.3 |
| - FT + Sampling | 23.8 | 25.4 | 46.2 | 51.2 | 26.0 | 20.0 | 18.9 | 25.1 | 12.6 | 11.9 | 51.6 | 20.3 |
| - FT + KID | 27.9 | 26.6 | 47.4 | 53.9 | 28.1 | 21.2 | 21.7 | 26.9 | 16.4 | 15.9 | 53.3 | 22.4 |
| BART-L [406M]* | 21.4 | 20.6 | 19.1 | 19.7 | 12.5 | 16.7 | 24.6 | 28.0 | 8.1 | 8.5 | 35.1 | 12.9 |
| - FT + Beam | 25.6 | 24.7 | 44.5 | 50.5 | 22.3 | 20.2 | 31.9 | 34.1 | 10.9 | 11.9 | 49.2 | 20.6 |
| - FT + Sampling | 25.8 | 25.1 | 48.4 | 53.5 | 24.4 | 20.9 | 30.5 | 33.6 | 12.2 | 15.0 | 53.7 | 20.4 |
| - FT + KID | 27.4 | 26.3 | 51.9 | 56.9 | 26.5 | 21.3 | 33.4 | 35.6 | 15.7 | 16.6 | 54.5 | 22.7 |
| Published SotA\(\diamond\) | - | 26.2 | - | 57.2 | 26.3 | 20.8 | - | 45.0 | 13.5 | 15.5 | - | - |
+
+requires generating reasonable hypothesis given two observations. We follow related work (Zhou et al., 2021; Guan et al., 2020) in using BLEU-1 and ROUGE-L as evaluation metrics.
+
+Dialogue Generation. Chitchat dialogues are normally multi-turn discussions over a variety of topics or concepts, which often involve topical and factual knowledge (Petroni et al., 2021). We study two dialogue datasets that require knowledge grounding: Wizard of Wikipedia (WoW) (Dinan et al., 2019), where the speaker in the conversation must ground their utterances in Wikipedia passages, and MuTual (Cui et al., 2020), where utterances have to be a logically-coherent continuation of the given multi-turn context. We follow existing work and the leaderboard of WoW in using F-1/ROUGE-L for WoW and MRR/ROUGE-L for MuTual evaluations.
+
+We take two representative language models to demonstrate the effectiveness of KID: 1) GPT2-medium (Radford et al., 2019) which is an auto-regressive LM, and 2) BART-large (Lewis et al., 2020a) which is a text-to-text LM. We tune the hyperparameters based on the models' performance on an in-house split dev set, and report the results that were best on the official dev set4.
+
+# 4.2 MAIN RESULTS ON DECODING PERFORMANCE
+
+Comparison with off-the-shelf decoding methods. Table 1 compares the results of GPT2-medium and BART-large on six diverse NLG tasks with beam search (Beam), sampling (Sampling), and our proposed KID decoding algorithm. Compared with the other two commonly used decoding algorithms, knowledge-guided KID achieves better results for all the cases, with significant improvements (with p-value $p < 0.01$ ) over the next-best decoding strategy (e.g., 4.1 absolute increase for BLEU-1 in ELI5 (GPT2)). We also notice that KID brings greater improvements to auto-regressive language models – above $5\%$ improvement in 9 out of 12 metrics for GPT2-medium, in contrast to 5 out of 12 for text2text language model (BART-large). The reason could be that the reinforcement learning objective of KID is more similar to the MLE objective of GPT2 than the denoising objective of BART (Pang & He, 2021; Guo et al., 2021). Compared with task-specific state-of-the-art models5, task-agnostic LMs armed with KID can beat SOTA results on three different tasks (ELI5, ROC, WoW), which is not possible when beam search and sampling decoding is used. This interesting observation demonstrates a huge potential in inference-time optimization, which we believe is worth exploring further.
+
+Table 2: Performance of six related works on Wiki-answerable ELI5 and MSMARCO, and out-of-domain PIQA and PubMedQA QA tasks. We report ROUGE-L score with $10\%$ and $100\%$ of the training data. As a model-agnostic method, KID shows particularly strong performance in few-shot scenarios, which can better help LMs transfer to new domain with minimum training data.
+
+ | ELI5 | MSMARCO | PIQA | PubMedQA |
| Method / Available FT Data | 10% | 100% | 10% | 100% | 10% | 100% | 10% | 100% |
| GPT2 + Knowledge (KG Triplets Post-train; 2020) | 9.3 | 15.7 | 22.3 | 42.1 | 7.5 | 16.2 | 3.6 | 8.4 |
| GPT2 + COMeT Emb. (KG Embedding Fuse; 2020) | 13.4 | 17.3 | 30.3 | 44.6 | 6.4 | 16.5 | 4.5 | 5.8 |
| RAG (Wiki Retrieval Augmented; 2020b) | 5.7 | 21.4 | 25.4 | 57.2 | 3.2 | 17.3 | 1.2 | 6.7 |
| FiD-T5 (Two-step Retrieval + Seq2Seq; 2021b) | 3.9 | 18.1 | 23.7 | 53.1 | 4.5 | 17.4 | 1.3 | 4.5 |
| QA-GNN (GNN + Attention; 2021) | 6.2 | 19.5 | 21.3 | 50.5 | 6.3 | 19.1 | 7.8 | 11.7 |
| ReFlective (Forward + Backward LMs; 2021) | 8.7 | 18.2 | 23.5 | 44.7 | 5.9 | 16.7 | 4.1 | 9.2 |
| Ours: KID (with GPT2-medium) | 15.2 | 26.6 | 32.3 | 53.9 | 10.5 | 18.4 | 9.9 | 11.5 |
+
+Comparison with existing knowledge-infusion methods. Besides evaluating KID from a pure decoding perspective, we also compare KID with existing methods of integrating knowledge for knowledge-intensive NLG tasks. In addition to ELI5 and MSMARCO, we also evaluate on two extra QA tasks: PIQA and PubMedQA (discussed in §4.1), where answers are considered to be not fully covered by Wiki knowledge. Besides RAG (Lewis et al., 2020b), we consider several competitive prior methods incorporating knowledge including a) GPT2 + Knowledge (Guan et al., 2020), which post-trains GPT2 on triplets-converted augmentation data (e.g., $\langle \text{helium}, \text{is}, \text{gas} \rangle \rightarrow$ "helium is gas."); b) GPT2 + COMeT Embeddings, which fuses knowledge-aware embeddings (e.g., from CoMET (Bosselut et al., 2019); c) FiD-T5 (Izacard & Grave, 2021b;a), which concatenates retrieved grounding documents with context as new input; d) QA-GNN (Yasunaga et al., 2021), which traverses a graph neural network; e) Reflective decoding (West et al., 2021), which relies on forward and backward LMs to encode bi-directional context for generation.
+
+As shown in Table 2 (columns with $100\%$ training data), KID outperforms all other methods in ELI5 (with 5.2 ROUGE-L points improvements over the second-best method (RAG)), and achieves competitive results requiring neither specific model architecture nor additional training to infuse knowledge. We also evaluate on a few-shot setting, where only $10\%$ of task training data is available to mimic domains for which ample training data is unavailable or difficult to acquire in practice. This setting also tests a method's ability to transfer to new domain and to generalize to unseen entities, concepts or events. Also shown in Table 2, KID with a LM similar in size to the baselines (GPT2-medium) achieves best few-shot performance in all four tasks, including PIQA and PubMedQA. Our experiments find baseline methods tend to generate off-topic and hallucinatory answers when the expected answer length is long (e.g., ELI5 and PIQA). RAG shows limited performance in few-shot scenarios, due to its static knowledge retrieved by initial context cannot be generalized to newly generated tokens. KID, instead, dynamically searches references for grounding, thus showing more agility in unfamiliar context. Comparison with more baselines can be found in §A.3 of Appendix.
+
+# 4.3 ABLATION STUDIES FOR THE BEST PERFORMING KID
+
+How to choose retriever? We experiment with replacing the default DPR document retriever of KID, with popular retrievers including the TF-IDF retriever from DrQA (Chen et al., 2017), and the Wiki retriever used in BLINK (Wu et al., 2020). We also experiment with a random retriever baseline that retrieves documents randomly given the context. We choose two tasks ELI5 and WoW that provide ground-truth knowledge provenance, which are also the only two KILT tasks requiring long and abstractive generation (Petroni et al., 2021). Following KILT benchmarking metrics, we use precision@1 (Prec@1) to measure the top-1 retrieval accuracy, and ROUGE-L (R-L) to evaluate generation quality. We also consider directly measuring how much knowledge in the ground-truth evidence (provenance) appear in the actual generation. We compute knowledge Coverage (Cov) (used in Guan et al. (2020)) which is the 1-gram overlap between the triplets of provenance and the generation, to measure the extent to which our generation is actually using the retrieved knowledge.
+
+
+Figure 2: Impact of hyperparameters on KID's ELI5 performance when (a) more documents are retrieved, and (b) more hops taken when querying the knowledge trie. (c) Average human ratings on different-length sequences generated by KID, sampling, beam search, and reflective decoding. KID generation has more stable quality across lengths by restraining exposure bias.
+
+
+
+
+
+Table 3 shows the corresponding results. For reference, RAG obtains nearly equivalent performance (R-L and Cov) with random retriever and the DPR $^{\text{FT6}}$ , which indicates its generation mainly relies on the fine-tuned BART and ignores retrieved knowledge (also observed in Krishna et al. (2021)). In contrast, KID with the default DPR retriever outperforms all other retrievers and RAG variants in retrieval accuracy (Prec@1), knowledge coverage (Cov) and final generation quality (R-L). We observe high correlation between (Cov, R-L) and Prec@1, indicating that a good knowledge retrieval is essential for knowledge-intensive NLG tasks.
+
+Table 3: A closer comparison of BART-L with KID and RAG (Lewis et al., 2020b) which also leverages retrieved Wikipedia passages as knowledge. We switch between different retrievers to study its impact on retrieval accuracy (Prec@1), generation quality (R-L), and knowledge coverage (Cov).
+
+ | ELI5 | WoW |
| Prec@1 | R-L | Cov | Prec@1 | R-L | Cov |
| RAG w/. Random | 3.4 | 21.3 | 2.62 | 15.6 | 10.4 | 9.12 |
| RAG w/. DPRFT | 16.7 | 21.4 | 2.68 | 26.3 | 11.8 | 11.8 |
| KID w/. Random | 3.4 | 16.5 | 1.34 | 15.6 | 9.5 | 7.79 |
| KID w/. TF-IDF | 11.0 | 20.9 | 3.88 | 41.9 | 15.4 | 12.8 |
| KID w/. BLINK | 8.9 | 21.5 | 2.87 | 24.3 | 10.0 | 8.31 |
| KID w/. DPR (default) | 17.3 | 26.3 | 4.39 | 45.5 | 16.6 | 15.7 |
+
+Table 4: The performance (R-L) on ELI5 of LMs with different sizes (similar architecture). Vanilla LMs $(^{*})$ benefit more with KID than the fine-tuned ones (FT). (The absolute gain over the next-best is annotated.)
+
+| Model | ELI5 |
| Beam | Sample | KID |
| GPT2-M* | 16.0 | 16.1 | 20.2▲4.1 |
| GPT2-MFT | 24.6 | 25.4 | 26.6▲1.2 |
| GPT3-1.3B* | 21.7 | 22.0 | 24.5▲2.5 |
| GPT3-1.3BFT | 24.9 | 25.5 | 26.6▲1.1 |
| GPT3-2.7B* | 22.8 | 24.6 | 26.7▲2.1 |
+
+How much knowledge do we need? We also study the impact of number of documents $(k)$ we retrieve and number of hops $(h_{\mathrm{max}})$ we use to query the knowledge trie, two factors that determine how much knowledge we use to ground the generation. As shown in Figure 2 (a) and (b), for the example task ELI5, we find the generation performance measured by ROUGE-L does not benefit from simply more retrieved documents—an optimum $k$ is 5 through empirical observation, and similarly, $h_{\mathrm{max}} = 4$ brings best performance. A larger $k$ might risk retrieving less relevant Wiki documents and a larger hop $h_{\mathrm{max}}$ with deeper traverse through the knowledge trie tends to bring in off-topic knowledge. We also plot the average time consumed for generating each sentence as reference (the second $y$ -axis in Figure 2 (a) and (b)), which demonstrate the best performing $k = 5$ and $h_{\mathrm{max}} = 4$ achieve a reasonable trade-off between generation quality and decoding speed.
+
+In Figure 2 (c), we quantify the exposure bias problem through human judgements. We first sample 200 ELI5 test set questions and generate answers of various lengths $\{80,100,\dots,260\}$ (260 is the average sequence length in training set) with beam search, sampling, reflective (West et al., 2021), and KID. We then ask humans to rate these generations with 7-point Likert scoring (Joshi et al., 2015) how likely the generated text is a natural sentence. Each generation receives at least 15 ratings. We observe that both beam search and sampling methods suffer from the exposure bias problem7, since
+
+Table 5: Human assessments of generation in terms of Relevance, Factuality, and Grammaticality on a 7-point Likert scale. We run paired sample $t$ -test comparing human references (Gold) with beam search (BM) with beam size 5, sampling (SP) with top $p = 0.9$ and $k = 20$ , reflective (RFLC) decoding, and our KID generation. $p$ value describes the significance of difference from Gold. (* corresponds to $p$ -value< 0.05 and ** to 0.01.)
+
+ | ELI5 | aNLG | WoW |
| Gold | BM | SP | RFLC | KID | Gold | BM | SP | RFLC | KID | Gold | BM | SP | RFLC | KID |
| Relevance | Mean p-value | 5.14 | 4.51 | 4.97 | 4.73 | 5.07 | 5.42 | 5.22 | 5.10 | 5.27 | 5.36 | 4.62 | 4.68 | 4.44 | 4.35 | 4.57 |
| - | .00** | .10 | .03* | .30 | - | .14 | .02* | .17 | .23 | - | .12 | .10 | .06 | .30 |
| Factuality | Mean p-value | 4.95 | 4.37 | 4.61 | 4.23 | 4.87 | 5.35 | 5.17 | 5.19 | 5.25 | 5.30 | 4.72 | 4.20 | 4.38 | 4.41 | 4.53 |
| - | .14 | .00** | .00** | .24 | - | .05 | .06 | .30 | .41 | - | .00** | .06* | .15 | .29 |
| Fluency | Mean p-value | 5.66 | 5.52 | 5.54 | 5.07. | 5.50 | 5.40 | 5.23 | 5.34 | 4.97 | 5.27 | 4.53 | 4.48 | 4.40 | 4.14 | 4.33 |
| - | .09 | .11 | .02* | .07 | - | .15 | .20 | .04* | .16 | - | .18 | .10 | .05 | .08 |
+
+their ratings deteriorate as the length grows. Reflective decoding exhibits similar trend since it stills relies on MLE training. KID, instead, dynamically infuses global knowledge with LM predictions at each step and thus can mitigate exposure bias by imitating non-local demonstrations.
+
+Does the size of LM matter? We run experiments with different sizes of LMs that have the similar architecture (GPT2-medium, and GPT3 with 1.3B, and 2.7B parameters $^8$ ). Table 4 shows that overall larger LMs benefits all decoding methods with KID consistently outperforming Beam search and sampling decoding. In addition, KID brings more gain for non-finetuned LMs than fine-tuned ones, potentially because the fine-tuning LM is already fit onto the new domain thus less knowledge infusion is needed. Interestingly with KID, vanilla GPT3-2.7B outperforms its 1.3B fine-tuned counterpart, which is especially meaningful since ever-large foundation models (Bommasani et al., 2021) are expensive to fine-tune effectively on common hardware settings (Liu et al., 2021).
+
+# 4.4 HUMAN EVALUATION
+
+We recruited 300 MTurk participants to manually examine generated outputs of several decoding algorithm in terms of relevance, factuality, and fluency. Each participant was asked to review five sample generations without revealing their source. We used paired samples $t$ -tests to examine the difference between human references and other decoding methods generation. As Table 5 shows, KID generates similar quality sequences as human references without significant differences across all three tasks, while in ELI5, beam search and reflective decoding generation are rated significantly low in both relevance and factuality, partially due to exposure bias in longer generation. There is no significant difference in grammaticality between KID and vanilla decoding methods. The exact questions we asked participants can be found in §A.5 of Appendix.
+
+# 5 CONCLUSIONS AND FUTURE WORK
+
+In this work, we proposed KID, a novel decoding algorithm which in each step of decoding dynamically fetches knowledge and guides token decoding via interaction between a local knowledge memory and a constructed external knowledge trie. Given its decoding nature, KID doesn't require architecture changes to existing LMs and is applicable to various generative LMs. Evaluations on eight knowledge-intensive NLG tasks demonstrated the effectiveness of KID and that its generations are aligned with human references well. In addition, KID is also found to alleviate exposure bias and maintain quality for long generations.
+
+Future work of KID could study more efficient data structures to accelerate knowledge fetching and integration. One could also investigate combining KID with prompt based generations to further boost the performance, especially in the few-shot settings. Another direction is to further study the integration of KID with full size foundation models, like GPT-3 175B to understand KID's potential.
+
+# ETHICS AND REPRODUCIBILITY STATEMENT
+
+The goal of KID is to provide a general-purpose knowledge infusing decoding algorithm by leveraging retrieved Wikipedia documents. Still, the generation of KID can be affected by certain biases from the LM it is based on though those biases may be partially mitigated by the knowledge demonstrations (Liu et al., 2022; Rae et al., 2021). Another major ethical consideration is that KID can mimic undesirable attributes of the target knowledge source documents that could be noncontemporary and do not represent current norms and practices—and KID has no scheme to diagnose these problems (Lewis et al., 2020b). Furthermore, our experiments and analysis are done in English, and therefore we do not claim that our findings will generalize across all languages, although our framework has potential to be extended to other languages with necessary modifications.
+
+For reproducibility, evaluations of KID and baseline methods are all conducted on public NLG data sets. We compare results from published papers and public leaderboards. Code and scripts for reproducing KID is available on GitHub at https://github.com/microsoft/KID.
+
+# REFERENCES
+
+Daniel Adiwardana, Minh-Thang Luong, David R So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, et al. Towards a human-like open-domain chatbot. ArXiv preprint, abs/2001.09977, 2020. URL https://arxiv.org/abs/2001.09977.
+Ashutosh Baheti, Alan Ritter, Jiwei Li, and Bill Dolan. Generating more interesting responses in neural conversation models with distributional constraints. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3970-3980, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1431. URL https://aclanthology.org/D18-1431.
+Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. Abductive commonsense reasoning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=Byg1v1HKDB.
+Yonatan Bisk, Rowan Zellers, Ronan LeBras, Jianfeng Gao, and Yejin Choi. PIQA: reasoning about physical commonsense in natural language. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 7432-7439. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/article/view/6239.
+Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. *ArXiv* preprint, abs/2108.07258, 2021. URL https://arxiv.org/abs/2108.07258.
+Antoine Bosselut, Hannah Rashkin, Maarten Sap, Chaitanya Malaviya, Asli Celikyilmaz, and Yejin Choi. COMET: Commonsense transformers for automatic knowledge graph construction. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4762-4779, Florence, Italy, 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1470. URL https://aclanthology.org/P19-1470.
+Antoine Bosselut, Ronan Le Bras, and Yejin Choi. Dynamic neuro-symbolic knowledge graph construction for zero-shot commonsense question answering. In AAAI, pp. 4923-4931, 2021. URL https://ojs.aaai.org/index.php/AAAI/article/view/16625.
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1870-1879, Vancouver, Canada, 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1171. URL https://aclanthology.org/P17-1171.
+
+Pinzhen Chen, Nikolay Bogoychev, Kenneth Heafield, and Faheem Kirefu. Parallel sentence mining by constrained decoding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 1672-1678, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.152. URL https://aclanthology.org/2020.acl-main.152.
+Eric Chu and Peter J. Liu. Meansum: A neural model for unsupervised multi-document abstractive summarization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 1223-1232. PMLR, 2019. URL http://proceedings.mlr.press/v97/chu19b.html.
+Leyang Cui, Yu Wu, Shujie Liu, Yue Zhang, and Ming Zhou. MuTual: A dataset for multi-turn dialogue reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 1406-1416, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.130. URL https://aclanthology.org/2020.acl-main.130.
+Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. Plug and play language models: A simple approach to controlled text generation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=H1edEyBKDS.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171-4186, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423.
+Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. Wizard of wikipedia: Knowledge-powered conversational agents. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=r1173iRqKm.
+Angela Fan, Mike Lewis, and Yann Dauphin. Hierarchical neural story generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 889-898, Melbourne, Australia, 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1082. URL https://aclanthology.org/P18-1082.
+Angela Fan, Claire Gardent, Chloe Braud, and Antoine Bordes. Using local knowledge graph construction to scale Seq2Seq models to multi-document inputs. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4186-4196, Hong Kong, China, 2019a. Association for Computational Linguistics. doi: 10.18653/v1/D19-1428. URL https://aclanthology.org/D19-1428.
+Angela Fan, Yacine Jernite, Ethan Perez, David Grangier, Jason Weston, and Michael Auli. ELI5: Long form question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3558-3567, Florence, Italy, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1346. URL https://aclanthology.org/P19-1346.
+Ulrich Germann, Eric Joanis, and Samuel Larkin. Tightly packed tries: How to fit large models into memory, and make them load fast, too. In Proceedings of the Workshop on Software Engineering, Testing, and Quality Assurance for Natural Language Processing (SETQA-NLP 2009), pp. 31-39, Boulder, Colorado, 2009. Association for Computational Linguistics. URL https://aclanthology.org/W09-1505.
+Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. SAMSum corpus: A human-annotated dialogue dataset for abstractive summarization. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, pp. 70–79, Hong Kong, China, 2019. Association
+
+for Computational Linguistics. doi: 10.18653/v1/D19-5409. URL https://aclanthology.org/D19-5409.
+Jian Guan, Fei Huang, Zhihao Zhao, Xiaoyan Zhu, and Minlie Huang. A knowledge-enhanced pretraining model for commonsense story generation. Transactions of the Association for Computational Linguistics, 8:93-108, 2020. doi: 10.1162/tacl_a_00302. URL https://aclanthology.org/2020.tacl-1.7.
+Han Guo, Bowen Tan, Zhengzhong Liu, Eric P Xing, and Zhiting Hu. Text generation with efficient (soft) q-learning. ArXiv preprint, abs/2106.07704, 2021. URL https://arxiv.org/abs/2106.07704.
+Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Retrieval augmented language model pre-training. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 3929-3938. PMLR, 2020. URL http://proceedings.mlr.press/v119/guu20a.html.
+Ari Holtzman, Jan Buys, Maxwell Forbes, Antoine Bosselut, David Golub, and Yejin Choi. Learning to write with cooperative discriminators. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1638-1649, Melbourne, Australia, 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1152. URL https://aclanthology.org/P18-1152.
+Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=rygGQyrFvH.
+Luyang Huang, Lingfei Wu, and Lu Wang. Knowledge graph-augmented abstractive summarization with semantic-driven cloze reward. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 5094-5107, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.457. URL https://aclanthology.org/2020.acl-main.457.
+Gautier Izacard and Edouard Grave. Distilling knowledge from reader to retriever for question answering. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021a. URL https://openreview.net/forum?id=NTEz-6wysdb.
+Gautier Izacard and Edouard Grave. Leveraging passage retrieval with generative models for open domain question answering. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 874-880, Online, 2021b. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.74. URL https://aclanthology.org/2021.eacl-main.74.
+Natasha Jaques, Judy Hanwen Shen, Asma Ghandeharioun, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Human-centric dialog training via offline reinforcement learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 3985-4003, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.327. URL https://aclanthology.org/2020.emnlp-main.327.
+Yacine Jernite. Explain anything like i'm five: A model for open domain long form question answering, 2020. URL https://yjernite.github.io/lfqa.html.
+Haozhe Ji, Pei Ke, Shaohan Huang, Furu Wei, Xiaoyan Zhu, and Minlie Huang. Language generation with multi-hop reasoning on commonsense knowledge graph. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 725-736, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.54. URL https://aclanthology.org/2020.emnlp-main.54.
+
+Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William Cohen, and Xinghua Lu. PubMedQA: A dataset for biomedical research question answering. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2567-2577, Hong Kong, China, 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1259. URL https://aclanthology.org/D19-1259.
+Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 2019. URL https://ieeexplore.ieee.org/abstract/document/8733051.
+Ankur Joshi, Saket Kale, Satish Chandel, and D Kumar Pal. Likert scale: Explored and explained. British Journal of Applied Science & Technology, 7(4):396, 2015.
+Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 6769-6781, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.550. URL https://aclanthology.org/2020.emnlp-main.550.
+Nora Kassner and Hinrich Schütze. Negated and misprimed probes for pretrained language models: Birds can talk, but cannot fly. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7811-7818, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.698. URL https://aclanthology.org/2020.acl-main.698.
+Nitish Shirish Keskar, Bryan McCann, Lav Varshney, Caiming Xiong, and Richard Socher. CTRL - A Conditional Transformer Language Model for Controllable Generation. ArXiv preprint, abs/1909.05858, 2019. URL https://arxiv.org/abs/1909.05858.
+Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor language models. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=Hk1BjCEKvH.
+Kalpesh Krishna, Aurko Roy, and Mohit Iyyer. Hurdles to progress in long-form question answering. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 4940-4957, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.393. URL https://aclanthology.org/2021.naacl-main.393.
+Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 6086–6096, Florence, Italy, 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1612. URL https://aclanthology.org/P19-1612.
+Yoav Levine, Barak Lenz, Or Dagan, Ori Ram, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon Shashua, and Yoav Shoham. SenseBERT: Driving some sense into BERT. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 4656-4667, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.423. URL https://aclanthology.org/2020.acl-main.423.
+Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871-7880, Online, 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://aclanthology.org/2020.acl-main.703.
+Patrick S. H. Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen-tau Yih, Tim Roektaschel, Sebastian Riedel, and Douwe Kiela. Retrieval-augmented generation for knowledge-intensive NLP tasks. In
+
+Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and HsuanTien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020b. URL https://proceedings.neurips.cc/paper/2020/bash/6b493230205f780e1bc26945df7481e5-Abstract.html.
+Jiwei Li, Will Monroe, Alan Ritter, Dan Jurafsky, Michel Galley, and Jianfeng Gao. Deep reinforcement learning for dialogue generation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1192-1202, Austin, Texas, 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1127. URL https://aclanthology.org/D16-1127.
+Bill Yuchen Lin, Seyeon Lee, Rahul Khanna, and Xiang Ren. Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-Trained Language Models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 6862-6868, Online, 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.557. URL https://aclanthology.org/2020.emnlp-main.557.
+Bill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou, Chandra Bhagavatula, Yejin Choi, and Xiang Ren. CommonGen: A constrained text generation challenge for generative commonsense reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1823-1840, Online, 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.165. URL https://aclanthology.org/2020.findings-emnlp.165.
+Ruibio Liu, Guangxuan Xu, Chenyan Jia, Weicheng Ma, Lili Wang, and Soroush Vosoughi. Data boost: Text data augmentation through reinforcement learning guided conditional generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9031-9041, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.726. URL https://aclanthology.org/2020.emnlp-main.726.
+Ruibo Liu, Chenyan Jia, Jason Wei, Guangxuan Xu, and Soroush Vosoughi. Quantifying and alleviating political bias in language models. Artificial Intelligence, 304:103654, 2022. ISSN 0004-3702. doi: https://doi.org/10.1016/j.artint.2021.103654. URL https://www.sciencedirect.com/science/article/pii/S0004370221002058.
+Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. ArXiv preprint, abs/2103.10385, 2021. URL https://arxiv.org/abs/2103.10385.
+Robert Logan, Nelson F. Liu, Matthew E. Peters, Matt Gardner, and Sameer Singh. Barack's wife hillary: Using knowledge graphs for fact-aware language modeling. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 5962-5971, Florence, Italy, 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1598. URL https://aclanthology.org/P19-1598.
+Yuning Mao, Xiang Ren, Heng Ji, and Jiawei Han. Constrained abstractive summarization: Preserving factual consistency with constrained generation. ArXiv preprint, abs/2010.12723, 2020. URL https://arxiv.org/abs/2010.12723.
+Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 839-849, San Diego, California, 2016. Association for Computational Linguistics. doi: 10.18653/v1/N16-1098. URL https://aclanthology.org/N16-1098.
+Rémi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient off-policy reinforcement learning. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 1046-1054, 2016. URL https://proceedings.neurips.cc/paper/2016/ hash/c3992e9a68c5ae12bd18488bc579b30d-Abstract.html.
+
+Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. Ms marco: A human generated machine reading comprehension dataset. In CoCo@ NIPS, 2016. URL http://ceur-ws.org/Vol-1773/CoCoNIPS_2016_paper9.pdf.
+Richard Yuanzhe Pang and He He. Text generation by learning from demonstrations. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=RovX-uQlHua.
+Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pp. 311-318, Philadelphia, Pennsylvania, USA, 2002. Association for Computational Linguistics. doi: 10.3115/1073083.1073135. URL https://aclanthology.org/P02-1040.
+Romain Paulus, Caiming Xiong, and Richard Socher. A deep reinforced model for abstractive summarization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=HkACLQgA-.
+Ben Peters, Vlad Niculae, and André F. T. Martins. Sparse sequence-to-sequence models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1504-1519, Florence, Italy, 2019a. Association for Computational Linguistics. doi: 10.18653/v1/P19-1146. URL https://aclanthology.org/P19-1146.
+Matthew E. Peters, Mark Neumann, Robert Logan, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A. Smith. Knowledge enhanced contextual word representations. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 43-54, Hong Kong, China, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/D19-1005. URL https://aclanthology.org/D19-1005.
+Fabio Petroni, Tim Rocktäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. Language models as knowledge bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2463-2473, Hong Kong, China, 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1250. URL https://aclanthology.org/D19-1250.
+Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vladimir Karpukhin, Jean Maillard, Vassilis Plachouras, Tim Roektaschel, and Sebastian Riedel. KILT: a benchmark for knowledge intensive language tasks. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2523-2544, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.200. URL https://aclanthology.org/2021.naacl-main.200.
+Lianhui Qin, Vered Shwartz, Peter West, Chandra Bhagavatula, Jena D. Hwang, Ronan Le Bras, Antoine Bosselut, and Yejin Choi. Back to the future: Unsupervised backprop-based decoding for counterfactual and abductive commonsense reasoning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 794-805, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.58. URL https://aclanthology.org/2020.emnlp-main.58.
+Lianhui Qin, Aditya Gupta, Shyam Upadhyay, Luheng He, Yejin Choi, and Manaal Faruqui. TIMEDIAL: Temporal commonsense reasoning in dialog. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 7066-7076, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.549. URL https://aclanthology.org/2021.acl-long.549.
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
+
+URL https://d4mucfpkseywv.cloudfront.net/better-language-models/language-models.pdf.
+Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling language models: Methods, analysis & insights from training gopher. ArXiv preprint, abs/2112.11446, 2021. URL https://arxiv.org/abs/2112.11446.
+Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. ArXiv preprint, abs/1910.10683, 2019. URL https://arxiv.org/abs/1910.10683.
+Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In Yoshua Bengio and Yann LeCun (eds.), 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.06732.
+Adam Roberts, Colin Raffel, and Noam Shazeer. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5418-5426, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.437. URL https://aclanthology.org/2020.emnlp-main.437.
+Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, Jing Xu, Myle Ott, Eric Michael Smith, Y-Lan Boureau, and Jason Weston. Recipes for building an open-domain chatbot. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 300-325, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.24. URL https://aclanthology.org/2021.eacl-main.24.
+Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A. Smith, and Yejin Choi. ATOMIC: an atlas of machine commonsense for if-then reasoning. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pp. 3027-3035. AAAI Press, 2019. doi: 10.1609/aaai.v33i01.33013027. URL https://doi.org/10.1609/aaai.v33i01.33013027.
+John Schulman, Sergey Levine, Pieter Abbeel, Michael I. Jordan, and Philipp Moritz. Trust region policy optimization. In Francis R. Bach and David M. Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp. 1889-1897. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/schulman15.html.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. ArXiv preprint, abs/1707.06347, 2017. URL https://arxiv.org/abs/1707.06347.
+Yuanlong Shao, Stephan Gouws, Denny Britz, Anna Goldie, Brian Strope, and Ray Kurzweil. Generating high-quality and informative conversation responses with sequence-to-sequence models. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2210-2219, Copenhagen, Denmark, 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1235. URL https://aclanthology.org/D17-1235.
+Robyn Speer, Joshua Chin, and Catherine Havasi. Conceptnet 5.5: An open multilingual graph of general knowledge. In Satinder P. Singh and Shaul Markovitch (eds.), Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pp. 4444-4451. AAAI Press, 2017. URL http://aaai.org/ocs/index.php/AAAI/AAAI17/paper/view/14972.
+
+Gabriel Stanovsky, Julian Michael, Luke Zettlemoyer, and Ido Dagan. Supervised open information extraction. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 885-895, New Orleans, Louisiana, 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1081. URL https://aclanthology.org/N18-1081.
+Yu Sun, Shuohuan Wang, Yu-Kun Li, Shikun Feng, Hao Tian, Hua Wu, and Haifeng Wang. ERNIE 2.0: A continual pre-training framework for language understanding. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 8968-8975. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/article/view/6428.
+Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. oLMpics-on what language model pre-training captures. Transactions of the Association for Computational Linguistics, 8:743-758, 2020. doi: 10.1162/tacl_a_00342. URL https://aclanthology.org/2020.tacl-1.48.
+Bayu Distiawan Trisedya, Gerhard Weikum, Jianzhong Qi, and Rui Zhang. Neural relation extraction for knowledge base enrichment. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 229-240, Florence, Italy, 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1023. URL https://aclanthology.org/P19-1023.
+Sean Welleck, Ilia Kulikov, Jaedeok Kim, Richard Yuanzhe Pang, and Kyunghyun Cho. Consistency of a recurrent language model with respect to incomplete decoding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5553-5568, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.448. URL https://aclanthology.org/2020.emnlp-main.448.
+Peter West, Ximing Lu, Ari Holtzman, Chandra Bhagavatula, Jena D. Hwang, and Yejin Choi. Reflective decoding: Beyond unidirectional generation with off-the-shelf language models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1435-1450, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.114. URL https://aclanthology.org/2021.acl-long.114.
+Ledell Wu, Fabio Petroni, Martin Josifoski, Sebastian Riedel, and Luke Zettlemoyer. Scalable zero-shot entity linking with dense entity retrieval. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 6397-6407, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.519. URL https://aclanthology.org/2020.emnlp-main.519.
+Ruidong Wu, Yuan Yao, Xu Han, Ruobing Xie, Zhiyuan Liu, Fen Lin, Leyu Lin, and Maosong Sun. Open relation extraction: Relational knowledge transfer from supervised data to unsupervised data. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 219-228, Hong Kong, China, 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1021. URL https://aclanthology.org/D19-1021.
+Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In Satinder P. Singh and Shaul Markovitch (eds.), Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pp. 3351-3357. AAAI Press, 2017. URL http://aaai.org/ocs/index.php/AAAI/AAAI17/paper/view/14563.
+Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=BJ1zm64tDH.
+
+Michihiro Yasunaga, Hongyu Ren, Antoine Bosselut, Percy Liang, and Jure Leskovec. QA-GNN: Reasoning with language models and knowledge graphs for question answering. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 535-546, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.45. URL https://aclanthology.org/2021.naacl-main.45.
+Houyu Zhang, Zhenghao Liu, Chenyan Xiong, and Zhiyuan Liu. Grounded conversation generation as guided traverses in commonsense knowledge graphs. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2031-2043, Online, 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.184. URL https://aclanthology.org/2020.acl-main.184.
+Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J. Liu. PEGASUS: pre-training with extracted gap-sentences for abstractive summarization. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 11328-11339. PMLR, 2020b. URL http://proceedings.mlr.press/v119/zhang20ae.html.
+Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. Personalizing dialogue agents: I have a dog, do you have pets too? In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2204-2213, Melbourne, Australia, 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1205. URL https://aclanthology.org/P18-1205.
+Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. DIALOGPT: Large-scale generative pre-training for conversational response generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 270-278, Online, 2020c. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-demos.30. URL https://aclanthology.org/2020.acl-demos.30.
+Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. ERNIE: Enhanced language representation with informative entities. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1441-1451, Florence, Italy, 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1139. URL https://aclanthology.org/P19-1139.
+Xueliang Zhao, Wei Wu, Can Xu, Chongyang Tao, Dongyan Zhao, and Rui Yan. Knowledge-grounded dialogue generation with pre-trained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 3377-3390, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.272. URL https://aclanthology.org/2020.emnlp-main.272.
+Wangchunshu Zhou, Dong-Ho Lee, Ravi Kiran Selvam, Seyeon Lee, and Xiang Ren. Pre-training text-to-text transformers for concept-centric common sense. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=3k20LAiHYL2.
+
+# A APPENDIX
+
+# A.1 DATASETS STATISTICS
+
+We chose eight knowledge intensive NLG tasks to evaluate KID. Here we present the dataset statistics of these tasks in Table A1. The links to these datasets can be found in §4.1.
+
+Table A1: The dataset statistics of the eight knowledge-intensive NLG tasks we evaluate for KID.
+
+| Split | ELI5 | MSMARCO | PIQA | PubMedQA | ROC | αNLG | WoW | MuTual |
| Train | 272,764 | 153,725 | 16,115 | 800 | 52,665 | 50,481 | 63,734 | 7,088 |
| Dev | 1,507 | 12,467 | 1,838 | 100 | 1,571 | 7,252 | 3,054 | 886 |
| Test | 600 | 12,467 | 3,000 | 100 | 4,081 | 14,313 | 2,944 | 886 |
+
+# A.2 DETAILS ON KNOWLEDGE TRIE CONSTRUCTION AND QUERY
+
+# A.2.1 KNOWLEDGE TRIE CONSTRUCTION
+
+In this section, we detail the process of constructing the knowledge trie and how we query for the knowledge in a dynamic fashion. In Figure A1 (a), for a given question (say from the ELI5 dataset), the DPR retriever (Karpukhin et al., 2020) would retrieve $k$ documents (the effect of choosing different $k$ on performance has been discussed in §4.3; we use $k = 3$ here for simplicity) from 21M 100-token Wiki documents as the grounding passages for the question. We then use co-reference resolution to replace the pronouns with their referents (colored in red), normalize the text (e.g., removing links, lower-casing, etc.), and pass them through the OpenIE (Stanovsky et al., 2018) to obtain knowledge triplets (the use of OpenIE can be also seen in related prior work (Trisedya et al., 2019; Wu et al., 2019; Fan et al., 2019a)). The end nodes of the extracted triplets (i.e., the subj and obj) serve as the key-value pairs when they are stored in the external knowledge trie ( $G_{\mathrm{ext}}$ ), and the relations between nodes are translated to the edges. We use the stems of the tokens as the keys in $G_{\mathrm{ext}}$ (e.g., "driving" → "drive"), in order to compress duplicated nodes in a concept-centric manner.
+
+During knowledge trie construction, besides the one-step key-value pairs from the triplets, we also consider multiple-step relations by looking for key mentions in the values of previous keys (e.g., value: "influence of drugs" $\rightarrow$ next-hop key: "drug"). Such iterative procedure will end when there are no more keys appearing in the values. Specifically, we use depth-first search (DFS) to record the maximum depth of the child branch for each key node, and also memorize the corresponding values (and its next-hop key) on the branch to facilitate further query.
+
+# A.2.2 DYNAMIC QUERYING FOR KNOWLEDGE
+
+Since retrieving knowledge from millions of documents is slow (even with GPU acceleration), the knowledge trie described above is constructed off-line. We pre-compute and store this knowledge trie on the disk, and build the local knowledge memory on the fly. The local knowledge memory is simply a First-in-First-out (FIFO) list which continuously stores newly generated entities ( $G_{\mathrm{loc}}$ ; initialized with entities in the input question), whose length will be limited by $w_{\mathrm{max}}$ (we set $w_{\mathrm{max}} = h_{\mathrm{max}}$ empirically, where $h_{\mathrm{max}}$ is the max query hops). In Figure A1 (b) we show a query example with the query word "driving" in the local memory. The query word is firstly converted to its stem (i.e., "drive"), and then its demonstrations are retrieved with the key "drive".
+
+We show the whole generation loop of KID in Algorithm 2. At each step of the decoding, we first collect knowledge demonstrations by querying $G_{\mathrm{ext}}$ with each entity in $G_{\mathrm{loc}}$ as key. The collected demonstrations (a list of tokens) will then serve as target word space to guide current step generation (has been detailed in §3.3). The local knowledge memory is updated only when a new entity is generated. This is because the non-entity words (such as stop words, digits, etc.) a) are rarely the keys in the $G_{\mathrm{ext}}$ (which are subj in OpenIE triplets), and b) rarely lead to meaningful next-step constraints (it's hard to answer what's a proper continuation of "the").
+
+Since the external knowledge trie is constructed off-line, the query time mainly depends on the number of query words in the local knowledge memory (with max length $w_{\mathrm{max}}$ ), and the maximum number of
+
+
+(a) ELI5 Question: Does marijuana impair driving ability? $\longrightarrow$ $G_{\mathrm{loc}}$ marijuana, driving, ability
+
+# Paragraph 1
+
+ID:20644819
+
+in some studies to have a negative effect on driving ability. The British Medical Journal indicated that "drivers who consume cannabis within three hours of driving are nearly twice as likely to cause a vehicle collision as those (who) drivers are not under the influence of drugs or alcohol". In "Cannabis and driving: a review of the literature and commentary", the United Kingdom's Department for Transport reviewed data on cannabis and driving, finding "Cannabis impairs driving behaviour. However, this impairment is mediated in that subjects under cannabis treatment appear to perceive that they are indeed impaired. Where they can compensate, they
+
+
+
+# Paragraph 2
+
+ID:16441766
+
+alcohol concentration is performed using three methods - blood, breath, or urine. For law enforcement purposes, breath is the preferred method, since results are available almost instantaneously. Drug testing screens are typically performed in scientific laboratories so that the results will be admissible in evidence at trial. Due to the overwhelming number of impairing substances that are not alcohol, drugs are classified into different categories for detection purposes. Drug impaired drivers still show impairment during the battery of standardized field sobriety tests, but there are additional tests to help detect drug impaired driving. The Drug Evaluation and Classification program is
+
+
+
+# Paragraph 3
+
+ID:16441788
+
+for life. Driving under the influence of drugs "to an extent as to be incapable of having proper control" is illegal. The Police may require suspects to undergo an objective (at the police station) Impairment Test. Suspects who fail the test shall surrender (their) suspects who fail the test driving licence for 24 hours. Regarding common drugs, the Road Safety Council reminds drivers to check the side effects before driving. The law prohibits driving with any concentration of illicit drugs: heroin, cocaine, ketamine, methamphetamine, cannabis and MDMA. Drug-impaired driving Drug-impaired driving, in the context of its legal definition, is the act of driving a
+
+
+Figure A1: A sample of KID's retrieved documents for the ELI5 question "Does marijuana impair driving ability?" and its corresponding knowledge trie. (a) The top three relevant documents retrieved by DPR. We annotate the triplets end nodes (subj and obj) picked by OpenIE for knowledge trie construction in green. (b) The partially observed knowledge trie when we query "driving" in the current local knowledge memory (blue) by $w_{\mathrm{max}}$ hops. We perform co-reference resolution to replace pronouns with actual entities in the documents, and use the stems of the tokens as the query words and keys in the external knowledge trie. The retrieved demonstrations (values in the trie; purple) in multiple hops will then serve as guidance for current step decoding, after split into single tokens.
+
+hops we query the external knowledge trie $(h_{\mathrm{max}})$ with, which is approximately $w_{\mathrm{max}} * h_{\mathrm{max}}$ in total. We claim this is actually constant time complexity because $h_{\mathrm{max}}$ and $w_{\mathrm{max}}$ are fixed hyper-parameters (normally 1-5, as discussed §4.3) and it will not scale up with sequence length or the number of grounding documents retrieved.
+
+# A.3 MORE COMPARISON WITH IMPROVED DECODING ALGORITHMS
+
+Besides the baselines we compare in the paper, there are other inference-time decoding methods that focus on improving generation quality in different perspectives, such as diversity (Baheti et al., 2018), and attributes controlling (Dathathri et al., 2020), and entity appearance (Mao et al., 2020) $^9$ .
+
+Algorithm 2: The Generation Loop of KID
+Input: constructed knowledge trie $G_{\mathrm{ext}}$ , local knowledge memory $G_{\mathrm{loc}}$ input context $q$ max query hop $h_\mathrm{max}$ , max sequence length $L$
+Output: generated tokens $\{x_{1},x_{2},\dots,x_{t}\}$ $G_{\mathrm{loc}}\gets$ entities in $q$
+while current sequence length $< L$ do Knowledge demonstrations $D\gets []$ . for each entity $e$ in $G_{\mathrm{loc}}$ do $\begin{array}{r}\lfloor \text{Query} G_{\mathrm{ext}}\text{with} e\text{by} h_{\mathrm{max}}\text{hopstocollectdemonstrations, and store in} D. \end{array}$ Use $D$ to guide current step decoding by Algorithm 1, and generate token $x_{t}$ if $x_{t}$ is entity then $\begin{array}{rl} & {\mathbb{L}\text{Append} x_t\text{to} G_{\mathrm{loc}},\text{and slim} G_{\mathrm{loc}}\text{by window size} w_{\mathrm{max}}.} \end{array}$
+return $\{x_1,x_2,\ldots ,x_t\}$
+
+We also notice some methods that are training-time optimization, such as CTRL (Keskar et al., 2019), which requires re-training language models conditioned on a set of static control words, and fusion-in-decoder (FiD) (Izacard & Grave, 2021b;a), which concatenates additional retrieved grounding sentences with input text, and fine-tunes text2text language models (e.g., T5 (Roberts et al., 2020)). KID differs from all these methods, since 1) KID aims to improve knowledge awareness during decoding, though we also find KID could mitigate exposure bias, and 2) KID can function as a standalone module requiring neither specific model architecture nor re-training or fine-tuning the language model (as shown in §4.3, the experiments with vanilla GPT3-2.7B). In the following part, we compare KID with all above methods except CTRL since it requires costly language model retraining on each new domain and how to pick control words for dynamic knowledge seems ambiguous. We also prepare a naive version of KID (Little KID) which uses plain list instead of graph structure (the knowledge trie) to store knowledge, where we directly use all the end nodes of extracted triplets from the documents as constraints without any dynamic query. We run experiments on QA tasks as FiD was trained on, and discuss their differences on performance, deployment, and efficiency (time/space).
+
+# A.3.1 PERFORMANCE ON KNOWLEDGE AWARENESS
+
+In Table A2 we present the comparison results about performance on knowledge awareness. Not surprisingly, FiD is the strongest baseline among others, as it also explicitly leverages retrieved documents to ground its generation. Compared with KID, we find the performance of FiD is relatively limited when the NLG tasks require longer and creative generation. For example, ELI5, whose average reference length is around 220 tokens, and FiD tends to generate generic and repeated sequence after about 80 tokens from our observation, potentially because though FiD fuses knowledge during training, there is no scheme to guarantee the knowledge parameterized in the model can be expressed during inference. Diverse Decoding, and PPLM show mediocre performance in these tasks because no knowledge-aware object was considered, but relatively well on longer generation tasks (e.g., ELI5), which seems to demonstrate the advantage of inference-time optimization methods (as KID). Little KID is not able to dynamically query knowledge when new context is generated, and thus performs not as good as KID, especially in longer generation (e.g., ELI5).
+
+# A.3.2 COMPARISON OF TIME AND SPACE CONSUMPTION
+
+The time and space cost of running KID could be a matter of concern especially when we consider real-world applications. In Table A3, we compare the time complexity of KID with other baselines, including vanilla beam search and sampling decoding. We provide a breakdown for different stages: retrieving knowledge (retrieving), training the generative model (training), and the actual generation (inference). Beam search and sampling decoding only have noticeable cost when there is sorting process filtering the candidate tokens (common in beam search and top- $p$ or top- $k$ sampling), which will often bring $O(k \log k)$ cost ( $O(1)$ when pure random sampling without any sorting). Diverse
+
+Table A2: Compare KID with additional baselines. Note that only FiD (Izacard & Grave, 2021b;a) is explicitly optimized for knowledge awareness. Diverse Decoding (Baheti et al., 2018) aims to improve generation diversity by constraining decoding distribution with topic and semantic similarity. PPLM (Dathathri et al., 2020) uses a static set of tokens as global constraints to do conditional generation. KID differs from all these methods as its knowledge awareness and dynamic nature. Little KID is a naive implementation of KID that uses plain list instead of trie to store knowledge.
+
+ | ELI5 | MSMARCO | PIQA | PubMedQA |
| Method | B-1 | R-L | B-1 | R-L | B-1 | R-L | B-1 | R-L |
| FiD-T5 (base) | 15.3 | 11.3 | 45.3 | 47.3 | 12.9 | 11.9 | 4.0 | 4.4 |
| FiD-T5 (large) | 15.7 | 18.1 | 51.9 | 53.1 | 14.8 | 17.4 | 4.0 | 4.5 |
| Diverse Decoding | 4.6 | 15.7 | 27.5 | 22.9 | 11.3 | 15.5 | 3.5 | 3.8 |
| PPLM | 11.9 | 15.0 | 23.4 | 26.6 | 10.3 | 11.9 | 3.8 | 4.2 |
| Little KID (ref.) | 12.1 | 14.3 | 40.2 | 46.3 | 12.2 | 13.5 | 5.2 | 6.6 |
| Ours: KIDGPT2 | 27.9 | 26.6 | 47.4 | 53.9 | 17.7 | 18.4 | 9.7 | 11.5 |
+
+Decoding, PPLM, and KID are similar as all are inference-time optimization (not necessarily need model fine-tuning, denoted as “LM FT / –”), but KID requires additional off-line knowledge trie construction (nearly the same time cost as RAG and FiD). During inference, KID takes constant time for query (as discussed in §A.2.2), and several iterations policy gradient (by constant number of steps) to guide the generation. We also analyze the space cost of KID and other baselines (Table A4). The difference between KID and RAG / FiD is the external and local knowledge memory, which is relatively small (normally < 10Mb) from our observation. Other decoding methods do not have the ability to infuse knowledge, and thus do not bring additional space cost.
+
+Table A3: Time complexity analysis of KID and other baselines. We study the time consumption during knowledge retrieving, model training, and inference (i.e., generation). KID has comparable time efficiency as RAG and FiD, but outperforms them in knowledge infusing (discussed in the §4.2). Note that KID can function as a standalone module operating only at inference time, rather than rely on a specific model fine-tuning or pre-training together (such as RAG and FiD).
+
+| Method / Time | Retrieving | Training | Inference |
| Beam Search | - | - | O(k log k), k = # of beams |
| Sampling | - | - | O(1) or O(k log k), k = top-k |
| RAG | O(#docs), #docs ≈ 10 | LM FT | ≥ O(1) |
| FiD-T5 (base) | O(#docs), #docs ≈ 100 | LM FT | ≥ O(1) |
| FiD-T5 (large) | O(#docs), #docs ≈ 100 | LM FT | ≥ O(1) |
| Diverse Decoding | - | LM FT / - | Two Neural Models Prediction + O(1) |
| PPLM | - | LM FT / - | O(#control words * step) |
| Ours: KID | O(#docs) + DFS, #docs ≈ 5 | LM FT / - | O(h2max) ≈ O(1) |
+
+# A.4 SAMPLE GENERATIONS
+
+We list several generation samples of KID and RAG. In general, the generated texts of both methods are highly readable; however, we find RAG's generation tends to off-topic and not coherent with current on-going concepts flow when the generation is long (e.g., ELI5, "smoking inside the vehicle"), or the context is multi-fold and complicated (e.g., multi-turn dialogue WoW, "do some exercise")—these are legit continuation if we only consider immediate context. KID is superior especially in longer generation, which seems to echo our findings that KID can mitigate exposure bias.
+
+We show some generation samples of KID and RAG in Table A5.
+
+# A.5 ACTUAL QUESTIONS WE ASK HUMAN ANNOTATORS
+
+We asked participants about: 1) Relevance (i.e., "What's the relevance level between the generated text and the given context?" Answer is from 1-totally not relevant to 7-totally relevant), 2) Factuality
+
+Table A4: Memory footprint of KID and other baselines. Similar to RAG and FiD, KID requires pre-store the grounding documents on disk (and corresponding dense vectors). In addition, KID builds a knowledge trie off-line (less than 10Mb for all the tasks we studied), and a local knowledge memory (a limited length FIFO list), to enable knowledge infusion during generation.
+
+| Method / Space | External Resources / Model | Knowledge? |
| Beam Search | - | X |
| Sampling | - | X |
| RAG | 13.4G Docs + 64.6G Index / BART | ✓ |
| FiD-T5 (base) | 13.4G Docs + 64.6G Index / T5 | ✓ |
| FiD-T5 (large) | 13.4G Docs + 64.6G Index / T5 | ✓ |
| Diverse Decoding | Two Models 2.8G in Total / LM | X |
| PPLM | BoW or Classifier / LM | X |
| Ours: KID | 13.4G Docs + 64.6G Index + Gloc + Gext / LM | ✓ |
+
+Table A5: Sample generation of KID and RAG on ELI5 (QA), ROC (Logic-centric Writing), and WoW (Dialogue) with fine-tuned language models.
+
+| ELI5 |
| Question | Does marijuana impair driving ability? |
| RAG | Marijuana does impair your ability to drive, but you can avoid this by not being asleep together in class together and using a napkin for balance.. One way to avoid discomfort would be smoking inside the vehicle. That being said, smoking in public can do the same thing as smoking outside. |
| KID | Marijuana does impair your ability to drive because cannabis is a depressant drug, which means it slows reaction times and information processing. A person who has been using cannabis is more likely to cause a vehicle collision, but may still think that they can drive safely. |
| ROC |
| Context | Keith lived in an area that had occasional earthquakes. But he thought keeping an first aid kit was unnecessary. The next day, he cut his hand while cutting food. And he had to drive himself to a hospital. |
| RAG | Keith quickly became worried and sad. |
| KID | Keith eventually learned first Aid at a clinic instead of building his own kit. |
| WoW |
| Utterance | f: would you like some tea or coffee? m: no thank you . it ’s very late now , that will keep me awake the whole night . f: then what about some water ? m: yes , please . f: do n’t work too late since you were not in good health . you should be careful with your health . |
| RAG | m: thank you. i would sleep earlier and do some exercise in the morning |
| KID | m: thank you for your concern. could i have some water please . |
+
+(i.e., "What's the factuality level of the generated text?" Answer is from 1-totally not factual to 7-very well factual), and 3) Grammaticality (i.e., "How much the text is similar to human-generated text?" Answer is from 1-not similar at all to 7-very much similar).
\ No newline at end of file
diff --git a/knowledgeinfuseddecoding/images.zip b/knowledgeinfuseddecoding/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..87d9c8e104e3d28cbddc9e7a39d60433b3de813f
--- /dev/null
+++ b/knowledgeinfuseddecoding/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db4868236c73df21a4484beb4f64d3e57fd8a33d1e00d66e338f19dd0c8397b3
+size 731717
diff --git a/knowledgeinfuseddecoding/layout.json b/knowledgeinfuseddecoding/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9d595a305379ea64fe5b0ec9904b87d349603462
--- /dev/null
+++ b/knowledgeinfuseddecoding/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54d039291b3017021aaf204afa87ebda8553e78f239986cbc462f3fd516d25c4
+size 657326
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_content_list.json b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9217b00af283588ba53c1550e5b4a51768d14ac5
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a05e691753f560ec415d3ad5454f2cd66825c312ef977caedfbc9710e7b70a95
+size 167545
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_model.json b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b9cba2471c708c47cccaaaf0a7a3cc0140945076
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0fa05a049ef22913102d7f3ebcf214b98aaa783f408c32aa074a4147b646f850
+size 195675
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_origin.pdf b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..b4a3c5267ec12c3ceca6bd3e860aa6c0111b0e1d
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/75518772-e233-4fcd-bf79-f588983013d1_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bfe9bc5d66101a94c8fa1453a7c1f926c317840ba51d2e8434e674e9ee96d140
+size 929758
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/full.md b/knowledgeremovalinsamplingbasedbayesianinference/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..013eb98e2fcf2aa736476b371ee6cfa9ebb25281
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/full.md
@@ -0,0 +1,818 @@
+# KNOWLEDGE REMOVAL IN SAMPLING-BASED BAYESIAN INFERENCE
+
+Shaopeng $\mathbf{F u}^{1*}$ , Fengxiang $\mathbf{H e}^{2,1*}$ & Dacheng Tao
+
+1The University of Sydney, Australia, 2JD Explore Academy, China
+
+shfu7008@uni.sydney.edu.au, fengxiang.f.he@gmail.com,
+
+dacheng.tao@sydney.edu.au
+
+# ABSTRACT
+
+The right to be forgotten has been legislated in many countries, but its enforcement in the AI industry would cause unbearable costs. When single data deletion requests come, companies may need to delete the whole models learned with massive resources. Existing works propose methods to remove knowledge learned from data for explicitly parameterized models, which however are not applicable to the sampling-based Bayesian inference, i.e., Markov chain Monte Carlo (MCMC), as MCMC can only infer implicit distributions. In this paper, we propose the first machine unlearning algorithm for MCMC. We first convert the MCMC unlearning problem into an explicit optimization problem. Based on this problem conversion, an MCMC influence function is designed to provably characterize the learned knowledge from data, which then delivers the MCMC unlearning algorithm. Theoretical analysis shows that MCMC unlearning would not compromise the generalizability of the MCMC models. Experiments on Gaussian mixture models and Bayesian neural networks confirm the effectiveness of the proposed algorithm. The code is available at https://github.com/fshp971/mcmc-unlearning.
+
+# 1 INTRODUCTION
+
+"The right to be forgotten" refers to the right of individuals to request data controllers such as tech giants to delete the data collected from them. It has been recognized in many countries through legislation, including the European Union's General Data Protection Regulation (2016) and the California Consumer Privacy Act (2018). In the field of machine learning, legal experts suggest that companies may need to delete and re-train the machine learning models to meet the legal requirements of the right to be forgotten (Li et al., 2018; Garg et al., 2020). However, training a machine learning model would usually cost massive amounts of resources, including data, energy, and time. Thus, the enforcement of the right to be forgotten in the AI industry may result in unbearable costs.
+
+Toward this end, recent works (Cao & Yang, 2015; Guo et al., 2020) propose machine unlearning algorithms to efficiently characterize and remove the knowledge learned from specific data. To enable knowledge removal analysis, existing unlearning approaches usually require the machine learning models to be explicitly parameterized, which however do not cover an important family of machine learning algorithm, the Markov chain Monte Carlo (MCMC). MCMC is a sampling-based Bayesian inference method that aims to draw samples along a Markov chain to approximate a target posterior distribution (Hastings, 1970; Geman & Geman, 1984; Welling & Teh, 2011). Distributions inferred by MCMC are usually implicitly parameterized, which makes it difficult to directly apply existing unlearning algorithms to the MCMC unlearning problem.
+
+In this paper, we propose an MCMC unlearning algorithm to realize the right to be forgotten in the sampling-based Bayesian inference for the first time. The key of tackling the MCMC unlearning problem is to design methods to directly analyze the implicit parameter of the learned distribution. To this end, we propose to employ the learned implicit distribution to approximate the target posterior under the measure of KL-divergence, which then converts the MCMC unlearning problem to an
+
+optimization problem with an explicit distribution parameter for knowledge removal analysis. Based on this conversion, an MCMC influence function is designed (Huber, 2004; Koh & Liang, 2017) to characterize the knowledge learned from single data samples. The new influence function then delivers the MCMC unlearning algorithm, which removes data knowledge by directly subtracting the corresponding influence from the learned distribution.
+
+Theoretical analyses are conducted for the proposed MCMC unlearning algorithm. For the knowledge removal analysis, we prove that the proposed algorithm can provably realize a $\varepsilon$ -knowledge removal, which is a new notation defined for evaluating the machine unlearning performance in Bayesian inference. For the generalization analysis, a PAC-Bayesian generalization upper bound (McAllester, 1998; 1999; 2003; He et al., 2019) is established for the distribution processed by the MCMC unlearning algorithm. The upper bound shows that the difference introduced by MCMC unlearning in the generalization upper bound is no larger than the order of $\mathcal{O}(\sqrt{|S'| / N})$ . This result demonstrates that the proposed algorithm would not compromise the generalization ability of the learned distribution.
+
+In summary, our work has four main contributions: (1) We enable the knowledge removal analysis in MCMC by converting the MCMC unlearning problem to an optimization problem. (2) Based on this problem conversion, we design an MCMC influence function to characterize the knowledge learned from data, which then delivers the MCMC unlearning algorithm. (3) We conduct theoretical analyses and prove that the MCMC unlearning can realize an $\varepsilon$ -knowledge removal and has little impact on the generalization ability of the learned distribution. (4) We conduct comprehensive experiments to verify the effectiveness of the proposed algorithm, which include Gaussian mixture models for clustering on synthetic data, and Bayesian neural networks for classification on real-world dataset. The results suggest that the MCMC unlearning can effectively remove the knowledge learned from the requested data while retaining the information learned from other data intact.
+
+# 2 RELATED WORKS
+
+Markov chain Monte Carlo. MCMC is a Bayesian inference method that would draw samples along a Markov chain, in which the drawn samples are proved to converge to that from a targeted distribution (Hastings, 1970). Although many improvements have been made such as Hamiltonian Monte Carlo (HMC) (Duane et al., 1987; Neal et al., 2011), Gibbs sampling (Geman & Geman, 1984; George & McCulloch, 1993) and slice sampling (Neal, 2003; Walker, 2007), MCMC still suffers from huge computational cost when inferring on large-scale dataset, e.g. in computer vision and image processing tasks (Zhang et al., 2020b; Wang et al., 2020), since each sampling step in MCMC requires computation over the whole dataset.
+
+To tackle this issue, Welling & Teh (2011) introduce a scalable MCMC sampler named stochastic gradient Langevin dynamics (SGLD) that by adding a proper noise to a standard stochastic gradient optimization algorithm (Robbins & Monro, 1951), which can help the update iterations converge to samples from the true posterior distribution. Since that, a variety of stochastic gradient MCMC samplers (SG-MCMC) have been proposed, including stochastic gradient HMC (SGHMC) (Chen et al., 2014), Patterson & Teh (2013), Ahn et al. (2012), Ding et al. (2014), and Zhang et al. (2020a). Ma et al. (2015) further design a complete framework for constructing SG-MCMC.
+
+Machine unlearning. Machine unlearning aims to remove the knowledge learned from specific data in efficient manners (Cao & Yang, 2015). Existing approaches can be roughly divided into exact methods and approximate methods. Exact methods aim to recover the model trained without the removed data exactly and are usually realized via reducing the retraining cost. For example, Ginart et al. (2019) design an efficient unlearning method for $k$ -means clustering via model quantization. Bourtoule et al. (2021) propose a SISA framework that would only retrain the affected part of the model during data deletion. Other advances include Ullah et al. (2021) and Brophy & Lowd (2021).
+
+On the other hand, approximate methods aim to modify the trained model to approximate that trained only on the remaining data. A series of works (Guo et al., 2020; Golatkar et al., 2020; 2021) are designed via characterizing the influence of data on the trained model with influence functions (Cook & Weisberg, 1982; Huber, 2004; Koh & Liang, 2017). Other approaches include Baumhauer et al. (2020) and Izzo et al. (2021). Some works have studied machine unlearning in Bayesian inference (Nguyen et al., 2020; Gong et al., 2021). However, these works only focus on variational
+
+inference, an optimization-based Bayesian inference method, and could not be applied to sampling-based Bayesian inference, MCMC. In contrast, our approach is the first machine unlearning method for MCMC, with a theoretical knowledge removal guarantee.
+
+# 3 PRELIMINARIES
+
+Suppose $p(z|\theta)$ is a parameterized distribution over the sample space $\mathcal{Z}$ , where $\theta \in \Theta \subset \mathbb{R}^d$ is the parameter with a prior distribution $p(\theta)$ . Suppose $S = \{z_1, z_2, \dots, z_N\}$ is a dataset consists of $N$ samples, where each sample $z_i \in \mathcal{Z}$ is drawn from the parameterized distribution $p(z|\theta)$ , i.e., $z_i \sim p(z|\theta)$ . Bayesian inference aims to infer the posterior distribution $p(\theta|S)$ of the parameter $\theta$ ,
+
+$$
+p (\theta | S) = \frac {p (\theta) \prod_ {i = 1} ^ {N} p (z _ {i} | \theta)}{\int p (\theta) \prod_ {i = 1} ^ {N} p (z _ {i} | \theta) \mathrm {d} \theta}.
+$$
+
+For simplicity, for the given dataset $S$ , we let $p_S$ denotes the true posterior distribution $p(\theta | S)$ , and $\hat{p}_S$ denotes the posterior distribution that inferred by Bayesian inference.
+
+Usually, the denominator of the posterior $p_S$ has no closed-form solution, which barriers directly calculating the posterior distribution. Thereby, researchers have designed methods to approximate the target posterior. A canonical approach is the sampling-based Bayesian inference method, Markov chain Monte Carlo (MCMC) (Hastings, 1970).
+
+MCMC infers a posterior distribution via first constructs a Markov chain and then draws samples according to the state of the chain. When the target posterior is the stationary distribution of the Markov chain, it is proved that the drawn samples will converge to that from the target posterior. However, MCMC methods usually suffer from scalable issues on large-scale datasets.
+
+To this end, stochastic gradient MCMC (SG-MCMC) (Ma et al., 2015) leverage mini-batch estimation (Robbins & Monro, 1951) to enable scalable sampling. In SG-MCMC, the posterior distribution $p(\theta | S)$ can be rewritten as $p(\theta | S) \propto \exp(-U(\theta))$ , where $U(\theta)$ is the potential function defined as $U(\theta) = -\sum_{z_i \in S} \log p(z_i | \theta) - \log p(\theta)$ . In each sampling step, drawing samples with SG-MCMC requires one to estimate the potential function $U(\theta)$ with mini-batch data $\tilde{S} \subset S$ as follows,
+
+$$
+\tilde {U} (\theta) = - \frac {| S |}{| \tilde {S} |} \sum_ {z _ {i} \in \tilde {S}} \log p (z _ {i} | \theta) - \log p (\theta).
+$$
+
+Typical SG-MCMC methods include SGLD and SGHMC. Stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011) inserts Gaussian noise to stochastic gradients. In each sampling step, SGLD updates the posterior sample $\theta_t$ as follows,
+
+$$
+\theta_ {t + 1} = \theta_ {t} - \eta_ {t} \nabla_ {\theta} \tilde {U} (\theta_ {t}) + 2 \sqrt {\eta_ {t}} W,
+$$
+
+where $W$ is drawn from the standard Gaussian distribution $\mathcal{N}(0, I)$ and $\eta_t > 0$ is the step size.
+
+To improve the sampling efficiency of SGLD, stochastic gradient Hamiltonian Monte Carlo (SGHMC) (Chen et al., 2014) inserts a momentum $v_{t}$ into the posterior sample update as below,
+
+$$
+\theta_ {t + 1} = \theta_ {t} + v _ {t},
+$$
+
+$$
+v _ {t + 1} = (1 - \alpha) v _ {t} - \eta_ {t} \nabla_ {\theta} \tilde {U} (\theta_ {t}) + \sqrt {2 \alpha \eta_ {t}} W,
+$$
+
+where $W$ is also drawn from the Gaussian distribution $\mathcal{N}(0,I)$ , $\eta_t > 0$ is the step size, and $\alpha \in (0,1)$ is the momentum factor. The initial momentum term $v_0$ is drawn from the Gaussian distribution $\mathcal{N}(0,\eta_0I)$ .
+
+To ensure the drawn samples converge to the targeted posterior, the step size $\eta_t$ for both SGLD and SGHMC needs to satisfy (Welling & Teh, 2011): (1) $\sum_{t=1}^{\infty} \eta_t = \infty$ ; and (2) $\sum_{t=1}^{\infty} \eta_t^2 < \infty$ . A typical step size schedule is $\eta_t = a(b + t)^{-r}$ , where $a, b > 0$ and $r \in (0.5, 1]$ .
+
+# 4 MCMC UNLEARNING ALGORITHM
+
+This section presents the main results of this paper. We first define a new notion, $\varepsilon$ -knowledge removal, to assess the machine unlearning performance in Bayesian inference. Then, an MCMC unlearning algorithm is designed with knowledge removal and generalizability guarantees.
+
+# 4.1 $\varepsilon$ -KNOWLEDGE REMOVAL FOR BAYESIAN INFERENCE
+
+Suppose a client requests to remove her/his data $S' \subset S$ from the whole training dataset $S$ . An unlearning algorithm $\mathcal{A}$ for Bayesian inference aims to remove the knowledge learned from the requested data $S'$ from the inferred distribution $\hat{p}_S$ as follows,
+
+$$
+\hat {p} _ {S} ^ {- S ^ {\prime}} = \mathcal {A} (\hat {p} _ {S}, S ^ {\prime}),
+$$
+
+where $\hat{p}_S^{-S'}$ is named as the processed distribution.
+
+In order to meet the regulation requirements, the following notion is defined to quantify the machine unlearning performance in Bayesian inference.
+
+Definition 1 ( $\varepsilon$ -knowledge removal). For the distribution $\hat{p}_S$ that inferred on dataset $S$ via Bayesian inference and any subset $S' \subset S$ , we call algorithm $\mathcal{A}$ performs $\varepsilon$ -knowledge removal, if
+
+$$
+\operatorname {K L} \left(\hat {p} _ {S} ^ {- S ^ {\prime}} \| \hat {p} _ {S - S ^ {\prime}}\right) \leq \varepsilon ,
+$$
+
+where $\hat{p}_S^{-S'} = \mathcal{A}(\hat{p}_S, S')$ is the processed distribution.
+
+Remark 1. Intuitively, a smaller $\varepsilon$ indicates the algorithm $\mathcal{A}$ has better unlearning performance.
+
+In practice, one usually can only obtain an inferred distribution $\hat{p}_S(\cdot |\omega)$ , subjects to a random seed $\omega$ . In this case, the overall inferred distribution is $\hat{p}_S = \int \hat{p}_S(\cdot |\omega)p(\omega)\mathrm{d}\omega$ , which suggests that the KL-divergence in Definition 1 can then be upper-bounded as below,
+
+$$
+\begin{array}{l} \mathrm {K L} (\hat {p} _ {S} ^ {- S ^ {\prime}} \| \hat {p} _ {S - S ^ {\prime}}) = \mathrm {K L} (\mathbb {E} _ {\omega} \hat {p} _ {S} ^ {- S ^ {\prime}} (\cdot | \omega) \| \mathbb {E} _ {\omega} \hat {p} _ {S - S ^ {\prime}} (\cdot | \omega)) = \int_ {\theta} \mathbb {E} _ {\omega} \hat {p} _ {S} ^ {- S ^ {\prime}} (\theta | \omega) \log \frac {\mathbb {E} _ {\omega} \hat {p} _ {S} ^ {- S ^ {\prime}} (\theta | \omega)}{\mathbb {E} _ {\omega} \hat {p} _ {S - S ^ {\prime}} (\theta | \omega)} \mathrm {d} \theta \\ \leq \int \mathbb {E} _ {\omega} \left[ \hat {p} _ {S} ^ {- S ^ {\prime}} (\theta | \omega) \log \frac {\hat {p} _ {S} ^ {- S ^ {\prime}} (\theta | \omega)}{\hat {p} _ {S - S ^ {\prime}} (\theta | \omega)} \right] \mathrm {d} \theta = \mathbb {E} _ {\omega} \mathrm {K L} (\hat {p} _ {S} ^ {- S ^ {\prime}} \| \hat {p} _ {S - S ^ {\prime}} | \omega). \\ \end{array}
+$$
+
+Motivated by the above inequality, the following knowledge removal estimator is further defined to efficiently estimate the knowledge removal performance in practice.
+
+Definition 2 (knowledge removal estimator). Suppose $\omega_{1},\dots ,\omega_{M}$ is $M$ i.i.d. random seed in Bayesian inference. Then, the knowledge removal estimator $\hat{\varepsilon}_M$ is defined as below,
+
+$$
+\hat {\varepsilon} _ {M} = \frac {1}{M} \sum_ {m = 1} ^ {M} \mathrm {K L} (\hat {p} _ {S} ^ {- S ^ {\prime}} \| \hat {p} _ {S - S ^ {\prime}} | \omega_ {m}),
+$$
+
+where $\hat{p}_S^{-S'}(\cdot |\omega_m) = \mathcal{A}(\hat{p}_S(\cdot |\omega_m),S')$ is the processed distribution for the $m$ -th random seed $\omega_{m}$ .
+
+Remark 2. Our experiments have employed this knowledge removal estimator $\hat{\varepsilon}_M$ to estimate the $\varepsilon$ value in the $\varepsilon$ -knowledge removal guarantee. See Section 5.2 for details.
+
+Remark 3. This estimator is similar to the "Local Forgetting Bound" defined in Golatkar et al. (2020). The difference is that the bound in Golatkar et al. (2020) aims to estimate the randomness introduced by some "readout functions", while $\hat{\varepsilon}_M$ aims to quantify the $\varepsilon$ -knowledge removal guarantee by estimating the difference between the original and processed distributions.
+
+# 4.2 METHODOLOGY
+
+This section presents the MCMC unlearning algorithm. To make the analysis easier, we assume that one can obtain the exact targeted posterior distribution via MCMC. In other words, for a posterior $\hat{p}_S$ that is inferred by MCMC, we assume that $\hat{p}_S = p_S$ .
+
+Developing unlearning algorithm for MCMC is challenging, since there is no explicitly parameterized distribution for knowledge removal analysis. To tackle this challenge, we re-formulate the MCMC unlearning problem as minimizing the following KL-divergence,
+
+$$
+\min _ {\delta} \mathrm {K L} \left(p _ {S} (\cdot - \delta) \| p _ {S - S ^ {\prime}}\right), \tag {1}
+$$
+
+where $p_S$ is the distribution already learned via MCMC, $\delta$ is the distribution shifting scale, $S'$ is the dataset that is requested to be deleted, and $p_{S - S'}$ is the targeted posterior that one aims to obtain. The
+
+idea behinds Eq. (1) is to approximate the targeted posterior $p_{S - S'}$ via directly shifting the currently learned distribution $p_S$ . In this case, one no longer needs to know the exact implicit distribution parameter to perform machine unlearning, but only the explicit shifting scale $\delta$ is enough.
+
+So far, the MCMC unlearning problem has been converted to an optimization problem defined as Eq. (1). We then design MCMC unlearning algorithm based on this problem conversion. Let $\delta_S^{-S'}$ denotes any local minimizer of Eq. (1), and the goal of MCMC unlearning is to calculate the optimal shifting scale $\delta_S^{-S'}$ . To achieve that goal, we first expand the KL-divergence in Eq. (1) as follows,
+
+$$
+\begin{array}{l} \mathrm {K L} \left(p _ {S} (\cdot - \delta) \| p _ {S - S ^ {\prime}}\right) = \mathrm {K L} \left(p _ {S} \| p _ {S - S ^ {\prime}} (\cdot + \delta)\right) \\ = \mathbb {E} _ {\theta \sim p _ {S}} [ \log p (\theta | S) ] + \log p (S - S ^ {\prime}) + \mathbb {E} _ {\theta \sim p _ {S}} [ - \log p (S, \theta + \delta) + \log p (S ^ {\prime} | \theta + \delta) ]. \tag {2} \\ \end{array}
+$$
+
+Through Eq. (2), one can find that when removing dataset $S'$ via optimizing Eq. (1), an additional term $\mathbb{E}_{\theta \sim p_S} \log p(S'| \theta + \delta)$ is introduced to force the distribution $p_S(\cdot - \delta)$ approaching the target posterior $p_{S-S'}$ . This motivate us to follow existing works (Koh & Liang, 2017; Guo et al., 2020) to conduct influence analysis on Eq. (1) based on the introduced term $\mathbb{E}_{\theta \sim p_S} \log p(S'| \theta + \delta)$ .
+
+Specifically, we define a new function $F_{-S',\tau}(\delta,S) = \mathbb{E}_{\theta \sim p_S}[-\log p(S,\theta + \delta) - \tau \cdot \log p(S'|\theta + \delta)]$ , where $\tau \in [-1,0]$ . Suppose there exists a function $\hat{\delta}(\tau)$ with domain $[-1,0]$ such that $\hat{\delta}(0) = 0$ and $\hat{\delta}(\tau)$ is a local minimizer of $F_{-S',\tau}(\delta,S)$ . Then, one can let the target shifting scale $\delta_S^{-S'}$ be $\hat{\delta}(-1)$ , and approximate it by the first-order approximation: $\hat{\delta}(-1) \approx \hat{\delta}(0) - \partial \hat{\delta}(0)/\partial \tau$ , which means $\delta_S^{-S'} \approx -\partial \hat{\delta}(0)/\partial \tau$ . Following a standard derivation, one can calculate the first derivative $\partial \hat{\delta}(0)/\partial \tau$ as the following defined MCMC influence function $\mathcal{I}(S')$ . Thus, the optimal $\delta_S^{-S'}$ is then approximated as $\delta_S^{-S'} \approx -\mathcal{I}(S')$ . For the detailed influence analysis, see Appendix A.1.
+
+Definition 3 (MCMC influence function). The MCMC influence function of dataset $S' \subset S$ is defined to be
+
+$$
+\mathcal {I} (S ^ {\prime}) = - \left(\mathbb {E} _ {\theta \sim p _ {S}} \nabla_ {\theta} ^ {2} \log p (\theta , S)\right) ^ {- 1} \sum_ {z \in S ^ {\prime}} \left(\mathbb {E} _ {\theta \sim p _ {S}} \nabla_ {\theta} \log p (z | \theta)\right) ^ {T}.
+$$
+
+The MCMC influence function is defined to estimate the influence of data $S'$ on the learned distribution $p_S$ , as $\delta_S^{-S'} \approx -\mathcal{I}(S')$ . The computational cost of the MCMC influence function would be high. An efficient calculation method is given in Appendix B.
+
+Finally, based on Definition 3, the MCMC unlearning algorithm is designed as follows.
+
+Algorithm 1 (MCMC unlearning). Suppose one has drawn a series of samples $\{\theta_1, \dots, \theta_T\}$ from the posterior $p_S$ via MCMC. Then, MCMC unlearning algorithm removes the learned knowledge of dataset $S'$ from each drawn sample $\theta_i$ as follows,
+
+$$
+\theta_ {i} ^ {\prime} \leftarrow \theta_ {i} - \mathcal {I} (S ^ {\prime}),
+$$
+
+where $\mathcal{I}(S^{\prime})$ is the MCMC influence function for dataset $S^{\prime}\subset S$
+
+Remark 4. Algorithm 1 is equivalent to the following unlearning process,
+
+$$
+p _ {S} ^ {- S ^ {\prime}} (\cdot) = \mathcal {A} \left(p _ {S}, S ^ {\prime}\right) = p _ {S} \left(\cdot + \mathcal {I} \left(S ^ {\prime}\right)\right) \approx p _ {S} \left(\cdot - \delta_ {S} ^ {- S ^ {\prime}}\right).
+$$
+
+Remark 5. Due to the inherent geometric difference between the distribution functions $p_S$ and $p_{S - S'}$ , it is impossible for Algorithm 1 to directly shift $p_S$ to exactly recover $p_{S - S'}$ . However, the experiments (see Section 5) show that the designed algorithm is good enough for removing learned knowledge from MCMC distributions.
+
+# 4.3 KNOWLEDGE REMOVAL ANALYSIS
+
+This section studies the $\varepsilon$ -knowledge removal for the proposed MCMC unlearning algorithm. We first introduces several assumptions (Assumptions 1-4) for the knowledge removal analysis.
+
+Assumption 1. Function $-\mathbb{E}_{\theta \sim p_S}\log p(\theta +\delta)$ and $-\mathbb{E}_{\theta \sim p_S}\log p(z|\theta +\delta)$ are $L_{1}$ -Lipschitz continuous on the support set $\mathrm{supp}(\delta)$ .
+
+The Lipschitzness of $-\mathbb{E}_{\theta \sim p_S}\log p(\theta +\delta)$ can be realized by choosing appropriate prior distribution for $\theta$ , for example, let $p(\theta)$ be a Laplace distribution. Besides, the Lipschitzness of $-\mathbb{E}_{\theta \sim p_S}\log p(z|\theta +\delta)$ can usually be achieved by setting $p(z|\theta +\delta)$ to be a neural network with bounded domain in practice.
+
+Assumption 2. There exists a neighborhood $V_{2} \subset \mathrm{supp}(\delta)$ of the origin point such that for any dataset $S$ and any sample point $z \in \mathcal{Z}$ , the followings hold:
+
+- (Smoothness). $\nabla_{\delta}[-\mathbb{E}_{\theta \sim p_S}\log p(\theta + \delta)]$ and $\nabla_{\delta}[-\mathbb{E}_{\theta \sim p_S}\log p(z|\theta + \delta)]$ are $L_2$ -Lipschitz continuous on the space $V_2$ .
+(Lipschitz Hessian). $\nabla_{\delta}^{2}[-\mathbb{E}_{\theta \sim p_{S}}\log p(\theta +\delta)]$ and $\nabla_{\delta}^{2}[-\mathbb{E}_{\theta \sim p_{S}}\log p(z|\theta +\delta)]$ are $L_{3}$ -Lipschitz continuous on the space $V_{2}$ .
+
+Assumption 2 assumes the local smoothness and Hessian Lipschitzness for the involved functions, which are common in literature for analyzing Newton methods (Nesterov & Polyak, 2006; Carmon et al., 2018; Zhou et al., 2018).
+
+Assumption 3 (strong convexity). There exists a neighborhood $V_{3} \subset \mathrm{supp}(\delta)$ of the origin point such that for any dataset $S$ and any sample point $z \in \mathcal{Z}$ , $-\mathbb{E}_{\theta \sim p_S} \log p(\theta + \delta)$ and $-\mathbb{E}_{\theta \sim p_S} \log p(z|\theta + \delta)$ are $\mu$ -strongly convex on $V_{3}$ .
+
+The influence analysis and the defined MCMC influence function require the Hessian matrices of $-\mathbb{E}_{\theta \sim p_S}\log p(\theta +\delta)$ and $-\mathbb{E}_{\theta \sim p_S}\log p(z|\theta +\delta)$ to be invertible. Assumption 3 ensures the invertibilities of these Hessian matrices.
+
+Assumption 4. Suppose Assumptions 1-3 hold. Then there exists a sub-neighborhood $V \in V_2 \cap V_3$ of the origin point such that for any dataset $S$ and any real $\tau \in [-1,0]$ , the function $-\mathbb{E}_{\theta \sim p_S} \log p(\theta + \delta | S) - \tau \cdot \mathbb{E}_{\theta \sim p_S} \log p(S' | \theta + \delta)$ has at least one local minimizer falls in $V$ .
+
+Assumption 4 assumes the target optimal solution $\delta_S^{-S'}$ of Eq. (1) exists in the subspace that we are interested in, which would make the influence analysis being meaningful.
+
+Under Assumptions 1-4, we prove that the MCMC influence function defined in Definition 3 can rigorously estimate the influence of data on the shifting scale $\delta$ .
+
+Theorem 1. Under Assumptions 1-4, we have that
+
+$$
+\delta_ {S} ^ {- S ^ {\prime}} = - \mathcal {I} (S ^ {\prime}) + \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right).
+$$
+
+The proof of Theorem 1 is presented in Appendix A.1.
+
+Based on Theorem 1, a knowledge removal guarantee is proved for the MCMC unlearning algorithm.
+
+Theorem 2. Suppose Assumptions 1-4 hold. Then, the MCMC unlearning algorithm $\mathcal{A}(p_S, S') = p_S(\cdot + \mathcal{I}(S'))$ performs $\varepsilon_S^{-S'}$ -knowledge removal, where
+
+$$
+\varepsilon_ {S} ^ {- S ^ {\prime}} = \mathrm {K L} (p _ {S} (\cdot - \delta_ {S} ^ {- S ^ {\prime}}) \| p _ {S - S ^ {\prime}}) + \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {4}}{N ^ {3}}\right),
+$$
+
+and $\delta_S^{-S'}$ is a local minimizer of the KL-divergence $\mathrm{KL}(p_S(\cdot -\delta)\| p_{S - S'})$ .
+
+Proof sketch. We expand $\mathrm{KL}(p_S(\cdot +\mathcal{I}(S'))\| p_{S - S'})$ into Taylor series up to 2-th order around the point $\delta = \delta_S^{-S'}$ . By applying the first-order optimality condition, the first-order term in the Taylor series becomes 0. By leveraging the approximation error given in Theorem 1, the second-order term is proved to be no larger than the order of $\mathcal{O}(|S'|^4 /N^3)$ . The proof is presented in Appendix A.2.
+
+Remark 6. As explained in the previous section, Algorithm 1 could not completely remove the learned knowledge from the inferred distribution due to the inherent geometric difference between the distribution $p_S$ and $p_{S - S'}$ . Nevertheless, Theorem 2 demonstrates that the Algorithm 1 can help the KL-divergence in Eq. (1) approach its local minimum.
+
+# 4.4 GENERALIZATION ANALYSIS
+
+This section studies the impact of the proposed MCMC unlearning algorithm on the generalization ability of the inferred distribution. The analysis is conducted based on the PAC-Bayes theory (McAllester, 1999; 2003; He et al., 2019), a framework for analyzing the generalization ability of stochastic machine learning models (Mohri et al., 2012; He & Tao, 2020).
+
+Figure 1: Experiment results for GMMs.
+
+(a) Visualized results of the GMMs experiments. There are four groups of points in the synthetic dataset, where different groups are in different colors. The samples that were generated from the original, processed, and target model via MCMC sampling are colored in black, blue, and red, respectively.
+
+
+
+
+
+
+(b) Time costs for processing single deletion requests via retraining and MCMC unlearning.
+
+Specifically, suppose $Q$ is the parameter distribution of a stochastic model. Suppose $S$ is the training dataset. Then, the expected risk $\mathcal{R}(Q)$ and empirical risk $\hat{\mathcal{R}}_S(Q)$ of $Q$ are defined to be
+
+$$
+\mathcal {R} (Q) = \underset {\theta \sim Q} {\mathbb {E}} \underset {z} {\mathbb {E}} \ell (\theta , z), \quad \hat {\mathcal {R}} _ {S} (Q) = \underset {\theta \sim Q} {\mathbb {E}} \frac {1}{N} \sum_ {i = 1} ^ {N} \ell (\theta , z _ {i}),
+$$
+
+where $\theta$ is the model parameter drawn from the distribution $Q$ and $\ell$ is a loss function ranging in [0, 1]. The difference of the expected risk and the empirical risk is the generalization error. Its magnitude characterizes the generalization ability of the stochastic model.
+
+Then, a generalization bound for the distribution processed by Algorithm 1 is proved as below.
+
+Theorem 3. Suppose Assumptions 1-4 hold. Let $p_S^{-S'}$ denotes the distribution processed by Algorithm 1. Then, for any $\delta \in (0,1)$ , with probability at least $1 - \delta$ , the following inequality holds,
+
+$$
+\mathcal {R} (p _ {S} ^ {- S ^ {\prime}}) \leq \hat {\mathcal {R}} _ {S} (p _ {S} ^ {- S ^ {\prime}}) + \sqrt {\frac {\mathbb {E} _ {\theta \sim p _ {S}} [ \log p _ {S} (\theta) + \| \theta \| _ {1} ] + \| \mathcal {I} (S ^ {\prime}) \| _ {1} + \log 2 + \log \frac {1}{\delta} + \log N + 2}{2 N - 1}},
+$$
+
+where $\| \mathcal{I}(S')\| _1\leq \mathcal{O}(|S'| / N)$
+
+The proof is given in Appendix A.3.
+
+Corollary 1. Algorithm 1 increases the generalization upper bound in Theorem 3 no larger than the order of $\mathcal{O}(\sqrt{|S'|} / N)$ .
+
+Proof. According to Theorem 3, the difference of the generalization upper bound introduced by Algorithm 1 is $\mathcal{O}(\sqrt{\frac{\|\mathcal{I}(S')\|_1}{2N - 1}}) \leq \mathcal{O}(\sqrt{\frac{\mathcal{O}(|S'| / N)}{2N - 1}}) = \mathcal{O}(\frac{\sqrt{|S'|}}{N})$ . This completes the proof.
+
+Remark 7. Corollary 1 indicates that the proposed MCMC unlearning algorithm would not compromise the generalization ability of the inferred distribution.
+
+# 5 EXPERIMENTS
+
+In this section, we empirically verify the effectiveness and efficiency of the proposed MCMC unlearning algorithm on the Gaussian mixture models and Bayesian neural networks.
+
+# 5.1 EXPERIMENTS FOR GAUSSIAN MIXTURE MODELS
+
+We first visualize the effect of the MCMC unlearning algorithm on a synthetic clustering dataset that consists of 2,000 examples, where each example is two-dimensional and is possibly from 4 clusters. The Gaussian mixture models (GMMs) are employed to infer the cluster centers. For the details of the GMMs used in our experiments, see Appendix C.1.
+
+Experiment design. We employ SGLD and SGHMC to infer the GMMs on the clustering dataset. Then, 400 points are removed from each of the grey parts and yellow parts, around $40\%$ of the whole
+
+Table 1: Experiment results on CIFAR-10. Different metrics are used to evaluate the machine unlearning performance, including the classification errors on the remaining set $S_r$ , removed set $S_f$ , and test set $S_{\mathrm{test}}$ , the knowledge removal estimators $\hat{\varepsilon}_M$ , and the membership inference attack (MIA) accuracy on $S_f$ . Every experiment is repeated 5 times. The results show that the proposed MCMC unlearning algorithm beats baseline methods in almost every experiments settings.
+
+ | Remove | Method | Err. on Sr (%) | Err. on Sf (%) | Err. on Stest (%) | \(\hat{\varepsilon}_{M}\left( \times 10^{3} \right)\) | MIA Acc. (%) |
| CIFAR-10 + SGLD | 3,000 Examples | Retrain | 20.45±0.95 | 46.69±1.05 | 31.80±0.71 | 0.00±0.00 | 51.85±1.39 |
| Origin | 21.71±0.94 | 18.91±1.13 | 31.22±0.53 | 4079.51±2.07 | 80.11±3.87 |
| IS | 21.81±0.80 | 28.71±1.06 | 31.77±0.82 | 4228.11±1.60 | 72.29±2.07 |
| Ours | 21.56±0.96 | 31.14±1.75 | 31.76±0.66 | 4070.59±1.99 | 69.21±5.22 |
| 5,000 Examples | Retrain | 18.61±0.90 | 100.00±0.00 | 36.25±0.63 | 0.00±0.00 | 0.00±0.00 |
| Origin | 21.82±0.91 | 19.07±1.26 | 31.23±0.53 | 4173.23±1.90 | 80.62±4.58 |
| IS | 21.17±0.87 | 54.05±1.86 | 33.25±0.77 | 4342.04±1.64 | 46.49±4.90 |
| Ours | 20.73±0.86 | 73.96±4.25 | 34.81±0.31 | 4151.34±1.94 | 26.64±7.68 |
| CIFAR-10 + SGHMC | 3,000 Examples | Retrain | 20.24±0.37 | 45.83±1.61 | 31.80±0.48 | 0.00±0.00 | 55.34±3.00 |
| Origin | 21.50±0.40 | 18.83±1.46 | 31.47±0.54 | 0.00±0.00 | 82.85±1.49 |
| IS | 21.61±0.40 | 28.64±1.23 | 31.90±0.53 | 4296.82±2.02 | 70.79±3.52 |
| Ours | 21.31±0.37 | 30.33±2.44 | 31.75±0.55 | 4137.04±2.42 | 69.83±2.78 |
| 5,000 Examples | Retrain | 18.56±0.38 | 100.00±0.00 | 36.21±0.34 | 0.00±0.00 | 0.00±0.00 |
| Origin | 21.61±0.39 | 18.91±1.13 | 31.47±0.52 | 4233.95±1.73 | 82.70±1.35 |
| IS | 21.03±0.44 | 54.20±1.48 | 33.55±0.36 | 4408.05±1.21 | 44.20±1.63 |
| Ours | 20.54±0.36 | 69.56±4.45 | 34.67±0.78 | 4212.63±1.72 | 29.12±3.94 |
+
+dataset at all, by our forgetting algorithms. We also trained models on only the remaining set with the same MCMC inference settings to show the targets of the forgetting tasks. For the details of the experiments, see Appendix C.
+
+Results analysis. The visualization results are presented in Fig. 1a, which show that after unlearning, the processed models are close to the target models. Besides, the time costs for processing single data deletion requests are presented in Fig. 1b, which shows that the proposed MCMC unlearning algorithm is significantly faster than retraining the whole model. These results demonstrate that the proposed algorithm can effectively and efficiently remove the learned knowledge of specified data.
+
+# 5.2 EXPERIMENTS FOR BAYESIAN NEURAL NETWORKS
+
+We then apply the MCMC unlearning algorithm to the Bayesian neural networks on the CIFAR-10 (Krizhevsky et al., 2009) dataset for classification. Analogous experiments are also conducted on the Fashion-MNIST (Xiao et al., 2017) dataset, please see Appendix D for more details.
+
+Dataset & BNN. We divide the training set $S$ of CIFAR-10 into two parts, the removed part $S_{f}$ and the remained part $S_{r}$ . A certain number of examples are randomly chosen from a single class in the dataset to form the removed training set $S_{f}$ . The test set is denoted by $S_{\mathrm{test}}$ . A BNN consists of two convolutional layers and two fully-connected layers is adopted in the experiments. For more details about the dataset and model architecture, see Appendix D.
+
+
+Figure 2: Time costs for processing single data deletion requests on BNNs. A smaller time cost implies a higher efficiency of the unlearning method.
+
+Baseline method. We compare the proposed MCMC unlearning algorithm with the importance sampling method (IS). Specifically, when a data deletion request comes, the importance sampling method will process the request via performing MCMC sampling on the remaining data.
+
+Evaluation metrics. Four kinds of metrics are used to evaluate the performance of machine unlearning: (1) Classification errors. We calculate classification errors the remaining set $S_r$ , removed set $S_f$ , and test set $S_{\mathrm{test}}$ for different models. Ideally, after removing data, the three errors of the processed model would approach that of the retrained model. (2) $\varepsilon$ -Knowledge removal guarantee. We use the knowledge removal estimator $\hat{\varepsilon}_M$ defined in Definition 2 to estimate the $\varepsilon$ value in the $\varepsilon$ -knowledge removal guarantee. A smaller estimation result would imply a better knowl-
+
+
+(a) The prediction confidence changes for a "plane" image. "Plane" is also the removed class.
+
+
+
+
+
+
+
+
+(b) The prediction confidences changes for a "plane" image. "Plane" is also the removed class.
+
+
+
+
+
+
+
+
+
+
+
+
+(c) The prediction confidence changes for a "cat" image. "Cat" is not the removed class.
+
+
+Figure 3: The changes of the prediction confidence for the test set examples of CIFAR-10 along with data removing. The BNN is trained with SGLD and the knowledge removal is conducted with the proposed MCMC unlearning algorithm. The predictions for the true labels are colored in red.
+
+
+
+
+
+
+(d) The prediction confidence changes for a "ship" image. "Ship" is not the removed class.
+
+
+
+
+
+
+
+
+
+
+
+edge removal performance. Calculating $\hat{\varepsilon}_M$ requires to fix a series of random seeds $\omega_1, \dots, \omega_M$ . To this end, we use a series of pre-trained models as the random seeds. See Appendix D.3 for the detailed calculation procedures. (3) Membership inference attack (MIA) accuracy. We employ a white-box MIA (Yeom et al., 2018) to infer whether the examples from the removed subset $S_f$ come from the training set of the model. Intuitively, the attack accuracy would decline after unlearning. Thereby, a small attack accuracy implies a strong knowledge removal performance. See Appendix D.4 for more details about the MIA and its calculation procedures. (4) Time costs for unlearning. For different unlearning methods, we estimate the average time usages for processing single data deletion requests. A smaller time cost corresponds to high unlearning efficiency.
+
+Experiment designs. We first train the BNN on the complete training set $S$ with SGLD and SGHMC, respectively. Then, the subset $S_f$ is removed iteratively, where a fixed number of data points are removed in each iteration. We also trained models on only the remaining set $S_r$ to show the targets of the machine unlearning task. For the details of the experiments, see Appendix D.5.
+
+Results analysis. The experiment results are presented in Table 1. In all experiments, we observe that the proposed MCMC unlearning algorithm can significantly increase the model error on sample set $S_{f}$ while making the error on sample sets $S_{r}$ and $S_{\mathrm{test}}$ close to that of the retrained one. Besides, our algorithm can also reduce the $\varepsilon$ value in the knowledge removal guarantee and the MIA accuracy on $S_{f}$ , which further indicates it can indeed remove specified knowledge from the MCMC models. In contrast, the importance sampling method could neither effectively make the classification errors approach the targets, nor achieve stronger $\varepsilon$ -knowledge removal. We also present the time costs for different unlearning methods in Fig. 2. One can found that the MCMC unlearning algorithm is significantly faster than other methods. All these experiment results demonstrate the effectiveness and efficiency of the proposed algorithm.
+
+Finally, we give a case study about the prediction changes on the test set examples to illustrate the effect of the proposed MCMC unlearning algorithm. The results are presented in Fig. 3, where one can observe that as the data removing continues, the prediction confidence of the model on the removed class significantly decreases, while those on other classes remain the same or increase.
+
+# 6 CONCLUSION
+
+The right to be forgotten imposes a considerable compliance burden on AI companies. A company may need to delete the whole model learned from massive resources due to a request to delete a single sample point. Existing works only appliable to explicit parameterized optimization problem, which however not work for sampling-based Bayesian inference method, i.e., MCMC. In this work, we convert the MCMC unlearning problem to an optimization problem. Then, an MCMC influence function is designed to characterize the influence of data on the distribution inferred by MCMC. It then delivers the first MCMC unlearning algorithm. Theoretical analyses show that the proposed algorithm can indeed reduce the learned knowledge, and would not compromise the generalization ability of the inferred distribution. Experiments show that the proposed algorithm can remove the influence of specified samples without compromising the knowledge learned on the remained data.
+
+# ACKNOWLEDGMENTS
+
+FH is supported in part by the Major Science and Technology Innovation 2030 “New Generation Artificial Intelligence” key project (No. 2021ZD0111700). SF and DT are supported by Australian Research Council Projects FL-170100117, IH-180100002, IC-190100031, and LE-200100049. The authors sincerely appreciate Yue Xu and the anonymous ICLR reviewers for their helpful comments.
+
+# 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.
+Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pp. 308-318, 2016.
+Naman Agarwal, Brian Bullins, and Elad Hazan. Second-order stochastic optimization for machine learning in linear time. The Journal of Machine Learning Research, 18(1):4148-4187, 2017.
+Sungjin Ahn, Anoop Korattikara, and Max Welling. Bayesian posterior sampling via stochastic gradient Fisher scoring. In International Conference on Machine Learning, pp. 1771-1778, 2012.
+Thomas Baumhauer, Pascal Schottle, and Matthias Zeppelinzauer. Machine unlearning: Linear filtration for logit-based classifiers. arXiv preprint arXiv:2002.02730, 2020.
+Lucas Bourtoule, Varun Chandrasekaran, Christopher A Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In 2021 IEEE Symposium on Security and Privacy (SP), pp. 141-159. IEEE, 2021.
+Jonathan Brophy and Daniel Lowd. Machine unlearning for random forests. In International Conference on Machine Learning, pp. 1092-1104. PMLR, 2021.
+Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In 2015 IEEE Symposium on Security and Privacy, pp. 463-480. IEEE, 2015.
+Yair Carmon, John C Duchi, Oliver Hinder, and Aaron Sidford. Accelerated methods for nonconvex optimization. SIAM Journal on Optimization, 28(2):1751-1772, 2018.
+Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1683-1691. PMLR, 2014.
+R Dennis Cook and Sanford Weisberg. *Residuals and Influence in Regression*. New York: Chapman and Hall, 1982.
+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, volume 27. Curran Associates, Inc., 2014.
+Simon Duane, Anthony D Kennedy, Brian J Pendleton, and Duncan Roweth. Hybrid Monte Carlo. Physics letters B, 195(2):216-222, 1987.
+Sanjam Garg, Shafi Goldwasser, and Prashant Nalini Vasudevan. Formalizing data deletion in the context of the right to be forgotten. Advances in Cryptology-EUROCRYPT 2020, 12106:373, 2020.
+
+Stuart Geman and Donald Geman. Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images. IEEE Transactions on Pattern Analysis and Machine Intelligence, (6): 721-741, 1984.
+Edward I George and Robert E McCulloch. Variable selection via Gibbs sampling. Journal of the American Statistical Association, 88(423):881-889, 1993.
+Antonio Ginart, Melody Guan, Gregory Valiant, and James Y Zou. Making AI forget you: Data deletion in machine learning. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
+Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Eternal sunshine of the spotless net: Selective forgetting in deep networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9304-9312, 2020.
+Aditya Golatkar, Alessandro Achille, Avinash Ravichandran, Marzia Polito, and Stefano Soatto. Mixed-privacy forgetting in deep networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 792–801, 2021.
+Jinu Gong, Osvaldo Simeone, and Joonhyuk Kang. Bayesian variational federated learning and unlearning in decentralized networks. arXiv preprint arXiv:2104.03834, 2021.
+Chuan Guo, Tom Goldstein, Awni Hannun, and Laurens Van Der Maaten. Certified data removal from machine learning models. In International Conference on Machine Learning, pp. 3832-3842. PMLR, 2020.
+W Keith Hastings. Monte Carlo Sampling Methods Using Markov Chains and Their Applications. 1970.
+Fengxiang He and Dacheng Tao. Recent advances in deep learning theory. arXiv preprint arXiv:2012.10931, 2020.
+Fengxiang He, Tongliang Liu, and Dacheng Tao. Control batch size and learning rate to generalize well: Theoretical and empirical evidence. In Advances in Neural Information Processing Systems, pp. 1143-1152, 2019.
+Peter J Huber. *Robust Statistics*, volume 523. John Wiley & Sons, 2004.
+Zachary Izzo, Mary Anne Smart, Kamalika Chaudhuri, and James Zou. Approximate data deletion from machine learning models. In International Conference on Artificial Intelligence and Statistics, pp. 2008-2016. PMLR, 2021.
+Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pp. 1885-1894, 2017.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Tiffany Li, Eduard Fosch Villaronga, and Peter Kieseberg. Humans forget, machines remember: Artificial intelligence and the right to be forgotten. Computer Law & Security Review, 34(2):304, 2018.
+Yi-An Ma, Tianqi Chen, and Emily Fox. A complete recipe for stochastic gradient MCMC. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015.
+David A McAllester. Some PAC-Bayesian theorems. In Proceedings of the Annual Conference on Computational Learning Theory, pp. 230-234, 1998.
+David A McAllester. PAC-Bayesian model averaging. In Proceedings of the Annual Conference on Computational Learning Theory, pp. 164-170, 1999.
+
+David A McAllester. PAC-Bayesian stochastic model selection. Machine Learning, 51(1):5-21, 2003.
+Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2012.
+Radford M Neal. Slice sampling. The Annals of Statistics, 31(3):705-767, 2003.
+Radford M Neal et al. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2(11):2, 2011.
+Yurii Nesterov and Boris T Polyak. Cubic regularization of Newton method and its global performance. Mathematical Programming, 108(1):177-205, 2006.
+Quoc Phong Nguyen, Bryan Kian Hsiang Low, and Patrick Jaillet. Variational Bayesian unlearning. Advances in Neural Information Processing Systems, 33, 2020.
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS-W, 2017.
+Sam Patterson and Yee Whye Teh. Stochastic gradient Riemannian Langevin Dynamics on the probability simplex. In Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013.
+Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pp. 400-407, 1951.
+Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 3-18. IEEE, 2017.
+Enayat Ullah, Tung Mai, Anup Rao, Ryan A. Rossi, and Raman Arora. Machine unlearning via algorithmic stability. In Proceedings of Thirty Fourth Conference on Learning Theory, volume 134 of Proceedings of Machine Learning Research, pp. 4126-4142. PMLR, 2021.
+Stephen G Walker. Sampling the dirichlet mixture model with slices. Communications in Statistics—Simulation and Computation® 36(1):45-54, 2007.
+Chaoyue Wang, Chang Xu, and Dacheng Tao. Self-supervised pose adaptation for cross-domain image animation. IEEE Transactions on Artificial Intelligence, 1(1):34-46, 2020. doi: 10.1109/ TAI.2020.3031581.
+Qing Wang, Sanjeev R Kulkarni, and Sergio Verdu. Divergence estimation for multidimensional densities via $k$ -nearest-neighbor distances. IEEE Transactions on Information Theory, 55(5): 2392-2405, 2009.
+Max Welling and Yee W Teh. Bayesian learning via stochastic gradient Langevin dynamics. In International Conference on Machine Learning, pp. 681-688, 2011.
+Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms, 2017.
+Samuel Yeom, Irene Giacomelli, Matt Fredrikson, and Somesh Jha. Privacy risk in machine learning: Analyzing the connection to overfitting. In 2018 IEEE 31st Computer Security Foundations Symposium (CSF), pp. 268-282. IEEE, 2018.
+Ruqi Zhang, Chunyuan Li, Jianyi Zhang, Changyou Chen, and Andrew Gordon Wilson. Cyclical stochastic gradient MCMC for Bayesian deep learning. In International Conference on Learning Representations, 2020a.
+Youjian Zhang, Chaoyue Wang, and Dacheng Tao. Video frame interpolation without temporal priors. In Advances in Neural Information Processing Systems, volume 33, pp. 13308-13318, 2020b.
+Dongruo Zhou, Pan Xu, and Quanquan Gu. Stochastic variance-reduced cubic regularized newton methods. In International Conference on Machine Learning, pp. 5990-5999. PMLR, 2018.
+
+# A PROOFS
+
+This section collects all the proofs in this paper. To avoid technicalities, we assume that all functions are differentiable throughout this paper. Furthermore, the order of differentiation and integration is assumed to be interchangeable.
+
+For simplicity, we denote that
+
+$h(\delta ,z)\coloneqq -\mathbb{E}_{\theta \sim p_S}\log p(z|\theta +\delta),$
+$f(\delta)\coloneqq -\mathbb{E}_{\theta \sim p_S}\log p(\theta +\delta),$
+- $F(\delta, S) \coloneqq \sum_{z \in S} h(\delta, z) + f(\delta) = \sum_{z \in S} -\mathbb{E}_{\theta \sim p_S} \log p(z|\theta + \delta) - \mathbb{E}_{\theta \sim p_S} \log p(\theta + \delta).$
+
+# A.1 PROOF OF THEOREM 1
+
+To prove Theorem 1, we first define the following function,
+
+$$
+F _ {- S ^ {\prime}, \tau} (\delta , S) = F (\delta , S) + \tau \sum_ {z \in S ^ {\prime}} h (\delta , z),
+$$
+
+where $\tau \in [-1,0]$ .
+
+Under Assumption 3, it can be shown that $F_{-S',\tau}(\delta, S)$ is strongly convex on the space $V_3$ defined in Assumption 3.
+
+Lemma 1. Suppose Assumption 3 holds. Then, for any $\tau \in [-1,0]$ , $F_{-S',\tau}(\delta, S)$ is strongly convex on the space $V_3$ .
+
+Proof of Lemma 1. We rearrange the function $F_{-S',\tau}$ as follows,
+
+$$
+F _ {- S ^ {\prime}, \tau} (\delta , S) = F (\delta , S - S ^ {\prime}) + (1 + \tau) \sum_ {z \in S ^ {\prime}} h (\delta , z).
+$$
+
+Apparently, $F(\delta, S - S')$ is strongly convex on $V_{3}$ . Since $\tau \in [-1, 0]$ , we have that $1 + \tau \geq 0$ . Thus, $(1 + \tau)\sum_{z \in S'} h(\delta, z)$ is either strongly convex on $V_{3}$ or equal to zero. Therefore, $F_{-S',\tau}(\delta, S)$ is strongly convex on $V_{3}$ .
+
+The proof is completed.
+
+We then prove that when Assumption 4 holds, there exists a continuous mapping that "connects" the origin point $\mathbf{0} \in \mathbb{R}^d$ and the target shifting scale $\delta_S^{-S'}$ .
+
+Lemma 2. Suppose Assumption 4 holds. Then, there exists a continuous function $\hat{\delta} : [-1,0] \to V$ such that for any $\tau \in [-1,0]$ , $\hat{\delta}(\tau)$ is the global minimizer of the function $F_{-S',\tau}(\delta,S)$ on space $V$ .
+
+Proof of Lemma 2. By applying Lemma 1 and Assumption 4, we have that the global minimizer of the function $F_{-S',\tau}(\gamma, S)$ uniquely exists in $V$ . Therefore, one can define the mapping $\hat{\delta}$ as below,
+
+$$
+\hat {\delta} (\tau) = \arg \min _ {\delta \in V} F _ {- S ^ {\prime}, \tau} (\delta , S),
+$$
+
+where $\tau \in [-1,0]$ .
+
+We then prove the continuity of $\hat{\delta}$ . Notice that $\hat{\delta}(\tau)$ is the solution of the following equation,
+
+$$
+\nabla_ {\delta} F (\delta , S) + \tau \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\delta , z) = 0. \tag {3}
+$$
+
+Since $F_{-S',\tau}(\delta, S)$ is strongly convex, thus its Hessian matrix $\nabla_{\delta}^{2} F_{-S',\tau}(\hat{\delta}(\tau), S)$ is invertible. Combining with the implicit function theorem, we have that $\hat{\delta}$ is continuous on the interval $[-1,0]$ .
+
+The proof is completed.
+
+When $\tau$ takes 0 and $-1$ , the function $\hat{\delta}(\tau)$ becomes $\mathbf{0} \in \mathbb{R}^d$ and $\delta_S^{-S'}$ , respectively. Therefore, $\delta_S^{-S'}$ can be expanded into Taylor series as follows,
+
+$$
+\delta_ {S} ^ {- S ^ {\prime}} = \hat {\delta} (- 1) = - \frac {\partial \hat {\delta} (0)}{\partial \tau} + \frac {1}{2} \cdot \frac {\partial^ {2} \hat {\delta} (\xi)}{\partial \tau^ {2}}, \tag {4}
+$$
+
+where $\xi \in [-1,0]$ , $\frac{1}{2}\frac{\partial^2\hat{\delta}(\xi)}{\partial\tau^2}$ is the Lagrange form of the remainder.
+
+We prove that the Lagrange remainder term becomes negligible as the training set size $N$ goes to infinity. To do this, we first prove the following Lemma.
+
+Lemma 3. Suppose Assumptions 1-4 hold. The mapping $\hat{\delta}$ is as defined in Lemma 2. Then, we have that
+
+$$
+\frac {\partial \hat {\delta} (\tau)}{\partial \tau} = - \nabla_ {\delta} ^ {- 2} F (\hat {\delta} (\tau), S) \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\hat {\delta} (\tau), z) ^ {T},
+$$
+
+and for any $\tau \in [-1,0]$ , $\| \frac{\partial\hat{\delta}(\tau)}{\partial\tau}\|_2\leq \mathcal{O}(|S'| / N)$ .
+
+Proof. We first calculate $\frac{\partial\delta(\tau)}{\partial\tau}$ based on Eq. (3) in the proof of Lemma 2. Calculate the derivatives of the both sides of Eq. (3) with respect to $\tau$ , we have that
+
+$$
+\nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} + \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\hat {\delta} (\tau), z) ^ {T} + \tau \cdot \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} = 0. \tag {5}
+$$
+
+According to Lemma 1, $F_{-S',\tau}(\delta,S)$ is strongly convex on $V$ . Thus, the following Hessian matrix
+
+$$
+\nabla_ {\delta} ^ {2} F _ {- S ^ {\prime}, \tau} (\hat {\delta} (\tau), S) = \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \tau \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)
+$$
+
+is positive definite, hence invertible. Combining with Eq. (5), we have that
+
+$$
+\frac {\partial \hat {\delta} (\tau)}{\partial \tau} = - \left(\nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \tau \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)\right) ^ {- 1} \cdot \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\hat {\delta} (\tau), z) ^ {T}. \tag {6}
+$$
+
+We then upper bound the norm of $\frac{\partial\hat{\delta}(\tau)}{\partial\tau}$ . Based on Eq. (6), we have that
+
+$$
+\left\| \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2} \leq \left\| \left(\frac {1}{N} \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)\right) ^ {- 1} \right\| _ {2} \cdot \left\| \frac {1}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\hat {\delta} (\tau), z) \right\| _ {2}. \tag {7}
+$$
+
+We first consider the first term of the right-hand side of Eq. (7). By Assumption 3, both $f(\delta)$ and $h(\delta, z)$ are $\mu$ -strongly convex on the space $V \subset \operatorname{supp}(\delta)$ . Thus, we have that
+
+$$
+\begin{array}{l} \frac {1}{N} \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \\ = \frac {1}{N} \sum_ {i = 1} ^ {N} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z _ {i}) + \frac {1}{N} \nabla_ {\delta} ^ {2} f (\hat {\delta} (\tau)) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \\ \succeq \left(\frac {1}{N} \sum_ {z \in S - S ^ {\prime}} \mu + \frac {\mu}{N} + \frac {1 + \tau}{N} \sum_ {z \in S ^ {\prime}} \mu\right) I \\ \succeq \frac {N - \left| S ^ {\prime} \right|}{N} \mu \cdot I. \tag {8} \\ \end{array}
+$$
+
+Let $\lambda_{\mathrm{min}}$ denotes the smallest eigenvalue of the following matrix
+
+$$
+\left(\frac {1}{N} \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)\right).
+$$
+
+Then, the Eq. (8) implies that $\lambda_{\mathrm{min}} \geq \frac{N - |S'|}{N} \mu$ . Hence, we have the following,
+
+$$
+\left\| \left(\frac {1}{N} \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)\right) ^ {- 1} \right\| _ {2} = \frac {1}{\lambda_ {\min }} \leq \frac {N}{(N - | S ^ {\prime} |) \mu} = \mathcal {O} (1). \tag {9}
+$$
+
+We then upper bound the second term of the right-hand side of Eq. (7). By applying Assumption 1, we have that
+
+$$
+\left\| \frac {1}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} h (\hat {\delta} (\tau), z) \right\| _ {2} \leq \frac {L _ {1} \cdot | S ^ {\prime} |}{N} = \mathcal {O} \left(\frac {| S ^ {\prime} |}{N}\right) \tag {10}
+$$
+
+Finally, inserting eqs. (9) (10) into Eq. (7), we eventually have that
+
+$$
+\left\| \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2} \leq \mathcal {O} (1) \cdot \mathcal {O} \left(\frac {| S ^ {\prime} |}{N}\right) = \mathcal {O} \left(\frac {| S ^ {\prime} |}{N}\right).
+$$
+
+The proof is completed.
+
+
+
+Then, the following Lemma is obtained based on Lemma 3, which demonstrates the strictness of the approximation in Eq. (4).
+
+Lemma 4. Suppose Assumptions 1-4 hold. The induced mapping $\hat{\delta}$ is as defined in Lemma 2. Then, for any $\tau \in [-1,0]$ , we have that $\| \frac{\partial^2\hat{\delta}(\tau)}{\partial\tau^2}\|_2\leq \mathcal{O}(|S'|^2 /N^2)$ .
+
+Proof. We first calculate $\frac{\partial^2\delta(\tau)}{\partial\tau^2}$ based on Eq. (3). Similar to the proof of Lemma 3, we calculate the second-order derivatives of the both sides of Eq. (3) with respect to $\tau$ and have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {N} B (\tau , z _ {i}) + A (\tau) + \left(\sum_ {i = 1} ^ {N} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z _ {i}) + \nabla_ {\delta} ^ {2} f (\hat {\delta} (\tau))\right) \cdot \frac {\partial^ {2} \hat {\delta} (\tau)}{\partial \tau^ {2}} \\ + 2 \cdot \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} + \tau \sum_ {z \in S ^ {\prime}} B (\tau , z) + \tau \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial^ {2} \hat {\delta} (\tau)}{\partial \tau^ {2}} = 0, \\ \end{array}
+$$
+
+which means
+
+$$
+\begin{array}{l} \frac {\partial^ {2} \hat {\delta} (\tau)}{\partial \tau^ {2}} = - \left(\frac {1}{N} \sum_ {i = 1} ^ {N} \nabla_ {\delta} ^ {2} F (\hat {\delta} (\tau), S) + \frac {\tau}{N} \nabla_ {\delta} ^ {2} \sum_ {z \in S ^ {\prime}} h (\hat {\delta} (\tau), z)\right) ^ {- 1} \\ \cdot \left(\frac {1}{N} \sum_ {i = 1} ^ {N} B (\tau , z _ {i}) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} B (\tau , z) + \frac {1}{N} A (\tau) + \frac {2}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau}\right), \tag {11} \\ \end{array}
+$$
+
+in which the invertibility of $\left(\frac{1}{N}\sum_{i = 1}^{N}\nabla_{\delta}^{2}F(\hat{\delta} (\tau),S) + \frac{\tau}{N}\sum_{z\in S^{\prime}}\nabla_{\delta}^{2}h(\hat{\delta} (\tau),z)\right)$ is guaranteed by Eq. (8), $A(\tau),B(\tau ,z)\in \mathbb{R}^{K\times 1}$ , and for $i = 1,\dots ,K$ , we have the following,
+
+$$
+A (\tau) _ {i} = \frac {\partial \hat {\delta} (\tau)}{\partial \tau} ^ {T} \cdot \nabla_ {\delta} ^ {2} \left(\frac {\partial f (\hat {\delta} (\tau))}{\partial \delta_ {i}}\right) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau}, \tag {12}
+$$
+
+$$
+B (\tau , z) _ {i} = \frac {\partial \hat {\delta} (\tau)}{\partial \tau} ^ {T} \cdot \nabla_ {\delta} ^ {2} \left(\frac {\partial h (\hat {\delta} (\tau) , z)}{\partial \delta_ {i}}\right) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau}. \tag {13}
+$$
+
+We then upper bound the norm of $\frac{\partial^2\hat{\delta}(\tau)}{\partial\tau^2}$ . Based on Eq. (11), we have that
+
+$$
+\begin{array}{l} \left\| \frac {\partial^ {2} \hat {\delta} (\tau)}{\partial \tau^ {2}} \right\| _ {2} \\ \leq \left\| \left(\frac {1}{N} \sum_ {i = 1} ^ {N} \nabla_ {\delta} ^ {2} F (\hat {\gamma} (\tau), S) + \frac {\tau}{N} \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z)\right) ^ {- 1} \right\| _ {2} \\ \cdot \frac {1}{N} \left(\sum_ {i = 1} ^ {N} \| B (\tau , z _ {i}) \| _ {2} + \tau \sum_ {z \in S ^ {\prime}} \| B (\tau , z) \| _ {2} + \| A (\tau) \| _ {2} + 2 \left\| \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2}\right) (14) \\ \leq \mathcal {O} \left(\frac {1}{N} \left(\sum_ {i = 1} ^ {N} \| B (\tau , z _ {i}) \| _ {2} + \tau \sum_ {z \in S ^ {\prime}} \| B (\tau , z) \| _ {2} + \| A (\tau) \| _ {2} + 2 \left\| \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2}\right)\right), (15) \\ \end{array}
+$$
+
+where Eq. (15) is obtained by inserting Eq. (9) (in the proof of Lemma 3) into Eq. (14). Thus, the remaining task is to upper bound the norms of $A(\tau), B(\tau, z)$ and $\nabla_{\delta}^{2}\sum_{z \in S'} h(\hat{\delta}(\tau), z) \cdot \frac{\partial \hat{\delta}(\tau)}{\partial \tau}$ .
+
+We first upper bound $\| A(\tau)\| _2$ . Applying Lemma 3, we have that $\| \frac{\partial\hat{\delta}(\tau)}{\partial\tau}\| _2\leq \mathcal{O}(|S'| / N)$ . Applying the Lipschitz Hessian condition in Assumption 2, we have that $\| \nabla_{\delta}^{2}(\frac{\partial f(\hat{\delta}(\tau))}{\partial\delta_{i}})\|_{2}$ is also bounded by a real constant. Therefore, we have that
+
+$$
+\| A (\tau) \| _ {2} \leq \sum_ {i = 1} ^ {K} \left\| \nabla_ {\delta} ^ {2} \left(\frac {\partial f (\hat {\delta} (\tau))}{\partial \delta_ {i}}\right) \right\| _ {2} \cdot \left\| \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2} ^ {2} \leq \sum_ {i = 1} ^ {K} \mathcal {O} (1) \cdot \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right) = \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right). \tag {16}
+$$
+
+For $B(\tau, z)$ , we similarly have that
+
+$$
+\left\| B (\tau , z) \right\| _ {2} \leq \mathcal {O} \left(\frac {\left| S ^ {\prime} \right| ^ {2}}{N ^ {2}}\right). \tag {17}
+$$
+
+To upper bound the norm of $\sum_{z\in S'}\nabla_{\delta}^2 h(\hat{\delta} (\tau),z)\cdot \frac{\partial\hat{\delta}(\tau)}{\partial\tau}$ , we apply Lemma 3, Assumption 2, and have that
+
+$$
+\left\| \sum_ {z \in S ^ {\prime}} \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \cdot \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2} \leq \sum_ {z \in S ^ {\prime}} \left\| \nabla_ {\delta} ^ {2} h (\hat {\delta} (\tau), z) \right\| _ {2} \left\| \frac {\partial \hat {\delta} (\tau)}{\partial \tau} \right\| _ {2} \leq \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N}\right). \tag {18}
+$$
+
+Inserting eqs. (16), (17) and (18), into Eq. (15), we eventually have that
+
+$$
+\begin{array}{l} \left\| \frac {\partial^ {2} \hat {\delta} (\tau)}{\partial \tau^ {2}} \right\| _ {2} \\ \leq \mathcal {O} \left(\frac {1}{N} \left(\sum_ {i = 1} ^ {N} \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right) + \tau \cdot \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {3}}{N ^ {2}}\right) + \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right) + 2 \cdot \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N}\right)\right)\right) = \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right). \\ \end{array}
+$$
+
+The proof is completed.
+
+Finally, combining all the results, we prove Theorem 1.
+
+Proof of Theorem 1. The proof is completed by applying Lemmas 3 and 4 into Eq. (4).
+
+
+
+# A.2 PROOF OF THEOREM 2
+
+This section presents the proof of Theorem 2.
+
+Proof of Theorem 2. By expanding the KL-divergence $\mathrm{KL}(p_S(\cdot +\mathcal{I}(S'))\| p_{S - S'})$ into Taylor series around the local region of $\delta = \delta_S^{-S'}$ , we have
+
+$$
+\begin{array}{l} \mathrm {K L} \left(p _ {S} (\cdot + \mathcal {I} \left(S ^ {\prime}\right)) \| p _ {S - S ^ {\prime}}\right) \\ = \mathrm {K L} (p _ {S} (\cdot - \delta_ {S} ^ {- S ^ {\prime}} \| p _ {S - S ^ {\prime}}) + (\mathcal {I} (S ^ {\prime}) + \delta_ {S} ^ {- S ^ {\prime}}) ^ {T} \cdot \nabla_ {\delta} ^ {2} \mathrm {K L} (p _ {S} (\cdot - \xi) \| p _ {S - S ^ {\prime}}) \cdot (\mathcal {I} (S ^ {\prime}) + \delta_ {S} ^ {- S ^ {\prime}}) \\ = \mathrm {K L} \left(p _ {S} \left(\cdot - \delta_ {S} ^ {- S ^ {\prime}} \| p _ {S - S ^ {\prime}}\right) - \left(\mathcal {I} \left(S ^ {\prime}\right) + \delta_ {S} ^ {- S ^ {\prime}}\right) ^ {T} \cdot \nabla_ {\delta} ^ {2} \left[ F (\xi , S) - \sum_ {z \in S ^ {\prime}} h (\xi , z) \right] \cdot \left(\mathcal {I} \left(S ^ {\prime}\right) + \delta_ {S} ^ {- S ^ {\prime}}\right), \right. \tag {19} \\ \end{array}
+$$
+
+where the first-order term equals 0 according to the first-order optimal condition. By applying Theorem 1 and Assumption 2, we further have
+
+$$
+\begin{array}{l} \left\| \left(\mathcal {I} (S ^ {\prime}) + \delta_ {S} ^ {- S ^ {\prime}}\right) ^ {T} \cdot \nabla_ {\delta} ^ {2} \left[ F (\xi , S) - \sum_ {z \in S ^ {\prime}} h (\xi , z) \right] \cdot \left(\mathcal {I} (S ^ {\prime}) + \delta_ {S} ^ {- S ^ {\prime}}\right) \right\| _ {2} \\ \leq \left\| \nabla_ {\delta} ^ {2} \left[ F (\xi , S) - \sum_ {z \in S ^ {\prime}} h (\xi , z) \right] \right\| _ {2} \cdot \left\| \mathcal {I} (S ^ {\prime}) + \delta_ {S} ^ {- S ^ {\prime}} \right\| _ {2} ^ {2} \\ \leq \mathcal {O} \left((N - | S ^ {\prime} | + 1) L _ {2} \cdot \operatorname {d i a m} (V)\right) \cdot \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {2}}{N ^ {2}}\right) ^ {2} \leq \mathcal {O} \left(\frac {| S ^ {\prime} | ^ {4}}{N ^ {3}}\right). \tag {20} \\ \end{array}
+$$
+
+By combining eqs. (19) and (20), the proof is completed.
+
+
+
+# A.3 PROOF OF THEOREM 3
+
+This section presents the proof of Theorem 3.
+
+We derive generalization bound for the proposed algorithm under the PAC-Bayesian framework (McAllester, 1998; 1999; 2003). The framework can provide guarantees for randomized predictors (e.g., the Bayesian predictors).
+
+Specifically, let $Q$ a distribution on the parameter space $\Theta$ , $P$ denotes the prior distribution over the parameter space $\Theta$ . Then, the expected risks $\mathcal{R}(Q)$ is bounded in terms of the empirical risk $\hat{\mathcal{R}}(Q, S)$ and KL-divergence $\mathrm{KL}(Q \| P)$ by the following result from PAC-Bayes.
+
+Lemma 5 (cf. McAllester (2003), Theorem 1). For any real $\delta \in (0,1)$ , with probability at least $1 - \delta$ , we have the following inequality for all distributions $Q$ :
+
+$$
+\mathcal {R} (Q) \leq \hat {\mathcal {R}} (Q, S) + \sqrt {\frac {\operatorname {K L} (Q \| P) + \log \frac {1}{\delta} + \log N + 2}{2 N - 1}}. \tag {21}
+$$
+
+Based on Lemma 5, we prove the generalization bounds in Theorem 3.
+
+Proof of Theorem 3. Let the prior distribution $P$ be a Laplace distribution $\mathrm{lap}(0,1)$ , $p_S^{-S'} = p_S(\cdot + \mathcal{I}(S'))$ be the distribution processed by the MCMC unlearning algorithm. Then, one can calculate the KL-divergence $\mathrm{KL}(p_S^{-S'}\| P)$ as follows (where we assume that $\Theta = \mathbb{R}^d$ ),
+
+$$
+\begin{array}{l} \mathrm {K L} (p _ {S} ^ {- S ^ {\prime}} \| P) = \int_ {\Theta} \log \left(\frac {p _ {S} ^ {- S ^ {\prime}} (\theta)}{p (\theta)}\right) p _ {S} ^ {- S ^ {\prime}} (\theta) \mathrm {d} \theta \\ = \int_ {\Theta} \log \left(\frac {p _ {S} (\theta)}{p \left(\theta - \mathcal {I} \left(S ^ {\prime}\right)\right)}\right) p _ {S} (\theta) \mathrm {d} \theta \\ = \int_ {\Theta} \left[ \log p _ {S} (\theta) + \| \theta - \mathcal {I} (S ^ {\prime}) \| _ {1} + \log 2 \right] p _ {S} (\theta) \mathrm {d} \theta \\ \leq \mathbb {E} _ {\theta \sim p _ {S}} \log p _ {S} (\theta) + \mathbb {E} _ {\theta \sim p _ {S}} \| \theta \| _ {1} + \| \mathcal {I} \left(S ^ {\prime}\right) \| _ {1} + \log 2. \tag {22} \\ \end{array}
+$$
+
+Inserting Eq. (22) into Eq. (21) in Lemma 5, we then obtain the PAC-Bayesian generalization bound.
+
+Eventually, by applying Lemma 3, we have that $\| \mathcal{I}(S')\| _1\leq \mathcal{O}(|S'| / N)$
+
+The proof is completed.
+
+
+
+# B EFFICIENT CALCULATION OF MCMC INFLUENCE FUNCTION
+
+A major computing burden in the MCMC unlearning algorithm is calculating the product of $H^{-1}v$ , where $H$ is the Hessian matrix of some vector-valued function $f(x)$ and $v$ is a constant vector. When the function $f(x)$ is of high dimension, the calculation would have a considerably high computational cost. We follow Agarwal et al. (2017) and Koh & Liang (2017) to apply a divide-and-conquer strategy to address the issue. This strategy relies on calculating the Hessian-vector product $Hv$ .
+
+Hessian-vector product (HVP). We first discuss how to efficiently calculate $Hv$ . The calculation of $Hv$ can be decomposed into two steps: (1) calculate $\frac{\partial f(x)}{\partial x}$ and then (2) calculate $\frac{\partial}{\partial x}\left(\frac{\partial f(x)}{\partial x}\cdot v\right)$ . It is worth noting that $\frac{\partial f(x)}{\partial x}\in \mathbb{R}^{1\times d}$ and $v\in \mathbb{R}^{d\times 1}$ , where $d > 0$ is the dimension of data. Thus, $\left(\frac{\partial f(x)}{\partial x}\cdot v\right)$ is a scalar value. Calculating its gradient $\frac{\partial}{\partial x}\left(\frac{\partial f(x)}{\partial x}\cdot v\right)$ has a very low computational cost on platform PyTorch (Paszke et al., 2017) or TensorFlow (Abadi et al., 2015).
+
+Calculating $H^{-1}v$ . When the norm $\| H\| \leq 1$ , the matrix $H^{-1}$ can be expanded by the Taylor's series as $H^{-1} = \sum_{i = 0}^{\infty}(I - H)^{i}$ . Define that $H_{j}^{-1} = \sum_{i = 0}^{j}(I - H)^{i}$ . Then, we have the following recursive equation,
+
+$$
+H _ {j} ^ {- 1} v = v + (I - H) H _ {j - 1} ^ {- 1} v.
+$$
+
+Agarwal et al. (2017) prove that when $j \to \infty$ , we have $\mathbb{E}[H_j^{-1}] \to H^{-1}$ . Therefore, we employ $H_j^{-1}v$ to approximate $H^{-1}v$ .
+
+Moreover, to secure the condition $\| H \| \leq 1$ stands, we scale $H$ to $cH$ by a scale $c \in \mathbb{R}^+$ , such that $\| cH \| \leq 1$ . Then, we approximate $(cH)^{-1}$ . Eventually, we have that $H^{-1} = c(cH)^{-1}$ . We can plug it to the applicable equations above.
+
+# C EXPERIMENTS DETAILS FOR GAUSSIAN MIXTURE MODELS
+
+This section provides the additional experiments details for the Gaussian mixture models.
+
+# C.1 GAUSSIAN MIXTURE MODELS
+
+We employ Gaussian mixture models (GMMs) to infer the cluster centers on the synthetic dataset. A GMM assumes that each example is drawn from $K$ Gaussian distributions centered at $\mu_1, \dots, \mu_K$ , respectively. Then, the hierarchical structure of GMM is as follows: (1) draw a clustering center from the uniform distribution over $\{\mu_{c_1}, \dots, \mu_{c_K}\}$ ; and (2) sample $z_i$ from a Gaussian distribution centering at $\mu_{c_i}$ . That is,
+
+$$
+\mu_ {k} \sim \mathcal {N} (0, \sigma^ {2} I),
+$$
+
+$$
+c _ {i} \sim \text {c a t e g o r i c a l} \left(\frac {1}{K}, \dots , \frac {1}{K}\right),
+$$
+
+$$
+Z _ {i} \sim \mathcal {N} (\mu_ {c _ {i}}, I),
+$$
+
+where $1 \leq k \leq K$ , $1 \leq i \leq n$ , $\mu_k \in \mathbb{R}^d$ , $c_i \in \{1, \dots, K\}$ , $Z_i \in \mathbb{R}^d$ , and the hyperparameter $\sigma \in \mathbb{R}$ is the prior standard deviation. In our experiments, the factor $K$ is set as 4, and the prior standard deviation $\sigma$ is set as 1.
+
+# C.2 EXPERIMENTS DETAILS
+
+The experiments for GMM have two main phases:
+
+Training phase. Every GMM is trained for 4,000 iterations. The batch size is set as 64. For both SGLD and SGHMC, the learning rate schedule is set as $4 \cdot t^{-0.5005} / N$ , where $t$ is the training iteration step and $N$ is the number of the training set size. Besides, the momentum factor $\alpha$ of SGHMC is set as 0.9.
+
+Unlearning phase. We remove a batch of 4 datums each time. When calculating the inversed-Hessian-vector product $H^{-1}v$ in the influence functions (see Section B), the recursive calculation number $j$ is set as 32, and the scaling factor $c$ is set as $1 / N'$ , where $N'$ is the number of the current remained training examples. Notice that $N'$ will gradually decrease as the forgetting process continues. Moreover, we employ the Monte Carlo method to calculate the expectations in the MCMC influence function. Specifically, we repeatedly draw sample $\theta$ for 5 times, calculate the matrix or vector in the MCMC influence function, and average the results to approach the expectations.
+
+# D EXPERIMENTS DETAILS FOR BAYESIAN NEURAL NETWORKS
+
+This section provides the additional experiments details for Bayesian neural networks.
+
+# D.1 DATASETS
+
+We employ two image datasets, Fashion-MNIST (Xiao et al., 2017) and CIFAR-10 (Krizhevsky et al., 2009), in our experiments. Fashion-MNIST consists of grey-scale images from 10 classes, where each class contains 6,000 training examples and 1,000 test examples. Besides, CIFAR-10 consists of color images from 10 classes, where each class contains 5,000 training examples and 1,000 test examples. No data augmentation is used in the experiments.
+
+Furthermore, it is worth noting that the models used for Fashion-MNIST and CIFAR-10 are first pretrained on MNIST (LeCun et al., 1998) and CIFAR-100 (Krizhevsky et al., 2009), respectively. Please see Appendices D.3 and D.5 for more details.
+
+# D.2 BAYESIAN NEURAL NETWORKS
+
+This section introduces the model architectures used in our experiments and the implementation details for training BNNs.
+
+# D.2.1 MODEL ARCHITECTURES
+
+For Fashion-MNIST, we use a LeNet (LeCun et al., 1998) architecture that consists of two convolutional layers followed by three fully-connected layers. The convolutional layers use $5 \times 5$ convolutions, each followed by a $2 \times 2$ max-pooling layer and a ReLU activation function. The channel numbers of the two convolutional layers are 6 and 16, respectively. Besides, each fully-connected layer is also followed by a ReLU activation function, while the hidden layer channels are 120 and 84, respectively.
+
+for CIFAR-10, we follow Abadi et al. (2016) to use a network architecture that consists of two convolutional layers followed by two fully-connected layers. Each convolutional layer uses $5 \times 5$ convolution, with a channel number of 64, followed by a $2 \times 2$ max-pooling layer and a ReLU activation function. Besides, each fully-connected layer is also followed by a ReLU activation function, while the hidden layer channels are 384.
+
+# D.2.2 MODEL TRAINING
+
+In all the experiments, we use an isotropic Gaussian distribution $\mathcal{N}(0,\sigma_0^2 I)$ as the prior of the BNNs, in which the hyperparameter $\sigma_0$ is set as 0.1.
+
+Traditional SG-MCMC methods would inject random noise to BNNs during training. However, it is found that the noise injection in the early training iterations hurts the convergence of BNNs (Zhang et al., 2020a). To alleviate such a problem, we follow Zhang et al. (2020a) to first avoid the noise injection in the early training iterations and then resume SG-MCMC as usual in the rest of the training.
+
+# D.3 ESTIMATING THE $\varepsilon$ -KNOWLEDGE REMOVAL GUARANTEE
+
+We use the knowledge removal estimator $\hat{\varepsilon}_M$ defined in Definition 2 to estimate the $\varepsilon$ value in the $\varepsilon$ -knowledge removal guarantee. According to the definition of $\hat{\varepsilon}_M$ , calculating it requires first fixing a series of random seeds, and then calculating the KL-divergence between two MCMC distributions.
+
+For the random seeds, we employ the pretraining technique (Golatkar et al., 2020) to fix them. Specifically, for the experiments on Fashion-MNIST, all the models used are first pre-trained on MNIST; for the experiments on CIFAR-10, all the models used are first pre-trained on CIFAR-100.
+
+Besides, for the KL-divergence calculation, we follow Wang et al. (2009) to estimate the KL-divergence in a $k$ -NN manner, in which 100 samples are drawn from each of the processed and retrained distributions for the estimation.
+
+# D.4 MEMBERSHIP INFERENCE ATTACK
+
+Membership inference attack (MIA) (Shokri et al., 2017; Yeom et al., 2018) is a privacy attack that aims to infer whether a given example is in the training set based on the output of the model. In our experiments, we adopt a white-box threshold-based MIA (Yeom et al., 2018) to assess the unlearning performance. The calculation consists of two steps: (1) learn an optimal MIA threshold on the remained training set $S_{r}$ and the test set $S_{\mathrm{test}}$ , and (2) calculate MIA accuracy with the learned threshold on the removed training set $S_{f}$ .
+
+Learn the optimal threshold. Suppose the "to-be-inferred" example $(x,y)$ comes from $S_{r}$ and $S_{\mathrm{test}}$ with equal probabilities. Then, the attack accuracy of MIA with a threshold $\rho \in [0,1]$ on the model $f_{\theta}$ is calculated as follows,
+
+$$
+\operatorname {A c c} (\rho , S _ {r}, S _ {\text {t e s t}}) = 0. 5 \times \left(\frac {\sum_ {(x , y) \in S _ {r}} \mathbf {1} [ f _ {\theta} (x) _ {y} \geq \rho ]}{| S _ {r} |} + \frac {\sum_ {(x , y) \in S _ {\text {t e s t}}} \mathbf {1} [ f _ {\theta} (x) _ {y} < \rho ]}{| S _ {\text {t e s t}} |}\right),
+$$
+
+where $f_{\theta}(x)_y$ is the output confidence for label $y$ and $\mathbf{1}[\cdot]$ is the indicator function. Then, the optimal threshold $\rho_{\mathrm{optim}}$ is obtained via calculating the maximizer of the above attack accuracy, i.e.,
+
+$$
+\rho_ {\mathrm {o p t i m}} = \underset {\rho} {\arg \max} \operatorname {A c c} (\rho , S _ {r}, S _ {\mathrm {t e s t}}).
+$$
+
+Calculate MIA accuracy on $S_{f}$ . With the optimal threshold $\rho_{\mathrm{optim}}$ that learned on $S_{r}$ and $S_{\mathrm{test}}$ , the MIA accuracy on the removed set $S_{f}$ is calculated as follows,
+
+$$
+\mathrm {A c c} (\rho_ {\mathrm {o p t i m}}, S _ {f}) = \frac {\sum_ {(x , y) \in S _ {f}} \mathbf {1} [ f _ {\theta} (x) _ {y} \geq \rho_ {\mathrm {o p t i m}} ]}{| S _ {f} |}.
+$$
+
+Intuitively, after removing the knowledge learned from the removed subset $S_f$ , the MIA accuracy $\mathrm{Acc}(\rho_{\mathrm{optim}}, S_f)$ would decline. As a result, a low MIA accuracy on the removed subset $S_f$ would imply a strong knowledge removal performance.
+
+# D.5 EXPERIMENTS DETAILS
+
+This section provides the omitted experiment details, including the settings of the hyperparameters and the procedures of the experiments.
+
+# D.5.1 EXPERIMENTS ON FASHION-MNIST
+
+Pretraining phase. In every experiment, we pretrain a non-Bayesian model on MNIST via SGD for 2,000 iterations, with a batch size of 128, a learning rate of $0.1 / N$ , where $N$ is the training set size, and a momentum factor of 0.9.
+
+Training phase. Every BNN is trained for 10,000 iterations. The batch size is set as 128. For both SGLD and SGHMC, we first train the model without noise injection in the first 1,000 iterations. In this stage, the learning rate is fixed to $0.01 / N$ . Then, we resume the traditional SGLD and SGHMC in the rest of the training. In this stage, the learning rate schedule is set as $0.01 \cdot t^{-0.5005} / N$ , where $t$ is the training iteration step. Besides, the momentum factor $\alpha$ of SGHMC is set as 0.9.
+
+Unlearning phase. We remove a batch of 64 datum each time.
+
+For the MCMC unlearning algorithm, when calculating the inversed-Hessian-vector product $H^{-1}v$ in the MCMC influence function (see Appendix B), the recursive calculation number $j$ is set as 64, the scaling factor $c$ is set as $0.05 / N'$ , in which $N'$ is the number of the current remained training examples. Notice that $N'$ will gradually decrease as the forgetting process continues. Besides, we employ the Monte Carlo method to calculate the expectations in the MCMC influence function. Specifically, each time we draw a sample $\theta$ via the MCMC sampler and calculate the matrix and vector in the MCMC influence function based on $\theta$ to estimate the desired expectation.
+
+Besides, for the importance sampling method, we process each data deletion request by performing MCMC sampling for 1,000 times on the remaining data.
+
+# D.5.2 EXPERIMENTS ON CIFAR-10
+
+Pretraining phase. In every experiment, we pretrain a non-Bayesian model on CIFAR-100 via SGD for 10,000 iterations, with a batch size of 128, a learning rate of $0.1 / N$ , where $N$ is the training set size, and a momentum factor of 0.9.
+
+Training phase. Every BNN is trained for 20,000 iterations. The batch size is set as 128. For both SGLD and SGHMC, we first train the model without noise injection in the first 5,000 iterations. In this stage, the learning rate is fixed to $0.01 / N$ . Then, we resume the traditional SGLD and SGHMC in the rest of the training. In this stage, the learning rate schedule is set as $0.01 \cdot t^{-0.5005} / N$ , where $t$ is the training iteration step. Besides, the momentum factor $\alpha$ of SGHMC is set as 0.9.
+
+Unlearning phase. We remove a batch of 64 datum each time.
+
+For the MCMC unlearning algorithm, When calculating the inversed-Hessian-vector product $H^{-1}v$ in the MCMC influence functions (see Appendix B), the recursive calculation number $j$ is set as 64, the scaling factors $c$ is set as $0.08 / N^{\prime}$ , where $N^{\prime}$ is the number of the current remained training examples. Notice that $N^{\prime}$ will gradually decrease as the forgetting process continues. Besides, we employ the Monte Carlo method to calculate the expectations in the MCMC influence function. Specifically, each time we draw a sample $\theta$ via the MCMC sampler and calculate the matrix and vector in the MCMC influence function based on $\theta$ to estimate the desired expectation.
+
+Besides, for the importance sampling method, we process each data deletion request by performing MCMC sampling for 1,000 times on the remaining data.
+
+# D.6 EXPERIMENT RESULTS ON FASHION-MNIST
+
+This section presents all the experiment results of BNNs on the Fashion-MNIST dataset. The evaluations of unlearning performance are shown as Table 2, while the time costs for unlearning is shown in Fig. 4. The results further justify the effectiveness of the proposed algorithm.
+
+
+Figure 4: Time costs for processing single data deletion requests on BNNs.
+
+# D.7 EVALUATION ON PREDICTION DIFFERENCES
+
+In this section, we adopt the metric named prediction differences to better quantify the difference between the retrained and processed models. For two BNNs $p_1(\cdot)$ and $p_2(\cdot)$ learned by MCMC, their prediction difference on a given dataset $S$ is defined as $\mathbb{E}_{\theta_1 \sim p_1} \mathbb{E}_{\theta_2 \sim p_2} \frac{1}{|S|} \sum_{(x_i, y_i) \in S} \| f_{\theta_1}(x_i) -$
+
+Table 2: Experiment results on Fashion-MNIST. Different metrics are used to evaluate the machine unlearning performance, including the classification errors on the remaining set $S_{r}$ , removed set $S_{f}$ , and test set $S_{\mathrm{test}}$ , the knowledge removal estimators $\hat{\varepsilon}_{M}$ , and the membership inference attack (MIA) accuracy on $S_{f}$ . Every experiment is repeated 5 times.
+
+ | Remove | Method | Err. on Sr (%) | Err. on Sf (%) | Err. on Stest (%) | εM (×103) | MIA Acc. (%) |
| Fashion MNIST + SGLD | 4,000 Examples | Retrain | 12.81±0.49 | 37.62±0.76 | 15.63±0.59 | 0.00±0.00 | 16.12±5.79 |
| Origin | 13.49±0.81 | 17.39±0.41 | 14.73±0.80 | 351.00±4.98 | 10.86±8.02 |
| IS | 12.67±0.70 | 34.93±2.16 | 15.30±0.77 | 365.97±3.04 | 13.97±11.37 |
| Ours | 12.93±0.72 | 35.84±1.85 | 15.57±0.77 | 350.30±4.82 | 10.36±2.31 |
| 6,000 Examples | Retrain | 11.21±0.57 | 100.00±0.00 | 21.05±0.49 | 0.00±0.00 | 0.00±0.00 |
| Origin | 13.38±0.85 | 17.08±0.51 | 14.73±0.80 | 364.63±2.45 | 7.20±5.93 |
| IS | 11.10±0.66 | 87.30±5.82 | 19.90±0.87 | 378.11±1.45 | 4.52±2.31 |
| Ours | 11.39±0.68 | 98.13±1.61 | 20.59±0.99 | 362.55±2.47 | 1.25±0.67 |
| Fashion MNIST + SGHMC | 4,000 Examples | Retrain | 14.57±1.11 | 38.90±3.42 | 17.34±1.11 | 0.00±0.00 | 5.58±5.81 |
| Origin | 15.21±1.30 | 17.58±1.68 | 16.40±1.17 | 362.60±8.24 | 12.03±12.61 |
| IS | 14.27±1.22 | 36.54±1.73 | 16.97±1.16 | 375.62±5.10 | 13.76±13.12 |
| Ours | 14.56±1.24 | 37.48±2.02 | 17.29±1.08 | 361.72±7.87 | 11.28±13.25 |
| 6,000 Examples | Retrain | 12.99±0.94 | 100.00±0.00 | 22.61±0.69 | 0.00±0.00 | 0.00±0.00 |
| Origin | 15.16±1.31 | 17.27±1.80 | 16.40±1.17 | 366.98±6.24 | 8.32±12.07 |
| IS | 12.52±1.04 | 87.48±7.22 | 20.94±1.44 | 382.34±3.48 | 4.20±1.84 |
| Ours | 12.93±1.16 | 98.23±1.04 | 22.39±0.85 | 364.99±6.00 | 1.59±0.51 |
+
+Table 3: The results of prediction differences on CIFAR-10 and Fashion-MNIST. The prediction differences between the retrained model and the processed model are calculated on the remaining set $S_{r}$ , removed set $S_{f}$ , and test set $S_{\mathrm{test}}$ , respectively.
+
+ | Remove | Method | Pred. diff. on Sr | Pred. diff. on Sf | Pred. diff. on Stest |
| CIFAR-10 + SGLD | 3,000 Examples | Origin | 0.18±0.00 | 0.50±0.02 | 0.21±0.01 |
| IS | 0.18±0.00 | 0.37±0.01 | 0.20±0.01 |
| Ours | 0.17±0.00 | 0.35±0.02 | 0.19±0.01 |
| 5,000 Examples | Origin | 0.23±0.00 | 1.42±0.02 | 0.37±0.01 |
| IS | 0.21±0.00 | 0.92±0.03 | 0.29±0.01 |
| Ours | 0.19±0.00 | 0.67±0.05 | 0.25±0.01 |
| CIFAR-10 + SGHMC | 3,000 Examples | Origin | 0.19±0.00 | 0.50±0.01 | 0.22±0.00 |
| IS | 0.19±0.00 | 0.38±0.01 | 0.21±0.00 |
| Ours | 0.18±0.00 | 0.35±0.01 | 0.20±0.01 |
| 5,000 Examples | Origin | 0.23±0.00 | 1.44±0.02 | 0.37±0.00 |
| IS | 0.22±0.00 | 0.94±0.02 | 0.31±0.00 |
| Ours | 0.20±0.00 | 0.73±0.05 | 0.27±0.00 |
| Fashion MNIST + SGLD | 4,000 Examples | Origin | 0.13±0.02 | 0.37±0.02 | 0.15±0.02 |
| IS | 0.11±0.02 | 0.22±0.01 | 0.12±0.02 |
| Ours | 0.11±0.02 | 0.21±0.02 | 0.12±0.02 |
| 6,000 Examples | Origin | 0.17±0.01 | 1.45±0.02 | 0.30±0.01 |
| IS | 0.13±0.01 | 0.56±0.05 | 0.18±0.01 |
| Ours | 0.13±0.01 | 0.33±0.07 | 0.15±0.01 |
| Fashion MNIST + SGHMC | 4,000 Examples | Origin | 0.15±0.03 | 0.43±0.03 | 0.18±0.03 |
| IS | 0.14±0.03 | 0.26±0.05 | 0.15±0.03 |
| Ours | 0.14±0.03 | 0.26±0.05 | 0.15±0.03 |
| 6,000 Examples | Origin | 0.18±0.02 | 1.44±0.02 | 0.30±0.02 |
| IS | 0.14±0.02 | 0.55±0.07 | 0.18±0.02 |
| Ours | 0.13±0.02 | 0.35±0.05 | 0.16±0.02 |
+
+$f_{\theta_2}(x_i)\| _1$ , where $f_{\theta_1}(x_i)$ and $f_{\theta_2}(x_i)$ are two prediction confidence vectors for the example $x_{i}$ Intuitively, a smaller prediction difference indicates a smaller deviation between the retrained and processed models.
+
+We calculate the prediction difference between the retrained model and the processed model on three different datasets, $S_r$ , $S_f$ , and $S_{\mathrm{test}}$ . The experiment results on CIFAR-10 and Fashion-MNIST are shown in Table 3. The results show that the proposed MCMC unlearning algorithm can effectively reduce the prediction difference, which further justify the effectiveness of the proposed method.
\ No newline at end of file
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/images.zip b/knowledgeremovalinsamplingbasedbayesianinference/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..72aa3f03998958ea73f2e10c3ac08c4a648f9cd2
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed668f25f7cc3a757cc204217ea403e61ffd58b54f74ab444e72635a96d316c2
+size 949693
diff --git a/knowledgeremovalinsamplingbasedbayesianinference/layout.json b/knowledgeremovalinsamplingbasedbayesianinference/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8753a5e780f713d8da35773267b258189b198cfd
--- /dev/null
+++ b/knowledgeremovalinsamplingbasedbayesianinference/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1176a1ed031fe33ba8d37369541d15064d7ad67f78bb7f1868f4bbc11a7fa816
+size 1021991
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_content_list.json b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d79754d691ecd3cfa2afbf8652ba0f1fb283b812
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9cf6a7d294ac7031ac4d925958b7c6e7f9607a5aabad797236b3a19a843c3b53
+size 112436
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_model.json b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5f99ae850b10170e5e75c7ab29d728f5187bbf6d
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d2f0e69ae4c0de0a3ee3b1f24bc5ab6a6ebeb5ae184b00ae2a46cfc02155c3b6
+size 133718
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_origin.pdf b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..281c43253a26916eefdf729b1d2722d184f1102e
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/8d344477-a159-4eb8-bcc6-ef11749c55fe_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:815168582440ba23e71317bba15ca783bd284a0c8e97abb103fa0c0a260e3536
+size 13307395
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/full.md b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c8cb2effe7725fd7c729b2b5e78ad199ab9dc5dc
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/full.md
@@ -0,0 +1,416 @@
+# KNOW THYSELF: TRANSFERABLE VISUAL CONTROL POLICIES THROUGH ROBOT-AWARENESS
+
+Edward S. Hu Kun Huang Oleh Rybkin Dinesh Jayaraman
+
+GRASP Lab, University of Pennsylvania
+
+{hued, huangkun, oleh, dineshj}@seas.upenn.edu
+
+# ABSTRACT
+
+Training visual control policies from scratch on a new robot typically requires generating large amounts of robot-specific data. How might we leverage data previously collected on another robot to reduce or even completely remove this need for robot-specific data? We propose a "robot-aware control" paradigm that achieves this by exploiting readily available knowledge about the robot. We then instantiate this in a robot-aware model-based RL policy by training modular dynamics models that couple a transferable, robot-aware world dynamics module with a robot-specific, potentially analytical, robot dynamics module. This also enables us to set up visual planning costs that separately consider the robot agent and the world. Our experiments on tabletop manipulation tasks with simulated and real robots demonstrate that these plug-in improvements dramatically boost the transferability of visual model-based RL policies, even permitting zero-shot transfer of visual manipulation skills onto new robots. Project website: https://www.seas.upenn.edu/~hued/rac
+
+# 1 INTRODUCTION
+
+Raw visual observations provide a versatile, high-bandwidth, and low-cost information stream for robot control policies. However, despite the huge strides in machine learning for computer vision tasks in the last decade, extracting actionable information from images remains challenging. As a result, even simple robotic tasks such as vision-based planar object pushing commonly require data collected over many hours of robot interaction to learn effective policies. This data collection cost would be amortized if the learned policies could transfer reliably and easily to new target robots. For example, a hospital adding a new robot to its robot fleet could simply plug in their existing policies and start using it immediately. Going further, other hospitals looking to automate the same tasks could purchase a robot of their choice and download the same policy models.
+
+However, such transferable policies are difficult to achieve in practice. Even when the task setting, such as the hospital, remains unchanged, the changed visual appearance of the robot itself leads to out-of-distribution inputs for visual policies pre-trained on other robots. This issue particularly affects manipulation tasks: manipulation involves operating in intimate proximity with the environment, and any cameras set up to observe the environment cannot avoid also observing the robot.
+
+There is a way out of this bind: most robots are capable of highly precise proprioception and kinesthesia to sense body poses and movements through internal sensors. We propose to develop "robot-aware" policies that can benefit from distinguishing pixels corresponding to the robot agent from those corresponding to the rest of the "world" in image observations.
+
+Our robot-aware policies treat the robot and the world differently, to their advantage. While this general principle applies broadly to all visual controllers, we demonstrate the advantages of robot awareness in model-based reinforcement learning (MBRL) policies. MBRL policies work by planning through visual dynamics models that are trained to predict the consequences of agent actions. First, we inject robot awareness into the dynamics model, by factorizing it into robot-specific "robot" dynamics and robot-aware "world" dynamics. Figure 1 shows a schematic. Our experiments show that composing these two modules permits reliably transferring visual dynamics models even across robots that look and move very differently. Next, we design a robot-aware planning cost over the separated robot and world pixels. We show that this not only allows visual task reward specifications to transfer from a source to a target robot, it even leads to gains on the source robot itself by allowing the policy to reason separately about the robot and its environment.
+
+
+Figure 1: (Left) As part of our method, robot-aware control (RAC), we propose to factorize visual dynamics into a robot and world model. (Right) The world model is then readily reused with a new robot, permitting plug-and-play transfer.
+
+We evaluate our method, robot-aware control (RAC), on simulated and real-world tabletop object pushing and pick-and-place tasks, demonstrating the importance of each robot-aware component. We show that a RAC policy trained on a single, low-cost 5-DoF WidowX arm can transfer entirely "zero-shot" to a very different 7-DoF Franka Panda arm in the real world. To our knowledge, this is the first demonstration of zero-shot visual skill transfer between real-world robots, and also the first instance of transfer after training on only one source robot.
+
+# 2 BECOMING AWARE OF THE ROBOT AGENT IN THE SCENE
+
+We set up our robot-aware control approach by starting with the question: what is required to be "aware of the robot" in a vision-based manipulation setting?
+
+First, a robot-aware agent must locate the robot in the visual observation from the camera. Consider, for example, a manipulation task involving a standard robot arm, as in Fig 1. At each discrete timestep $t$ , the input to the agent's policy is an RGB image observation $o(t)$ from a static camera observing the robot workspace. Since the robot must operate in close proximity with objects in the workspace, these images contain parts of the robot's body as well as the rest of the workspace. We define a visual projection function $I(\cdot)$ that maps from true robot state $r$ and "world" (i.e., the rest of the workspace) state $w$ to the image observation $o(t) = I(r(t), w(t))$ . Robot states $r$ could be robot joint angles, and world states $w$ could be object poses in the workspace.
+
+Note that the robot's state $r(t)$ is readily available in high precision through internal joint encoders. Further, a full geometric specification of the robot shape and joint degrees of freedom may be assumed available (usually from the manufacturer). Finally, techniques for camera-to-robot calibration are increasingly robust and efficient, to the point of acquiring calibration from even a single image when the robot shape is known as above (Labbe et al., 2021; Lee et al., 2020). Combining these, we may simply project the articulated robot shape through the camera parameters to obtain the visual projection of the robot in the scene, see Supp. A.11 for details. When parts of this projection may be occluded, we may further use RGB-D observations to easily identify and handle them. We represent this as an image segmentation mask $M_r(t)$ of the same height and width as image observations $o(t)$ : $M_r$ is 1 on robot pixels and 0 elsewhere. We show examples of such masks in Fig 2. This simple process effectively spatially disentangles robot pixels from world pixels in image observations $o(t)$ . This spatial disentanglement is a key building block for our robot-aware visual policies, since it permits treating robot and world pixels differently. $^1$
+
+Second, with common high-level robot action spaces used in reinforcement learning (such as end-effector displacement actions), it may even be possible to analytically predict future robot states $r'$ given the current state $r$ and the action $a$ : $P_r(r, a) = r'$ . This is not a strict requirement for robot-aware control, and we may instead simply learn the robot-specific dynamics model $P_r$ from a small amount of experience. However, as we will show in our experiments, analytical $P_r$ models work well for our manipulation tasks, and further, they permit fully zero-shot transfer to a new robot.
+
+# 3 TRANSFERABLE ROBOT-AWARE MODEL-BASED RL POLICIES
+
+Above, we have described how a policy might be "robot-aware" by spatially disentangling the robot in its observations, and utilizing knowledge of its dynamics. We now show how such robot-awareness enables effective visual control policies that can be readily transferred between robots. In particular, we instantiate a robot-aware model-based reinforcement learning agent. Continuing in the manipulation setting from Sec 2, assume that tasks are specified through a goal image that exhibits the target configuration of the workspace. Given the goal image $o_g = I(r_g, w_g)$ , the agent must execute a sequence of actions $\boldsymbol{a}_0^T = (a(0), a(t + 1), \dots, a(T))$ to reach that goal, where $T$ is a time limit. Success is typically measured by how close the final world state is to the goal image. For example, the goal image might show a specific goal orientation of objects on a table, in which case success might be measured in terms of how close the objects are to their goals.
+
+To solve such tasks, we inject robot-awareness into a widely used model-based reinforcement learning paradigm for robots: visual foresight (VF) (Finn & Levine, 2017; Ebert et al., 2018). Standard VF involves two key steps:
+
+- Visual dynamics modeling: The first step is to perform exploratory data collection on the robot to generate a dataset $\mathcal{D}$ of transitions $(o(t),a(t),o(t + 1))$ . Dropping time indices, we sometimes use the shorthand $(o,a,o^{\prime})$ to avoid clutter. Then, a visual dynamics model $P$ is trained on this dataset $\mathcal{D}$ to predict $o^{\prime}$ given $o$ and $a$ as inputs, i.e. $o^{\prime} \approx P(o,a)$ . When the robot state $r$ is available, it is sometimes included as a third input to $P$ to assist in dynamics modeling.
+- Visual MPC: Given the trained dynamics model $P$ , VF approaches search over action sequences $\pmb{a}_0^T$ to find the sequence whose outcome will be closest to the goal specification $o_g$ , as predicted by $P$ . For outcome prediction, they apply $P$ recursively, as $\delta(o(0), \pmb{a}) = P(P(\dots P(o(0), a(0)), a(1)), \dots, a(T))$ . Then, they pick the action sequence $\pmb{a}^*(o(0), o_g) = \arg \min_{\pmb{a}} C(\delta(o(0), \pmb{a}), o_g)$ , where the cost function $C$ is commonly the mean pixel-wise $\ell_2$ error between the predicted image and the goal image. Sometimes, rather than measure the error of only the final image, the cost function may sum the errors of all intermediate predictions. For closed-loop control, only the first action $a^*(0)$ is executed; then, a new image $o(1)$ is observed, and a new optimal action sequence $\pmb{a}_1^{T^*}(o(1), o_g)$ is computed, and the process repeats. For action sequence optimization, we found the cross-entropy method (CEM) (De Boer et al., 2005) to be sufficient, although more sophisticated optimization methods (Zhang et al., 2019; Rybkin et al., 2021) could also work well.
+
+To train reliable dynamics models $P$ , visual foresight approaches commonly require many hours of exploratory robot interaction (Finn & Levine, 2017; Ebert et al., 2018) even for simple tasks. Data requirements may be reduced a little by interleaving model training with data collection: in this case, data is collected by selecting goal images and then running visual MPC using the most recently trained dynamics model to reach those goals. However, such goal selection must be designed to match the target task(s), which may trade off task generality for sample complexity.
+
+# 3.1 IMPROVING VISUAL FORESIGHT THROUGH ROBOT-AWARENESS
+
+Having trained one data-hungry visual dynamics model $P$ on one robot, do we still need to repeat this process from scratch on a new robot aiming to perform the same tasks? In standard VF, the answer is unfortunately yes, for two main reasons: (1) With the new robot, all observations $o(t) = I(r_{\mathrm{new}}(t),w(t))$ are out-of-domain for $P$ . Further, the visual dynamics of the new robot may be very different, as between a green 3-DOF robot arm, and a red 5-DOF robot arm. (2) As described above, standard VF approaches operate by aiming to match the goal image. However, since the observations contain the robot, they commonly require the task specification image $o_g = I(r_g,w_g)$ itself to contain the robot in a plausible goal-reaching pose. This makes task specification more difficult, and also robot-specific: it is impossible to plan to reach $o_g$ using a different robot. We show how VF policies may overcome these obstacles through robot-awareness.
+
+# 3.1.1 ROBOT-AWARE MODULAR VISUAL DYNAMICS
+
+How can robot-awareness be useful in visual dynamics modelling? Recall from Sec 2 that the robot is both spatially disentangled and its dynamics are known to us as a function $P_r(r, a) = r'$ , where ' denotes the next timestep. Here, we propose to exploit this by effectively factorizing the visual dynamics into world and robot dynamics terms.
+
+
+Figure 2: The visual dynamics architecture is composed of an analytical robot model $P_r$ , and the learned $P_w$ world model. During robot transfer, the target robot's analytical model is used.
+
+Given the robot state $r$ and the image observation $o$ , we first compute the projected robot mask $M_r$ as above, then mask out the robot in the image to obtain $o_w = o \circ (1 - M_r)$ , where $\circ$ is the pixel-wise product. See Fig 2 for examples of such masked images. Now, we train a world-only dynamics model $P_w$ by minimizing the following error, summed over all transitions in the training dataset $\mathcal{D}$ :
+
+$$
+\mathcal {L} _ {w} = \left\| P _ {w} \left(o _ {w}, r, r ^ {\prime}, a\right) - o _ {w} ^ {\prime} \right\|, \tag {1}
+$$
+
+where the next robot state is computed using the known robot dynamics, as $r' = P_r(r, a)$ . Treating all dynamics models as probabilistic, this is equivalent to the following decomposition of full visual dynamics into a robot dynamics module $P_r$ and a world dynamics module $P_w$ :
+
+$$
+P \left(r ^ {\prime}, o _ {w} ^ {\prime} \mid r, o _ {w}, a\right) = P _ {r} \left(r ^ {\prime} \mid r, a\right) P _ {w} \left(o _ {w} ^ {\prime} \mid o _ {w}, r, r ^ {\prime}, a\right). \tag {2}
+$$
+
+What advantage does this modularity offer? First, since $P_w$ largely captures the physics of objects in the workspace, we hypothesize that it can be shared across very different robots. Second, $P_r$ is commonly available for every robot "out-of-the-box" as described in Sec 2, requiring no data collection or training. Together, this paves the way for zero-shot transfer of visual dynamics.
+
+Specifically, suppose that a robot-aware world-only dynamics module $P_w$ has been trained on a robot arm $R_1$ with robot dynamics $P_{R1}$ for various manipulation tasks as seen in Figure 1. The full dynamics model, used during visual MPC, would be $P_1 = P_{R1}P_w$ as in equation 2. Then, given a new robot arm $R_2$ with dynamics $P_{R2}$ , its full dynamics model $P_2 = P_{R2}P_w$ is available without any new data collection at all. We validate this in our experiments, demonstrating few-shot and zero-shot transfer of $P_w$ between very different robots.
+
+# 3.1.2 ROBOT-AWARE PLANNING COSTS
+
+Recall that the visual MPC stage in VF relies on the planning cost function $C(\hat{o}, o_g)$ , which measures the distance between a predicted future observation $\hat{o}$ and the goal $o_g$ . It is clear that for any task, the ideal planning cost is best specified as some function of the robot configurations $r$ and the world configurations $w$ . However, since only image observations are available, it is common in VF to aim to minimize a pixel-wise error planning cost (Tian et al., 2019; Nair & Finn, 2020; Jayaraman et al., 2019), such as $C(\hat{o}, o_g) = \| \hat{o} - o_g\|_2^2$ . Instead, our spatially disentangled observations $o \rightarrow (r, o_w)$ make it possible to produce the decomposed robot-aware cost:
+
+$$
+C \left(\hat {r}, \hat {o} _ {w}, r _ {g}, o _ {w, g}\right) = \lambda \left\| \hat {r} - r _ {g} \right\| + \left\| \hat {o} _ {w} - o _ {w, g} \right\| \tag {3}
+$$
+
+The first term in this expression is the robot cost scaled by $\lambda$ and the second term is the world cost. We compute a robot cost that is usable by all robots such as end effector distance, and compute the world cost by measuring pixel-wise distance over the world region of the predicted and goal image.
+
+Why should this decomposed cost help? This robot-aware cost makes it possible to separately modulate the extent to which robot and world configurations affect the planning cost. To motivate this, observe that the basic pixel-wise cost suffers from a key problem: it is affected inordinately by the spatial extents of objects in the scene, so that large objects get weighted more than small objects. Indeed, Ebert et al. (2018) report that the robot arm itself frequently dominates the pixel cost in
+
+
+Figure 3: The behavior of the pixel and RA cost between the current images of a feasible trajectory and the goal image. (Left) The first row shows the trajectory. The next two rows show the heatmaps (pixel-wise norm) between the image and goal for each cost. The heatmaps show high cost values in the robot region, while the RA cost heatmaps correctly have zero cost in the robot region. (Right) The relative pixel cost fails to decrease as the trajectory progresses, while the RA cost correctly decreases.
+
+manipulation. This means that the planner often selects actions that match the robot position in a goal image, ignoring the target objects. See Figure 3 for a visual example of the pixel cost behavior and its failure to compute meaningful costs for planning. As a result, even if the task involves displacing an object, the goal image is usually required to contain the robot in a plausible pose while completing the task (Nair & Finn, 2020). For our goal of robot transfer, this is an important obstacle, since the task specification is itself robot-specific. Even ignoring transfer, robot-dominant planning costs hurt performance, and gathering goal images with the robot is cumbersome. Our approach does not require robots to be in plausible task completion positions in the goal images. In fact, they may even be completely absent from the scene. In our experiments, we use goal images without robots, and sometimes with humans in place of robots. To handle them, we could set $\lambda$ to 0 in the above equation to instantiate a cost function that only focuses on the world region.
+
+Some VF-based methods do handle goal images without robots; however, they typically require all input images for dynamics and planning to also omit the robot, so that image costs are exclusively influenced by the world configurations $w$ (Wang et al., 2019; Pathak et al., 2018; Agrawal et al., 2016). For closed-loop controllers, this often means extremely slow execution times, because, at every timestep, the robot must enter the scene, execute an action, and then move out of the camera view. This also eliminates tasks requiring dynamic motions.
+
+Finally, there are efforts to learn more sophisticated cost functions over input images $C_{\theta}(\hat{o},o_g)$ (Nair et al.; Sermanet et al., 2018; Srinivas et al., 2018; Yu et al., 2019; Tian et al., 2021). For example, Nair et al. train a latent representation to focus on portions of the image that are different between the goal and the current image, and show that costs computed over these latents permit better control on one robot. These approaches all learn the cost contributions of different objects or regions, from data. Instead, we directly segment the robot using readily available information. While we restrict our evaluation to basic pixel-based costs, we expect that these other costs will also benefit from spatially disentangled inputs, i.e., $C_{\theta}(\hat{r},\hat{o}_w,r_g,o_{w,g})$ .
+
+# 3.2 IMPLEMENTATION DETAILS
+
+We summarize some key implementation details about the robot-aware model here, and refer the rest to Supp. A.1. For implementing the learned world dynamics model $P_{w}$ , we extended the authors' implementation of the SVG architecture (Denton & Fergus, 2018) to be conditioned on robot actions and states. SVG consists of a convolutional encoder, frame predictor LSTM, and decoder alongside a learned prior and posterior network. The encoder network takes in the RGB image, current mask, and future mask as a 5-channel $64 \times 48$ image. It outputs a spatial latent of dimension (256, 8, 6). Actions and end effector poses are then tiled onto this spatial latent before being fed into the convolutional LSTM. The convolutional LSTM output is then fed into the decoder which outputs the predicted image. Refer to algorithm 1 and 2 for world model training and testing pseudocode.
+
+The world model $P_{w}$ is a CNN that must take the world pixels $o_{w}$ as input and predict future world pixels $o_{w}'$ . Since it cannot selectively process partial images $o_{w}$ , we must instead feed in a
+
+full rectangular image. However, if we trained $P_w$ on full images of the training robots $o$ without modification, then test images with new, different-looking robots would lie outside the training distribution of $P_w$ . To induce some invariance to the robot appearance in $P_w$ , the robot is masked (producing the appearance of a black robot) at training as well as at test time. Note that the world model is still trained based on Eq. 1, which only penalizes errors in world pixels. We use MoveIt, PyRobot, and MuJoCo to implement the analytical robot dynamics for the various robots.
+
+# 4 EXPERIMENTS
+
+Our experiments focus on zero and few-shot transfer across robots for pushing and pick-and-place (Finn & Levine, 2017; Ebert et al., 2018; Dasari et al., 2019): a robot arm must move objects to target configurations, specified by a goal image, on a tabletop. We aim to answer: (1) How does the robot-aware controller compare against standard controllers and a domain adaptation baseline when transferred to a new robot? (2) Which robot-aware components in the visual foresight pipeline are most important for transfer?
+
+Baselines. For evaluating robot-aware dynamics models, we compare against prior visual foresight methods (Ebert et al., 2018; Finn & Levine, 2017) which use action-conditioned models that solely rely on image input (VF), as well as models that rely on robot state and images (VF+State). For our full robot-aware pipeline, we experiment with combinations of predictive models and cost functions to probe their transferability to new robots. Hereafter, we will refer to all controllers by the names of the dynamics model and the cost, e.g., RA/RA for the full robot-aware controller, and VF+State/Pixel for the baseline VF controller. See Table 2 for all controllers. We also compare against an unsupervised domain translation approach (CycleGAN+VF+State/Pixel), based on the human-to-robot imitation policy of Smith et al. (2020), that learns a mapping between target and source robot images for transfer. Note that this policy is few-shot since it is trained on test robot images. See Supp. for additional details about baselines, calibration, data, training, and evaluation.
+
+Transfer settings. We evaluate the transferability of robot-aware control in various configurations:
+
+$\triangleright$ Simulated zero-shot transfer from one robot. Simulation permits a "straight swap" of the robot with perfectly controlled viewpoints and environments. We conduct pushing and pick-and-place experiments by training policies on a 5-DoF WidowX200 arm and evaluating these models zero-shot on an unseen 7-DoF Fetch arm. For the prediction experiment, we train on 10k trajectories of length 30 of the WidowX200 arm performing random actions on the tabletop with several objects, and evaluate on 1000 trajectories of the Fetch robot. See Supp. A.9 for more prediction experiments. For the control experiments, we transfer the WidowX200 trained policies to the Fetch robot and perform pushing and pick-and-place tasks. The CycleGAN (Zhu et al., 2017) (authors' implementation) was trained using 1k videos (12k frames) each of the training and test time robots. See Supp. A.3 for more details on control experiments.
+
+Real zero-shot transfer from one / multiple robot(s). We evaluate zero-shot prediction and control of an unseen Franka robot (Fig. 4) from models trained on $\sim 1.8\mathrm{k}$ videos of a single WidowX200 robot, as well as models trained on a multi-robot dataset (Fig. 4) that randomly perturbs the objects. The multi-robot models are pretrained on 83k videos including 82k RoboNet (Dasari et al., 2019) videos of Sawyer, Baxter, and WidowX robots, and 1k videos from the above WidowX200² dataset. We used a subset of RoboNet for which we were able to manually annotate camera calibration matrices and robot CAD models (see Supp. A.11). After training, we deploy the models to the unseen Franka
+
+and perform pushing tasks.
+
+Next, we evaluate zero-shot prediction of an unseen Modified WidowX200 (Fig. 4) from models trained on the multi-robot dataset. To modify the appearance and dynamics of the WidowX200, we swapped out the
+
+
+Figure 4: WidowX200, Mod. WidowX200, Franka
+
+black $14\mathrm{cm}$ forearm link with a silver $20\mathrm{cm}$ forearm link, and added a foam bumper and sticker. We collected 25 videos of the modified robot for evaluation.
+
+$\triangleright$ Few-shot transfer. Finally, we follow the few-shot transfer setup of Robonet (Dasari et al., 2019) by first pretraining the models on RoboNet data, and then finetuning on $\sim 400$ videos of the WidowX200. We then evaluate the prediction and control performance of the WidowX200 on pushing tasks.
+
+Table 1: World prediction evaluations, reported as average world region PSNR and SSIM over 5 timesteps. We compare against conventional models that use image and/or state (VF and VF+State).
+
+| Model | Zero-shot Sim. Fetch (Train on WidowX200) | Few-shot WidowX200 (Train on 3 robots) | Zero-shot Mod. WidowX200 (Train on 4 robots) | Zero-shot Franka (Train on 4 robots) | Zero-shot Franka (Train on WidowX200) |
| PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ |
| VF | 39.9 | 0.985 | 32.86 | 0.939 | 30.59 ± 3.18 | 0.913 ± 0.04 | 28.31 ± 3.35 | 0.901 ± 0.04 | 28.42 ± 3.43 | 0.905 ± 0.04 |
| VF+State | - | - | 33.05 | 0.941 | 31.03 ± 3.17 | 0.915 ± 0.04 | 29.19 ± 3.02 | 0.901 ± 0.04 | 28.31 ± 3.18 | 0.894 ± 0.05 |
| RA (Ours) | 41.8 | 0.990 | 33.26 | 0.944 | 31.83 ± 2.88 | 0.924 ± 0.03 | 29.37 ± 2.93 | 0.904 ± 0.04 | 29.63 ± 3.00 | 0.928 ± 0.03 |
+
+
+Figure 5: Model outputs of the zero-shot experiments. First row: the RA model is able to predict contact with the green box, while the baseline (VF+State) predicts none. Next row: the RA-model models the downward motion of the octopus more accurately. Refer to the website for videos.
+
+Results: Transferring visual dynamics models across robots. the Table 1 shows quantitative prediction results for average PSNR and SSIM per timestep over a 5-step horizon, computed over the world region. Peak signal to noise ratio (PSNR) and structural similarity index metric (SSIM) are widely used metrics used for evaluating video prediction approaches. PSNR scales the inverse MSE error logarithmically, and SSIM measures similarity over local patches instead of per-pixel. The robot-aware world dynamics module $P_{w}$ outperforms the baselines across all zero-shot and few-shot transfer settings, simulated and real, on both metrics. To supplement the quantitative metrics, Fig 5 shows illustrative examples of 5-step prediction, where we recursively run visual dynamics models to predict images 5 steps out from an input.
+
+We show more examples of prediction results in the Supp. and website. Some key observations: first, the VF+State baseline overlays the original robot over the target robot rather than moving the target robot (see Figure 5, bottom right). Next, RA produces relatively sharper object images and more accurate object motions, as with the pink octopus toy in Figure 5. Finally, while both VF+State and RA predict motions better for large objects, VF+State more frequently predicts too small, or even zero object motions (see Figure 5, top right). Our RA approach can use known robot dynamics for accurate robot state predictions, which in turn reduces uncertainty in predicting object interaction. As we will show next, these performance differences in object dynamics prediction are crucial for successfully executing manipulation tasks.
+
+Results: Transferring visual policies across robots. We now evaluate our full robot-aware MBRL pipeline on simulated and real pushing tasks, as well as a simulated pick-and-place task. This jointly evaluates the RA dynamics models and the RA planning cost.3 Pushing tasks are specified by a single goal image, while pick-and-place tasks are specified by three goals for picking, lifting, and placing. After each evaluation episode, we measure the distance between the moved object's current and goal position. We define a successful episode as a distance under 5cm for the pushing task, and under 2.5cm for the pick-and-place task. For each task, we use an object-only goal image where the
+
+
+Figure 6: Example results from the control experiments (full videos on website). We show the start, goal, and end states of RA/RA and baseline (VF+State/Pixel). The goal image is overlaid on top of the end state for visual reference.
+
+Table 2: Zero-shot control results. All models are trained on a single robot (WidowX200) unless denoted otherwise. Note the CycleGAN baseline is trained on 12k images of the test-time robot.
+
+| Dynamics Model | Cost | Fetch Push (Sim.) | Fetch Pick-and-place (Sim.) | Franka Push (Real) |
| CycleGAN+VF+State | Pixel | 12/20 (60%) | 0/20 (0%) | - |
| VF+State | Pixel | 0/20 (0%) | 0/20 (0%) | 0/30 (0%) |
| RA | Pixel | 0/20 (0%) | 0/20 (0%) | 0/30 (0%) |
| VF+State | RA | 12/20 (60%) | 4/20 (20%) | 6/30 (20%) |
| RA | RA | 18/20 (90%) | 8/20 (40%) | 22/30 (71%) |
| VF+State (Multi-robot) | Pixel | - | - | 11/30 (36%) |
| RA (Multi-robot) | RA | - | - | 27/30 (90%) |
+
+object is in the correct configuration, but the robot is not in the image. For pushing, we vary the goal position and object per trial and for pick-and-place, we vary the block initialization and goal position. See Supp. A.3 and A.5 for more details.
+
+Table 2 and 3 shows that RA/RA achieves the highest success rate in all tasks and transfer settings. Note that our method's success rate (40%) on pick-and-place is not much worse than our method's success rate of 55% on the source robot (see Supp. A.10 for all source robot results), which shows our method is robust to robot transfer. We observed two primary failure modes of the VF baselines in zero-shot scenarios. First, both VF+State/Pixel and RA/Pixel, which optimized the pixel cost, tend to retract the arm back into its base, because the cost penalizes the arm for contrasting against the background of the goal image as seen in Figure 6. Next, consistent with the prediction results, VF+State/Pixel and VF+State/RA suffer from predicting blurry images of the training robot and inaccurate object dynamics, which negatively impacts planning.
+
+The CycleGAN baseline performs moderately well in pushing (60% success) but completely fails in pick-and-place (0% success). Qualitatively, the CycleGAN baseline correctly moves to pick the block, but nearly always fails by selecting an unstable grasp, where the block slips through the gripper. Note that the CycleGAN itself is trained correctly: it successfully produces visually high quality domain-translated images of Fetch-to-WidowX (see website). However, transferring dynamics models for grasping requires very precise domain translation, which CycleGAN is unable to achieve even when trained with 12k images of the target robot.
+
+The failure of the baselines to transfer zero-shot is expected, since generalizing to a new robot from training on a single robot dataset is a daunting task. One natural improvement is to train on multiple robots before transfer to facilitate generalization. We evaluate RA/RA and $\mathrm{VF + }$ State/Pixel in this multi-robot pretraining setting, where they are trained on RoboNet videos in addition to our WidowX200 dataset. As Table 2 ("Multi-robot" rows) shows, the VF+State/Pixel improves with training on additional robots, but still falls far short of RA/RA trained on even a single robot. RA/RA improves still further with multi-robot pretraining.
+
+$\triangleright$ Few-shot transfer. In this setting, dynamics models are pretrained on RoboNet and finetuned on $\sim 400$ videos of the WidowX200. As Table 3 shows, RA/RA significantly outperforms the baseline controller. Due to the baseline's inability to model object dynamics aside from the largest object, it succeeds only on pushes with the largest object. The RA model adequately models object dynamics for all object types, and is able to succeed at least once for each object (see Supp. A.5 for
+
+Table 3: Few-shot transfer to WidowX200 control results.
+
+| Dynamics Model | Cost | Success |
| VF | Pixel | 4/50 (8%) |
| RA | RA | 40/50 (80%) |
+
+# 5 OTHER RELEVANT PRIOR WORK
+
+Several works have focused on transferring controllers between tasks (Duan et al., 2017; Finn et al., 2017b), environments (Finn et al., 2017a), and simulation-to-real (Tobin et al., 2017), but relatively little attention has been paid to few / zero-shot transfer across distinct robots. Aside from RoboNet (Dasari et al., 2019), discussed above, a few prior works have studied providing the robot morphology as input to model-free RL policies, enabling transfer to new robots (Chen et al., 2018; Devin et al., 2017; Wang et al., 2018).
+
+Devin et al. (2017) train modular policies containing a robot module and a task module, both learned from data, but requires data gathered on the new robot for training the robot-specific module before transfer is possible. Chen et al. (2018) propose to train a "universal" policy conditioned on the robot hardware specification, but must train on many robots to permit transfer, and operates on low-dimensional states. In contrast, RAC transfers visual policies after training even on a single robot. For simulated snake and centipedes robots with repeated chained segments, NerveNet (Wang et al., 2018) demonstrates transferable state-based locomotion skills by running a graph neural network policy over the known chain structure. This permits transfer, for example, from a centipedes with 4 chained segments to one with 10 identical chained segments. RAC targets more challenging settings: visual object interaction and manipulation on real robots with varied morphologies and appearances. RAC is also technically distinct: it trains a model-based goal-reaching controller, while these prior methods (Devin et al., 2017; Chen et al., 2018; Wang et al., 2018) train model-free task-specific policies. Richard et al. (2021) concurrently propose a decomposed world and robot state dynamics model to enable zero-shot transfer across robots in state-based navigation with sim-to-real training, whereas we evaluate our method on transfer of vision-based manipulation skills and train on real data.
+
+Other works train visual representations that generalize to different embodiments, such as humans or other robots, and use them to infer rewards for RL (Zakka et al., 2021; Zhou et al., 2021; Smith et al., 2020; Sermanet et al., 2018). However, these methods require access to images or significant experience on the test-time robot. For example, Zakka et al. (2021) learn task-specific rewards (e.g. block pushing) and require $\sim 100\mathrm{k}$ steps on the test robot to learn. In contrast, RAC's world dynamics model can be reused across tasks, and can achieve multiple tasks through goal image specification.
+
+Finally, our work has interesting connections to "contingency awareness" in cognitive science (Watson, 1966), that has also been studied for RL (Bellemare et al., 2021; Choi et al., 2018): in simple 2D Atari games, they show that learning to localize the agents in image observations can improve model-free visual reinforcement learning and exploration. We operate in more complex real-world robotic settings, and focus on transferring model-based policies across agents.
+
+# 6 CONCLUSION
+
+We have studied the challenging task of transferring learned visual control policies for object manipulation across robot arms that might be very different in their appearance and capabilities. Our "robot-aware control" (RAC) paradigm, when used in widely used model-based RL algorithms, convincingly transfers zero-shot to unseen real and simulated robots for object manipulation for the first time, and also yields large gains for few-shot transfer. RAC benefits from a world model that aims to capture the physics of the environment independent of the robot so as to be fully transferable. Implemented with pixel models and costs, RAC's world model is still subject to limitations: it is tied to the end-effector action space and even to the shape of the source robots, which may inhibit transfer in more extreme settings. Further, the operating environment and its physics might differ from one robot to the next. We will aim to address these limitations and challenges in future work.
+
+# 7 ACKNOWLEDGEMENTS AND DISCLOSURE OF FUNDING
+
+This work was partly supported by an Amazon Research Award to DJ. The authors would like to thank Karl Schmeckpeper and Leon Kim for technical guidance, the anonymous reviewers for their constructive feedback, and the Perception, Action, and Learning Group (PAL) for general support.
+
+# 8 REPRODUCIBILITY STATEMENT
+
+To ensure reproducibility, we will release the codebase that contains our video prediction and control algorithms, as well as weights for our trained models. The supplementary contains details about hyperparameters (Supp. A.2) and architecture (Supp. A.1). For datasets, we will release our subset of RoboNet labeled with robotic masks, and our WidowX video dataset. We provide details of our mask labeling process in Supp. A.11, and the labeling code will be in the codebase. See the website for the code https://www.seas.upenn.edu/~hued/rac.
+
+# REFERENCES
+
+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.
+Marc Bellemare, Joel Veness, and Michael Bowling. Investigating contingency awareness using atari 2600 games. Proceedings of the AAAI Conference on Artificial Intelligence, 26(1):864-871, Sep. 2021.
+Tao Chen, Adithyavairavan Murali, and Abhinav Gupta. Hardware conditioned policies for multirobot transfer learning. In Advances in Neural Information Processing Systems, 2018.
+Jongwook Choi, Yijie Guo, Marcin Moczulski, Junhyuk Oh, Neal Wu, Mohammad Norouzi, and Honglak Lee. Contingency-aware exploration in reinforcement learning. arXiv preprint arXiv:1811.01483, 2018.
+Sudeep Dasari, Frederik Ebert, Stephen Tian, Suraj Nair, Bernadette Bucher, Karl Schmeckpeper, Siddharth Singh, Sergey Levine, and Chelsea Finn. Robonet: Large-scale multi-robot learning. In Conference on Robot Learning, 2019.
+Pieter-Tjerk De Boer, Dirk P Kroese, Shie Mannor, and Reuven Y Rubinstein. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19-67, 2005.
+Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In International Conference on Machine Learning, 2018.
+Coline Devin, Abhishek Gupta, Trevor Darrell, Pieter Abbeel, and Sergey Levine. Learning modular neural network policies for multi-task and multi-robot transfer. In IEEE International Conference on Robotics and Automation, 2017.
+Yan Duan, Marcin Andrychowicz, Bradly Stadie, Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in Neural Information Processing Systems, pp. 1087-1098, 2017.
+Frederik Ebert, Chelsea Finn, Sudeep Dasari, Annie Xie, Alex Lee, and Sergey Levine. Visual foresight: Model-based deep reinforcement learning for vision-based robotic control. arXiv preprint arXiv:1812.00568, 2018.
+Aaron Edsinger and Charles C Kemp. What can i control? a framework for robot self-discovery. In 6th International Conference on Epigenetic Robotics, 2006.
+Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In IEEE International Conference on Robotics and Automation, 2017.
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126-1135, 2017a.
+
+Chelsea Finn, Tianhe Yu, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot visual imitation learning via meta-learning. In Conference on Robot Learning, pp. 357-368, 2017b.
+Dinesh Jayaraman, Frederik Ebert, Alexei A Efros, and Sergey Levine. Time-agnostic prediction: Predicting predictable video frames. In International Conference on Learning Representations, 2019.
+Yann Labbe, Justin Carpentier, Mathieu Aubry, and Josef Sivic. Single-view robot pose and joint angle estimation via render & compare. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1654-1663, 2021.
+Timothy E Lee, Jonathan Tremblay, Thang To, Jia Cheng, Terry Mosier, Oliver Kroemer, Dieter Fox, and Stan Birchfield. Camera-to-robot pose estimation from a single image. In IEEE International Conference on Robotics and Automation, pp. 9426-9432, 2020.
+Philipp Michel, Kevin Gold, and Brian Scassellati. Motion-based robotic self-recognition. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2004.
+Suraj Nair and Chelsea Finn. Hierarchical foresight: Self-supervised learning of long-horizon tasks via visual subgoal generation. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=H1gzR2VKDH.
+Suraj Nair, Silvio Savarese, and Chelsea Finn. Goal-aware prediction: Learning to model what matters. In Proceedings of the 37th International Conference on Machine Learning.
+Lorenzo Natale, Francesco Orabona, Giorgio Metta, and Giulio Sandini. Sensorimotor coordination in a "baby" robot: learning about objects through grasping. Progress in brain research, 164: 403-424, 2007.
+Deepak Pathak, Parsa Mahmoudieh, Guanghao Luo, Pulkit Agrawal, Dian Chen, Yide Shentu, Evan Shelhamer, Jitendra Malik, Alexei A Efros, and Trevor Darrell. Zero-shot visual imitation. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 2050-2053, 2018.
+Kanishka Rao, Chris Harris, Alex Irpan, Sergey Levine, Julian Ibarz, and Mohi Khansari. Rl-cyclegan: Reinforcement learning aware simulation-to-real. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
+Dripta S. Raychaudhuri, Sujoy Paul, Jeroen van Baar, and Amit K. Roy-Chowdhury. Cross-domain imitation from observations. In International Conference on Machine Learning, 2021.
+Antoine Richard, Stephanie Aravecchia, Matthieu Geist, and Cedric Pradalier. Learning behaviors through physics-driven latent imagination. In Conference on Robot Learning, 2021.
+Josh Roy and George Konidaris. Visual transfer for reinforcement learning via wasserstein domain confusion. In Association for the Advancement of Artificial Intelligence, 2021.
+Oleh Rybkin, Chuning Zhu, Anusha Nagabandi, Kostas Daniilidis, Igor Mordatch, and Sergey Levine. Model-based reinforcement learning via latent-space collocation. International Conference on Machine Learning (ICML), 2021.
+Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, and Sergey Levine. Time-contrastive networks: Self-supervised learning from video. In IEEE International Conference on Robotics and Automation, pp. 1134–1141, 2018.
+Laura Smith, Nikita Dhawan, Marvin Zhang, Pieter Abbeel, and Sergey Levine. AVID: learning multi-stage tasks via pixel-level translation of human videos. In Robotics: Science and Systems, 2020.
+Aravind Srinivas, Allan Jabri, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Universal planning networks. arXiv preprint arXiv:1804.00645, 2018.
+S. Tian, F. Ebert, D. Jayaraman, M. Mudigonda, C. Finn, R. Calandra, and S. Levine. Manipulation by feel: Touch-based control with deep predictive models. In 2019 International Conference on Robotics and Automation (ICRA), pp. 818-824, 2019. doi: 10.1109/ICRA.2019.8794219.
+
+Stephen Tian, Suraj Nair, Frederik Ebert, Sudeep Dasari, Benjamin Eysenbach, Chelsea Finn, and Sergey Levine. Model-based visual planning with self-supervised functional distances. In International Conference on Learning Representations, 2021.
+Maxim Tkachenko, Mikhail Malyuk, Nikita Shevchenko, Andrey Holmanyuk, and Nikolai Liubimov. Label Studio: Data labeling software, 2020-2021. URL https://github.com/heartexlabs[label-studio.
+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 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 23-30. IEEE, 2017.
+Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033, 2012.
+Angelina Wang, Thanard Kurutach, Kara Liu, Pieter Abbeel, and Aviv Tamar. Learning robotic manipulation through visual planning and acting. arXiv preprint arXiv:1905.04411, 2019.
+Tingwu Wang, Renjie Liao, Jimmy Ba, and Sanja Fidler. Nervenet: Learning structured policy with graph neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=S1sqHMZCb.
+John S Watson. The development and generalization of "contingency awareness" in early infancy: Some hypotheses. *Merrill-Palmer Quarterly of Behavior and Development*, 12(2):123-135, 1966.
+Brian Yang, Dinesh Jayaraman, Glen Berseth, Alexei Efros, and Sergey Levine. Mavric: Morphology-agnostic visual robotic control. ICRA and RA-L, 2020.
+Tianhe Yu, Gleb Shevchuk, Dorsa Sadigh, and Chelsea Finn. Unsupervised visuomotor control through distributional planning networks. In Proceedings of Robotics: Science and Systems (RSS), June 2019.
+Kevin Zakka, Andy Zeng, Pete Florence, Jonathan Tompson, Jeannette Bohg, and Debidatta Dwibedi. XIRL: Cross-embodiment inverse reinforcement learning. In Conference on Robot Learning, 2021.
+Marvin Zhang, Sharad Vikram, Laura Smith, Pieter Abbeel, Matthew Johnson, and Sergey Levine. SOLAR: Deep structured representations for model-based reinforcement learning. In International Conference on Machine Learning, 2019.
+Yuxiang Zhou, Yusuf Aytar, and Konstantinos Bousmalis. Manipulator-independent representations for visual imitation. Robotics: Science and Systems, 2021.
+Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In IEEE International Conference on Computer Vision, 2017.
+
+# A APPENDIX
+
+We encourage the reader to visit the website at the url: https://www.seas.upenn.edu/~hued/rac for an explanation video and additional video visualizations.
+
+# A.1 NETWORK DETAILS
+
+The robot-aware dynamics model described in Section 3.1.1 consists of two modules, an analytical robot-specific dynamics model $P_r$ and a learned, visual dynamics world model $P_w$ . The robot dynamics model is required to predict the next robot state $r'$ (end effector pose and mask) from the current robot state $r$ and action $a$ and feed that as input into the world model. This future robot state and mask is useful for the world model to predict the overall future state, as it can infer object displacement from such information.
+
+Neural network architecture for the learned visual dynamics $P_{w}$ . We extend the stochastic video generation (SVG) architecture (Denton & Fergus, 2018) which consists of the convolutional encoder, frame predictor LSTM, and decoder alongside a learned prior and posterior.
+
+The encoder consists of 4 layers of VGG blocks (convolution, batch norm, leaky RELU) and passes skip connections to the decoder. We use a convolutional LSTM for the learned prior, posterior, and frame predictor. As seen in Figure 2, visual data such as the current RGB observation $o_w$ with dimension (3,48,64), current mask with dimension (1,48,64), and future mask $M_r$ , $M_{r'}$ (1,48,64) are concatenated channel-wise and fed into the encoder, which convolves the input into a feature map of dimension (256, 8, 8). Additional data such as the action, current state, and future state are tiled onto the feature map before being passed into the recurrent frame predictor, outputting a feature map of size (256, 8, 8) that gets decoded into the next RGB image $o'$ .
+
+Generating predictions from the dynamics model at test time. During training, the RA-model utilizes ground truth future robot state as input for prediction since all data is recorded in advance. From our prediction results in Table 1, we find that using future robot state and masks to be useful for future prediction. But how might we produce the future input $r'$ for $P_w$ during test time?
+
+We use the analytical dynamics model $P_r$ as described in Section 3.1.1 to compute the future inputs. We now describe this process with more detail. The analytical dynamics model $P_r$ predicts the future robot state $r'$ as a function of the current state $r$ and action $a$ . For example, if the control commands are robot end-effector displacements, then the robot state $r$ is the gripper pose, and next state $r' = P(r, a) = r + a$ . Then, to obtain the masks, we must compute the full robot pose and its visual projection in two simple steps. First, we compute the joint positions using inverse kinematics $q' = \mathrm{IK}(r')$ , and then project the joint positions into a mask $M_{r'} = \mathrm{Project}(q')$ . We use the analytical inverse kinematics solver from the PyRobot library to obtain future joint positions for the WidowX200 while for the Franka, we use the MoveIt! motion planning ROS package.
+
+Next, we use a simulator such as MuJoCo that supports 3D rendering of the robot along with camera calibration to project the image of the virtual robot into a 2D mask. These steps are also important for recursively applying the dynamics models to produce "rollouts". Given a starting image $o(t)$ and actions $a(t + 1), a(t + 2), \dots, a(T)$ , we can predict $\hat{o}(t + 1)$ as above. To predict $\hat{o}(t + 2)$ , $P_w$ needs as input $M(t + 1), M(t + 2), r(t + 1), r(t + 2)$ , all of which are inferred as above through the analytical dynamics $P_r$ . Algorithm 2 provides pseudocode to generate such rollouts.
+
+RA-loss implementation. In Algorithm 3, we provide a PyTorch implementation of the robot-aware dynamics loss (eq. 1) over RGB images. Note that the principle of separating the robot region and world region in the loss computation is general, and can be applied to other state formats as well.
+
+# A.2 VISUAL DYNAMICS EXPERIMENT DETAILS
+
+We now present some details of the visual dynamics experiments in Section 1 where we evaluated models on unseen robots as seen in Figure 4.
+
+Training and finetuning details. Models were pretrained for 150,000 gradient steps on the RoboNet dataset with the Adam optimizer, learning rate $3\mathrm{e} - 4$ and batch size of 16. We use scheduled sampling to change the prediction loss from 1-step to 5-step future prediction over the course of training. For
+
+Algorithm 1 TRAIN
+1: Input: World model $W$ , analytical model $R$ , image sequence $o(1) \ldots o(T + 1)$ , mask sequence $M_r(1) \ldots M_r(T + 1)$ , state sequence $r(1) \ldots r(T + 1)$ , actions $a(1), \ldots, a(T)$ .
+2: $\hat{O}_w \gets \{\}$
+3: $O_w \gets \{(1 - M_r(2)) \circ o(2), \ldots, (1 - M_r(T + 1)) \circ o(T + 1)\}$
+4: $o_w \gets \text{MaskRobot}(o(1), M_r(1))$ // Here we abuse the $o_w$ notation to be the masked image
+5: for $t = 1$ to $T$ do
+6: $\hat{o}' \gets W(o_w, r(t), r(t + 1), a(t))$
+7: $\hat{o}_w(t + 1) \gets (1 - M_r(t + 1)) \circ \hat{o}'$
+8: $\hat{O}_w \gets \hat{O}_w \cup \hat{o}_w(t + 1)$
+9: $o_w \gets \text{MaskRobot}(\hat{o}', M_r(t + 1))$
+10: end for
+11: Compute world loss (eq. 1) between $O_w$ and $\hat{O}_w$ .
+12:
+13: return
+
+Algorithm 2 TEST
+1: Input: World model $W$ , analytical model $R$ , Start image $o(1)$ , start mask $M_r(1)$ , start state $r(1)$ , actions $a(1), \ldots, a(T)$ .
+2: $\hat{O}_w = \{\}$
+3: $r \gets r(1)$
+4: $o_w \gets \text{MaskRobot}(o(1), M_r(1))$ // Here we abuse the $o_w$ notation to be the masked image
+5: for $t = 1$ to $T$ do
+6: $r' \gets R(r, a)$
+7: $\hat{o}' \gets W(o_w, r, r', a(t))$
+8: $\hat{o}_w(t + 1) \gets (1 - M_{r'}) \circ \hat{o}'$
+9: $\hat{O}_w \gets \hat{O}_w \cup \hat{o}_w(t + 1)$
+10: $o_w \gets \text{MaskRobot}(\hat{o}', M_{r'})$
+11: $r \gets r'$
+12: end for
+13:
+14: return $\hat{O}_w$
+
+fine-tuning, all models were trained on the fine-tune dataset for 10,000 gradient steps with learning rate of $1\mathrm{e} - 4$ , batch size of 10, and scheduled sampling. See algorithm 1 for pseudocode.
+
+Evaluation details. To evaluate PSNR and SSIM metrics over the world region of the images instead of the entire image, we preprocess the images by setting the robot region of the images to black. This corresponds to removing all pixel differences between the predicted and target robot region before computing the PSNR and SSIM over the entire region.
+
+For all experiments, we evaluate on sequences of length 5 and calculate the average world PSNR and SSIM metrics over the timestep. Because the models are stochastic, we perform Best-of-3 evaluation where 3 videos are sampled from the model, and we report the sample with the best PSNR and SSIM.
+
+Dataset. Following RoboNet (Dasari et al., 2019) conventions, the image dimension is 64 by 48 pixels. and the action space of the robot is the displacement in end effector pose $(x,y,z,\theta ,f)$ where $x,y,z$ are the cartesian coordinates of the gripper with respect to robot base, $\theta$ is the yaw of the gripper, and $f$ is the gripper force. The videos are length 31, but we sample subsequences of length 6 from the video to train the network to predict 5 images from 1 conditioning image. Due to the workspace bounds varying in size across robots, RoboNet chooses to normalize the cartesian coordinates to [0, 1] using the minimum and maximum boundary of each workspace.
+
+The WidowX200 dataset consists of 1800 videos collected using a random gaussian action policy that outputs end effector displacements in the action space. For the pushing task, we fix $z$ , $\theta$ , $f$ to constants, and sample $x, y$ displacements from a 2 dimensional gaussian with 0 mean and $3.5\sigma$ in
+
+Algorithm 3 Pytorch code for the $L_{w}$ loss.
+```python
+def ra_l1_loss(pred, target, mask):
+ '''pred and target are of images of dim (3, H, W)
+mask is binary segmentation mask of the robot of dim (1, H, W)
+outputs the mean L1 norm of world pixels
+'''difference = target - pred # (3, H, W)
+# repeat mask across channel axis so we can use it
+# to index the robot region in difference
+robot_region = maskrepeat(3,1,1)
+# ignore the pixel differences in the robot region
+difference[robot_region] = 0
+# compute the l1 norm over the world pixels
+num_worldPixels = (~robot_region).sum()
+l1_perpixel = diff.abs().sum() / num_worldPixels
+return l1_perpixel
+```
+
+
+Figure 7: Qualitative outputs of the zero-shot prediction experiments on models that were pretrained on multiple robots. From left to right, we show the ground truth start, ground truth future, and predictions for the robot-aware model and VFS model. The baseline blurs the bear in the top row, and predicts minimal movement for the octopus in the bottom row. The proxy robot is visualized in green. Refer to the videos on the website for more visual comparisons.
+
+centimeters. Similar to RoboNet, the states are normalized by the workspace minimum and maximum. We also collected 25 trajectories of the modified WidowX200 as seen in 4 for evaluation.
+
+# A.3 SIMULATED CONTROL EXPERIMENT DETAILS.
+
+We study the effect of robot transfer on pushing and pick-and-place tasks using the MuJoCo simulation (Todorov et al., 2012). The models are trained on 10k videos of the WidowX200 and evaluated on their task performance on the unseen Fetch robot.
+
+Pushing. The robot must push the block from a randomized starting pose to a randomized goal position $10\mathrm{cm}$ away from the start. To initialize the environment, we first set the robot and block spawn locations. The block is initialized with uniform noise of $5\mathrm{cm}$ in the center of the workspace. The robot gripper is then moved behind the block, and then perturbed with uniform noise of $1\mathrm{cm}$ . The episode limit is 10 steps. We only used the image-based world cost for pushing so we set $\lambda = 0$ .
+
+Pick-and-place. The robot must pick an object from a randomized starting pose and place it on an elevated platform at a location specified through a goal image. For pick-and-place, we give a goal for picking, lifting, and placing for a total of 3 goals per pick-and-place episode. We found it helpful to use the robot cost term in Equation 3, specifically by using the $L_{2}$ distance between the current and goal end effector position. We scaled $\lambda$ so the magnitude of world and robot cost would roughly contribute equal weight to the total cost. Note that using only the robot cost term causes the agent to completely focus on arm placement and ignore block placement. To initialize the environment, we first set the robot and block spawn locations. The block is initialized with uniform noise of 6cm next to the platform. The robot gripper is then moved above the block, and then perturbed with uniform
+
+noise of $3\mathrm{cm}$ . We give the controller up to 5 steps to achieve the current goal, before switching to the next goal for a maximum episode length of 15 steps.
+
+# A.4 CYCLEGAN BASELINE.
+
+To the best of our knowledge, no prior methods can perform zero-shot transfer of visuomotor skills between robots. However, we have looked into alternative approaches that might plausibly perform few-shot transfer between robots. In particular, based on the human-to-robot transfer approach of Smith et al. (2020), we can train a CycleGAN to translate images of the test-time robot to the train-time robot. Then, having trained full robot+world dynamics models on the train-time robot, we may apply them directly to the translated images for accomplishing robotic tasks. This is also similar to transfer approaches proposed in Rao et al. (2020); Raychaudhuri et al. (2021) and Roy & Konidaris (2021).
+
+We used the official CycleGAN implementation with default hyperparameters. The training process used 1k videos (12k images) per robot. We trained the CycleGAN until convergence, and the CycleGAN outputs look visually accurate (see website).
+
+# A.5 REAL WORLD CONTROL EXPERIMENT DETAILS.
+
+
+Figure 8: The objects used in the control experiments. The few-shot WidowX250 transfer experiment used all objects, while the zero-shot Franka experiment used the bear and watermelon.
+
+The bear, watermelon, box, octopus, and shark used in the control experiments are seen in Figure 8, and vary in size, texture, color, and deformability.
+
+In the few-shot WidowX200 control experiment, the robot is tasked with pushes on five different objects that vary in shape, color, deformability, and size. We chose two directions, a forward and sideways direction, giving a total of 10 push tasks. We run 5 trials for each push task for a total of 50 pushes per method. For the zero-shot Franka experiment, the controllers are evaluated on two different objects pushed in three different directions. Each pushing task is repeated 5 times for a total of 30 trials per controller.
+
+For the cost function, we only used the image-based world cost function $C_w$ by setting $\lambda = 0$ .
+
+CEM action selection. As mentioned in Section 3, the CEM algorithm is used to search for action trajectories that minimize the given cost function. The CEM hyperparameters are constant across controllers to ensure that all methods get the same search budget for action selection. For the few-shot WidowX200 experiment, the CEM action selection generates 300 action trajectories of length 5, selects the top 10 sequences, and optimizes the distribution for 10 iterations. For the zero-shot Franka experiment, the CEM action selection generates 100 action trajectories of length 5, selects the top 10 sequences, and optimizes the distribution for 3 iterations.
+
+
+Figure 9: We evaluate the performance of the pixel cost (V-C) and robot-aware cost (RA-C) by running 100 push tasks where the robot must achieve the object-only goal image. Then we visualize for each task, the final pose distance between the object and the object pose in the goal image. The dashed horizontal line indicates the success threshold of $1\mathrm{cm}$ . The robot-aware cost succeeds in most tasks by outputting a sensible cost over the world region, while pixel cost is distorted by the robot.
+
+# A.6 EVALUATING THE ROBOT-AWARE COST IN ISOLATION
+
+The control experiments in performed in Section 4 evaluate the robot-aware cost with various choices of dynamics models. Here, we evaluate the cost function more closely in isolation by using ground-truth dynamics of the simulator instead of a learned model.
+
+In section 3.1.2, we propose to separate the conventional pixel-wise cost into a robot-specific and world-specific cost. We report the results of a simulated experiment, where we set up a block pushing environment with the Fetch robot. The environment consists of three objects with varying shapes, colors, and physics. We sample the goal image by moving one of the objects from its initial pose to a random pose $10\mathrm{cm}$ away.
+
+We then run the visual foresight pipeline using ground truth dynamics and the given cost function for 5 action steps, and record the final distance between the object and its pose in the target image. Success is defined as moving the object within $1\mathrm{cm}$ of the goal pose. As seen in Figure 9, The robot-aware cost (RA-C) gets $95\%$ success rate, where as pixel cost (V-C) only gets $16\%$ success rate.
+
+The robot-aware cost is able to disregard the extraneous robot when computing the pixel difference between the current image with the robot and the goal image without the robot. Pixel cost on the other hand, results in the CEM selecting actions that move the robot out of the scene rather than moving the object to the correct pose.
+
+# A.7 IMITATING HUMAN GOAL IMAGES.
+
+We evaluate the robot-aware cost's effectiveness on achieving goal images with a human arm. Videos are on the project website. We collect five goal images by recording human pushing demonstrations, and use the last image from each video as the goal image as seen in Figure 10. Human masks are annotated using Label Studio (Tkachenko et al., 2020-2021). We run RA/RA and RA/Pixel controllers, which differ only in the planning cost. RA/RA achieves all goal images, whereas RA/Pixel fails on all goal images. See the website for videos.
+
+# A.8 USING ADDITIONAL CAMERA VIEWS
+
+Next, we analyze the benefit of using additional viewpoints for the robot-aware cost function. One potential local minima of the robot-aware cost is occlusion of the object by the gripper, since robot-
+
+
+Figure 10: Example human goal image.
+
+aware cost does not compute costs over the robot region. However, we did not find this occlusion behavior to be a problem in practice since our CEM search was powerful enough to find the true solution (which has lower cost than the occlusion minima). We can also address this by adding an additional viewpoint. We tested the multi-view version of our cost function on the simulated pushing setup, and found it improved performance as seen in Table 4.
+
+Using multiple views gave larger performance gains in the pick-and-place domain. Here, we repeat the pick-and-place experiment from section 4 by training a multi-view video prediction model on the WidowX, and then transfer it to a multi-view scene of the Fetch robot.
+
+Table 4: Adding an additional view improves pick-and-place performance.
+
+| Dynamics Model | Cost | Fetch Pick-and-Place (1 View) | Fetch Pick-and-place (2 Views) |
| VF+State | Pixel | 0/20 (0%) | 0/20 (0%) |
| RA | Pixel | 0/20 (0%) | 0/20 (0%) |
| VF+State | RA | 4/20 (20%) | 8/20 (40%) |
| RA | RA | 8/20 (40%) | 14/20 (70%) |
+
+# A.9 EFFECT OF ROBOT APPEARANCE ON PREDICTION
+
+In addition to the real-world transfer examples reported in the main paper, we experiment with robot transfer in MuJoCo simulations (Todorov et al., 2012) by setting up a tabletop manipulation workspace. During training, the model is trained on 10,000 videos of a gray WidowX200 5-DOF robot performing random exploration. Then, we evaluate the model on various modifications of the WidowX. First, we try changing the color of the entire WidowX from gray to red. Next, we extend the forearm link of the WidowX by $10\mathrm{cm}$ , similar to the real-world modified WidowX experiment in Section 4. Finally, we evaluate on a WidowX with a longer and red link. As seen in Table 5, the robot-aware model outperforms the vanilla model in world PSNR and SSIM metrics.
+
+For the color change, the vanilla model predicts a still image for all timesteps, which suggests that the network does not recognize the red robot as the training time robot. Our model is invariant to the color shift of the robot due to the masking, and can accurately predict the trajectory with little degradation in quality.
+
+With the link length change, the vanilla model is able to predict robot movement, but it replaces the longer link with the original short link. In some cases, the longer link allows the robot to contact the object and move it. Our model correctly predicts the object movement, but the vanilla model fails to model the object interaction and movement since the object contact is not possible with the shorter link.
+
+Finally, in the longer and different color link setting, the vanilla model is able to recognize and predict movement for the unaltered parts of the robot. It replaces the long red link with the original short gray link, and leaves the long red link in the image as an artifact. Similar to the previous experiment, the vanilla model has degraded object prediction while our model can still accurately predict the dynamics.
+
+Table 5: Zero-shot video prediction results to a modified WidowX200 in simulation. The modified WidowX200 has different color and/or link lengths.
+
+ | Color Change | Link Change | Color and Link Change |
| PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ | PSNR ↑ | SSIM ↑ |
| VF | 37.5 | 0.976 | 42.3 | 0.994 | 40.3 | 0.987 |
| RA (Ours) | 38.7 | 0.985 | 45.2 | 0.997 | 40.9 | 0.991 |
+
+# A.10 RAC PERFORMANCE ON TRAINING ROBOT
+
+As a sanity check, we tested if the baseline and our method is suitable for planning on the original robot. We follow the exact setup as the simulated pushing and pick-and-place experiments, except that we do not change the robot during evaluation. As seen in Table 6, our method is marginally better in performance in prediction and control in comparison with the baselines.
+
+Table 6: Performance on the training robot.
+
+| Dynamics Model | Cost | Push Success | Pick-and-place Success |
| VF+State | Pixel | 86/100 (86%) | 9/20 (45%) |
| RA | RA | 92/100 (92%) | 11/20 (55%) |
+
+# A.11 ROBOT MASKS AND CALIBRATION.
+
+Acquiring robot masks that accurately segment the robot and world is crucial for the robot-aware method, as it depends on the mask to train the dynamics model and evaluate costs as mentioned in Section 3.1.1 and 3.1.2. The first step to acquiring robot masks is to get the camera calibration, which is the intrinsics and extrinsics matrix of the camera. If we have physical access to the robot and camera, acquiring the camera calibration is trivial. In our experiment setup with the Franka and WidowX200, we use AprilTag to calibrate the camera extrinsics, i.e. the transformation between camera coordinates and robot coordinates given the camera intrinsics.
+
+Extracting calibration from RoboNet. However, if we do not have access to the robot and camera, as in RoboNet, acquiring camera calibration is still possible. RoboNet does not contain the camera extrinsics information, but does contain the camera model information. Therefore, we use the default factory-calibrated camera intrinsics for each corresponding camera model.
+
+Next, RoboNet contains the 3D positions of the robot end-effector in the robot coordinates for each image. For each viewpoint, we hand-associate a few-dozen 2D image coordinates of the corresponding end-effector, and use OpenCV's camera calibration functionality to regress the camera extrinsic given the camera intrinsics and labeled 3D-2D end-effector point pairs.
+
+Synthesizing masks. Once we have the camera calibration of the robot, we render the 3D model of the robot, and project it to a 2D segmentation map using the camera calibration. We use the MuJoCo simulator for this process. Conveniently, the MuJoCo simulator can render a segmentation map of the geometries for a given camera viewpoint. By setting up an empty MuJoCo scene with only the robot geometries, we can render the geometry segmentation map and use that as the robot mask.
+
+Using depth. Observe that the robot mask $M_r(t)$ above is computed from only the robot state, without any reference to the world state. As a result, it can not account for robot occlusion by objects in the scene. For example, if the robot is pushing a large object towards the camera, the part of the object occluding the robot will count as the robot region. With RGB-D observations $o(t)$ , which are commonly used in robotics, it is easy to refine $M_r(t)$ to remove occluded regions. To do so, we may compute the distance $D_r(x,y)$ of all robot pixels through the above projection, and zero out pixels in the mask where $D_r(x,y)$ is greater than the observed depth at that pixel. In other words, pixels that are closer to the camera than the computed distance of the robot at that location must correspond to occluders. In practice, in our experiments, we find it sufficient to use RGB cameras and ignore occlusions.
\ No newline at end of file
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/images.zip b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..273e6c4b29cbcf407692e43b3de656b3b8974ab8
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08c0467db2c1cf09de4e1659702628a003658062d57ec501b2291492debde9c6
+size 569031
diff --git a/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/layout.json b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c78cb801c85845ba6b4023b62e9307e8e2c7769c
--- /dev/null
+++ b/knowthyselftransferablevisualcontrolpoliciesthroughrobotawareness/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:728ad2bf901b3d92c07f17523518294e0170d3018a2c53e2c1fd6de9b9ae010b
+size 587590
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_content_list.json b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ad4b1a06f339afcef5932bb73484e26fbc5b219b
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4e18ed136aacab9fb1e68a62df6e2887ca87e284c4342e49fc61c4b3b45cf014
+size 163382
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_model.json b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5e2a48185f8dc4a86fdecd0b284e8a87ddbbfcbc
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b4d6218e57e50c7bdca6f6ec215da2e6663a44306e7276f9e84a65581ecf41a8
+size 194924
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_origin.pdf b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8359efe43ed2ab0f645af0fc50e3c4e22a0a0ab6
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/db1ffeae-d9e9-4554-a2d0-a23b6f9f94f6_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af6bd939e9b0df5c7dc4be7538f8c2a3ca7fc20fd66ca983b13cc3f64d1e80d8
+size 6430574
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/full.md b/knowyouractionsetlearningactionrelationsforreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..86ab28434d2748f3447494b7c3da2bfa7718740f
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/full.md
@@ -0,0 +1,627 @@
+# KNOW YOUR ACTION SET: LEARNING ACTION RELATIONS FOR REINFORCEMENT LEARNING
+
+Ayush Jain*1 Norio Kosaka*2 Kyung-Min Kim*4 Joseph J. Lim†,‡
+
+1University of Southern California (USC), 2NAVER CLOVA,
+
+$^{3}$ Korea Advanced Institute of Science and Technology (KAIST), $^{4}$ NAVER AI Lab
+
+# ABSTRACT
+
+Intelligent agents can solve tasks in various ways depending on their available set of actions. However, conventional reinforcement learning (RL) assumes a fixed action set. This work asserts that tasks with varying action sets require reasoning of the relations between the available actions. For instance, taking a nail-action in a repair task is meaningful only if a hammer-action is also available. To learn and utilize such action relations, we propose a novel policy architecture consisting of a graph attention network over the available actions. We show that our model makes informed action decisions by correctly attending to other related actions in both value-based and policy-based RL. Consequently, it outperforms non-relational architectures on applications where the action space often varies, such as recommender systems and physical reasoning with tools and skills.
+
+# 1 INTRODUCTION
+
+Imagine you want to hang a picture on the wall. You may start by placing a nail on the wall and then use a hammer to nail it in. However, if you do not have access to a hammer, you would not use the nail. Instead, you would try alternative approaches such as using a hook and adhesive-strips or a screw and a drill (Figure 1). In general, we solve tasks by choosing actions that interact with each other to achieve a desired outcome in the environment. Therefore, the best action decision depends not only on the environment but also on what other actions are available to use.
+
+This work addresses the setting of varying action space in sequential decision-making. Typically reinforcement learning (RL) assumes a fixed action space, but recent work has explored variations in action space when adding or removing actions (Boutilier et al., 2018; Chandak et al., 2020a,b) or for generalization to unseen actions (Jain et al., 2020). These assume that the given actions can be treated independently in decision-making. But this assumption often does not hold. As the picture hanging example illustrates, the optimality of choosing the nail is dependent on the availability of a hammer. Therefore, our goal is to address this problem of learning the interdependence of actions.
+
+Addressing this problem is vital for many varying action space applications. These include recommender systems where articles to recommend vary everyday and physical reasoning where decision-making must be robust to any given set of tools, objects, or skills. In this paper, we benchmark three such scenarios where learning action interdependence is crucial for solving the task optimally. These are (i) shortcut-actions in grid navigation, which can shorten the path to the goal when available, (ii) co-dependent actions in tool reasoning, where tools need other tools to be useful (like nail-hammer), and (iii) list-actions or slate-actions (Sunehag et al., 2015) in simulated and real-data recommender systems, where user response is a collective effect of the recommended list.
+
+There are three key challenges in learning action interdependence for RL with varying action space. First, since all the actions are not known in advance, the policy framework must be flexible to work with action representations. Second, the given action space is an additional variable component, just like state observations in RL. Therefore, the policy framework must incorporate a variably sized set of action representations as part of the input. Finally, an agent's decision for each action's utility (Q-value or probability) should explicitly model its relationship with other available actions.
+
+
+Figure 1: Picture hanging task with varying sets of tool-actions. The strategy with each action set depends on all the pairwise action relations. (Left) The agent infers that a nail and a hammer are strongly related (bold line). Thus, it takes nail-action in Step-1 because hammer-action is available for Step-2. (Right) With a different action set, the nail-action is no longer useful due to the absence of a hammer. So, the agent must use an adhesive-tape in Step-1 since its related action of the hook is available for later use. We show that a policy with GAT over actions can learn such action relations.
+
+We propose a novel policy architecture to address these challenges: AGILE, Action Graph for Interdependence Learning. AGILE builds on the utility network proposed in Jain et al. (2020) to incorporate action representations. Its key component is a graph attention network (GAT) (Velicković et al., 2017) over a fully connected graph of actions. This serves two objectives: summarizing the action set input and computing the action utility with relational information of other actions.
+
+Our primary contribution is introducing the problem of learning action interdependence for RL with varying action space. We demonstrate our proposed policy architecture, AGILE, learns meaningful action relations. This enables optimal decision-making in varying action space tasks such as simulated and real-world recommender systems and reasoning with skills and tools.
+
+# 2 RELATED WORK
+
+# 2.1 STOCHASTIC ACTION SETS
+
+In recent work, Boutilier et al. (2018) provide the theoretical foundations of MDPs with Stochastic Action Sets (SAS-MDPs), where actions are sampled from a known base set of actions. They propose a solution with Q-learning which Chandak et al. (2020a) extend to policy gradients. An instance of SAS-MDPs is when certain actions become invalid, like in games, they are masked out from the output action probability distribution (Huang & Ontañón, 2020; Ye et al., 2020; Kanervisto et al., 2020). However, the assumption of knowing the finite base action set limits the practical applicability of SAS-MDPs. E.g., recommender agents often receive unseen items to recommend and a robotic agent does not know beforehand what tools it might encounter in the future. We work with action representations to alleviate this limitation. Furthermore, in SAS-MDPs the action set can vary at any timestep of an episode. Thus, the learned policy will only be optimal on average over all the possible action sets (Qin et al., 2020). Whereas in our setting, the action set only changes at the beginning of a task instance and stays constant over the episode. This is a more practical setup and raises the challenging problem of solving a task optimally with any given action space.
+
+# 2.2 ACTION REPRESENTATIONS
+
+In discrete action RL, action representations have enabled learning in large action spaces (Dulac-Arnold et al., 2015; Chandak et al., 2019), transfer learning to a different action space (Chen et al., 2019b), and efficient exploration by exploiting the shared structure among actions (He et al., 2015; Tennenholtz & Mannor, 2019; Kim et al., 2019). Recently, Chandak et al. (2020b) use them to accelerate adaptation when new actions are added to an existing action set. In contrast, our setting requires learning in a constantly varying action space where actions can be added, removed, or completely replaced in an episode. Closely related to our work, Jain et al. (2020) assume a similar setting of varying action space while training to generalize to unseen actions. Following their motivation, we use action representations to avoid assuming knowledge of the base action set. However, their policy treats each action independently, which we demonstrate leads to suboptimal performance.
+
+# 2.3 LIST-WISE ACTION SPACE
+
+The action space is combinatorial in list size in listwise RL (or slate RL). Commonly it has applications in recommendation systems (Sunehag et al., 2015; Zhao et al., 2017; 2018; Ie et al., 2019b; Gong et al., 2019; Liu et al., 2021; Jiang et al., 2018; Song et al., 2020). In recent work, Chen et al. (2019a) proposed Cascaded DQNs (CDQN) framework, which learns a Q-network for every index in the list and trains them all with a shared reward. For our experiments on listwise RL, we utilize CDQN as the algorithm and show its application with AGILE as the policy architecture.
+
+# 2.4 RELATIONAL REINFORCEMENT LEARNING
+
+Graph neural networks (Battaglia et al., 2018) have been explored in RL tasks with a rich relational structure, such as morphological control (Wang et al., 2018; Sanchez-Gonzalez et al., 2018; Pathak et al., 2019), multi-agent RL (Tacchetti et al., 2019), physical construction (Hamrick et al., 2018), and structured perception in games like StarCraft (Zambaldi et al., 2018). In this paper, we propose that the set of actions possess a relational structure that enables the actions to interact and solve tasks in the environment. Therefore, we leverage a graph attention network (Veličković et al., 2017) to learn these action relations and show that it can model meaningful action interactions.
+
+# 3 PROBLEM FORMULATION
+
+A hallmark of intelligence is the ability to be robust in an ever-changing environment. To this end, we consider the setting of RL with a varying action space, where an agent receives a different action set in every task instance. Our key problem is to learn the interdependence of actions so the agent can act optimally with any given action set. Figure 1 illustrates that for a robot with the task of hanging a picture on the wall, starting with a nail is optimal only if it can access a hammer subsequently.
+
+# 3.1 REINFORCEMENT LEARNING WITH VARYING ACTION SPACE
+
+We consider episodic Markov Decision Processes (MDPs) with discrete action spaces, supplemented with action representations. The MDP is defined by a tuple $\{S, \mathbb{A}, \mathcal{T}, \mathcal{R}, \gamma\}$ of states, actions, transition probability, reward function, and a discount factor, respectively. The base set of actions $\mathbb{A}$ can be countably infinite. To support infinite base actions, we use $D$ -dimensional action representations $c_{a} \in \mathbb{R}^{D}$ to denote an action $a \in \mathbb{A}$ . These can be image or text features of a recommendable item, behavior characteristics of a tool, or simply one-hot vectors for a known and finite action set.
+
+In each instance of the MDP, a subset of actions $\mathcal{A} \subset \mathbb{A}$ is given to the agent, with associated representations $\mathcal{C}$ . Thereafter, at each time step $t$ in the episode, the agent receives a state observation $s_t \in S$ from the environment and acts with $a_t \in \mathcal{A}$ . This results in a state transition to $s_{t+1}$ and a reward $r_t$ . The objective of the agent is to learn a policy $\pi(a|s, \mathcal{A})$ that maximizes the expected discounted reward over evaluation episodes with potentially unseen actions, $\mathbb{E}_{\mathcal{A} \subset \mathbb{A}}\left[\sum_t \gamma^{t-1} r_t\right]$ .
+
+# 3.2 CHALLENGES OF VARYING ACTION SPACE
+
+1. Using Action Representations: The policy framework should be flexible to take a set of action representations $\mathcal{C}$ as input and output corresponding Q-values or probability distribution for RL.
+2. Action Set as part of State: When the action set varies, the original state space $S$ is not anymore Markovian. For example, the state of a robot hanging the picture is under-specified without knowing if its toolbox contains a hammer or not. The MDP can be preserved by reformulating the state space as $S' = \{ s \circ \mathcal{C}_{\mathcal{A}} : s \in S, \mathcal{A} \subset \mathbb{A} \}$ to include the representations $\mathcal{C}_{\mathcal{A}}$ associated with the available actions $\mathcal{A}$ (Boutilier et al., 2018). Thus, the policy framework must support the input of $s \circ \mathcal{C}_{\mathcal{A}}$ , where $\mathcal{A}$ is a variably sized action set.
+3. Interdependence of Actions: The optimal choice of an action $a_{t} \in \mathcal{A}$ is dependent on the action choices that would be available in the future steps of the episode, $a_{t'} \in \mathcal{A}$ . Recalling Figure 1, a nail should only be picked initially from the toolbox if a hammer is accessible later. Thus, an optimal agent must explicitly model the relationships between the characteristics of the current action $c_{a_t}$ and the possible future actions $c_{a_i} \forall a_i \in \mathcal{A}$ .
+
+
+Figure 2: Given an action set, AGILE builds a complete graph where each node is composed of an action representation and the state encoding. A graph attention network (GAT) learns action relations by attending to other relevant actions for the current state. For example, the attention weight between the cannon and the fire is high because fire can activate the cannon. The GAT outputs more informed relational action representations than the original inputs. Finally, a utility network computes each action's value or selection probability in parallel using its relational action representation, the state, and a mean-pooled summary vector of all available actions' relational features.
+
+# 4 APPROACH
+
+Our goal is to design a policy framework that is optimal for any given action set by addressing the challenges in Sec. 3.2. We build on the utility network proposed by Jain et al. (2020) that acts in parallel on each action's representation. Our central insight is to use graph neural networks for summarizing the set of action representations as a state component and learning action relations.
+
+# 4.1 AGILE: ACTION GRAPH FOR INTERDEPENDENCE LEARNING
+
+We propose AGILE, a relational framework for learning action interdependence in RL with a varying action space. Given a list of action representations $\mathcal{C}$ , AGILE builds a fully-connected action graph. A graph attention network (GAT) (Velicković et al., 2017) processes the action graph and learns action relations. The attention weights in the GAT would be high for closely related actions such as a nail and a hammer in Figure 1. A utility network uses the GAT's resulting relational action representations, the state, and a pooled together action set summary to compute each action's Q-value or probability logit for policy gradient methods(Figure 2).
+
+Action Graph: The input to our policy framework consists of the state $s$ and a list $\mathcal{C} = [c_{a_0},\dots,c_{a_k}]$ of action representations for each action $a_i\in \mathcal{A}$ . We build a fully connected action graph $\mathcal{G}$ with vertices corresponding to each available action. If certain action relations are predefined via domain knowledge, we can reduce some edges to ease training (Appendix B.1). We note that the action relations can vary depending on the environment state. For instance, a screwdriver is related to a screw for furniture repair, but a drill machine is more related when the screw is for a wall. Therefore, we join the state and action representations, $c_{a_i}' = (s,c_{a_i})$ to obtain the nodes of the graph. Sec. 6.3.2 validates that learning state-dependent action relations leads to more optimal solutions.
+
+Graph Attention Network: The action graph $\mathcal{G}$ is input to a GAT. Since the graph is fully-connected, we choose an attention-based graph network that can learn to focus on the most relevant actions in the available action set. A similar insight was employed by Zambaldi et al. (2018) where the entities inferred from the visual observation are assumed to form a fully connected graph. To enable propagation of sufficient relational information between actions, we use two graph attention layers with an ELU activation in between (Clevert et al., 2015). We found a residual connection after the second GAT layer was crucial in experiments, while multi-headed attention did not help.
+
+Action Set Summary: The output of the GAT is a list of relational action representations $\mathcal{C}^R = \{c_{a_0}^R, \dots, c_{a_k}^R\}$ which contain the information about the presence of other available actions and their relations. To represent the input action set as part of the state, we compute a compact action set summary by mean-pooling the relational action features, $\bar{c}^R = \frac{1}{K}\sum_{i=1}^{K}c_{a_i}^R$ .
+
+Action Utility: To use the relational action representations with RL, we follow the utility network architecture $\pi_{u}$ from Jain et al. (2020). It takes the relational action representation, the state, and the action set summary as input for each available action in parallel. It outputs a utility score $\pi_{u}(c_{a}^{R}, s, \bar{c}^{R})$ for how useful an action $a$ is for the current state and in relation to the other available actions. The utility scores can be used as a Q-value directly for value-based RL or as a logit fed into a softmax function to form a probability distribution over the available actions for policy-based RL.
+
+# 4.2 TRAINING AGILE FRAMEWORK WITH REINFORCEMENT LEARNING
+
+The AGILE architecture can be trained with both policy gradient and value-based RL methods.
+
+Policy Gradient (PPO): For every action decision step, we take the output action utility and use a softmax over all available actions to get a probability distribution. We use PPO (Schulman et al., 2017) to train the policy. PPO requires a value function $V(s')$ as a baseline. We represent the effective state as the concatenation of the state encoding $s$ and the action set summary $\bar{c}^R$ inferred from the GAT, $s' = (s, \bar{c}^R)$ . An important implementation detail to make the training faster and stable was to not share the GAT weights used for the actor $\pi(a|s', c_a^R)$ and the critic $V(s')$ networks.
+
+Value-based RL (DQN) The output action utility can be directly treated as the $Q(s', a)$ value of the action $a$ at the current effective state $s'$ with the available action set $\mathcal{A}$ . This can be trained using standard Deep Q-learning Bellman backup (Mnih et al., 2015).
+
+Listwise RL (CDQN): For tasks with listwise actions, we follow the Cascaded DQN (CDQN) framework of Chen et al. (2019a). The main challenge is that building the action list all at once is not feasible due to a combinatorial number of possible list-actions. Therefore, the key is to build the list incrementally, one action at a time. Thus, each list index can be treated as an individual action decision trained with independent Q-networks. We replace the Q-network of CDQN with AGILE to support a varying action space. Sharing the weights of the cascaded Q-networks led to better performance. Algorithm 1 provides complete details on CDQN for listwise AGILE.
+
+# 5 ENVIRONMENTS
+
+We evaluate AGILE on three varying action set scenarios requiring learning action interdependence: (i) shortcut actions in goal-reaching, which can shorten the optimal path to the goal in a 2D Grid World when available, (ii) co-dependent actions in tool reasoning, which require other tools to activate their functionality, and (iii) list-actions in simulated and real-data recommender systems where the cumulative list affects the user response. Figure 3 provides an overview of the tasks, the base and varying action space, and an illustration of the action interdependence. More environment details such as tasks, action representations, and data collection are present in Appendix A.
+
+# 5.1 DIG LAVA GRID NAVIGATION
+
+We modify the grid world environment (Chevalier-Boisvert et al., 2018) where an agent navigates a 2D maze with two lava rivers to reach a goal. The agent always has access to four direction movements and a turn-left skill (Figure 5). There are two additional actions randomly sampled out of four special skills: turn-right, step-forward, dig-orange-lava and dig-pink-lava. If the agent enters the lava, it will die unless it uses the matching dig-lava skill to remove the lava in the immediately next timestep. Thus, when available, dig-lava skills can be used to create shortcut paths to the goal and receive a higher reward. We use PPO for all experiments in this environment.
+
+# 5.2 CHAIN REACTION TOOL ENVIRONMENT: CREATE
+
+The CREATE environment (Jain et al., 2020) is a challenging physical reasoning benchmark with a large variety of tools as actions and also supports evaluation with unseen actions. The objective is to sequentially place tools to help push the red ball towards the green goal. An action is a hybrid of a discrete tool-selection from varying toolsets and a continuous $(x, y)$ coordinate of tool-placement on the screen. An auxiliary policy network decides the tool-placement based on the effective state $s'$ as input, following Jain et al. (2020). To emphasize action relations, we augment the environment with special activator tools (e.g., fire) that general tools (e.g., cannon) need in contact for being functional. Thus, a general tool can be useful only if its activator is also available. Action representations of general tools encode their physical behavior (Jain et al., 2020), while those of activator tools are one-hot vectors. We train AGILE and the auxiliary policy jointly with PPO.
+
+
+Figure 3: Environment Setup. (Left) In Grid World, the red agent must avoid orange and pink lava to reach the green goal. The dig-lava skills enable shortcut paths to the goal when available. (Middle) In CREATE, tools are selected and placed sequentially to push the red ball to the green goal. General tools (cannon, fan) require activator tools (fire, electric) to start functioning. The choice of general tools depends on what activators are available and vice-versa. (Right) In simulated and real-data recommender systems, the agent selects a list of items. Lists with coherent categories and complementary sub-categories improve user satisfaction (e.g., click likelihood).
+
+
+
+
+
+# 5.3 RECOMMENDER SYSTEMS
+
+Recommender system (RecSys) is a natural application of varying action space RL — for instance, news articles or videos to recommend are updated daily. Action interdependence is distinctly apparent in the case of listwise actions. A recommended list of diverse videos is more likely to get a user click than videos about the same thing (Zhou et al., 2010). In this work, we experiment with the listwise metric of Complementary Product Recommendation (CPR) (Hao et al., 2020).
+
+Complementary Product Recommendation (CPR) is a scenario where user response for a recommended list is more favorable if the list is diverse at a low level but coherent at a high level. In our experiments, each item has a primary category (such as shirt or pant) and a subcategory (such as its color). We define the CPR of an item-list as, Entropy of subcategory Entropy of category. This encourages diversity in subcategories (colors) and similarity in the main category (all shirts). We maximize CPR (i) implicit in the click-behaviors of simulated users and (ii) explicit in the reward computed on real-world data.
+
+# 5.3.1 SIMULATED RECOMMENDER SYSTEM: RECSIM
+
+We use RecSim (Ie et al., 2019a) to simulate user interactions and extend it to the listwise recommendation task. We have a base action set of 250 train and 250 test items, and 20 items are sampled as actions for the agent in each episode. The agent recommends a list-action of size six at each step. We assume a fully observable environment with the state as the user preference vector and the action representations as item characteristics. The objective implicitly incorporates CPR by boosting the probability of a user clicking any item proportional to the list CPR. The implicit CPR objective exemplifies realistic scenarios where the entire list influences user response. One way to optimize CPR is to identify the most common category in the available action set and recommend most items from that category. Such counting of categories requires relational reasoning over all items available in the action set. We train CDQN-based models to maximize the number of clicks in a user session.
+
+# 5.3.2 REAL-DATA RECOMMender SYSTEM
+
+We collect four-week interaction data in a listwise online campaign recommender system. Users are represented by attributes such as age, occupation, and localities. Item attributes include text features, image features, and reward points of campaigns. We train a VAE (Kingma & Welling, 2013) to learn item representations. We create a representative RL environment by training two click-estimation models using data from the first two weeks for training and the last two weeks for evaluation. The training environment consists of 68,775 users and 57 items, while testing has 82,445 users and 58 items, with an overlap of 30 items. The reward function combines the user-click and CPR value of the list. The explicit CPR reward is a representative scenario for when the designer has listwise objectives in addition to user satisfaction. We train with CDQN and report the test reward.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: We evaluate AGILE against baselines on training actions (top) and unseen testing actions (bottom). Generalization is enabled by continuous action representations, except Grid World (Appendix A). All architectures share the same RL algorithm (PPO or CDQN). The results are averaged over 5 random seeds, and the seed variance is shown with shading. AGILE outperforms all baselines that assume a fixed action set (cannot generalize) or treat actions independently (suboptimal).
+
+
+
+
+
+# 6 EXPERIMENTS
+
+We design experiments to answer the following questions in the context of RL with varying action space: (1) How effective is AGILE compared to prior works that treat actions independently or assume a fixed action set? (2) How effective are AGILE's relational action representations for computing action set summary and action utility score? (3) Does the attention in AGILE represent meaningful action relations? (4) Is attention necessary in the graph network of AGILE? (5) Is learning state-dependent action relations important for solving general varying action space tasks?
+
+# 6.1 EFFECTIVENESS OF AGILE IN VARYING ACTION SPACES
+
+We evaluate AGILE against baselines from prior work in varying action space, which either assume a fixed action set or act independently of the other actions. We ablate the importance of relational action features by replacing them with the original action representations and compute the action set summary in different ways. The Appendix details the comparison (C.1) and visualization (Figure 17) of all baselines and ablations, hyperparameter-tuning (D.2,D.3) and network designs(C.3).
+
+# 6.1.1 BASELINES
+
+- **Mask-Output** (No action representations, No input action set): Assumes a fixed action space output. Q-values or policy probabilities are masked out for unavailable actions. It represents prior work on SAS-MDP: Boutilier et al. (2018); Chandak et al. (2020a); Huang & Ontañón (2020).
+- Mask-Input-Output (No action representations): Augments Mask-Output with an extra input of action set via a binary availability vector: having 1s at available action indices and 0s otherwise.
+- Utility-Policy (No input action set): Jain et al. (2020) propose a parallel architecture to compute each action's utility using action representations. But, it ignores any action interdependence.
+- Simple DQN (No cascade, No input action set): A non-cascaded DQN baseline for listwise RL that selects top-K items instead of reasoning about the entire list. Thus, it ignores two action interdependencies: (i) on other items in the list and (ii) on other available actions.
+
+# 6.1.2 ABLATIONS
+
+- Summary-LSTM: A Bi-LSTM (Huang et al., 2015) encodes the list of action representations.
+- Summary-Deep Set: A deep set architecture (Zaheer et al., 2017) with mean pooling is used to aggregate the available action representation list.
+- Summary-GAT: The relational action representations output from the GAT in AGILE is used only for the action set summary but not for the utility network. This does not scale to tasks with many diverse interaction relations because the summary vector has a limited modeling capacity.
+
+
+
+
+
+
+
+
+
+
+Figure 5: Test performance of AGILE against ablations with utility network using only action set summary, but not the relational action representations. The difference is most pronounced in CREATE, where there are several diverse action (tool) relations for each action decision.
+
+# 6.1.3 RESULTS
+
+Baselines: Figure 4 shows baseline results on train and test actions. Grid world has no unseen actions, so we report only train reward. Grid World: all methods learn to reach the goal with perfect success but achieve different rewards due to the length of the path. The methods which do not take action set as input, Mask-Output and Utility Policy, resort to the safe strategy of going around the lava rivers (Figure 6(b)). This is because the agent must enter the lava and then dig it to take a shortcut. So before taking the move-right action into lava, the agent must know whether that dig-lava skill is available. CREATE: Mask baselines do not support generalization due to fixed action set assumption and train poorly as they do not exploit the structure in action representations. Utility policy outperforms the other baselines since it can exploit learning with action representations. Finally, AGILE outperforms all the baselines, demonstrating that relational knowledge of other available actions is crucial for an optimal policy. RecSim and Real RecSys: result trends are consistent with CREATE, but less pronounced for Real RecSys. Additionally, DQN is worse than CDQN-based architectures because the top-K greedy list-action ignores intra-list dependence.
+
+Ablations: Figure 5 shows ablation results on test actions. Grid World: all ablations utilize the action set summary as input, aggregated via different mechanisms. Thus, they can identify which dig-lava skills are available and enter lava accordingly to create shortcuts. In such small action spaces with simple action relations, summary-ablations are on par with AGILE. This trend also holds for RecSim and Real RecSys, where the summary can find the most common category and its items are then selected to maximize CPR (e.g., Figure 6(c)). Therefore, we observe only $5 - 20\%$ gains of AGILE over the ablations. To test the consistency of results, we further evaluate two more RecSim tasks. (i) Direct CPR: the agent receives additional explicit CPR metric reward on top of click/no-click reward (Sec. B.3), and (ii) pairing environment: the task is to recommend pairs of associated items based on predefined pairings (Sec. B.4). We reproduce the trend that AGILE $\geq$ ablations. However, the difference is most pronounced ( $30 - 50\%$ ) in CREATE, where each action decision relies on relations between various tools and activators. In Figure 6(a), the decision of Spring relates with all other tools that spring can activate, and the decision of trampoline relates with its activator, Spring. In ablations, the action set summary must model all the complex and diverse action relations with a limited representation capacity. In contrast, the relational action representations in AGILE model each action's relevant relations, and the summary models the global relations.
+
+# 6.2 DOES THE ATTENTION IN AGILE LEARN MEANINGFUL ACTION RELATIONS?
+
+In Figure 6, we analyze the agent performance qualitatively. (a) In CREATE, at $t = 0$ , the selected action spring in AGILE's GAT attends to various other tools, especially the tools that get activated with spring, such as trampoline. At $t = 1$ , the trampoline tool is selected with strong attention on spring. This shows that for selecting the trampoline, the agent checks for its activator, spring, to ensure that it is possible to place spring before or after the trampoline. (b) In Grid World, we visualize the inter-action attention in Summary-GAT's summarizer. We consider the case where both dig - lava skills are available. The agent goes right, digs the orange lava, and is about to enter the pink lava. At this point, the Right action attends with a large weight to the Dig - Pink skill, checking for its presence before making an irreversible decision of entering the lava. In contrast, the Utility Policy always follows the safe suboptimal path as it is blind to the knowledge of dig-skills before entering lava. (c) In RecSim, we observe that the agent can maximize the CPR score by selecting 5 out of 6 items in the list from the same primary category. In contrast, Utility Policy cannot determine the most common available category and is unable to maximize CPR.
+
+
+Figure 6: Qualitative Analysis. (a,b) The attention maps from GAT show the reasoning behind an action decision. The nodes show available actions, and edge widths are proportional to attention weight (thresholded for clarity). (b) Utility Policy learns the same suboptimal solution for any given action set, while Summary-GAT (like AGILE) adapts to the best strategy by exploiting dig-skills. (c) AGILE can optimize CPR by identifying the most common item category available, unlike Utility Policy. We provide qualitative video results for Grid World and CREATE on the project page https://sites.google.com/view/varyingaction.
+
+
+Figure 7: Additional Analyses. (i) GAT v/s GCN (ii) state-action relations v/s action-only relations.
+
+# 6.3 ADDITIONAL ANALYSES
+
+# 6.3.1 IMPORTANCE OF ATTENTION IN THE GRAPH NETWORK
+
+We validate the choice of using graph attention network as the relational architecture. In Figure 7, we compare GAT against a graph convolutional network (GCN) (Kipf & Welling, 2016) to act over AGILE's action graph. We observe that GCN achieves optimal performance for the grid world and RecSys tasks. GCN can learn simple action relations even though the edge weights are not learned. However, it suffers in CREATE and RecSim-pairing (Figure 16), where the action relations are diverse and plenty. Moreover, we believe that the attention in GAT makes the graph sparse to ease RL training, which in contrast, is difficult in a fully-connected GCN.
+
+# 6.3.2 IMPORTANCE OF STATE-DEPENDENT LEARNING OF ACTION RELATIONS
+
+We evaluate a version of AGILE where the GAT only receives action representations as input and no state. Thus, the action relations are inferred independently of the state. Figure 7 shows a drop in performance for Grid World and CREATE, where the relevant action relations change based on the state. However, this effect is less apparent on RecSim because CPR requires only knowing the most common category, independent of user state.
+
+# 7 CONCLUSION
+
+We present AGILE, a policy architecture for leveraging action relations for reinforcement learning with varying action spaces. AGILE builds a complete graph of available actions' representations and utilizes a graph attention network to learn the interdependence between actions. We demonstrate that using the knowledge of available actions is crucial for optimal decision-making and relational action features ease learning in four environments, including a real-data recommendation task.
+
+# ACKNOWLEDGEMENTS
+
+This project was supported by Naver AI Lab and USC. The authors are grateful to Youngwoon Lee for help with ideation and guidance. We thank Xingdong Zuo for help with data extraction in real-data RecSys. We appreciate the fruitful discussions with Shao-Hua Sun, Karl Pertsch, Jesse Zhang, Grace Zhang, and Jisoo Lee.
+
+# REFERENCES
+
+Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
+Lukas Biewald. Experiment tracking with weights and biases. Software available from wandb.com, pp. 33, 2020.
+Craig Boutilier, Alon Cohen, Amit Daniely, Avinatan Hassidim, Yishay Mansour, Ofer Meshi, Martin Mladenov, and Dale Schuurmans. Planning and learning with stochastic action sets. arXiv preprint arXiv:1805.02363, 2018.
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
+Yash Chandak, Georgios Theocharous, James Kostas, Scott Jordan, and Philip Thomas. Learning action representations for reinforcement learning. In International Conference on Machine Learning, pp. 941-950. PMLR, 2019.
+Yash Chandak, Georgios Theocharous, Blossom Metevier, and Philip Thomas. Reinforcement learning when all actions are not always available. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 3381-3388, 2020a.
+Yash Chandak, Georgios Theocharous, Chris Nota, and Philip Thomas. Lifelong learning with a changing action set. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 3373-3380, 2020b.
+Xinshi Chen, Shuang Li, Hui Li, Shaohua Jiang, Yuan Qi, and Le Song. Generative adversarial user model for reinforcement learning based recommendation system. In International Conference on Machine Learning, pp. 1052-1061. PMLR, 2019a.
+Yu Chen, Yingfeng Chen, Yu Yang, Ying Li, Jianwei Yin, and Changjie Fan. Learning action-transferable policy with action embedding. arXiv preprint arXiv:1909.02291, 2019b.
+Heng-Tze Cheng, Levent Koc, Jeremiah Harmsen, Tal Shaked, Tushar Chandra, Hrishi Aradhye, Glen Anderson, Greg Corrado, Wei Chai, Mustafa Ispir, et al. Wide & deep learning for recommender systems. In Proceedings of the 1st workshop on deep learning for recommender systems, pp. 7-10, 2016.
+Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. Minimalistic gridworld environment for openai gym. https://github.com/maximecb/gym-minigrid, 2018.
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
+Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
+Gabriel Dulac-Arnold, Richard Evans, Hado van Hasselt, Peter Sunehag, Timothy Lillicrap, Jonathan Hunt, Timothy Mann, Theophane Weber, Thomas Degris, and Ben Coppin. Deep reinforcement learning in large discrete action spaces. arXiv preprint arXiv:1512.07679, 2015.
+
+Yu Gong, Yu Zhu, Lu Duan, Qingwen Liu, Ziyu Guan, Fei Sun, Wenwu Ou, and Kenny Q Zhu. Exact-k recommendation via maximal clique optimization. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 617-626, 2019.
+Jessica B Hamrick, Kelsey R Allen, Victor Bapst, Tina Zhu, Kevin R McKee, Joshua B Tenenbaum, and Peter W Battaglia. Relational inductive bias for physical construction in humans and machines. arXiv preprint arXiv:1806.01203, 2018.
+Junheng Hao, Tong Zhao, Jin Li, Xin Luna Dong, Christos Faloutsos, Yizhou Sun, and Wei Wang. P-companion: A principled framework for diversified complementary product recommendation. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pp. 2517-2524, 2020.
+Ji He, Jianshu Chen, Xiaodong He, Jianfeng Gao, Lihong Li, Li Deng, and Mari Ostendorf. Deep reinforcement learning with a natural language action space. arXiv preprint arXiv:1511.04636, 2015.
+Shengyi Huang and Santiago Ontañón. A closer look at invalid action masking in policy gradient algorithms. arXiv preprint arXiv:2006.14171, 2020.
+Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional LSTM-crf models for sequence tagging, 2015.
+Eugene Ie, Chih-wei Hsu, Martin Mladenov, Vihan Jain, Sanmit Narvekar, Jing Wang, Rui Wu, and Craig Boutilier. Recsim: A configurable simulation platform for recommender systems. arXiv preprint arXiv:1909.04847, 2019a.
+Eugene Ie, Vihan Jain, Jing Wang, Sanmit Narvekar, Ritesh Agarwal, Rui Wu, Heng-Tze Cheng, Tushar Chandra, and Craig Boutilier. Slateq: A tractable decomposition for reinforcement learning with recommendation sets. 2019b.
+Ayush Jain, Andrew Szot, and Joseph Lim. Generalization to new actions in reinforcement 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. 4661-4672. PMLR, 13-18 Jul 2020. URL http://proceedings.mlr.press/v119/jain20b.html.
+Ray Jiang, Sven Gowal, Timothy A Mann, and Danilo J Rezende. Beyond greedy ranking: Slate optimization via list-cvae. arXiv preprint arXiv:1803.01682, 2018.
+Anssi Kanervisto, Christian Scheller, and Ville Hautamäki. Action space shaping in deep reinforcement learning. In 2020 IEEE Conference on Games (CoG), pp. 479-486. IEEE, 2020.
+Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. Nsml: Meet the mlaas platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018.
+Hyoungseok Kim, Jaekyeom Kim, Yeonwoo Jeong, Sergey Levine, and Hyun Oh Song. EMI: Exploration with mutual information. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 3360-3369, Long Beach, California, USA, 09-15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/kim19a.html.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
+Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
+
+Shuchang Liu, Fei Sun, Yingqiang Ge, Changhua Pei, and Yongfeng Zhang. Variation control and evaluation for generative slate recommendations. Proceedings of the Web Conference 2021, Apr 2021. doi: 10.1145/3442381.3449864. URL http://dx.doi.org/10.1145/3442381.3449864.
+Andrew L Maas, Awni Y Hannun, Andrew Y Ng, et al. Rectifier nonlinearities improve neural network acoustic models. In Proc. icml, volume 30, pp. 3. Citeseer, 2013.
+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.
+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. Advances in neural information processing systems, 32: 8026-8037, 2019.
+Deepak Pathak, Chris Lu, Trevor Darrell, Phillip Isola, and Alexei A. Efros. Learning to control self-assembling morphologies: A study of generalization via modularity, 2019.
+Zhiwei Qin, Xiaocheng Tang, Yan Jiao, Fan Zhang, Zhe Xu, Hongtu Zhu, and Jieping Ye. Ride-hailing order dispatching at didi via reinforcement learning. INFORMS Journal on Applied Analytics, 50(5):272-286, 2020.
+Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In International Conference on Machine Learning, pp. 4470-4479. PMLR, 2018.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+Junshuai Song, Zhao Li, Chang Zhou, Jinze Bai, Zhenpeng Li, Jian Li, and Jun Gao. Co-displayed items aware list recommendation. IEEE Access, 8:64591-64602, 2020. doi: 10.1109/ACCESS.2020.2984543.
+Peter Sunehag, Richard Evans, Gabriel Dulac-Arnold, Yori Zwols, Daniel Visentin, and Ben Coppin. Deep reinforcement learning with attention for slate markov decision processes with high-dimensional states and actions. arXiv preprint arXiv:1512.01124, 2015.
+Andrea Tacchetti, H. Francis Song, Pedro A. M. Mediano, Vinicius Zambaldi, János Kramár, Neil C. Rabinowitz, Thore Graepel, Matthew Botvinick, and Peter W. Battaglia. Relational forward models for multi-agent learning. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rJlEojAqFm.
+Guy Tennenholtz and Shie Mannor. The natural language of actions. arXiv preprint arXiv:1902.01119, 2019.
+Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
+Tingwu Wang, Renjie Liao, Jimmy Ba, and Sanja Fidler. Nervenet: Learning structured policy with graph neural networks. In International Conference on Learning Representations, 2018.
+Deheng Ye, Zhao Liu, Mingfei Sun, Bei Shi, Peilin Zhao, Hao Wu, Hongsheng Yu, Shaojie Yang, Xipeng Wu, Qingwei Guo, et al. Mastering complex control in moba games with deep reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 6672-6679, 2020.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. 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/f22e4747dalaa27e363d86d40ff442fe-Paper.pdf.
+
+Vinicius Zambaldi, David Raposo, Adam Santoro, Victor Bapat, Yujia Li, Igor Babuschkin, Karl Tuyls, David Reichert, Timothy Lillicrap, Edward Lockhart, et al. Deep reinforcement learning with relational inductive biases. In International Conference on Learning Representations, 2018.
+Xiangyu Zhao, Liang Zhang, Long Xia, Zhuoye Ding, Dawei Yin, and Jiliang Tang. Deep reinforcement learning for list-wise recommendations. arXiv preprint arXiv:1801.00209, 2017.
+Xiangyu Zhao, Long Xia, Liang Zhang, Zhuoye Ding, Dawei Yin, and Jiliang Tang. Deep reinforcement learning for page-wise recommendations. Proceedings of the 12th ACM Conference on Recommender Systems, Sep 2018. doi: 10.1145/3240323.3240374. URL http://dx.doi.org/10.1145/3240323.3240374.
+Tao Zhou, Zoltán Kuscsik, Jian-Guo Liu, Matúš Medo, Joseph Rushton Wakeling, and Yi-Cheng Zhang. Solving the apparent diversity-accuracy dilemma of recommender systems. Proceedings of the National Academy of Sciences, 107(10):4511-4515, 2010.
+
+# A ENVIRONMENT DETAILS
+
+# A.1 DIG LAVA GRID NAVIGATION
+
+The grid world environment, introduced in Sec. 5.1, requires an agent to reach a goal by navigating a 2D maze with two lava rivers using a variable set of skills.
+
+State: The state space is a concatenation of two flattened $9 \times 9$ grids:
+
+1. Environment: each grid element is an integer ID representing whether the cell is empty, orange-lava, pink-lava, goal, or sub-goal
+2. Agent: an empty grid except for 1 at agent-coordinates.
+
+Termination: An episode is terminated in success when the agent reaches the goal and in failure when it stays in lava for two consecutive timesteps or after a total of 50 timesteps. Note that the agent can leave a lava cell only using the dig lava skill of the corresponding color.
+
+Actions: The base action set is a fixed set of 9 skills and in each episode, a set of 7 skills is given to the agent. 5 skills are always available: move-right, move-down, move-left, move-up, and turn-left. The other 2 skills are randomly sampled from a set of 4 skills: turn-right, step-forward, dig-orange-lava, and dig-pink-lava.
+
+Reward: The agent receives a large goal reward on reaching the goal. There are two subgoal rewards for a successful crossing of each lava column (i.e. column 4 and column 8) for the first time. The goal and subgoal rewards are discounted based on the number of action steps taken to reach that location, thus rewarding shorter paths. To further encourage shorter paths, successful lava digging is rewarded. A small exploration reward is added whenever the agent visits a new cell in the episode. The exploration reward is accumulated and subtracted when the agent reaches a subgoal or a goal to ensure that the exploration reward does not hinder learning short paths. Thus,
+
+$$
+\begin{array}{l} R (s, a) = \mathbb {1} _ {G o a l} \cdot \left[ R _ {\text {G o a l}} \left(1 - \lambda_ {\text {G o a l}} \frac {N _ {\text {c u r r e n t s t e p s}}}{N _ {\text {m a x s t e p s}}}\right) - R _ {\text {E x p l o r a t i o n}} N _ {\text {s t e p s f r o m p r e v s u b g o a l}} \right] + \\ \mathbb {1} _ {\text {S u b g o a l}} \cdot \left[ R _ {\text {S u b g o a l}} \left(1 - \lambda_ {\text {S u b g o a l}} \frac {N _ {\text {c u r r e n t s t e p s}}}{N _ {\text {m a x s t e p s}}}\right) - R _ {\text {E x p l o r a t i o n}} N _ {\text {s t e p s f r o m p r e v s u b g o a l}} \right] + \\ \mathbb {1} _ {\text {S u c c e s s f u l D i g}} \cdot R _ {\text {D i g}} + \mathbb {1} _ {\text {N e w S t a t e}} \cdot R _ {\text {E x p l o r a t i o n}} \tag {1} \\ \end{array}
+$$
+
+where $R_{\mathrm{Goal}} = 100$ , $R_{\mathrm{Subgoal}} = 0.5$ , $R_{\mathrm{Exploration}} = 0.01$ , $R_{\mathrm{Dig}} = 0.01$
+
+$$
+\lambda_ {\text {G o a l}} = 0. 9 9, \lambda_ {\text {S u b g o a l}} = 0. 9, N _ {\max \text {s t e p s}} = 5 0
+$$
+
+Action Representations: The action representations are 11-dimensional vectors manually defined using a mix of one-hot vectors, as shown in Table 1. Dimensions 1-5 identify the category of skills (movement, elemental, dig-orange, dig-pink), 6-7 distinguish movement skills (right, down, left, up), 8-9 are always 0 (originally meant for diagonal skills), 10-11 are used to distinguish elemental skills (turn-left, turn-right, move-forward).
+
+| Category | Skill | Action Representation |
| Movement | move-right | 0 | 0 | 0 | 0 | 1 | -1 | -1 | 0 | 0 | 0 | 0 |
| move-down | 0 | 0 | 0 | 0 | 1 | -1 | 1 | 0 | 0 | 0 | 0 |
| move-left | 0 | 0 | 0 | 0 | 1 | 1 | -1 | 0 | 0 | 0 | 0 |
| move-up | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| Elemental | turn-left | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 1 |
| turn-right | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | -1 |
| move-forward | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| Digging | dig-orange | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| dig-pink | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
+
+Table 1: Action representations for the skills used in Dig Lava Grid Navigation environment.
+
+# A.2 CHAIN REACTION TOOL ENVIRONMENT (CREATE)
+
+The CREATE environment (Sec. 5.2) requires an agent to place tools in a physics-based puzzle to make the target ball reach the goal position. We follow all the base settings of the CREATE Push Environment from Jain et al. (2020). We add the functionality of new activator tools and reduce the number of available actions per episode from 50 to 25.
+
+State: The agent receives the past three gray-scale frames, which are stacked channel-wise to make a $84 \times 84 \times 3$ input.
+
+Termination: The episode ends in success when the agent accomplishes the goal and in failure when there is no remaining movement in the game or after 30 timesteps.
+
+Actions: Each original tool from CREATE is now associated with newly added activator tools as shown in Figure 8. Thus, we add 5 activator tools to the 2110 general tools, which are variations in angle, size, friction, or elasticity of the tools shown in Figure 8. Unlike Jain et al. (2020), we remove the No-Operation action. Activator tools are pass-through tools and only serve the function of activating their corresponding general tools when placed in contact.
+
+We split the general tool space into 1098 tools for training, 507 tools for validation, and 507 tools for testing. All 5 activator tools are available for sampling during training, validation, and testing. In each episode, 23 general tools and 2 activator tools are randomly sampled and made available to the agent. The agent outputs in a hybrid action space consisting of (1) the discrete tool selection and (2) $(x,y)$ coordinates of tool position.
+
+
+Figure 8: CREATE Activator Mapping: Original CREATE tools (right) are activated by the respective newly introduced activator tools (left). E.g., a Cannon tool (abbreviated as CNN in attention maps) placed on the environment will only be functional when a Fire tool is placed in contact with it. Other objects are not affected by non-functional tools - they simply pass through.
+
+**Reward:** We adopt the reward structure from Jain et al. (2020). CREATE Push is a sparse reward environment with rewards for reaching the goal and making the target ball move. There is an additional alive reward to continue the episode. Placements outside the scene are penalized. The original CREATE environment penalizes overlapping tools. However, since overlapping activators and general tools is required for solving tasks, we modify the overlap penalty to apply only when either both are general tools or both are activator tools. Thus, the agent receives the following reward:
+
+$$
+R (s, a) = R _ {\text {a l i v e}} + \mathbb {1} _ {\text {G o a l}} \cdot R _ {\text {G o a l}} + \mathbb {1} _ {\text {t a r g e t h i t}} \cdot R _ {\text {t a r g e t h i t}} + \mathbb {1} _ {\text {i n v a l i d}} \cdot R _ {\text {i n v a l i d}} + \mathbb {1} _ {\text {o v e r l a p}} \cdot R _ {\text {o v e r l a p}} \tag {2}
+$$
+
+where $R_{\mathrm{alive}} = 0.01$ , $R_{\mathrm{Goal}} = 10.0$ , $R_{\mathrm{target\_hit}} = 1$ , and $R_{\mathrm{invalid}} = R_{\mathrm{overlap}} = -0.01$ .
+
+Action Representations: Each action representation is a 134-dimensional vector, a concatenation of two 128-D and 6-D vectors, as shown in Table 2. The 128-D vector corresponds to the learned characteristics of the tool, and the 6-D vector is a binary vector denoting whether the tool is a general tool, an activator tool, or a no-op tool (no-op is disabled for experiments).
+
+For general tools, Jain et al. (2020) obtain action representations using a Hierarchical VAE. They encode a set of tool observations into a latent representation. Each tool is made to interact with a probing ball launched from various angles, positions, and speeds. The tool characteristics can be inferred from this collection of tool interactions. We utilize these 128-D learned tool representations from Jain et al. (2020) for the general tools and pad them with a 6-D zero-vector. Generalization to unseen tools is possible because a trained agent can utilize the 128-D tool embedding to extract the relevant characteristics of any given tool. The agent must infer which activator a general tool is associated with using its tool embedding.
+
+For activator tools, the first 128 dimensions are always zero, and the final 6 dimensions correspond to a one-hot vector, each for {no-op, Fire, Water, Electric, Magnet, Spring}.
+
+| Tool | Action Representation |
| General Tools | Learned 128-D tool characteristics | 0 | 0 | 0 | 0 | 0 | 0 |
| No-Op | 128-D Zero Vector | 1 | 0 | 0 | 0 | 0 | 0 |
| Fire | 128-D Zero Vector | 0 | 1 | 0 | 0 | 0 | 0 |
| Water | 128-D Zero Vector | 0 | 0 | 1 | 0 | 0 | 0 |
| Electric | 128-D Zero Vector | 0 | 0 | 0 | 1 | 0 | 0 |
| Magnet | 128-D Zero Vector | 0 | 0 | 0 | 0 | 1 | 0 |
| Spring | 128-D Zero Vector | 0 | 0 | 0 | 0 | 0 | 1 |
+
+Table 2: Action representations for the tools in CREATE environment.
+
+# A.3 RECSIM
+
+The simulated RecSys environment (RecSim in Sec. 5.3.1), requires an agent to select a list of items that match the user's interest out of a variety of recommendable items. We simulate users that have a preference over high-CPR lists (Sec 5). The agent's task is to infer this preference from user clicks and recommend a list of items to optimize both user interest and CPR.
+
+State: The state is represented by the user interest embedding $(e_u\in \mathbb{R}^n$ where $n$ denotes the number of categories of items) in categories that transitions over time as the user consumes different items upon click. So, when the user clicks an item with the corresponding item embedding $(e_i\in \mathbb{R}^n)$ then the user interest embedding $(e_u)$ will be updated as follows,
+
+$$
+\Delta \left(e _ {u}\right) = (- y \mid e _ {u} \mid + y) \cdot \left(1 - e _ {u}\right), \text {f o r} y \in [ 0, 1 ]
+$$
+
+$$
+e _ {i} \leftarrow e _ {u} + \Delta \left(e _ {u}\right) \text {w i t h p r o b a b i l i t y} \left[ e _ {u} ^ {T} e _ {i} + 1 \right] / 2
+$$
+
+$$
+e _ {u} \gets e _ {u} - \Delta (e _ {u}) \mathrm {w i t h p r o b a b i l i t y} [ 1 - e _ {u} ^ {T} e _ {i} ] / 2
+$$
+
+This essentially pulls the user's preference towards the item that was clicked.
+
+Action: The base action set is a set of 500 items (250 for each train and test action set), and in each episode, a sampled subset of size 20 is given to the agent. To simulate the varying action space environment, we implemented the most common category sampling method to form the candidate-set. Here, the majority of items are sampled from one common category, and the remaining items are sampled from other categories. In this way, identifying the most common category is crucial to recommend a coherent list of items. Note that if we just sampled items uniformly across all categories, then CPR maximization would be less interesting as no single category has the potential to fill the entire list of items (i.e., achieve maximum CPR).
+
+
+(a) Items with main category
+
+
+(b) Items with main and sub category
+Figure 9: t-SNE visualization of synthetically generated items in RecSim.
+
+Reward: The base reward is a simulated response (e.g., clicks) from users (the user model (Ie et al., 2019a) stochastically skips or clicks an item in the list based on the user interest embedding). To better simulate the realistic scenario of user preference being affected by CPR of a presented list, we implement additional features in the user model:
+
+$$
+\text {s c o r e} _ {\text {i t e m}} = \alpha_ {\text {u s e r}} * \left\langle e _ {u}, e _ {i} \right\rangle + \alpha_ {\text {m e t r i c}} * m
+$$
+
+$$
+p _ {i t e m} = \frac {e ^ {s _ {i t e m}}}{\sum e ^ {s _ {i t e m}}}
+$$
+
+$$
+R = f _ {\text {c l i c k} \text {o r} \text {s k i p}} (p _ {\text {i t e m}})
+$$
+
+where, $e_{u}, e_{i} \in \mathbb{R}^{n}$ are the user and item embedding, respectively, $\langle \cdot, \cdot \rangle$ is the dot product notation and $\alpha_{user}, \alpha_{metric}, m \in \mathbb{R}$ where $m$ denotes the list-metric (e.g., CPR-score). So, given the score score item of an item, the user model computes the click likelihood through a softmax function over all items and a predefined skip-item followed by a categorical distribution ( $f_{\text{click_or}skip}$ ). It takes the computed likelihood and outputs either click (reward=1) or skip (reward=0) as user feedback.
+
+Action Representations: Originally, Ie et al. (2019a) use the discrete representation of items based on the one-hot encoding of item-category. However, this does not support generalization over items (actions). Therefore, we implement continuous item representations sampled from a Gaussian Mixture Model (GMM) with centers around each item category. Each item category has two sub-categories for items, which are also clustered. This ensures that the action representation contains information about the primary and sub-categories. Fig. 9 shows the t-SNE visualization of action representations for the 500 items, based on a GMMs. There are 10 main categories that each have two sub-categories. Figure 9a shows item representations labeled according to the primary category. Figure 9b shows item representations clustered according to sub-category.
+
+# A.4 REAL-DATA RECOMMender SYSTEM
+
+The real-data RecSys environment (Sec. 5.3.2) requires an agent to select a list of items that match the user's interest out of a variety of recommendable items. We experiment with the scenario in which domain engineers want an RL agent's list-actions to conform to user preference while optimizing a listwise metric. Since having a high CPR is correlated with better user response (Hao et al., 2020), we use CPR as the additional listwise metric. Thus, we reward the agent based on (i) user models trained from real data and (ii) CPR of the recommended list of items. We collected the dataset from two different periods, two weeks in late August in 2021 as the offline period (used for training) and the following two weeks from early September in 2021 as the online period (used for evaluation).
+
+State: The state is a concatenation of a sequence of historical user interactions. Concretely, a set of item representations (32 dimensional real vectors) of the three most recent clicked items (i.e., $32 \times 3$ matrix) are appended individually to the user attributes (137 dimensional real vectors) such as age, occupation, and localities. Therefore, the state is in the form of $507 = 169 \times 3 = (32 + 137) \times 3$ . To act optimally, the agent must extract the useful representation of the user preference through this historical observation.
+
+
+Figure 10: Real-Data Recommender System: F1 Score for Training/test user models. (Left) The online user model is trained on online-training data and evaluated on both online-training (green) and online-held-out (orange) data. (Right) The offline user model is trained on offline-training data and evaluated on both offline-training (green) and offline-held-out data (orange). Thus, the disparity between online data training and evaluation curves (left) shows that it is hard to train the online user model. In contrast, the offline user model generalizes reasonably well (right).
+
+
+
+
+(a)
+
+
+(b)
+Figure 11: (a) t-SNE visualization of split of train and test item representations. This shows that the train and test items are within the same distribution (b) Visualizations of item representations clustered according to the main category. This shows that item representations contain information about the main category, which is necessary to maximize CPR. (c) Item distribution labeled according to sub category, which is another information necessary for CPR.
+
+
+(c)
+
+Action: The base action set is a set of 85 items, and in each episode, a sampled subset of size 20 is given to the agent. We employed the same sampling methods as in Sec. A.3. So, the agent needs to select a list of 6 items given the sampled candidate set of 20 items.
+
+Reward: The base reward is a simulated response (click or skip) from the user model trained from real-world data. We add the CPR metric (between 0 to 1) to this click reward (1 or 0). The agent's objective is to optimize user preference and the CPR of the list of items it recommends.
+
+Training of User models: We follow the two different periods (offline and online) in the data extraction procedure. Thus, we trained two different user models $(f_{user} : S \times \mathcal{A}^{\mathrm{list - size}} \to \mathbb{R})$ to (i) train the agents offline and (ii) evaluate them with online users. The result of training those user models can be found in Figure 10 (a). Thus, the reward is computed as follows; $R = f_{user}(e_{user}, e_{item}) + m$ where $f_{user}$ is either the offline user model or the online user model that provides us with the simulated response of users (e.g., click or skip). The user model architectures are described in Sec. C.3.5.
+
+Action Representation: In the previous work CDQN (Chen et al., 2019a), the authors found it useful to characterize the items by wide and deep features. For example, their movie recommendation task considered the text description as the wide feature and the movie category as the deep feature. And they utilized the Wide and Deep Network (Cheng et al., 2016) to get useful representations of items. Following their work, we used the wide and deep network to pretrain the item embedding given the rich item features in the real-world data. However, we empirically observed that employing VAEs for each wide and deep feature of items leads to the better-segregated representation of items. Therefore, given an item instance, we separate the raw item attributes into the deep attributes (e.g., reward points of campaigns) and the wide attributes (e.g., text description),
+
+which are then fed into the VAE based wide and deep network to get the compressed representation by combining the wide and the deep features together. See Sec C.3.4 for more details about the network architecture. Thus, each action representation is a 32-dimensional vector encoded by a VAE based Wide and Deep network. The learned representations of items are visualized based on the train-test split, distribution of the main category, and distribution of sub-category in Figure 11.
+
+# B FURTHER EXPERIMENTAL RESULTS
+
+# B.1 EFFECT OF USING DOMAIN KNOWLEDGE IN ACTION GRAPH EDGES
+
+To show how to incorporate domain knowledge about action relations into the action graph (discussed in Section 4), we use the Dig Lava Grid World environment. Specifically, we use the knowledge that directional actions are always available. Thus, the only relevant action relations are the ones with the variable actions, i.e., 2 out of 4 actions (including both dig-lava skills). So, while building the action graph, we only keep connections to and from the 2 variable actions instead of having a fully-connected structure. The rest of the AGILE architecture and algorithm stays the same. This reduces the number of bidirectional edges from $7^{2} = 49$ to 29 by removing 20 edges between the always available actions. As shown in Figure 12, the learning speed of AGILE is slightly accelerated, and the seed variance has reduced. We expect domain knowledge to help efficiency even more, when the action space is large since the edges scale quadratically.
+
+
+(a) Training Curve: Slightly faster
+(b) Attention Map: Fewer edges
+
+
+Figure 12: Effect of using domain knowledge to predefine the possible relations via edges in the action graph of AGILE. We know that in the Grid Navigation task, only the action relations with respect to variable actions are important. Thus, we remove all the other edges. This makes the learning slightly faster and more stable as shown by a reduction in seed variance. (5 seeds)
+
+# B.2 VALIDATING DESIGN CHOICES FOR VALUE-BASED AGILE
+
+We conducted an exhaustive search on the architecture of value-based AGILE from two different perspectives; (a) Hyper-parameters and (b) Architectures. Note that the same hyper-parameter search procedure of this section was applied to all other methods, and the same trend of the improvement in AGILE was found for other methods. In this section, AGILE used in the main results (Fig. 4, 5, 7) is called AGILE-Tuned. The barebone version of AGILE-Tuned is called AGILE-Untuned. We illustrate how each change contributes to an improvement in performance.
+
+# B.2.1 HYPER-PARAMETER SEARCH IN AGILE
+
+- AGILE-Tuned without sync-freq-change: In Mnih et al. (2015), the authors used the periodicyncing between the target and the main networks to alleviate the issue of frequently moving Q-value targets. In this work, we compare two extreme cases of the sync frequency: 10 depicted by Sync-freq=10 in Fig. 13 (a) and 500 depicted by AGILE-Tuned.
+- AGILE-Tuned without graph-dim-change: To understand the difficulty in expressing the action relations through a compact representation, we compare two hidden dimension sizes. The node-features are encoded in 32 ( $\text{Graph-dim} = 32$ ) or 64(AGILE-Tuned) dimensions.
+
+
+(a) Hyperparameter search
+
+
+
+
+(b) Design choices
+
+
+Figure 13: Results of value-based AGILE on RecSim CPR task (a) hyperparameter testing and (b) validating architecture design choices, on train actions (left) and test actions (right).
+
+Figure 13(a) shows the result on both train and test actions. AGILE-Tuned outperformed all the methods. Graph-dim=32 is slightly worse than AGILE-Tuned and Sync-freq=10 fails to learn anything meaningful. Thus, frequently moving target network harms the agent's performance while sufficient expressiveness in the action graph improves the performance.
+
+# B.2.2 DESIGN CHOICES OF AGILE
+
+- AGILE-Tuned with pre-summarizer: In AGILE-Tuned, the concatenation of an action representation and the state is a node feature input to the GAT (Sec.C.3.1)). Here, we experiment and observe that adding a 2-layer MLP with ReLU over the node features does not help performance.
+- AGILE-Tuned without target-q-change: Chen et al. (2019a) compute the target q-values for training CDQN using the list-action at the next time-step. But, there is another potential target q-value from the next item in the current list-action. Here, we compare these two methods to get the target q-value: (a) intra-list(AGILE-Tuned): the target q-value is from the next list index. (b) across-list (No target-q change): the target q-value is from the next timestep.
+- AGILE-Tuned without twinGAT-change: In AGILE, the GAT output provides the utility network with the relational action representation and the action summary. Here, we compared two options: (a) Sharing GAT (No twin-GAT): there is a single GAT working to provide both of them. (b) Non-sharing GAT (AGILE-Tuned): this employs two different GATs for each.
+- AGILE-Tuned without main/target-encoder-separation-change: In the implementation of AGILE, we compared two different architectural decisions. (a) No main-target separation: Separate the list-action encoder in CDQN for main and target Q-networks. (b) AGILE-Tuned: share the same list-action encoder for main and target Q-networks.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 14: Comparison against the baselines on train (top) and test (bottom) actions on the Direct CPR (left) and Pairing (right) RecSim environments. Along with Figure 4, these results exhibit the same trend that AGILE consistently outperforms all the baselines on both train and test actions.
+
+
+
+
+Figure 15: Comparison against ablations on the Direct CPR (left) and Pairing (right) RecSim environments. Along with Figure 5, these results exhibit the same trend that AGILE slightly outperforms the various summary ablations, which do not explicitly utilize relational action features and rely only on the summary vector to encode all the necessary action relations.
+
+Figure 13(b) shows the result on both train and test actions. AGILE-Tuned, With pre-summizer, and No twin-GAT showed the similar performance which is better than No target-q-change. The difference between AGILE-Tuned and No target-q-change is that the cascaded network in AGILE-Tuned uses the target q-value from the intermediate list constructed. This is a more accurate target q-value as compared to the target q-value from another list from a future time-step.
+
+# B.3 EFFECT OF DIRECT V/S INDIRECT REWARD IN RECSIM
+
+In Fig.4, we studied the learning capability of AGILE under the action interdependence on RecSim in which the CPR itself was not directly visible to the agents. Therefore, agents need to indirectly understand how well the list-action is through user feedback (i.e., clicks). In this section, we strengthen our results by examining the consistency of results. The CPR is made directly visible to all the agents in this setting. So, we implemented an additional environment in RecSim where the reward is a sum of the click reward and the CPR metric. We call this environment as Direct CPR. Figure.14 shows the comparison of AGILE against the same baseline agents as in Fig.4 on the Direct
+
+
+
+
+Figure 16: Analyses of (i) GAT v/s GCN and (ii) state-action graph v/s action-only graphs on (left) RecSim: Direct CPR environment and (right) RecSim: Pairing environment.
+
+
+
+CPR RecSim. And in Fig.15 and Fig.16, we got the consistent result that AGILE slightly outperforms the ablations. AGILE outperforming the baselines shows that the knowledge of dependence on other available actions is crucial for optimal policy. This result is consistent with the indirect CPR optimization setting in Fig.4. So AGILE can perform well in the direct maximization of CPR.
+
+# B.4 RECSIM-PAIRING ENVIRONMENT
+
+In the experiment of Fig. 5, we found that in RecSim, the relation of items is easy to model such that AGILE could not outperform the ablations. In contrast, AGILE outperformed the ablations in CREATE and Grid World by correctly utilizing the action relation in decision-making. We hypothesize that these environments require complex relations between actions (e.g., tools and activators in CREATE). To this end, we implement the pre-defined pairings among items in RecSim such that clicks can only happen when the correct pairs of items are recommended. Since action relations are complex, AGILE is expected to outperform the ablations. Figure 14 shows that AGILE beats the baselines and in Fig.15 AGILE slightly but consistently outperforms the ablations. In Fig.16, AGILE outperforming AGILE-GCN shows that a GAT is capable of modeling the action relations correctly. AGILE converges faster than AGILE Only-Action. This shows that the state and the partially constructed list are crucial to learning to attend the other half in pairing items efficiently.
+
+# C APPROACH AND BASELINE DETAILS
+
+# C.1 DETAILS OF BASELINES AND ABLATIONS
+
+Like AGILE, all baselines and ablations receive the state and action representations as input and output a Q-value or a probability distribution over available actions. Figure 17 describes the architectures of all the methods. Here, we discuss how each baseline and ablation is different from AGILE and why AGILE is expected to outperform them:
+
+- **Mask-Output** (No representations, No input action set): This baseline assumes a fixed-action space that is known in advance. Since it does not use action representations, it cannot generalize to unseen actions or exploit the structure in action space. Moreover, it does not take the available action set as input and thus cannot solve tasks where action decisions require knowledge of other actions.
+- Mask-Input-Output (No representations): By augmenting a binary availability mask of given actions to the state input of Mask-Output, this method can utilize the information about the available action set as a set. However, the input availability-mask is fed into an MLP, which lacks the inductive bias of order invariance of action set and cannot learn relations explicitly like graph networks.
+- Utility-Policy (No input action set): By using action representations, this method can use the structure of action space for efficient training and also generalize to unseen actions. However, like Mask-Output, it does not utilize the available action set as part of the state and makes each action
+
+
+(a) Mask-Output and Mask-Input-Output Baselines
+
+
+(b) Utility-Policy Baseline
+
+
+(c) Summary-GAT, -LSTM, and -Deep Set Ablations
+
+
+(d) AGILE
+
+
+(e) AGILE-Only Action Analysis
+Figure 17: Architectures of all methods used as baselines (Sec. 6.1.1), ablations (Sec. 6.1.2), and analyses (Sec. 6.3.2). (a) Following prior work in SAS-MDPs (Boutilier et al., 2018; Chandak et al., 2020a) and invalid action masking (Huang & Ontanon, 2020; Ye et al., 2020; Kanervisto et al., 2020), the mask-output baseline masks out the unavailable actions assuming a known action set. The mask-input-output baseline additionally augments the state with the action availability mask. (b) Utility-policy (Jain et al., 2020) can generalize over actions by using action representations. However, it computes each action utility independent of other available actions. (c) Summary Ablations augment the utility-policy with an extra action-summary input, which is a compressed version of the list of available action representations. This compression can be done by mean-pooling over a Bi-LSTM output layer, or a deep set, or a graph network (GAT) processed node features. (d) AGILE (Ours) uses a GAT's node features both to compute an action set summary and as relational action features replacing the original action representations. While the action set summary is a compact representation of the available actions, it does not sufficiently scale when there are many actions or the task requires many action relations for each action decision. (e) AGILE-Only Action is the version of AGILE where the state is not used to compute action relations in GAT. This is a simpler architecture to learn but is not expected to work for certain tasks where action relations change depending on the state.
+
+decision independent of other actions. Thus, it is expected to be suboptimal in all the tasks we consider.
+
+- Summary-LSTM: This is an ablation where we do not utilize the per-action relational features computed by a GAT in AGILE. Instead, we use raw action features as input to the utility network. However, we utilize the available action set information by summarizing the set of input action representations into a vector. The summarization based on Bi-LSTM does not use the order invariance property of the action set, which makes it less efficient to learn than other summarizers. AGILE is expected to outperform all summary-only ablations in environments where several different action relations need to be modeled for computing different action utilities. This is true for complex environments like CREATE, where the agent needs to consider various tools and activators to make an optimal decision about its action choice. In such environments, learning a shared summary-vector for all action utility computations is inefficient and possibly prohibitive for learning. We note that the summary-ablations are sufficient in simple environments such as Grid World navigation. The agent just needs to summarize which of the two dig-lava skills are available. Such a summary is enough to compute the utility of each of the 7 available actions.
+- Summary-Deep Set: This ablation utilizes the order invariance of action sets using a deep-set. While it still suffers from the limitations of lack of per-action relational action features, it is a low-parameter network and thus easy to train.
+- Summary-GAT: This is a variation of AGILE, where raw action features replace the relational action features. Using a GAT to extract the action set summary exploits order invariance. However, being a fully-connected graph network, it is can be slow to train while not offering much more than the deep-set summarizer. This can be useful when certain action relations are predefined using domain knowledge (Section B.1).
+- Agile-Only-Action: This variation of AGILE does not utilize state input in the GAT. Thus, the summary vector and relational action features are computed independently of state-context. While this is a simpler architecture to train, it can be insufficient in environments where the action relations vary depending on the state.
+
+# C.2 DETAILS ON LISTWISE AGILE
+
+AGILE is implemented based on the listwise RL architecture, CDQN (Chen et al., 2019a). As shown in Algorithm 1, CDQN builds a list-action incrementally by selecting N actions in sequence. For each list-index, a Q-network is used to select the best action. In addition to the usual state input, the partially built list-action is also an input to the Q-network. Concretely, the state and current list are encoded into latent embeddings for any list index. These are concatenated with each action representation in the remaining action set to build a list of nodes to be input into the action graph of AGILE. Treating it as a fully-connected graph, AGILE outputs a set of relational action features for all inputs actions. These are mean-pooled into a summary vector representing the entire action set. The representations of state, current-list, summary, and relational action features are used as input by a utility network (MLP) which outputs the Q-value of that particular action for the current list-index. The action with the maximum Q-value is added to the list, and the algorithm moves to the next list-index.
+
+For training AGILE-based CDQN, we maintain a target Q-network that is synchronized periodically with the main Q-network. Suppose a tuple of $(s, a_{\mathrm{list}}, r, \tilde{s})$ is sampled from the replay buffer. For list index $n$ between 1 and $N - 1$ , we compute the target Q-value using the current state $s$ with partial list-action $a_{1:n}$ as input. However, for the last list index $n = N$ , we compute the target Q-value using the next state $\tilde{s}$ for its first list index. A mean-squared error loss is used over all the list indices to train the main Q-network.
+
+# C.3 NETWORK ARCHITECTURES
+
+# C.3.1 ACTION GRAPH
+
+The action graph takes as input the action representations and the state-information (we also include the list-embedding for Listwise AGILE; See Sec. C.2). Given the concatenation of the input components above, an optional 2-layer MLP with ReLU, called pre-summarizer.mlp, transforms it into
+
+Algorithm 1 Cascaded DQN: Listwise Action RL
+1: def listwise_action):
+2: Parameters: Q-network $\phi$ - Encoders, GAT and Utility network
+3: Inputs: State $s$ , actions $\mathcal{A}$ , representations $\mathcal{C} = \{c_{a_0},\dots,c_{a_k}\}$ , list-action length $N$
+4: Initialize: List Action $a_{list} = []$ . Candidate Actions $\mathcal{A}' = \mathcal{A}$
+5: for $n = 1,\ldots,N$ do:
+6: Encode State: $e_s = \phi_s(s)$
+7: Encode Current List: $e_{list} = \phi_{list}(a_{list})$
+8: Build Graph Nodes: $\mathcal{V} = \{[e_s,e_{list},c_a]:a\in \mathcal{A}'\}$
+9: Build fully-connected Adjacency Matrix of size $|\mathcal{V}|$ : $\mathcal{E}$
+10: Relational Action Features: $e_{\text{relational}}^a = \phi_{\text{GAT}}(\mathcal{V},\mathcal{E})\forall a\in \mathcal{A}'$
+11: Action Set Summary: $e_{\text{summary}} = \frac{1}{|\mathcal{V}|}\sum_a e_{\text{relational}}^a$
+12: Q-values: $Q_n(s,a,\mathcal{A}') = \phi_{\text{utility}}(e_s,e_{list},e_{summary},e_{\text{relational}}^a)\triangleright Ablations: e_{\text{relational}}^a = c_a$
+13: Select action: $a_n = \arg \max_{a\in \mathcal{A}'}Q_n(s,a,\mathcal{A}')$
+14: Update: $a_{list} = a_{list}\cup a_n.\mathcal{A}' = \mathcal{A}'\setminus a_n$
+15: def listwise_update():
+16: Parameters: Q-network $\phi$ , Target Q-network $\phi_T$ , discount factor $\gamma$
+17: Inputs: state $s$ , action $a_{list} = a_1,\dots a_N$ , reward $r$ , next state $\tilde{s}$
+18: for $n = 1,\dots,N$ do:
+19: Use listwise_action( $\phi$ ) to get Q-function: $q_n = Q_n(s,a_n,\mathcal{A}\setminus a_{1:n-1})$
+20: Use listwise_action( $\phi_T$ ) to get target Q-value :
+[ y_n = \begin{cases} r + \gamma \max_a Q_{n+1}(s,a,\mathcal{A}\setminus a_{1:n}) & n < N \\ r + \gamma \max_a Q_1(\tilde{s},a,\mathcal{A}) & n = N \end{cases} ]
+21: Optimize Loss $\mathcal{L} = \sum_{n=1}^{N}(q_n - y_n)^2$
+
+the node features for the action graph. Then, the resultant node features are passed on to two GAT layers followed by a residual connection. The same architecture of GAT is duplicated with different weights to provide separate pathways to compute the summary vector and relational action features. Therefore, we have two different sets of node features. The first set of node features is mean-pooled to produce the action-summary vector, which is put through a 2-layer MLP with ReLU to post-process before being passed on to the utility network. The other set of node features (i.e., relational action features) is directly fed into the utility network.
+
+AGILE with GCN: When the GCN is used in the action graph, the same input as above goes into a linear layer to compress the size. Subsequently, the resultant node-features are used in GCN message-passing based on the normalized adjacency matrix, with all the diagonal elements made 0. Otherwise, the GCN reduces to learning the same edge coefficients for all the nodes. The rest of the following architecture is the same as GAT above.
+
+Summary-GAT: In this ablation, instead of the relational action features being fed into the utility network, the raw action representations are used. The rest of the architecture remains the same.
+
+# C.3.2 SUMMARIZERS: BI-LSTM AND DEEP SET
+
+Bi-LSTM: The raw action representations of candidate actions are passed on to the 2-layer MLP followed by ReLU. Then, the output of the MLP is processed by a 2-layer bidirectional LSTM (Huang et al., 2015). Another 2-layer MLP follows this to create the action set summary to be used in the following utility network.
+
+DeepSet: Similar to the Bi-LSTM variant of the summarizer, we employed the 2-layer MLP with ReLU followed by the mean pooling over all the candidate actions to compress the information. Finally, the 2-layer MLP with ReLU provides the resultant action summary with the following utility network described in the next subsection.
+
+# C.3.3 UTILITY NETWORK
+
+We implemented two types of utility networks to show the potential of AGILE architecture working with different kinds of RL algorithms and environments. Both the utility networks take as input the same components: the state-information, the relational or raw action representations, and the action summary of the action graph (See Sec C.3.1). The utility network is a 2-layer MLP applied parallelly on all these inputs corresponding to each action. It computes a scalar value for each action.
+
+Policy Gradient(PPO): The action utility values are used as logits of a Categorical distribution, which is then used to train the AGILE architecture with policy gradient algorithm, PPO.
+
+Value-based(CDQN): List Encoder: An intermediate list that contains the currently selected list items at each intra-list time-step is passed on to a single layer gated recurrent network (GRU (Cho et al., 2014)) followed by a 2-layer MLP to extract the compact representation of the intermediate list. See Algorithm 1 for details on this.
+
+$Q$ -network: As in Sec C.3.1, the input components for the utility network are the raw action representation, the state-information, the list-embedding, the node-features, and the action set summary from the action graph — $(s_t, e_{\mathrm{list}}, e_{\mathrm{node}}, e_{\mathrm{summary}}, a_k)$ in Algorithm 1. These are concatenated into a single vector and passed on to a 2-layer MLP with ReLU to compute the Q-value of an item.
+
+# C.3.4 ACTION REPRESENTATION NETWORK
+
+Hierarchical VAE (CREATE): The CREATE action representations are borrowed from Jain et al. (2020) directly. The Hierarchical VAE network takes as input a list of behavioral trajectories representing each action (tool) and reconstructs it with a two-layer hierarchy of VAEs. We refer the reader to Appendix D.3.1 of Jain et al. (2020) for complete details of the Hierarchical VAE network.
+
+VAE in Deep and Wide architecture (Real World recommender system): In a VAE, the encoder is implemented with a 5-layer MLP with a Batch Normalization layer (Maas et al., 2013) and LeakyReLU (Maas et al., 2013). On the other hand, the decoder is implemented with a single MLP to process the input, followed by the same architecture of MLPs used in the encoder. Finally, a 2-layer MLP with Batch Norm and LeakyReLU and the hyperbolic tangent activation function is used to reconstruct the input instance.
+
+# C.3.5 REWARD INFERENCE NETWORK (USER MODEL IN REAL WORLD RECSYS)
+
+The user model takes as input the user information(i.e., a concatenation of user attributes and a sequence of the user interactions) and a set of item embeddings in the list. The user information is passed on to a single layer gated recurrent network(GRU (Cho et al., 2014)) followed by a 2-layer MLP to extract the compact representation of the state. The same GRU network architecture (with different weights) processes the set of item embeddings into a list-embedding. Finally, a 2-layer MLP takes as input the concatenation of those two embeddings(i.e., state-embedding and list-embedding) and provides the scores of items in the list followed by the sigmoid function to transform to the individual click likelihood.
+
+# D EXPERIMENT DETAILS
+
+# D.1 IMPLEMENTATION DETAILS
+
+We used PyTorch (Paszke et al., 2019) for our implementation, and the experiments were primarily conducted on workstations with either NVIDIA GeForce RTX 2080 Ti, P40, or V100 GPUs on Naver Smart Machine Learning platform (NSML) (Kim et al., 2018). Each experiment seed takes about 4 hours for Grid Navigation, 60 hours for CREATE, 8 hours for RecSim, and 15 hours for Real-Data Recommender Systems, to converge. We use the Weights & Biases tool (Biewald, 2020) for logging and tracking experiments. All the environments were developed using the OpenAI Gym interface (Brockman et al., 2016). For training Grid Navigation and CREATE environments, we use the PPO (Schulman et al., 2017) implementation based on Kostrikov (2018). For the recommender system environments, we use DQN (Mnih et al., 2015). We use the Adam optimizer (Kingma & Ba, 2014) throughout. We attach the code with details to reproduce all the experiments, except the real-data recommender system.
+
+# D.2 HYPERPARAMETERS
+
+We build on hyperparameters used in prior work on CDQN (Chen et al., 2019a) and utility policy (Jain et al., 2020). The hyperparameters for the additional components introduced in AGILE, baselines, and ablations are shown in Table 3. The environment-specific and RL algorithm hyperparameters are described in Table 4.
+
+| Hyperparameter | Value |
| AGILE |
| number of GAT layers | 2 |
| number of attention heads | 1 |
| number of message passing steps | 1 |
| leakyReLU alpha | 0.2 |
| graph hidden dimension | 64 |
| Residual Connection | True |
| Mask-Input-Output |
| Availability mask MLP hidden size | 64 |
| Ablations |
| Summary-LSTM hidden size | 64 |
| Summary-LSTM directions | 2 |
| Summary-LSTM number of layers | 2 |
| Summary-Deep-Set hidden size | 64 |
| Summary-GAT hidden size | 64 |
| Summarizer pooling operation | mean |
+
+Table 3: AGILE, baseline and ablations: Hyperparameters for additional components
+
+# D.3 HYPERPARAMETER TUNING
+
+Initial hyperparameters are inherited from the prior works (PPO: Jain et al. (2020); CDQN: Chen et al. (2019a)). To ensure fairness across all baselines and our methods, we use the original hyperparameters for the RL algorithms, such as learning rate, entropy coefficient, etc. (Table 4. We choose a sufficiently large number for total epochs (DQN) and total environment steps (PPO) to ensure all the methods converge.
+
+Our main contribution is the AGILE architecture. Thus, to correctly validate against baseline and ablation architectures, we search over shared parameters together and generally observe the same trend across all methods. This was expected because of the shared underlying implementation of the RL algorithm. Specifically, we searched over the following shared parameters, usually over 5 seeds and sometimes 3 seeds:
+
+- Hidden dimension in DQN networks: We searched over $\{32,64,128\}$ and found that $64 \approx 128 > 32$ . We choose 64 as the base hidden dimension across all encoders, summarizers, and GATs.
+- Target network sync frequency: This was a sensitive parameter for DQN training. We searched over $\{10, 20, 100, 500, 1000\}$ and found 500 to be the best performing across all methods.
+- Weight sharing in CDQN: In Chen et al. (2019a), the authors did not share the weights of Q-nets in their Cascading architecture, but we empirically observed that sharing the weights of them improved the performance. This is likely due to the nature of RecSim tasks requiring similar items to be recommended across the slate to maximize CPR.
+- Training batch size (DQN): We searched over $\{32,64,128,256\}$ on RecSim and chose 128 as, beyond that, we observed diminishing returns. For Real RecSys, we used the same batch size.
+- Training batch size (PPO): We searched over \{4096, 8192\} for Grid World and \{3072, 4608\} for CREATE and observed that larger batch sizes are better. We did not increase the batch size further due to limits on GPU memory size.
+
+| Hyperparameter | Grid world | CREATE | RecSim | Real RecSys |
| Environment |
| action representation size | 11 | 134 | 20 | 32 |
| observation space | 162 | 84 × 84 × 3 | 10 | 507 |
| candidate actions per episode | 7 | 25 | 20 | 20 |
| max. episode length | 50 | 30 | 15 | 10 |
| RL Training |
| training batch size | 8192 | 4608 | 128 | 128 |
| parallel processes | 64 | 48 | 16 | 16 |
| discount factor | 0.99 | 0.99 | 0.99 | 0.99 |
| learning rate | 1e-3 | 1e-3 | 1e-4 | 1e-4 |
| hidden layer size | 64 | 64 | 64 | 64 |
| PPO |
| entropy coefficient | 0.05 | 0.005 | | |
| continuous action entropy coefficient | - | 0.0005 | | |
| total environment steps | 8 × 10^6 | 10^8 | | |
| value loss coefficient | 0.5 | 0.5 | | |
| PPO epochs | 4 | 4 | | |
| PPO clip parameter | 0.1 | 0.1 | | |
| DQN |
| epochs | | | 10000 | 5000 |
| target network sync frequency | | | 500 | 500 |
| Q-network hidden dimension | | | 256 × 64 | 256 × 64 |
| list encoder dimension | | | 64 | 64 |
| action encoder dimension | | | 32 | 32 |
| list size | | | 6 | 6 |
| replay buffer size | | | 10^6 | 10^6 |
| initialize replay buffer size | | | 5000 | 100 |
| epsilon decay | | | 1 → 0.1 | 1 → 0.1 |
| epsilon decay last epoch | | | 500 | 250 |
+
+Table 4: Environment/Policy-specific Hyperparameters
+
+Below, we detail the hyperparameters and network variations searched specifically for the graph attention network (GAT) used in AGILE and its variants.
+
+- Skip Connection: Adding skip connection was crucial to making AGILE learn well.
+- Number of graph attention layers: We searched over $\{1,2,3\}$ layers and found 2 layers to be the best performing for both PPO and CDQN based policies.
+- Number of attention heads: We compared having $\{1,2\}$ attention heads and found no meaningful learning for 2 attention heads.
+- Number of message passing steps: Adding more message-passing steps than 1 did not improve AGILE performance.
+
+Other relevant design choices are described and validated in Section B.2.
\ No newline at end of file
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/images.zip b/knowyouractionsetlearningactionrelationsforreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..dae566b32db624afc10975f4231d5667010c653f
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:692ba62bcc274a32063a2b6ec66bf4ed8fbaa00f114b8ca8dfb9e7d12f662c21
+size 1211103
diff --git a/knowyouractionsetlearningactionrelationsforreinforcementlearning/layout.json b/knowyouractionsetlearningactionrelationsforreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0e5372597adba38281d314ffbfb102b4e3aa2537
--- /dev/null
+++ b/knowyouractionsetlearningactionrelationsforreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5f50b3ffaff579e764b47f1f444ae46ff4683a82e43b9b7a150c79b890c4fb18
+size 755387
diff --git a/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_content_list.json b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8343d6fe76301ecc66875c23f99fa34ba025f681
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9bf3d6851c843aa3e286752f0b4c9b354696fc6795645678f9a6f30ece72ca32
+size 121781
diff --git a/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_model.json b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..35d9223b72e320c4767360d15b9ee293d44be46b
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:266adb989608710bde5b991da5eb8d9d5422d8bd7b3cf6ea2c3b50833ea7b44c
+size 146974
diff --git a/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_origin.pdf b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0f491e3247dafbc0508b553fb32de607cac2d4b7
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/f40b5ecb-0c06-42ec-ae10-ec77a8d984bd_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10ccd9a23c123a8815dcc0487cd203ce6c35432fd8322c5a276eaa3ae83b7e61
+size 3557868
diff --git a/l0sparsecanonicalcorrelationanalysis/full.md b/l0sparsecanonicalcorrelationanalysis/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8c334177a99feee5fdd578d0feb9fce2604ac579
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/full.md
@@ -0,0 +1,438 @@
+# $\ell_0$ -SPARSE CANONICAL CORRELATION ANALYSIS
+
+# Ofir Lindenbaum
+
+Faculty of Engineering
+
+Bar Ilan University
+
+Ramat Gan, Israel
+
+ofirlin@gmail.com
+
+# Moshe Salhov* & Amir Averbuch
+
+School of Computer Science
+
+Tel Aviv University
+
+Tel Aviv, Israel
+
+# Yuval Kluger
+
+School of Medicine
+
+Yale University
+
+New Haven, CT, USA
+
+yuval.kluger@yale.edu
+
+# ABSTRACT
+
+Canonical Correlation Analysis (CCA) models are powerful for studying the associations between two sets of variables. The canonically correlated representations, termed canonical variates are widely used in unsupervised learning to analyze unlabeled multi-modal registered datasets. Despite their success, CCA models may break (or overfit) if the number of variables in either of the modalities exceeds the number of samples. Moreover, often a significant fraction of the variables measures modality-specific information, and thus removing them is beneficial for identifying the canonically correlated variates. Here, we propose $\ell_0$ -CCA, a method for learning correlated representations based on sparse subsets of variables from two observed modalities. Sparsity is obtained by multiplying the input variables by stochastic gates, whose parameters are learned together with the CCA weights via an $\ell_0$ -regularized correlation loss. We further propose $\ell_0$ -Deep CCA for solving the problem of non-linear sparse CCA by modeling the correlated representations using deep nets. We demonstrate the efficacy of the method using several synthetic and real examples. Most notably, by gating nuisance input variables, our approach improves the extracted representations compared to other linear, non-linear and sparse CCA-based models.
+
+# 1 INTRODUCTION
+
+Canonical Correlation Analysis (CCA) (Hotelling, 1936; Thompson, 2005), is a classic statistical method for finding the maximally correlated linear transformations of two modalities (or views). Using modalities $\mathbf{X} \in \mathbb{R}^{D^x \times N}$ and $\mathbf{Y} \in \mathbb{R}^{D^y \times N}$ , which are centered and have $N$ samples with $D^x$ and $D^y$ features, respectively, CCA seeks canonical vectors $\mathbf{a} \in \mathbb{R}^{D^x}$ , and $\mathbf{b} \in \mathbb{R}^{D^y}$ , such that, $\mathbf{u} = \mathbf{a}^T\mathbf{X}$ , and $\mathbf{v} = \mathbf{b}^T\mathbf{Y}$ , will maximize the sample correlations between the canonical variates, i.e.
+
+$$
+\max _ {\boldsymbol {a}, \boldsymbol {b} \neq 0} \rho (\boldsymbol {a} ^ {T} \boldsymbol {X}, \boldsymbol {b} ^ {T} \boldsymbol {Y}) = \frac {\boldsymbol {a} ^ {T} \boldsymbol {X} \boldsymbol {Y} ^ {T} \boldsymbol {b}}{\| \boldsymbol {a} ^ {T} \boldsymbol {X} \| _ {2} \| \boldsymbol {b} ^ {T} \boldsymbol {Y} \| _ {2}}. \tag {1}
+$$
+
+To identify non-linear relations between input variables, several extensions of CCA have been proposed. Kernel methods such as Kernel CCA (Bach & Jordan, 2002), Non-parametric CCA (Michaeli et al., 2016) or Multi-view Diffusion maps (Lindenbaum et al., 2020; Salhov et al., 2020) learn the non-linear relations in reproducing Hilbert spaces. These methods have several shortcomings: they are limited to a designed kernel, and they have poor interpolation and extrapolation capabilities. Deep CCA (Andrew et al., 2013) overcomes these limitations by learning two non-linear transformations parametrized using neural networks. The model has several extension, see for example (Wang et al., 2016; Gundersen et al., 2019; Karami & Schuurmans, 2021).
+
+CCA models have been widely used in biology (Pimentel et al., 2018), neuroscience (Al-Shargie et al., 2017), medicine (Zhang et al., 2017), and engineering (Chen et al., 2017), for unsupervised or semi-supervised learning. By extracting meaningful dimensionality reduced representations, CCA improves downstream tasks such as clustering, classification, or manifold learning. One key limitation of CCA is that it requires more samples than features, i.e., $N > D^{x}, D^{y}$ . However, if we have
+
+
+Figure 1: Illustration of $\ell_0$ -DCCA. Data from two observed views propagate through stochastic gates (defined in Eq. 4). The gates output is fed into two neural sub-nets that have a shared loss (see Eq. 5). We compute this shared loss based on the neural sub-nets outputs (with dimension $d = 3$ in this example). Our shared loss combines a total correlation term with a differentiable regularization term which induces sparsity in the input variables (by sparsifying the gates).
+
+more variables than samples, the estimation based on the closed-form solution of the CCA problem (in Eq. 1) breaks (Suo et al., 2017) (because the covariance matrix is low rank). Moreover, in high dimensional data, often some of the variables do not measure the phenomenon that is common to both modalities (therefore are not correlated) and thus should be omitted from the transformations. For these reasons, there has been a growing interest in studying sparse CCA models.
+
+Sparse CCA (SCCA) models seek linear transformations which are based on a sparse subset of variables from the input modalities $\mathbf{X}$ and $\mathbf{Y}$ . Sparsifying the feature space improves interpretability, prevents overfitting, and removes the degeneracies inherent to $N < D^{x},D^{y}$ (once the number of selected variables is smaller than $N$ the covariance matrix becomes full rank). To encourage sparsity of the canonical vectors $\mathbf{a}$ and $\mathbf{b}$ , several authors (Wiesel et al., 2008; Cai et al., 2019) propose an $\ell_0$ regularized variant of Eq. 1. However, these schemes are greedy and therefore may lead to suboptimal solutions. As demonstrated by (Waaijenborg et al., 2008; Parkhomenko et al., 2009; Witten et al., 2009; Hardoon & Shawe-Taylor, 2011; Suo et al., 2017) replacing the $\ell_0$ norm by $\ell_{1}$ is differentiable and leads to a sparse solution to Eq. 1. Several authors extended these ideas by considering group sparsity (Chen & Liu, 2012; Klami et al., 2013; Solari et al., 2019). However, these methods are limited to linear transformations and may lead to shrinkage of the canonical vectors due to the $\ell_{1}$ regularizer. There has been limited work on extending these models to sparse non-linear CCA. Specifically, there are two kernel-based extensions: two-stage kernel CCA (TSKCCA) by (Yoshida et al., 2017) and SCCA based on Hilbert-Schmidt Independence Criterion (SCCA-HSIC) by (Uurtio et al., 2018). However, these models suffer from the same limitations as KCCA and do not scale to a high dimensional regime.
+
+We present $\ell_0$ -CCA, a simple yet effective method for learning correlated representation based on sparse subsets of the input variables by minimizing an $\ell_0$ regularized loss. Our $\ell_0$ regularization relies on a recently proposed Gaussian-based continuous relaxation of Bernoulli random variables, termed gates (Yamada et al., 2020). The gates are applied to the input features to sparsify the canonical vectors. The model and gates parameters are trained jointly via gradient descent to maximize the correlation between the representations of $X$ and $Y$ while simultaneously selecting only the subsets of most correlated input features. Our contributions are four-folds: (i) By modeling the transformations using two neural networks, we provide a natural solution to the problem of sparse non-linear correlation analysis. (ii) We then propose a novel initialization scheme that helps the model identify small subsets of correlated features in the challenging regime of $D > N$ . (iii) We apply the proposed method to synthetic data and demonstrate that our approach improves the estimation of the canonical vectors compared with existing baselines. (iv) We demonstrate the efficacy of the proposed scheme to several real work applications; specifically, we demonstrate that it leads to more reliable and interpretable representations than other linear and non-linear data fusion schemes.
+
+# 2 SPARSE CCA
+
+The problem in Eq. 1 has a closed-form solution based on the eigendecomposition of $C_x^{-1}C_{xy}C_y^{-1}C_{yx}$ and $C_y^{-1}C_{yx}C_x^{-1}C_{xy}$ , where $C_x, C_y$ are within view sample covariance matrices and $C_{xy}, C_{yx}$ are cross-view sample covariance matrices. However, if $N$ is smaller than the number of input variables ( $D^x$ or $D^y$ ), the sample covariance may be rank deficient, and the closed-form solution becomes meaningless. To overcome this limitation, we consider the problem of sparse CCA. Sparse CCA reduces the number of active variables and therefore the covariance matrix becomes full rank. Sparsity also improves model interpretability but may reduce the maximal (training) correlation value obtained in Eq. 1 (Shalev-Shwartz et al., 2010).
+
+Sparse CCA deals with identifying maximally correlated representations based on linear combinations of sparse subsets of the input variables in $\mathbf{X}$ and $\mathbf{Y}$ . The problem can be formulated as
+
+$$
+\min _ {\boldsymbol {a}, \boldsymbol {b}} - \rho (\boldsymbol {a} ^ {T} \boldsymbol {X}, \boldsymbol {b} ^ {T} \boldsymbol {Y}) + \lambda^ {x} \| \boldsymbol {a} \| _ {0} + \lambda^ {y} \| \boldsymbol {b} \| _ {0}, \tag {2}
+$$
+
+where $\lambda^x$ and $\lambda^y$ are regularization parameters which control the sparsity the input variables. If $\| \pmb{a}\| _0$ and $\| \pmb {b}\| _0$ are smaller than $N$ , we can remove the degeneracy inherent to Eq. 1, and identify meaningful correlated representations based on a sparse subset of input variables.
+
+# 3 PROBABILISTIC REFORMULATION OF SPARSE CCA
+
+The sparse CCA problem formulated in Eq. 2 becomes intractable for large $D^x$ or $D^y$ , moreover, due to the discrete nature of the $\ell_0$ norm, the problem is not amenable to gradient-based optimization schemes. Fortunately, as demonstrated in sparse regression, probabilistic models such as the spike-and-slab (George & McCulloch, 1993; Kuo & Mallick, 1998; Zhou et al., 2009; Polson & Sun, 2019) provide a compelling alternative. More recently, differentiable probabilistic models such as (Louizos et al., 2017; Yamada et al., 2020; Jana et al., 2021) were proposed for sparse supervised learning. Here, we adopt these ideas by rewriting the canonical vectors as $\alpha = \theta^x \odot s^x$ and $\beta = \theta^y \odot s^y$ , where $\odot$ denotes the Hadamard product (element wise multiplication), and $\theta^x \in \mathbb{R}^{D^x}, \theta^y \in \mathbb{R}^{D^y}$ . The vectors $s^x \in \{0,1\}^{D^x}$ , $s^y \in \{0,1\}^{D^y}$ are Bernoulli random vectors with parameters $\pi^x = (\pi_1^x, \dots, \pi_{D^x}^x)$ and $\pi^y = (\pi_1^y, \dots, \pi_{D^y}^y)$ . These Bernoulli variables, act as gates and sparsify the coefficients of the canonical vectors. Now, the problem in Eq. 2 can be reformulated as an expectation minimization, which is parameterized by $\pi^x$ and $\pi^y$ . Specifically, based on the following theorem, we can reformulate the problem in Eq. 2.
+
+Theorem 3.1 The solution of the sparse CCA problem in Eq. 2 is equivalent to the solution of the following probabilistic problem
+
+$$
+\min _ {\boldsymbol {\pi} ^ {x}, \boldsymbol {\pi} ^ {y}, \boldsymbol {\theta} ^ {x}, \boldsymbol {\theta} ^ {y}} \mathbb {E} \left[ - \rho \left(\boldsymbol {\alpha} ^ {T} \boldsymbol {X}, \boldsymbol {\beta} ^ {T} \boldsymbol {Y}\right) + \lambda^ {x} \| \boldsymbol {s} ^ {x} \| _ {0} + \lambda^ {y} \| \boldsymbol {s} ^ {y} \| _ {0} \right], \tag {3}
+$$
+
+where $\alpha = \pmb{\theta}^x \odot \pmb{s}^x$ and $\beta = \pmb{\theta}^y \odot \pmb{s}^y$ and the expectation is taken with respect to the random Bernoulli variables $\pmb{s}^x$ and $\pmb{s}^y$ (which are parameterized by $\pmb{\pi}^x$ and $\pmb{\pi}^y$ ).
+
+Note that the expected values of the $\ell_0$ norms can be expressed using the Bernoulli parameters as $\mathbb{E}\| \mathbf{s}^x\| _0 = \sum \pi_i^x$ , and $\mathbb{E}\| \mathbf{s}^y\| _0 = \sum \pi_i^y$ . The proof relies on the fact that the optimal solution to Eq. 2 is a valid solution to Eq. 3, and vice versa. The proof is presented in the Appendix, Section H, and follows the same construction as the proof of Theorem 1 in (Yin et al., 2020).
+
+# 3.1 CONTINUOUS RELAXATION FOR SPARSE CCA
+
+Due to the discrete nature of $\mathbf{s}^x$ and $\mathbf{s}^y$ , differentiating the leading term in Eq. 3 is not straightforward. Although solutions such as REINFORCE (Williams, 1992) or the straight-through estimator (Bengio et al., 2013) enable differentiating through discrete random variables, they still suffer from high variance. Furthermore, they require many Monte Carlo samples for effective training (Tucker et al., 2017). Recently, several authors (Maddison et al., 2016; Jang et al., 2016; Louizos et al., 2017) have demonstrated that using a continuous reparametrization of discrete random variables can reduce the variance of the gradient estimates. Here, following the reparametrization presented in (Yamada et al., 2020; Lindenbaum et al., 2021), we use Gaussian-based relaxation for the Bernoulli random variables.
+
+Each relaxed Bernoulli variables $z_{i}$ is defined by drawing from a centered Gaussian $\epsilon_{i}\sim N(0,\sigma^{2})$ , then shifting it by $\mu_{i}$ and truncating its values using the following hard Sigmoid function
+
+$$
+\mathrm {z} _ {i} = \max (0, \min (1, \mu_ {i} + \epsilon_ {i})). \tag {4}
+$$
+
+Using these relaxed Bernoulli variables, we can define the gated canonical vectors as $\alpha = \theta^x \odot \mathbf{z}^x$ and $\beta = \theta^y \odot \mathbf{z}^y$ . We incorporate these vectors into the objective defined in Eq. 3, in which the $\ell_0$ regularization terms can be expressed as
+
+$$
+\mathbb {E} \| \mathbf {z} ^ {x} \| _ {0} = \sum_ {i = 1} ^ {D ^ {x}} \mathbb {P} (z _ {i} ^ {x} \geq 0) = \sum_ {i = 1} ^ {D ^ {x}} \left(\frac {1}{2} - \frac {1}{2} \operatorname {e r f} \left(- \frac {\mu_ {i} ^ {x}}{\sqrt {2} \sigma}\right)\right),
+$$
+
+where $\operatorname{erf}()$ is the Gaussian error function, and is defined similarly for $\mathbb{E}\| \mathbf{z}^y\| _0$ .
+
+To learn to model parameters $\theta^x, \theta^y$ and gate parameters $\mu^x, \mu^y$ we first draw realizations for the gates, then we update the parameters by applying gradient descent to minimize
+
+$$
+\mathbb {E} \left[ - \rho \left(\boldsymbol {\alpha} ^ {T} \boldsymbol {X}, \boldsymbol {\beta} ^ {T} \boldsymbol {Y}\right) + \lambda^ {x} \| \mathbf {z} ^ {x} \| _ {0} + \lambda^ {y} \| \mathbf {z} ^ {y} \| _ {0} \right].
+$$
+
+Post training, we remove the stochasticity from the gates and use all variables such that $\mathbf{z}_i^x = \max(0, \min(1, \mu_i^x)) > 0$ (defined similarly for $\mathbf{z}^y$ ).
+
+# 3.2 GATE INITIALIZATION
+
+If the gates are initialized with $\mu_{i} = 0.5$ , they will approximate "fair" Bernoulli variables. This is a reasonable choice if no prior knowledge about the solution is available; however, we can utilize the closed-form solution of the CCA problem to derive a more suitable parameter initialization for the gate. Specifically, given the empirical covariance matrix $C_{xy} = \frac{\mathbf{X}\mathbf{Y}^T}{(N - 1)}$ , we denote the thresholded covariance matrix by $\bar{C}_{xy}$ , with values defined as follows
+
+$$
+(\bar{C}_{xy})_{ij} = \left\{ \begin{array}{ll}(C_{xy})_{i,j}, & \text{if} |(C_{xy})_{i,j}| > \delta \\ 0, & \text{otherwise}, \end{array} \right.
+$$
+
+where $\delta$ is the selected threshold value based on the desired sparsity for $X$ and $Y$ , specifically, if we assume that $r$ percent of the values should be zeroed, then $\delta$ is set to be the $r$ -th percentile of $|(C_{xy})|$ . Then, we compute the leading singular vectors $\pmb{u}$ and $\pmb{v}$ of $\bar{C}_{xy}$ . We further threshold the absolute values of these vectors using the same percentile used for $\bar{C}_{xy}$ . The initial values of the parameters of the gates are then defined by $\mu^x = \bar{\pmb{u}} + 0.5$ , and $\mu^y = \bar{\pmb{v}} + 0.5$ , where $\bar{\pmb{u}}$ and $\bar{\pmb{v}}$ are the thresholded versions of the absolute value of the singular vectors. Using this procedure, we increase the initial probability for all gates in the support of $\bar{\pmb{u}}$ and $\bar{\pmb{v}}$ based on the singular vectors of $\bar{C}_{xy}$ .
+
+# 3.3 $\ell_0$ -DEEP CCA
+
+To extend our model to non-linear function estimation, we can formulate the problem of sparse non-linear CCA by modeling the transformations using deep nets as in (Andrew et al., 2013; Wang et al., 2015b). We introduce two random Bernoulli relaxed vectors into the input layers of two neural networks trained in tandem to maximize the total correlation. Denoting the random gating vectors $\mathbf{z}^x$ and $\mathbf{z}^y$ for view $\mathbf{X}$ and $\mathbf{Y}$ , respectively, our $\ell_0$ -Deep CCA ( $\ell_0$ -DCCA) loss is defined by
+
+$$
+\mathbb {E} \left[ - \bar {\rho} (\boldsymbol {f} (\hat {\boldsymbol {X}}), \boldsymbol {g} (\hat {\boldsymbol {Y}})) + \lambda^ {x} \| \mathbf {z} ^ {x} \| _ {0} + \lambda^ {y} \| \mathbf {z} ^ {y} \| _ {0} \right], \tag {5}
+$$
+
+where $f(\hat{X}) = f(\mathbf{z}^x \odot X|\theta^x) \in \mathbb{R}^{d \times N}$ , and $g(\hat{Y}) = g(\mathbf{z}^y \odot Y|\theta^y) \in \mathbb{R}^{d \times N}$ are modeled as deep networks with model parameters $\theta = (\theta^x, \theta^y)$ , and gate parameters $\mu = (\mu^x, \mu^y)$ . The functions $f$ and $g$ embed the data into a $d$ -dimensional space (this formulation could also be used for linear $f$ and $g$ ). The functional $\bar{\rho}(f(\hat{X}), g(\hat{Y}))$ measures the total correlation between the two $d$ dimensional outputs of the deep nets, this is the sum over $d$ correlation values computed between pairs of coordinates. Exact details on the computation of this term appear in the following subsection. The regularization parameters $\lambda^x, \lambda^y$ control the sparsity of the input variables. The vectors $\mathbf{z}^x$ and $\mathbf{z}^y$ are Bernoulli relaxed vectors, with elements defined based on Eq. 4.
+
+Figure. 1 highlights the proposed architecture. We first pass both observed modalities through the gates. Then, we feed these into view-specific neural sub-nets. Finally, we minimize the shared loss term in Eq. 5 by optimizing the parameters of the gates and the neural sub-nets.
+
+# 3.4 ALGORITHM DETAILS
+
+Denoting the centered representations for $X, Y$ by $\Psi^x, \Psi^y \in \mathbb{R}^{d \times N}$ (computed using the coupled neural sub-nets), respectively, the empirical covariance matrix between these representations can be expressed as $\widehat{\pmb{C}}_{xy} = \frac{1}{N-1} \pmb{\Psi}^x (\pmb{\Psi}^y)^T$ . Using a similar notations, we express the regularized empirical covariance matrices of $X$ and $Y$ as $\widehat{\pmb{C}}_x = \frac{1}{N-1} \pmb{\Psi}^x (\pmb{\Psi}^x)^T + \gamma \pmb{I}$ and $\widehat{\pmb{C}}_y = \frac{1}{N-1} \pmb{\Psi}^y (\pmb{\Psi}^y)^T + \gamma \pmb{I}$ ,
+
+where the matrix $\gamma I (\gamma > 0)$ is added to stabilize the invertibility of $\widehat{C}_x$ and $\widehat{C}_y$ . The total correlation in Eq. 5 (i.e. $\bar{\rho}(\pmb{f}(\hat{\pmb{X}}), \pmb{g}(\hat{\pmb{Y}}))$ ) can be expressed using the trace of $\widehat{C}_y^{-1/2}\widehat{C}_{yx}\widehat{C}_x^{-1}\widehat{C}_{xy}\widehat{C}_y^{-1/2}$ .
+
+To learn the parameters of the gates $\mu$ and of the representations $\theta$ we apply full batch gradient descent to the loss in Eq. 5. Specifically, we use Monte Carlo sampling to estimate the left part of Eq. 5. This is repeated for several steps (epochs), using one Monte Carlo sample between each gradient step as suggested by (Louizos et al., 2017) and (Yamada et al., 2020), and worked well in our experiments. After training, we remove the stochastic part of the gates and use only the variables $i^x \in \{1, \dots, D^x\}$ and $i^y \in \{1, \dots, D^y\}$ such that $\mathbf{z}_{i^x}^x > 0$ and $\mathbf{z}_{i^y}^y > 0$ . Finally, we apply linear CCA to the low dimensional extracted embedding to remove this arbitrary scaling and use the normalized generalized eigenvectors (of the closed-form CCA solution) as our canonical vectors. Empirically, we observe that our method also works well with stochastic gradient descent, as long as the batch size is not too small. Alternatively, for small batches we can use a variant of the total correlation loss as was presented in (Wang et al., 2015c) or (Chang et al., 2018). In the Appendix section G, we present a pseudo-code of $\ell_0$ -DCCA, evaluate the complexity of the method, and extend it for a multi-modal setting (more than two views).
+
+# 4 RELATED WORK
+
+The problem of of $\ell_0$ sparse CCA was studied in (Wiesel et al., 2008; Cai et al., 2019). However, both rely on a greedy heuristic which iteratively adds non zero elements to the support of $a$ and $b$ . Alternatively, as proposed by (Suo et al., 2017), an $\ell_1$ -regularized problem can be described as
+
+$$
+\begin{array}{l} \boldsymbol {a}, \boldsymbol {b} = \operatorname {a r g m i n} \left[ - \operatorname {C o v} (\boldsymbol {a} ^ {T} \boldsymbol {X}, \boldsymbol {b} ^ {T} \boldsymbol {Y}) + \tau_ {1} \| \boldsymbol {a} \| _ {1} + \tau_ {2} \| \boldsymbol {b} \| _ {1} \right], \\ \text {s u b j e c t} \quad \| \boldsymbol {a} ^ {T} \boldsymbol {X} \| _ {2} \leq 1, \quad \| \boldsymbol {b} ^ {T} \boldsymbol {Y} \| _ {2} \leq 1, \\ \end{array}
+$$
+
+where $\tau_{1}$ and $\tau_{2}$ are regularization parameters. A number of variants have been proposed to this problem (Waaijenborg et al., 2008; Parkhomenko et al., 2009; Witten et al., 2009; Hardoon & Shawe-Taylor, 2011), but they all suffer from parameter shrinkage and therefore lead to a solution which is less consistent with the correct canonical vectors (see Table 1).
+
+# 5 EXPERIMENTAL RESULTS
+
+We validate the effectiveness of the proposed approach on a wide range of tasks. First, using synthetic data, we demonstrate that $\ell_0$ -CCA correctly identifies the canonical vectors in a challenging regime of $N < D^x, D^y$ . Next, using a coupled video dataset, we demonstrate that $\ell_0$ -CCA can identify the common information from high dimensional data, and embed it into correlated, low-dimensional representations. Then, we use noisy images from MNIST and multi-channel seismic data to demonstrate that $\ell_0$ -DCCA finds meaningful representations of the data even in a noisy regime. Finally, we use $\ell_0$ -DCCA to improve cancer sub-type classification using high dimensional genetic measurements. In all experiments validation sets are used for tuning the hyperparameters of all baselines by maximizing the total correlation on the validation set. We refer the reader to the Appendix for a complete description of the baselines, training procedure, and parameters choice for all methods.
+
+# 5.1 SYNTHETIC EXAMPLE
+
+To generate samples from $\mathbf{X}, \mathbf{Y} \in \mathbb{R}^{D \times N}$ , we follow the procedure described in (Suo et al., 2017), considering data sampling from the following distribution $\left( \begin{array}{c} \mathbf{X} \\ \mathbf{Y} \end{array} \right) \sim N\left(\left( \begin{array}{c} \mathbf{0} \\ \mathbf{0} \end{array} \right), \left( \begin{array}{cc} \boldsymbol{\Sigma}_x & \boldsymbol{\Sigma}_{xy} \\ \boldsymbol{\Sigma}_{yx} & \boldsymbol{\Sigma}_y \end{array} \right)\right)$ , where $\boldsymbol{\Sigma}_{xy} = \rho_0 \boldsymbol{\Sigma}_x (\phi \boldsymbol{\eta}^T) \boldsymbol{\Sigma}_y$ . We study three cases for the covariance matrices $\boldsymbol{\Sigma} = \boldsymbol{\Sigma}_x = \boldsymbol{\Sigma}_y$ .
+
+Model I. Identity: $\pmb{\Sigma} = \pmb{I}_D$ . Model II. Toeplitz: $\Sigma_{i,j} = \rho_0^{[i - j]}, i, j = 1,\dots,D$ .
+
+Model III. Sparse inverse: $\Sigma_{i,j} = \frac{\bar{\Sigma}_{i,j}}{\sqrt{\bar{\Sigma}_{i,i}\bar{\Sigma}_{j,j}}}$ , where $\bar{\Sigma} = \Gamma^{-1}$ , $\Gamma_{i,j} = \mathbb{1}_{i = j} + 0.5\mathbb{1}_{i = j} + 0.4\mathbb{1}_{i = j}$ .
+
+For all three cases, the vectors $\phi, \eta \in \mathbb{R}^D$ , are sparse with 5 nonzero elements and $\rho_0 = 0.9$ . The indices of the active elements are chosen randomly with values equal to $1 / \sqrt{5}$ . In this setting, the
+
+
+
+
+Figure 2: Left: Regularization path of $\ell_0$ -CCA on data generated from the linear model I (described in Section 5.1). Values on the left $y$ -axis (green) represent the sum of active gates (by expectation). Values on the right $y$ -axis (blue) represent the empirical correlation between the estimated representations, i.e. $\hat{\rho} = \hat{\phi}^T X^T Y \hat{\eta}$ , where $\hat{\phi}$ and $\hat{\eta}$ are the estimated canonical vectors. Dashed lines indicate the correct number of active coefficients (10) and true correlation $\rho$ (0.9). Note that for small values of $\lambda = \lambda^x = \lambda^y$ , the model selects many variables and attains a higher correlation value; in this case, $\ell_0$ -CCA suffers from overfitting. Right: True canonical vector $\phi$ along with the estimated vectors using $\ell_0$ -CCA ( $\hat{\phi}$ ) and CCA ( $\hat{a}$ ). Due to the small sample size, CCA overfits and fails to identify the correct canonical vectors.
+
+canonical vectors $\mathbf{a}$ and $\mathbf{b}$ maximizing the correlation objective in Eq. 1 are $\phi$ and $\eta$ , respectively (see Proposition 1 in (Suo et al., 2017)).
+
+ | Model I- Identity covariance |
| (N, Dx, Dy) | (400,800,800) | (500,600,600) | (700,1200,1200) |
| PMA (Witten et al., 2009) | (1.170,1.170) | (0.850,0.850) | (1.090,1.090) |
| IP-SCCA (Mai & Zhang, 2019) | (1.658,1.647) | (1.051,1.051) | (1.544,1.542) |
| SCCA-I (Hardoon & Shawe-Taylor, 2011) | (1.602,1.140) | (1.143,0.282) | (1.160,0.181) |
| SCCA-II (Gao et al., 2017) | (0.060,0.066) | (0.053,0.057) | (0.045,0.043) |
| mod-SCCA (Suo et al., 2017) | (0.056,0.062) | (0.05,0.056) | (0.045,0.043) |
| l0-CCA | (0.003,0.009) | (0.002,0.002) | (0.001,0.002) |
| Model II- Toeplitz covariance |
| PMA (Witten et al., 2009) | (1.038,1.067) | (1.115,0.943) | (1.098,0.890) |
| IP-SCCA (Mai & Zhang, 2019) | (NA,NA) | (NA,NA) | (NA,NA) |
| SCCA-I (Hardoon & Shawe-Taylor, 2011) | (1.382,1.357) | (1.351,1.299) | (1.219,1.186) |
| SCCA-II (Gao et al., 2017) | (0.213,0.296) | (0.145,0.109) | (0.110,0.088) |
| mod-SCCA (Suo et al., 2017) | (0.173,0.218) | (0.136,0.098) | (0.109,0.086) |
| l0-CCA | (0.101,0.079) | (0.098,0.072) | (0.026,0.039) |
| Model III- Sparse Inverse covariance |
| PMA (Witten et al., 2009) | (0.930,1.050) | (0.670,0.450) | (0.760,0.580) |
| IP-SCCA (Mai & Zhang, 2019) | (0.654,0.653) | (0.092,0.091) | (0.282,0.285) |
| SCCA-I (Hardoon & Shawe-Taylor, 2011) | (1.375,0.966) | (1.041,0.502) | (0.985,0.364) |
| SCCA-II (Gao et al., 2017) | (0.129,0.190) | (0.069,0.062) | (0.051,0.047) |
| mod-SCCA (Suo et al., 2017) | (0.092,0.149) | (0.068,0.059) | (0.050,0.044) |
| l0-CCA | (0.108,0.103) | (0.026,0.036) | (0.009,0.005) |
+
+Table 1: Evaluating the estimation quality of the canonical vectors $\phi$ and $\eta$ . Each pair indicates $(e_{\phi}, e_{\eta})$ , which are the estimation errors of $\phi$ and $\eta$ respectively. We compare the proposed $\ell_0$ -CCA to other sparse CCA schemes considering three types of covariance matrices for generating $X$ and $Y$ , and different dimensions $(N, D^x, D^y)$ . The description of all three covariances appears in Section 5.1. We highlight the smallest error obtained across all methods using boldface.
+
+Using Model I, we first generate $N = 400$ samples, with $D = 800$ , and estimate the canonical vectors based on CCA and $\ell_0$ -CCA. In Fig. 2, we present a regularization path of the proposed scheme. Specifically, we apply $\ell_0$ -CCA to the data described above using various values of $\lambda = \lambda^x = \lambda^y$ . We present the $\ell_0$ of active gates (by expectation) along with the empirical correlation between the extracted representations, defined by $\hat{\rho} = \rho (\hat{\phi}^T\mathbf{X},\hat{\eta}^T\mathbf{Y})$ . As evident from the left panel, a wide range of $\lambda$ values leads to the correct number of active coefficients (10) and the correct correlation value ( $\rho_0 = 0.9$ ). Next, in the right panel we present the values of $\phi$ , the $\ell_0$ -CCA estimate (using $\lambda = 30$ ) of the canonical vector $\hat{\phi}$ , and the CCA spectral based estimate of the canonical vector $\hat{\pmb{a}}$ . Due to the low number of samples, the solution by CCA is wrong and not sparse, while the $\ell_0$ -CCA solution correctly identifies the support of $\phi$ .
+
+Next, we evaluate the estimation error of $\phi$ using $e\phi = 2(1 - |\phi^T\hat{\phi}|)$ , and $e\eta$ is defined similarly. In Table 1 we present the estimation errors of $\phi$ and $\rho$ (averaged over 100 simulations) for Models I, II and III (identity, Toeplitz and sparse inverse covariance matrices). As baselines, we compare the performance to 5 leading sparse CCA models. As evident from these experiments, $\ell_0$ -CCA significantly outperforms all baselines in its ability to learn the correct canonical vectors. Here, we restrict our evaluation to five baselines since code was not available for other sparse CCA models. We have implemented (Wiesel et al., 2008) but observed that it does not converge to the correct canonical vectors (the estimation errors $e\phi$ and $e\rho$ were 2). In the Appendix, section F we provide a runtime evaluation of the method for different values of $N$ and $D$ .
+
+# 5.2 MULTI VIEW OF SPINNING PUPPETS
+
+As an illustrative example, we use a dataset collected by (Lederman & Talmon, 2018). The authors have generated two videos capturing rotations of 3 desk puppets. One camera captures two puppets, while the other captures another two, where one puppet is shared across cameras. A snapshot from both cameras appears in Fig. 3. All puppets are placed on spinning devices that rotate the dolls at different frequencies. In both videos, there is a shared underlying parameter, namely the rotation of the common bulldog. We use 400 images from each camera, where each image has $240 \times 320 = 76800$ pixels (using a grayscale version of the colored image); therefore, $N \ll D$ , and direct application of CCA would fail. We apply the proposed scheme using $\lambda^y = \lambda^x = 50$ , a linear activation and embedding dimension $d = 2$ . $\ell_0$ -CCA converges to embedding with a total correlation of 1.99 using 372 and 403 pixels from views $X$ and $Y$ . The active gates are presented in the right panels of Fig. 3. In this example, the gates correctly attenuate the modality-specific information and preserve subsets of pixels capturing common information, allowing for embedding the gated videos into a shared correlated representation.
+
+
+
+
+
+
+
+
+
+
+Figure 3: Left: two samples from the spinning puppets videos. The videos capture the rotation of 3 desk puppets. Arrows indicate the spinning direction of each puppet. We use $\ell_0$ -CCA to identify a sparse subset of pixels that are correlated from both videos. Right: the values of the gates for each video $\mathbf{z}^x$ and $\mathbf{z}^y$ . After training, the values of the gates are binary (i.e., $\{0,1\}$ ), with 372 and 403 active gates for the left and right videos, respectively. $\ell_0$ -CCA correctly select correlated subsets of pixels that highlight the common puppet (Bulldog) in this example.
+Figure 4: The correlated $\ell_0$ -CCA representations (visualized using MVDM (Lindenbaum et al., 2020)) of the Yoda+Bulldog video (left) and Bulldog+Bunny (right). We superimpose each embedding with 6 images corresponding to 6 points in the embedding spaces. The transformations are based on the information described by pixels whose gates are active (presented in Fig. 3). The resulting embeddings are correlated with each other, with a total correlation of $\bar{\rho} = 1.99$ . The structure captured by the embeddings correctly represent the angular rotation of the Bulldog, which is the common latent parameter in this experiment.
+
+
+Figure 5: Images from the coupled noisy MNIST dataset. In the bottom right of both panels, we presents the active gates (white values within a green frame). There are 277 and 258 active gates for view I and II, respectively.
+In Fig. 4, we present the coupled two-dimensional embedding of both videos. Both embeddings are correlated with each other and reveal the correct angular orientation of the Bulldog (which is the common latent parameter in this experiment). This indicates the ability of $\ell_0$ -CCA to identify correlated latent variables in the regime of $N \ll D^x$ , $D^y$ .
+
+
+
+# 5.3 NOISY MNIST
+
+We use two noisy variants of MNIST (LeCun et al., 2010) as our coupled views. The first view is created by adding noise drawn uniformly from $[0,1]$ to all pixels. The second view is created by placing a random patch from a natural image in the background of the handwritten digits. Random samples from these modalities are presented in Fig. 5. Each view consists of 62,000 samples, of which we use 40,000 for training, 12,000 for testing and 10,000 are used as a validation set.
+
+We train $\ell_0$ -DCCA to embed the data into a correlated 10 dimensional space while selecting subsets of input pixels. Our model selects 277, and 258 pixels from both modalities respectively (see bottom right corner of Fig. 5). Next, we evaluate the quality of learned embedding by applying $k$ -means to the stacked embedding of both views. We run $k$ -means (with $k = 10$ ) using 20 random initializations and record the run with the smallest sum of square distances from centroids. Given the cluster assignment, $k$ -means clustering accuracy (KM) and mutual information (MI) are measured using the true labels. Additionally, we train a Linear-SVM (SVM) model on our train and validation datasets. SVM classification accuracy is measured on the remaining test set. The embedding provided by $\ell_0$ -DCCA leads to higher classification and clustering results compared with several linear and nonlinear modality fusion models appear in Table 2. In the Appendix, we provide the implementation details and present experimental results demonstrating the accuracy vs. sparsity trade-off of $\ell_0$ -DCCA.
+
+# 5.4 SEISMIC EVENT CLASSIFICATION
+
+Next, we evaluate the method using a dataset of seismic events studied by (Lindenbaum et al., 2018). Here, we focus on 537 explosions which are categorized into 3 quarries. Each event is recorded using two directional channels facing east (E) and north (N); these comprise the coupled views for the correlation analysis. Following the analysis by (Lindenbaum et al., 2018), the input features are sonogram representations of the seismic signal. Sonograms are time-frequency representations with bins equally tempered on a logarithmic scale. Each sonogram $z \in \mathbb{R}^{1157}$ with 89 time bins and 13 frequency bins. An example of sonograms from both channels appears in the top row of Fig. 6.
+
+We create the noisy seismic data by adding sonograms computed based on vehicle noise from ${}^{1}$ . Examples of noisy sonograms appear in the middle row of Fig. 6. We hold out ${20}\%$ of the data as a validation set, and train ${\ell }_{0}$ -DCCA to embed the data in 3 dimensions. In Table 2 we present the MI, $k$ -means and SVM accuracies computed based on ${\ell }_{0}$ -DCCA embedding. Furthermore,we compare the performance with several other baselines. Here,the proposed scheme improves performance in all 3 metrics while identifying a subset of 17 and 16 features from channel $\mathrm{E}$ and $\mathrm{N}$ ,respectively. The active gates are presented in the bottom row of Fig. 6. Our results indicate that even in the presence of strong noise, ${\ell }_{0}$ -DCCA correctly activates the gates in frequency bins that coincide with the energy stamps of the primary and secondary waves (P and S in the top left of Fig. 6).
+
+
+
+
+
+
+
+
+
+
+Figure 6: Top: Clean sample sonograms of an explosion based on the E and N channels (left and right, respectively). Arrows highlight the Primary (P) and Secondary (S) waves caused by the explosion. Middle: noisy sonograms generated by adding sonograms of vehicle recordings. Bottom: the active gates for both channels. Note that the gates are active at time-frequency bins which correspond to the P and S waves (see top left panel).
+
+
+
+| Method | Noisy MNIST (LeCun et al., 2010) | Seismic (Lindenbaum et al., 2018) | METABRIC (Curtis et al., 2012) |
| MI | KM (%) | SVM (%) | MI | KM (%) | SVM (%) | MI | KM (%) | SVM (%) |
| Raw Data | 0.130 | 16.6 | 86.6 | 0.001 | 35.7 | 41.3 | 0.58 | 36.5 | 63.8 |
| PCA (Pearson, 1901) | 0.130 | 16.6 | 89.3 | 0.002 | 38.8 | 41.3 | 0.08 | 19.2 | 23.6 |
| CCA (Chaudhuri et al., 2009) | 1.290 | 66.4 | 75.8 | 0.003 | 38.1 | 40.4 | 0.20 | 20.7 | 24.1 |
| mod-SCCA (Suo et al., 2017) | 0.342 | 23.9 | 63.1 | 0.610 | 71.7 | 86.9 | 0.12 | 21.0 | 26.0 |
| SCCA-HSIC (Urtio et al., 2018) | NA | NA | NA | 0.003 | 38.7 | 49.5 | NA | NA | NA |
| KCCA (Bach & Jordan, 2002) | 0.943 | 50.2 | 85.3 | 0.006 | 38.4 | 92.5 | 0.35 | 30.8 | 61.3 |
| grad-KCCA (Urtio et al., 2019) | NA | NA | NA | 0.005 | 40.9 | 41.4 | 0.50 | 32.6 | 47.8 |
| multiview-ICA (Richard et al., 2020) | 1.750 | 88.0 | 90.0 | 0.748 | 90.1 | 94.2 | 0.74 | 44.7 | 62.8 |
| NCCA (Michaeli et al., 2016) | 1.030 | 47.5 | 77.2 | 0.700 | 86.8 | 91.4 | 0.72 | 48.7 | 63.7 |
| DCCA (Andrew et al., 2013) | 1.970 | 93.2 | 93.2 | 0.830 | 94.9 | 94.6 | 0.79 | 45.2 | 72.1 |
| DCCAE (Wang et al., 2015b) | 1.940 | 91.8 | 94.0 | 0.92 | 97.0 | 97.0 | 0.68 | 42.9 | 69.0 |
| \( \ell_0 \)-CCA (linear) | 1.73 | 87.1 | 88.4 | 0.85 | 93.7 | 94.9 | 0.82 | 49.5 | 70.7 |
| \( \ell_0 \)-DCCA (non-linear) | 2.05 | 95.4 | 95.5 | 0.97 | 98.1 | 97.2 | 0.88 | 50.3 | 74.1 |
+
+Table 2: Evaluation of correlated embedding extracted from the Noisy MNIST, Seismic, and METABRIC (cancer type) datasets. The representation extracted by $\ell_0$ -DCCA leads to higher clustering accuracy (KM), and classification accuracy (SVM) compared with several baselines. MI indicates the Mutual Information between cluster assignments and sample labels. We use NA to denote simulations which did not converge.
+
+# 5.5 CANCER SUB-TYPE CLASSIFICATION
+
+Accurate classification of cancer sub-type is vital for extending the life span of patients by personalized treatments (Zhu et al., 2020). This task is challenging since the number of measured genes is typically much larger than the number of observations. Here, we use multi-modal observations from the METABRIC data (Curtis et al., 2012) and attempt to find correlated representations to improve cancer sub-type classification. The data consists of 1, 112 breast cancer patients which are annotated by 10 subtypes based on InClust (Dawson et al., 2013). We observe two modalities, namely the RNA gene expression data, and Copy Number Alteration (CNA) data. The dimensions of these modalities are 15, 709 and 47, 127, respectively. We compute the $\ell_0$ -DCCA 10 dimensional embedding (and all baseline embeddings) and demonstrate using $k$ -means and SVM that the representation identified using $\ell_0$ -DCCA can lead to more accurate cancer sub-type classification (see Table 2).
+
+# 6 CONCLUSION
+
+This paper presents a method for learning sparse non-linear transformations that maximize the canonical correlations between two modalities. Our approach is realized by gating the input layers of two neural networks, which are trained to optimize their output's total correlations. Input variables are gated using a regularization term which encourages sparsity. We further propose a novel scheme to initialize the gates based on a thresholded cross-covariance matrix. Our method can learn informative correlated representations even when the number of variables far exceeds the number of samples. Finally, we demonstrate that the proposed scheme outperforms existing algorithms for linear and non-linear canonical correlation analysis. We describe our future directions in the Appendix section I.
+
+# 7 ACKNOWLEDGMENT
+
+The work of YK was supported by the National Institutes of Health R01GM131642, UM1PA05141, U54AG076043, P50CA121974, and U01DA053628.
+
+# REFERENCES
+
+Fares Al-Shargie, Tong Boon Tang, and Masashi Kiguchi. Assessment of mental stress effects on prefrontal cortical activities using canonical correlation analysis: an fnirs-eeg study. Biomedical optics express, 8(5):2583-2598, 2017.
+Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In International Conference on Machine Learning, pp. 1247-1255, 2013.
+Francis R Bach and Michael I Jordan. Kernel independent component analysis. Journal of machine learning research, 3(Jul):1-48, 2002.
+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.
+Adrian Benton, Huda Khayrallah, Biman Gujral, Dee Ann Reisinger, Sheng Zhang, and Raman Arora. Deep generalized canonical correlation analysis. In Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019), pp. 1-6, 2019.
+Sarah M Bernhardt, Pallave Dasari, David Walsh, Amanda R Townsend, Timothy J Price, and Wendy V Ingman. Hormonal modulation of breast cancer gene expression: implications for intrinsic subtyping in premenopausal women. Frontiers in oncology, 6:241, 2016.
+Jia Cai, Wei Dan, and Xiaowei Zhang. 10-based sparse canonical correlation analysis with application to cross-language document retrieval. Neurocomputing, 329:32-45, 2019.
+J. D. Carroll. Generalization of canonical correlation analysis to three or more sets of variables. Proceedings of the 76th annual convention of the American Psychological Association, 3:227-228, 1968.
+Xiaobin Chang, Tao Xiang, and Timothy M Hospedales. Scalable and effective deep cca via soft decorrelation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1488-1497, 2018.
+Kamalika Chaudhuri, Sham M Kakade, Karen Livescu, and Karthik Sridharan. Multi-view clustering via canonical correlation analysis. In Proceedings of the 26th annual international conference on machine learning, pp. 129-136. ACM, 2009.
+Xi Chen and Han Liu. An efficient optimization algorithm for structured sparse cca, with applications to eqtl mapping. Statistics in Biosciences, 4(1):3-26, 2012.
+Zhiwen Chen, Steven X Ding, Tao Peng, Chunhua Yang, and Weihua Gui. Fault detection for nongaussian processes using generalized canonical correlation analysis and randomized algorithms. IEEE Transactions on Industrial Electronics, 65(2):1559-1567, 2017.
+Christina Curtis, Sohrab P Shah, Suet-Feung Chin, Gulisa Turashvili, Oscar M Rueda, Mark J Dunning, Doug Speed, Andy G Lynch, Shamith Samarajiwa, Yinyin Yuan, et al. The genomic and transcriptomic architecture of 2,000 breast tumours reveals novel subgroups. Nature, 486(7403): 346, 2012.
+Sarah-Jane Dawson, Oscar M Rueda, Samuel Aparicio, and Carlos Caldas. A new genome-driven integrated classification of breast cancer and its implications. The EMBO journal, 32(5):617-628, 2013.
+Chao Gao, Zongming Ma, Harrison H Zhou, et al. Sparse cca: Adaptive estimation and computational barriers. Annals of Statistics, 45(5):2074-2101, 2017.
+Edward I George and Robert E McCulloch. Variable selection via gibbs sampling. Journal of the American Statistical Association, 88(423):881-889, 1993.
+Gregory Gundersen, Bianca Dumitrascu, Jordan T Ash, and Barbara E Engelhardt. End-to-end training of deep probabilistic cca on paired biomedical observations. In Uncertainty in artificial intelligence, 2019.
+
+David R Hardoon and John Shawe-Taylor. Sparse canonical correlation analysis. Machine Learning, 83(3):331-353, 2011.
+Paul Horst. Generalized canonical correlations and their applications to experimental data. Journal of Clinical Psychology, 17(4):331-347, 1961.
+Harold Hotelling. Relations between two sets of variates. Biometrika, 28(3/4):321-377, 1936.
+Soham Jana, Henry Li, Yutaro Yamada, and Ofir Lindenbaum. Support recovery with stochastic gates: Theory and application for linear models. arXiv preprint arXiv:2110.15960, 2021.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
+Mahdi Karami and Dale Schuurmans. Deep probabilistic canonical correlation analysis. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 8055-8063, 2021.
+J. R. Kettering. Canonical analysis of several sets of variables. Biometrika, 58(3):433-451, 12 1971. ISSN 0006-3444. doi: 10.1093/biomet/58.3.433. URL https://doi.org/10.1093/ biomet/58.3.433.
+Arto Klami, Seppo Virtanen, and Samuel Kaski. Bayesian canonical correlation analysis. Journal of Machine Learning Research, 14(4), 2013.
+Lynn Kuo and Bani Mallick. Variable selection for regression models. *Sankhya: The Indian Journal of Statistics*, Series B, pp. 65-81, 1998.
+Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
+Roy R Lederman and Ronen Talmon. Learning the geometry of common latent variables using alternating-diffusion. Applied and Computational Harmonic Analysis, 44(3):509-536, 2018.
+Ofir Lindenbaum, Yuri Bregman, Neta Rabin, and Amir Averbuch. Multiview kernels for low-dimensional modeling of seismic events. IEEE Transactions on Geoscience and Remote Sensing, 56(6):3300-3310, 2018.
+Ofir Lindenbaum, Arie Yeredor, Moshe Salhov, and Amir Averbuch. Multi-view diffusion maps. Information Fusion, 55:127-149, 2020.
+Ofir Lindenbaum, Uri Shaham, Erez Peterfreund, Jonathan Svirsky, Nicolas Casey, and Yuval Kluger. Differentiable unsupervised feature selection based on a gated laplacian. Advances in Neural Information Processing Systems, 34, 2021.
+Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l_{-}0$ regularization. arXiv preprint arXiv:1712.01312, 2017.
+Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
+Qing Mai and Xin Zhang. An iterative penalized least squares approach to sparse canonical correlation analysis. Biometrics, 75(3):734-744, 2019.
+Roderick P McDonald. A unified treatment of the weighting problem. Psychometrika, 33(3):351-381, 1968.
+James John McKeon. *Canonical analysis: Some relations between canonical correlation, factor analysis, discriminant function analysis, and scaling theory*. Number 13. Psychometric Society, 1966.
+Tomer Michaeli, Weiran Wang, and Karen Livescu. Nonparametric canonical correlation analysis. In International Conference on Machine Learning, pp. 1967-1976, 2016.
+
+Elena Parkhomenko, David Tritchler, and Joseph Beyene. Sparse canonical correlation analysis with application to genomic data integration. Statistical applications in genetics and molecular biology, 8(1), 2009.
+Karl Pearson. Principal components analysis. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 6(2):559, 1901.
+Harold Pimentel, Zhiyue Hu, and Haiyan Huang. Biclustering by sparse canonical correlation analysis. Quantitative Biology, 6(1):56-67, 2018.
+Nicholas G Polson and Lei Sun. Bayesian 10-regularized least squares. Applied Stochastic Models in Business and Industry, 35(3):717-731, 2019.
+Hugo Richard, Luigi Gresele, Aapo Hyvarinen, Bertrand Thirion, Alexandre Gramfort, and Pierre Ablin. Modeling shared responses in neuroimaging studies through multiview ica. arXiv preprint arXiv:2006.06635, 2020.
+Moshe Salhov, Ofir Lindenbaum, Yariv Aizenbud, Avi Silberschatz, Yoel Shkolnisky, and Amir Averbuch. Multi-view kernel consensus for data analysis. Applied and Computational Harmonic Analysis, 49(1):208-228, 2020.
+Shai Shalev-Shwartz, Nathan Srebro, and Tong Zhang. Trading accuracy for sparsity in optimization problems with sparsity constraints. SIAM Journal on Optimization, 20(6):2807-2832, 2010.
+Omid S Solari, James B Brown, and Peter J Bickel. Sparse canonical correlation analysis via concave minimization. arXiv preprint arXiv:1909.07947, 2019.
+Xiaotong Suo, Victor Minden, Bradley Nelson, Robert Tibshirani, and Michael Saunders. Sparse canonical correlation analysis. arXiv preprint arXiv:1705.10865, 2017.
+Arthur Tenenhaus and Michel Tenenhaus. Regularized generalized canonical correlation analysis. Psychometrika, 76(2):257, 2011.
+Arthur Tenenhaus, Cathy Philippe, Vincent Guillemot, Kim-Anh Le Cao, Jacques Grill, and Vincent Frouin. Variable selection for generalized canonical correlation analysis. *Biostatistics*, 15(3):569–583, 02 2014. ISSN 1465-4644. doi: 10.1093/biostatistics/kxu001. URL https://doi.org/10.1093/biostatistics/kxu001.
+Arthur Tenenhaus, Cathy Philippe, and Vincent Frouin. Kernel generalized canonical correlation analysis. Computational Statistics and Data Analysis, 90:114-131, 2015. ISSN 0167-9473. doi: https://doi.org/10.1016/j.csd.a.2015.04.004. URL https://www.sciencedirect.com/science/article/pii/S0167947315001012.
+Bruce Thompson. Canonical correlation analysis. Encyclopedia of statistics in behavioral science, 2005.
+George Tucker, Andriy Mnih, Chris J Maddison, Dieterich Lawson, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. arXiv preprint arXiv:1703.07370, 2017.
+Viivi Uurtio, Sahely Bhadra, and Juho Rousu. Sparse non-linear cca through hilbert-schmidt independence criterion. In 2018 IEEE International Conference on Data Mining (ICDM), pp. 1278-1283. IEEE, 2018.
+Vivi Uurtio, Sahely Bhadra, and Juho Rousu. Large-scale sparse kernel canonical correlation analysis. In International Conference on Machine Learning, pp. 6383-6391. PMLR, 2019.
+John P Van de Geer. Linear relations amongk sets of variables. Psychometrika, 49(1):79-94, 1984.
+Sandra Waaijenborg, Philip C Verselewel de Witt Hamer, and Aeilko H Zwinderman. Quantifying the association between gene expressions and dna-markers by penalized canonical correlation analysis. Statistical applications in genetics and molecular biology, 7(1), 2008.
+
+Weiran Wang, Raman Arora, Karen Livescu, and Jeff Bilmes. On deep multi-view representation learning. In Proceedings of the 32nd International Conference on International Conference on Machine Learning - Volume 37, ICML'15, pp. 1083-1092. JMLR.org, 2015a.
+Weiran Wang, Raman Arora, Karen Livescu, and Jeff Bilmes. On deep multi-view representation learning. In International conference on machine learning, pp. 1083-1092. PMLR, 2015b.
+Weiran Wang, Raman Arora, Karen Livescu, and Nathan Srebro. Stochastic optimization for deep cca via nonlinear orthogonal iterations. In 2015 53rd Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 688-695. IEEE, 2015c.
+Weiran Wang, Xinchen Yan, Honglak Lee, and Karen Livescu. Deep variational canonical correlation analysis. arXiv preprint arXiv:1610.03454, 2016.
+Ami Wiesel, Mark Kliger, and Alfred O Hero III. A greedy approach to sparse canonical correlation analysis. arXiv preprint arXiv:0801.2748, 2008.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992.
+Daniela M Witten, Robert Tibshirani, and Trevor Hastie. A penalized matrix decomposition, with applications to sparse principal components and canonical correlation analysis. *Biostatistics*, 10 (3):515-534, 2009.
+Yutaro Yamada, Ofir Lindenbaum, Sahand Negahban, and Yuval Kluger. Feature selection using stochastic gates. In Proceedings of Machine Learning and Systems 2020, pp. 8952-8963. 2020.
+Mingzhang Yin, Nhat Ho, Bowei Yan, Xiaoning Qian, and Mingyuan Zhou. Probabilistic best subset selection via gradient-based optimization. arXiv e-prints, pp. arXiv-2006, 2020.
+Kosuke Yoshida, Junichiro Yoshimoto, and Kenji Doya. Sparse kernel canonical correlation analysis for discovery of nonlinear interactions in high-dimensional data. BMC bioinformatics, 18(1):1-11, 2017.
+Yu Zhang, Guoxu Zhou, Jing Jin, Yangsong Zhang, Xingyu Wang, and Andrzej Cichocki. Sparse bayesian multiway canonical correlation analysis for eeg pattern recognition. Neurocomputing, 225:103-110, 2017.
+Mingyuan Zhou, Haojun Chen, John W Paisley, Lu Ren, Guillermo Sapiro, and Lawrence Carin. Non-parametric bayesian dictionary learning for sparse image representations. In NIPS, volume 9, pp. 2295-2303. CiteSeer, 2009.
+Wan Zhu, Longxiang Xie, Jianye Han, and Xiangqian Guo. The application of deep learning in cancer prognosis prediction. Cancers, 12(3):603, 2020.
+
+# A APPENDIX
+
+# B ADDITIONAL EXPERIMENTAL DETAILS
+
+In the following sections we provide additional experimental details required for reproduction of the experiments provided in the main text. All the experiments were conducted using Intel(R) Xeon(R) CPU E5-2620 v3 @2.4Ghz x2 (12 cores total).
+
+# B.1 SELECTING THE EMBEDDING DIMENSION
+
+Choosing the embedding dimension might require application-specific considerations. For example, for clustering purposes, if the number of clusters is known $(K)$ , we might select $d = K$ to have a sufficient number of dimensions to separate the clusters. However, for other applications, we can use a validation set to tune the embedding dimension $d$ ; precisely, by increasing $d$ until the total correlation in the validation set stops increasing. Using this procedure we can estimate the most significant number of correlated embedding coordinates.
+
+# B.2 SYNTHETIC EXAMPLE
+
+For the linear model we use a learning rate of 0.005 with 10,000 epochs. The values of $\lambda^x$ and $\lambda^y$ are both set to 30. These values were obtained using a cross validation procedure. The standard deviation $\sigma$ of the injected noise was set to 0.5 by (Yamada et al., 2020). They have selected this value as it maximized the gradient of the regularization term at initialization. Empirically, we observe that for $\ell^0$ -CCA smaller values of $\sigma$ translated to improved convergence. Specifically, we used $\sigma = 0.25$ , which worked well in our experiments.
+
+For each data model, we run the method 100 times with different realizations of $\mathbf{X}$ and $\mathbf{Y}$ . In Table 1, we compare the average results of $\ell^0$ -CCA to PMA (Witten et al., 2009), IP-SCCA (Mai & Zhang, 2019), SCCA-I (Hardoon & Shawe-Taylor, 2011), SCCA-II (Gao et al., 2017), and mod-SCCA (Suo et al., 2017). Results of SCCA-II, PMA, and mod-SCCA were simulated by (Suo et al., 2017).
+
+To demonstrate the tuning procedure of $\lambda_{x}$ and $\lambda_{y}$ , we generate data based on Model-I (described in Section 5.1) and evaluate the total correlation on training and validation samples. The results are presented in Fig. 7. As demonstrated in this plot, the correlation values on unseen samples can indicate the optimal values for the regularization parameters. Namely, the model leads to lower correlation values when selecting nuisance variables or removing some of the informative variables.
+
+
+Figure 7: Regularization path of $\ell_0$ -CCA on data generated from the linear model I (described in Section 5.1). Values on the left $y$ -axis (green) represent the sum of active gates (by expectation). Values on the right $y$ -axis (blue) represent the empirical correlation between the estimated representations, i.e. $\hat{\rho} = \hat{\phi}^T X^T Y \hat{\eta}$ , where $\hat{\phi}$ and $\hat{\eta}$ are the estimated canonical vectors. Dashed lines indicate the correct number of active coefficients (10) and true correlation $\rho$ (0.9). In this example, we present the correlation values training samples (blue circles), and on unseen samples (blue asterisks). Red vertical lines indicate the range of $\lambda$ 's that maximize the correlation on the validation set. Within this range of values the model selects the "correct" set of coefficients.
+
+# B.3 NOISY MNIST
+
+In this subsection we provide additional details regarding the noisy MNIST experiment. In Fig. 8, we present the performance as a function of the number of active gates (pixels) controlled by $\lambda^x = \lambda^y$ . The Mutual Information (MI) score, $k$ -means, and linear Support Vector Machine (LSVM) accuracies were computed based on $\ell^0$ -DCCA embedding with learning rate of 0.01. Furthermore, the number of epochs ( $\sim$ 4000) was tuned by early stopping using a validation set of size 10000. To learn 10 dimensional correlated embedding, we use the same architecture as suggested by (Wang et al., 2015a) consisting of three hidden layers with 1000 neurons each. The number of dimensions in the embedding was selected based on the number of classes in MNIST. This architecture is used for $\ell^0$ -DCCA, DCCA (Andrew et al., 2013) and DCCAE (Wang et al., 2015b). Note that for $\ell^0$ -DCCA using small values of the regularization parameters $\lambda^x$ and $\lambda^y$ , increases the number of selected features and degrades the performance. This is due to the fact that as more features are selected
+
+more noise is introduced into the extracted representation (of size 10). It is interesting to note that the $k$ -means was more robust to the introduced noise than the LSVGM.
+
+The regularization parameters $\lambda^x$ and $\lambda^y$ balance between the correlation loss and the amount of sparsification performed by the gates. These hyper parameters are tuned using the validation set by maximizing the total correlation value. We compare $\ell^0$ -DCCA to CCA (Chaudhuri et al., 2009) $^2$ , mod-SCCA (Suo et al., 2017), SCCA-HSIC (Uurtio et al., 2018), KCCA (Bach & Jordan, 2002) $^3$ , NCCA (Michaeli et al., 2016) $^4$ , multiview-ICA (Richard et al., 2020), DCCA (Andrew et al., 2013) $^5$ and DCCAE (Wang et al., 2015b). For all methods we use an embedding with dimension 10, and evaluate performance with $k$ -means using 20 random initializations, and using LSVG by performing training on the training samples and testing on the remaining samples (split defined in the main text). The hyperparameters of all methods are tuned to maximize the total correlation on a validation set. The solution obtained by mod-SCCA is based on $\sim 320$ variables. In this experiment we tried to train SCCA-HSIC (Uurtio et al., 2018) $^6$ for over two days, but it did not converge. Furthermore, we believe that the poor performance of the kernel methods stems from the high level of noise in the input images. We note that grad-KCCA (Uurtio et al., 2019) did not converge in this experiment, therefore we did not report its performance on MNIST.
+
+
+Figure 8: $k$ -means and SVM classification accuracy (left) and mutual information score (right) vs. the number of selected features.
+
+
+
+# B.4 SEISMIC EVENT CLASSIFICATION
+
+Using the seismic data, we compare the performance of $\ell^0$ -DCCA with a linear and non-linear activation. In this example, we use a learning rate of 0.01 with 2000 epochs. The number of neurons for the five hidden layer are: 300, 200, 100, 50, and 40 respectively, with a tanh activation after each layer. The number of dimensions in the embedding ( $d = 3$ ) was selected based on the number of classes in the data. Parameters are optimized manually to maximize the correlation on a validation set. In Fig. 9, we present SVM accuracy for different levels of sparsity. The presented number of features is the average over both modalities, and SVM performance is evaluated using 5-folds cross validation. We compare $\ell^0$ -DCCA to CCA (Chaudhuri et al., 2009), mod-SCCA (Suo et al., 2017), SCCA-HSIC (Uurtio et al., 2018), KCCA (Bach & Jordan, 2002), NCCA (Michaeli et al., 2016), multiview-ICA (Richard et al., 2020), DCCA (Andrew et al., 2013), and DCCAE (Wang et al., 2015b). For all methods we use an embedding with dimension $d = 3$ , and evaluate performance with $k$ -means using 20 random initializations, and using linear SVM by performing a 5-folds cross validation. For the kernel methods we evaluated performance by constructing a kernel using $k = 5, 10, \ldots, 50$ , nearest neighbors and selected the value which maximized performance
+
+$^{2}$ https://scikit-learn.org/stable/modules/generated/sklearn.Cross_decomposition.CCA.html
+3https://gist.github.com/yuyay/16ce4914683da30f87d0
+4https://tomer.net.technion.ac.il/files/2017/08/NCCAcode_v3.zip
+$^{5}$ https://github.com/adrianna1211/DeepCCA_tensorflow
+$^{6}$ https://github.com/aalto-ics-kepaco/scca-hsic
+
+
+Figure 9: Classification accuracy on the noisy seismic data. Performance is evaluated using linear SVM in the 3 dimensional embedding. Comparing performance of $\ell^0$ -DCCA for different levels of sparsity, and using linear and nonlinear activation (tanh).
+
+in terms of total correlation. In this example, the optimal solution obtained mod-SCCA Suo et al. (2017) is based on $\sim 200$ input variables, while the solution obtained SCCA-HSIC Uurtio et al. (2018) is based on $\sim 77$ variables. This means that our method uses much fewer input variables and leads to substantially higher clustering and classification accuracies (see Table 3).
+
+# C LOW DIMENSIONAL SYNTHETIC EXAMPLE
+
+Following an interesting suggestion raised during the review process, we provide here an evaluation of the method for the regime of $D \ll N$ . We use a noisy version of the synthetic data model presented in Section 5.1. Specifically, we generate samples from $X, Y \in \mathbb{R}^{D \times N}$ , using the following distribution $\left( \begin{array}{c}X \\ Y \end{array} \right) \sim N\left(\left( \begin{array}{c}0\\ 0 \end{array} \right),\left( \begin{array}{cc}\pmb{\Sigma}_x & \pmb{\Sigma}_{xy}\\ \pmb{\Sigma}_{yx} & \pmb{\Sigma}_y \end{array} \right)\right)$ , where $\pmb{\Sigma}_{xy} = \rho_0\pmb{\Sigma}_x(\phi \pmb{\eta}^T)\pmb{\Sigma}_y$ . With $\pmb{\Sigma} = \pmb{I}_D$ . The we use additive noise to create the two modalities, namely $\tilde{\pmb{X}} = \pmb{X} + \epsilon_X$ , $\tilde{\pmb{Y}} = \pmb{Y} + \epsilon_Y$ . Where $\epsilon_X$ and $\epsilon_Y$ are drawn from $N(0,\pmb{I}_D\sigma_N)$ . We use $D = 20$ and $N = 4000$ to evaluate if our method is beneficial in the regime where there are more samples than variables. In table 3 we present the average errors for different noise levels (values of $\sigma_N$ ). As evident from this table, the proposed approach can provide a more accurate estimate of the sparse canonical vectors in the regime of $D \ll N$ .
+
+ | (D=20,N=4000) |
| σN | 0 | 1 | 2 |
| CCA | (0.0098,0.0099) | (0.034,0.036) | (0.256,0.258) |
| SCCA-II (Gao et al., 2017) | (0.0013,0.0008) | (0.0131,0.0097) | (0.6003,0.5881) |
| l0-CCA | (0.0005,0.0004) | (0.0065,0.0044) | (0.1075,0.0633) |
+
+Table 3: Evaluating the estimation quality of the canonical vectors $\phi$ and $\eta$ . Each pair indicates $(e_{\phi}, e_{\eta})$ , which are the estimation errors of $\phi$ and $\eta$ respectively. We compare the proposed $\ell_0$ -CCA to standard CCA and to SCCA-II (Gao et al., 2017). Different columns indicate different additive noise levels.
+
+# D CANCER SUB-TYPE CLASSIFICATION
+
+In the main text, we demonstrated that the embedding extracted with $\ell_0$ -DCCA leads to more accurate cancer sub-type classification. Here, we provide additional details on the experiment described in Section 5.5. In this example, we use a learning rate of 0.5 with 2000 epochs. The number of neurons for the 3 hidden layers are: 500, 300, 100, with a tanh activation after each layer. The number of dimensions in the embedding ( $d = 10$ ) was selected based on the number of classes in
+
+Algorithm 1 $\ell_0$ -DCCA
+Input: Coupled data, $\{\mathbf{X},\mathbf{Y}\}$ , regularization parameters $\lambda^x,\lambda^y$ , number of epochs $T$ . Initialize the gate parameters: $\mu_i^x = 0.5$ for $i = 1,\ldots ,D^{x}$ , and $\mu_i^y = 0.5$ for $i = 1,\ldots ,D^{y}$ .
+for $t = 1$ to $T$ do
+ Sample a stochastic gate (STG) vectors $\mathbf{z}^x,\mathbf{z}^y$ defined based on equation 4. Apply the STG to the data $\hat{\mathbf{X}} = \mathbf{z}^x\odot X$ and $\hat{\mathbf{Y}} = \mathbf{z}^y\odot Y$ .
+ Compute the loss $L = \mathbb{E}\left[-\bar{\rho} (\pmb {f}(\hat{\pmb{X}}),\pmb {g}(\hat{\pmb{Y}})) + \lambda^x\| \mathbf{z}^x\| _0 + \lambda^y\| \mathbf{z}^y\| _0\right]$ , where the calculation of the total correlation $\bar{\rho}$ is based on Section 3.4. Where $\pmb {f}(\hat{\pmb{X}}) = \pmb {f}(\pmb {z}^x\odot \pmb {X}|\pmb {\theta}^x)\in \mathbb{R}^{d\times N}$ , and
+ $\pmb {g}(\hat{\pmb{Y}}) = \pmb {g}(\pmb {z}^y\odot \pmb {Y}|\pmb {\theta}^y)\in \mathbb{R}^{d\times N}$ .
+ Update $\pmb {\theta}^x = \pmb {\theta}^x -\gamma \nabla \pmb {\theta}^x L$ $\pmb {\theta}^y = \pmb {\theta}^y -\gamma \nabla \pmb {\theta}^y L$ $\pmb {\pi}^x = \pmb {\pi}^x -\gamma \nabla \pmb {\pi}^x L$ $\pmb {\pi}^y = \pmb {\pi}^y -\gamma \nabla \pmb {\pi}^y L$ .
+end for
+Optional: apply linear CCA on $\pmb {f}(\hat{\pmb{X}})$ , and $\pmb {g}(\hat{\pmb{Y}})$ to remove arbitrary scalings.
+
+the data. Parameters are optimized manually to maximize the correlation on a validation set. We compare $\ell^0$ -DCCA to CCA (Chaudhuri et al., 2009), mod-SCCA (Suo et al., 2017), SCCA-HSIC (Uurtio et al., 2018), KCCA (Bach & Jordan, 2002), NCCA (Michaeli et al., 2016), multiview-ICA (Richard et al., 2020), DCCA (Andrew et al., 2013), and DCCAE (Wang et al., 2015b). We use the same SVM and $k$ -means scheme as described in Section B.4. The solution obtained by mod-SCCA is based on $\sim 940$ variables.
+
+To provide additional intuition on why sparsity is useful in biomedical applications, we further analyze the results presented in Section 5.5 (the METABRIC dataset). In the experiment provided in this section, our method selects 169 genes from the RNA data and extracts an embedding that leads to improved identification (clustering and classification) of cancer subtypes. To understand if the variables selected by our model are interpretable, we analyze genes selected by the model. We have observed that out of the 169 selected genes, six are part of the known risk factors for breast cancer, namely the well-known PAM50 list. The PAM50 contains 50 genes known to be critical variables for classifying breast cancer subtypes Bernhardt et al. (2016). Our model has identified six genes (in an unsupervised fashion) out of the 42 possible PAM50 genes that were initially available in the METABRIC data. To demonstrate that this is a statistically significant finding, we compute the probability of selecting 169 genes out of a total of 15019 genes while having an overlap of 6 genes with another list of size 42. This probability is $5.39\mathrm{E - }6$ (the p-value), which indicates that this overlap is unlikely to have happened by chance. To conclude, our method was able to identify known markers for breast cancer subtypes classification without using any labels. Notably, one of these genes is 'ERBB2', which corresponds to the HER2/neu protein. 'ERBB2' is known to have a large copy number in patients classified to the HER2 cancer subtype. Thus the method found a strong association between the RNA and CNA of this gene.
+
+# E PSEUDOCODE
+
+In Algorithm 1 we provide a pseudocode description of the proposed approach.
+
+# F RUN TIME ANALYSIS
+
+Our method requires computing covariance matrices for $k_{x}$ and $k_{y}$ variables with N samples at each iteration. This scales like $\mathcal{O}(Nk_x^2 + Nk_y^2)$ . To demonstrate the computational efficiency of our method, we run $\ell_0$ -CCA for different values of $N$ and $D$ and evaluate the empirical computational complexity of the method. In Fig. 10 we present the average runtime over 100 runs, the data is generated following Model I from Section 5.1.
+
+# G GENERALIZED $\ell_0$ -BASED SPARSE CCA
+
+The proposed $\ell_0$ -CCA algorithm was designed and demonstrated on coupled datasets. However, in many applications, one may have access to multiple ( $>2$ ) datasets. There are many real-life
+
+
+Figure 10: Run time evaluation of the proposed approach. We measure the average runtime (over 100 runs) for different values of $N$ and $D^x, D^y$ .
+
+cases where more than two modalities are available such as hyper-spectral imaging, medical imaging and more. The problem of CCA was generalized decades ago to include multiple data sets by (Horst, 1961; McKeon, 1966; McDonald, 1968) and (Carroll, 1968) to name some. These approaches were later summarized in (Kettering, 1971). Since then, many extensions have been proposed such as (Van de Geer, 1984). Some of the modern extensions of multi-view CCA comprise its regularised (Tenenhaus & Tenenhaus, 2011), kernelised (Tenenhaus et al., 2015) sparse (Tenenhaus et al., 2014) and deep (Benton et al., 2019) variants. In this section, we extend the proposed $\ell_0$ -DCCA to multi-view datasets.
+
+Let $K$ be the number of views and $\pmb{X}^{k}$ the corresponding $k$ -th view $1 \leq k \leq K$ . The Deep Generalized CCA that was proposed in (Benton et al., 2019) aims to solve
+
+$$
+\min _ {\boldsymbol {G} \in \mathcal {R} ^ {n \times d}, \boldsymbol {U} _ {k} \in \mathcal {R} ^ {d \times d}} \sum_ {k = 1} ^ {K} \| \boldsymbol {G} - \boldsymbol {U} _ {k} ^ {T} f (\boldsymbol {X} ^ {k}) \| _ {F} \quad s. t. \quad \boldsymbol {G} \boldsymbol {G} ^ {T} = \boldsymbol {I}, \tag {6}
+$$
+
+where $\pmb{G}$ is the desired shared representation, and $\pmb{U}_k$ is a linear transformation from the $k$ -th deep network output, $f(\pmb{X}^k)$ , to the shared representation space.
+
+While the proposed method in Section 3.3 describes a solution for coupled views, this solution can be naturally extended to include multiple views by introducing a shared common space into the optimization problem in Eq 6. Denoting the random gating vectors $\mathbf{z}^k$ for view $X^k$ . The generalized $\ell_0$ -DCCA loss is defined by
+
+$$
+\min _ {\boldsymbol {G} \in \mathcal {R} ^ {n \times d}, \boldsymbol {U} _ {k} \in \mathcal {R} ^ {d \times d}, \boldsymbol {z} ^ {k} \in \mathcal {R} ^ {d _ {k}}} \sum_ {k = 1} ^ {K} \| \boldsymbol {G} - \boldsymbol {U} _ {k} ^ {T} f (\hat {\boldsymbol {X}} ^ {k}) \| _ {F} + \lambda_ {k} \| \boldsymbol {z} ^ {k} \| _ {0} \quad s. t. \quad \boldsymbol {G} \boldsymbol {G} ^ {T} = \boldsymbol {I}, \tag {7}
+$$
+
+where $f(\bar{X}^k) = f(\mathbf{z}^k \odot X^k | \theta^x) \in \mathbb{R}^{d \times N}$ and $\lambda_k$ is the regularization parameter that controls the sparsity of $k$ -th selected gate vector $z^k$ . The optimization problem in Eq 7 can be solved using standard optimizers such as gradient descent. The initialization of $G$ and $U_k$ plus the analysis of the above suggested generalized gated canonical correlation are left for further research.
+
+# H PROOF OF THEOREM 1
+
+We first note that the equivalence of the solutions means that if we denote the solution to Eq. 2 by $(\hat{a},\hat{b})$ , then there is a corresponding set of values $\pi^x,\pi^y,\theta^x,\theta^y$ , such that $(\hat{\alpha},\hat{\beta}) = (\hat{a},\hat{b})$ where $\alpha = \theta^{x}\odot s^{x}$ and $\beta = \theta^{y}\odot s^{y}$ . The proof follows the same construction as the proof of Theorem 1 in (Yin et al., 2020). To prove the Theorem, we will show that the optimal solution to the deterministic sparse CCA problem (in Eq. 2) is a valid solution to the probabilistic sparse CCA problem (in Eq. 3) and vice versa.
+
+First, we denote by $(\hat{\pmb{a}},\hat{\pmb{b}})$ the optimal solution of the problem defined in Eq. 2, then by setting $\hat{\alpha} = \hat{\pmb{a}}\odot \hat{\pmb{s}}^x$ and $\hat{\beta} = \hat{\pmb{b}}\odot \hat{\pmb{s}}^{y}$ , where $\hat{\pi}_i^x = 1$ if $\hat{a}_i\neq 0$ and $\pi_i^x = 0$ otherwise, we get a feasible solution to Eq. 3 which leads to the same objective value.
+
+Now, we want to show that the optimal solution to Eq. 3 is also a feasible solution to Eq. 2. Denoting the optimal solution to Eq. 3 by $\hat{\alpha}$ and $\hat{\beta}$ , with $\hat{\alpha} = \hat{\pmb{\theta}}^x \odot \hat{s}^x$ and $\hat{\beta} = \hat{\pmb{\theta}}^y \odot \hat{s}^y$ , if $p(s^x|\pi^x)$ or $p(s^y|\pi^y)$ are point mass densities (i.e., $\pi^x, \pi^y \in \{0,1\}^D$ ), then the solution is effectively deterministic and $\hat{a} = \hat{\alpha}$ , $\hat{b} = \hat{\beta}$ would be a valid solution to problem Eq. 2. If $p(s^x|\pi^x)$ and $p(s^y|\pi^y)$ are not point mass densities, we will now show by contradiction that all the points in the support of $p(s^x|\pi^x)$ (or $p(s^y|\pi^y)$ ) would lead to the same objective values. Assume without loss of generality that $\{s_1^x, \dots, s_L^x\} \in \mathrm{supp}[p(s^x|\hat{\pi}^x)]$ , if not all values in the support lead to the same objective value, this means that there exist $s_l^x, s_m^x$ such that $L(s_l^x) < L(s_m^x)$ , where
+
+$$
+L (\pmb {s} ^ {x}) = \left[ - \rho ((\hat {\pmb {\theta}} ^ {x} \odot \pmb {s} ^ {x}) ^ {T} \pmb {X}, (\hat {\pmb {\theta}} ^ {y} \odot \hat {\pmb {s}} ^ {y}) ^ {T} \pmb {Y}) + \lambda^ {x} \| \pmb {s} ^ {x} \| _ {0} + \lambda^ {y} \| \hat {\pmb {s}} ^ {y} \| _ {0} \right],
+$$
+
+which is the objective from Eq. 3 with optimal values of $\hat{\pmb{\theta}}^x, \hat{\pmb{\theta}}^y, \hat{\pmb{s}}^y$ . Now if we set $\bar{\pi}^x = s_l^x$ we would obtain $\mathbb{E}_{\pmb{S}^x \sim p(\pmb{S}^x | \bar{\pmb{\pi}}^x)} L(\pmb{s}^x) < \mathbb{E}_{\pmb{S}^x \sim p(\pmb{S}^x | \hat{\pmb{\pi}}^x)} L(\pmb{s}^x)$ which contradicts the assumption that $\hat{\pi}^x$ is optimal. This means that all points in $\mathrm{supp}[p(\pmb{s}^x | \hat{\pmb{\pi}}^x)]$ lead to the same objective value, therefore, they are also feasible solutions to Eq. 2. Now, showing that the solution to Eq. 3 is a feasible solution to Eq. 2 and vice versa completes our proof.
+
+# I LIMITATIONS AND FUTURE DIRECTIONS
+
+The proposed method provides an effective solution to the problems of sparse linear and nonlinear CCA. One advantage of the suggested method compared with existing sparse CCA solutions, is that it can embed data into a $d > 1$ dimensional space and learn the sparsity pattern simultaneously. The proposed $\ell_0$ -CCA problem albeit not being convex leads to an empirically stable solution across different settings. Nonetheless, the method has some limitations, specifically, tuning $\lambda$ requires a cross validation procedure, which could be costly in high dimensional regime. Another caveat of the existing approach is that it lacks guarantees when trained on small batches. In the future, we aim to extend the method to enable compatibility with small batch training. Furthermore, we are currently working on evaluating how the estimation error scales with respect to the dimension, sparsity, for different structures of the covariance matrix. Furthermore, we are working on bounding the estimation error of our method. We observe that using a Gaussian based data model (similar to the one used in section 5.1), it is possible to bound the estimation error (in probability) by $\mathcal{O}(D / N + ck / N)$ where $D$ is the number of variables, $N$ is the number of measurements, $k$ is the true sparsity of the conical vectors, and $c$ is an independent constant. Although this bound provides some guarantee, it is ubiquitous in the context of the regime studied in our manuscript (i.e., $N \ll D$ ). Therefore, we are currently working on improving this bound. Empirically, we observe that the method works well in regimes that existing $\ell_1$ and $\ell_0$ based approaches fail.
\ No newline at end of file
diff --git a/l0sparsecanonicalcorrelationanalysis/images.zip b/l0sparsecanonicalcorrelationanalysis/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b297562730df633653a8d6e70a6b10ca2c963ebe
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f3db523f7dad0d6a61c794295754cfb1c95558782af4fe1d49cb49be3a64474
+size 776296
diff --git a/l0sparsecanonicalcorrelationanalysis/layout.json b/l0sparsecanonicalcorrelationanalysis/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d04a668e6529ef32edf7382c6818e902ea799cd5
--- /dev/null
+++ b/l0sparsecanonicalcorrelationanalysis/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85f160b5395422e74159470450086da1b795ff02bf7d1863becc73a0162ec93f
+size 835024
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_content_list.json b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4fb7e661eb19f89319802db6ac7af27b1443b031
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d4857a618e40ad84f84f08c77805c6a5460090b5a2074a94baf1a4ea0c598fa
+size 83838
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_model.json b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a269371c696286176e8149606a894cded015a525
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:76f2eae3effaacf9af6acebf3585019e1d773822e0e517c05e2ee894c8577c0a
+size 105785
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_origin.pdf b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4f8493292e1f2e4e1e9ebf9c84886f29c2348ef0
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/fc100213-e7c0-4421-8ae0-56782745bbf9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:254291b5fb80af72361c6986a989e28318a290842b1a3d94328413094ae56efe
+size 8371727
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/full.md b/labelefficientsemanticsegmentationwithdiffusionmodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f736433a72ca84757f0130acb0207aa2aa8332de
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/full.md
@@ -0,0 +1,345 @@
+# LABEL-EFFICIENT SEMANTIC SEGMENTATION WITH DIFFUSION MODELS
+
+Dmitry Baranchuk, Ivan Rubachev, Andrey Voynov, Valentin Khrulkov, Artem Babenko
+Yandex Research
+
+# ABSTRACT
+
+Denoising diffusion probabilistic models have recently received much research attention since they outperform alternative approaches, such as GANs, and currently provide state-of-the-art generative performance. The superior performance of diffusion models has made them an appealing tool in several applications, including inpainting, super-resolution, and semantic editing. In this paper, we demonstrate that diffusion models can also serve as an instrument for semantic segmentation, especially in the setup when labeled data is scarce. In particular, for several pretrained diffusion models, we investigate the intermediate activations from the networks that perform the Markov step of the reverse diffusion process. We show that these activations effectively capture the semantic information from an input image and appear to be excellent pixel-level representations for the segmentation problem. Based on these observations, we describe a simple segmentation method, which can work even if only a few training images are provided. Our approach significantly outperforms the existing alternatives on several datasets for the same amount of human supervision. The source code of the project is publicly available.
+
+# 1 INTRODUCTION
+
+Denoising diffusion probabilistic models (DDPM) (Sohl-Dickstein et al., 2015; Ho et al., 2020) have recently outperformed alternative approaches to model the distribution of natural images both in the realism of individual samples and their diversity (Dhariwal & Nichol, 2021). These advantages of DDPM are successfully exploited in applications, such as colorization (Song et al., 2021), inpainting (Song et al., 2021), super-resolution (Saharia et al., 2021; Li et al., 2021b), and semantic editing (Meng et al., 2021), where DDPM often achieve more impressive results compared to GANs.
+
+So far, however, DDPM were not exploited as a source of effective image representations for discriminative computer vision problems. While the prior literature has demonstrated that various generative paradigms, such as GANs (Donahue & Simonyan, 2019) or autoregressive models (Chen et al., 2020a), can be used to extract the representations for common vision tasks, it is not clear if DDPM can also serve as representation learners. In this paper, we provide an affirmative answer to this question in the context of semantic segmentation.
+
+In particular, we investigate the intermediate activations from the U-Net network that approximates the Markov step of the reverse diffusion process in DDPM. Intuitively, this network learns to denoise its input, and it is not clear why the intermediate activations should capture semantic information needed for high-level vision problems. Nevertheless, we show that on certain diffusion steps, these activations do capture such information, and therefore, can potentially be used as image representations for downstream tasks. Given these observations, we propose a simple semantic segmentation method, which exploits these representations and works successfully even if only a few labeled images are provided. On several datasets, we show that our DDPM-based segmentation method outperforms the existing baselines for the same amount of supervision.
+
+To sum up, the contributions of our paper are:
+
+1. We investigate the representations learned by the state-of-the-art DDPM and show that they capture high-level semantic information valuable for downstream vision tasks.
+
+2. We design a simple semantic segmentation approach that exploits these representations and outperforms the alternatives in the few-shot operating point.
+3. We compare the DDPM-based representations with their GAN-based counterparts on the same datasets and demonstrate the advantages of the former in the context of semantic segmentation.
+
+# 2 RELATED WORK
+
+In this section, we briefly describe the existing lines of research relevant to our work.
+
+Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) are a class of generative models that approximate the distribution of real images by the endpoint of the Markov chain which originates from a simple parametric distribution, typically a standard Gaussian. Each Markov step is modeled by a deep neural network that effectively learns to invert the diffusion process with a known Gaussian kernel. Ho et al. highlighted the equivalence of diffusion models and score matching (Song & Ermon, 2019; 2020), showing them to be two different perspectives on the gradual conversion of a simple known distribution into a target distribution via the iterative denoising process. Very recent works (Nichol, 2021; Dhariwal & Nichol, 2021) have developed more powerful model architectures as well as different advanced objectives, which led to the "victory" of DDPM over GANs in terms of generative quality and diversity. DDPM have been widely used in several applications, including image colorization (Song et al., 2021), super-resolution (Saharia et al., 2021; Li et al., 2021b), inpainting (Song et al., 2021), and semantic editing (Meng et al., 2021). In our work, we demonstrate that one can also successfully use them for semantic segmentation.
+
+Image segmentation with generative models is an active research direction at the moment, however, existing methods are primarily based on GANs. The first line of works (Voynov & Babenko, 2020; Voynov et al., 2021; Melas-Kyriazi et al., 2021) is based on the evidence that the latent spaces of the state-of-the-art GANs have directions corresponding to effects that influence the foreground/background pixels differently, which allows producing synthetic data to train segmentation models. However, these approaches are currently able to perform binary segmentation only, and it is not clear if they can be used in the general setup of semantic segmentation. The second line of works (Zhang et al., 2021; Tritrong et al., 2021; Xu, 2021; Galeev et al., 2020) is more relevant to our study since they are based on the intermediate representations obtained in GANs. In particular, the method proposed in (Zhang et al., 2021) trains a pixel class prediction model on these representations and confirms their label efficiency. In the experimental section, we compare the method from (Zhang et al., 2021) to our DDPM-based one and demonstrate several distinctive advantages of our solution.
+
+Representations from generative models for discriminative tasks. The usage of generative models, as representation learners, has been widely investigated for global prediction (Donahue & Simonyan, 2019; Chen et al., 2020a), and dense prediction problems (Zhang et al., 2021; Tritrong et al., 2021; Xu, 2021; Xu et al., 2021). While previous works highlighted the practical advantages of these representations, such as out-of-distribution robustness (Li et al., 2021a), generative models as representation learners receive less attention compared to alternative unsupervised methods, e.g., based on contrastive learning (Chen et al., 2020b). The main reason is probably the difficulty of training a high-quality generative model on a complex, diverse dataset. However, given the recent success of DDPM on Imagenet (Deng et al., 2009), one can expect that this direction will attract more attention in the future.
+
+# 3 REPRESENTATIONS FROM DIFFUSION MODELS
+
+In the following section, we investigate the image representations learned by diffusion models. First, we provide a brief overview of the DDPM framework. Then, we describe how to extract features with DDPM and investigate what kind of semantic information these features might capture.
+
+Background. Diffusion models transform noise $x_{T} \sim N(0, I)$ to the sample $x_{0}$ by gradually denoising $x_{T}$ to less noisy samples $x_{t}$ . Formally, we are given a forward diffusion process:
+
+$$
+q \left(x _ {t} \mid x _ {t - 1}\right) := \mathcal {N} \left(x _ {t}; \sqrt {1 - \beta_ {t}} x _ {t - 1}, \beta_ {t} I\right), \tag {1}
+$$
+
+for some fixed variance schedule $\beta_{1},\ldots ,\beta_{t}$
+
+
+Figure 1: Overview of the proposed method. (1) $x_0 \to x_t$ by adding noise according to $q(x_t|x_0)$ . (2) Extracting feature maps from a noise predictor $\epsilon_{\theta}(x_t,t)$ . (3) Collecting pixel-level representations by upsampling the feature maps to the image resolution and concatenating them. (4) Using the pixel-wise feature vectors to train an ensemble of MLPs to predict a class label for each pixel.
+
+Importantly, a noisy sample $x_{t}$ can be obtained directly from the data $x_0$ :
+
+$$
+q \left(x _ {t} \mid x _ {0}\right) := \mathcal {N} \left(x _ {t}; \sqrt {\bar {\alpha} _ {t}} x _ {0}, (1 - \bar {\alpha} _ {t}) I\right), \tag {2}
+$$
+
+$$
+x _ {t} = \sqrt {\bar {\alpha} _ {t}} x _ {0} + \sqrt {1 - \bar {\alpha} _ {t}} \epsilon , \epsilon \sim \mathcal {N} (0, 1),
+$$
+
+where $\alpha_{t} := 1 - \beta_{t}$ , $\bar{\alpha}_{t} := \prod_{s=1}^{t} \alpha_{s}$ .
+
+Pretrained DDPM approximates a reverse process:
+
+$$
+p _ {\theta} \left(x _ {t - 1} \mid x _ {t}\right) := \mathcal {N} \left(x _ {t - 1}; \mu_ {\theta} \left(x _ {t}, t\right), \Sigma_ {\theta} \left(x _ {t}, t\right)\right). \tag {3}
+$$
+
+In practice, rather than predicting the mean of the distribution in Equation (3), the noise predictor network $\epsilon_{\theta}(x_t,t)$ predicts the noise component at the step $t$ ; the mean is then a linear combination of this noise component and $x_{t}$ . The covariance predictor $\Sigma_{\theta}(x_{t},t)$ can be either a fixed set of scalar covariances or learned as well (the latter was shown to improve the model quality (Nichol, 2021)).
+
+The denoising model $\epsilon_{\theta}(x_t,t)$ is typically parameterized by different variants of the UNet architecture (Ronneberger et al., 2015), and in our experiments we investigate the state-of-the-art one proposed in (Dhariwal & Nichol, 2021).
+
+Extracting representations. For a given real image $x_0 \in \mathbb{R}^{H \times W \times 3}$ , one can compute $T$ sets of activation tensors from the noise predictor network $\epsilon_{\theta}(x_t, t)$ . The overall scheme for a timestep $t$ is presented in Figure 1. First, we corrupt $x_0$ by adding Gaussian noise according to Equation (2). The noisy $x_t$ is used as an input of $\epsilon_{\theta}(x_t, t)$ parameterized by the UNet model. The UNet's intermediate activations are then upsampled to $H \times W$ with bilinear interpolation. This allows treating them as pixel-level representations of $x_0$ .
+
+# 3.1 REPRESENTATION ANALYSIS
+
+We analyze the representations produced by the noise predictor $\epsilon_{\theta}(x_t,t)$ for different $t$ . We consider the state-of-the-art DDPM checkpoints trained on the LSUN-Horse and FFHQ-256 datasets1.
+
+The intermediate activations from the noise predictor capture semantic information. For this experiment, we take a few images from the LSUN-Horse and FFHQ datasets and manually assign each pixel to one of the 21 and 34 semantic classes, respectively. Our goal is to understand whether the pixel-level representations produced by DDPM effectively capture the information about semantics. To this end, we train a multi-layer perceptron (MLP) to predict the pixel semantic label from its features produced by one of the 18 UNet decoder blocks on a specific diffusion step $t$ . Note that we consider only the decoder activations because they also aggregate the encoder activations through the skip connections. MLPs are trained on 20 images and evaluated on 20 hold-out ones. The predictive performance is measured in terms of mean IoU.
+
+
+Figure 2: The evolution of predictive performance of DDPM-based pixel-wise representations for different UNet decoder blocks and diffusion steps. The blocks are numbered from the deep to shallow ones. The most informative features typically correspond to the later steps of the reverse diffusion process and middle layers of the UNet decoder. The earlier steps correspond to uninformative representations. The plots for other datasets are provided in Appendix A
+
+
+
+
+Figure 3: The evolution of predictive performance of DDPM-based pixel-wise representations on the LSUN-Horse dataset for classes with the smallest (Left) and largest (Right) average areas. The predictive performance for small-sized objects starts growing later in the reverse process. The deeper blocks are more informative for larger objects and the shallower blocks are more informative for smaller objects. A similar evaluation for other datasets is provided in Appendix A.
+
+
+
+The evolution of predictive performance across the different blocks and diffusion steps $t$ is presented in Figure 2. The blocks are numbered from the deep to shallow ones. Figure 2 shows that the discriminability of the features produced by the noise predictor $\epsilon_{\theta}(x_t, t)$ varies for different blocks and diffusion steps. In particular, the features corresponding to the later steps of the reverse diffusion process typically capture semantic information more effectively. In contrast, the ones corresponding to the early steps are generally uninformative. Across different blocks, the features produced by the layers in the middle of the UNet decoder appear to be the most informative on all diffusion steps.
+
+Also, we separately consider small-sized and large-sized semantic classes based on the average area in the annotated dataset. Then, we evaluate mean IoU for these classes independently across the different UNet blocks and diffusion steps. The results on LSUN-Horse are in Figure 3. As expected, the predictive performance for large-sized objects starts growing earlier in the reverse process. The shallower blocks are more informative for smaller objects, while the deeper blocks are more so for the larger ones. In both cases, the most discriminative features still correspond to the middle blocks.
+
+Figure 2 implies that for certain UNet blocks and diffusion steps, similar DDPM-based representations correspond to the pixels of the same semantics. Figure 4 shows the k-means clusters $(k = 5)$ formed by the features extracted by the FFHQ checkpoint from the blocks $\{6,8,10,12\}$ on the diffusion steps $\{50,200,400,600,800\}$ , and confirms that clusters can span coherent semantic objects and object-parts. In the block $B = 6$ , the features correspond to coarse semantic masks. At the other extreme, the features from $B = 12$ can discriminate between fine-grained face parts but exhibit less semantic meaningfulness for coarse fragmentation. Across different diffusion steps, the most meaningful features correspond to the later ones. We attribute this behavior to the fact that on the earlier steps of the reverse process, the global structure of a DDPM sample has not yet emerged, therefore, it is hardly possible to predict segmentation masks at this stage. This intuition is qualitatively confirmed by the masks in Figure 4. For $t = 800$ , the masks poorly reflect the content of actual images, while for smaller values of $t$ , the masks and images are semantically coherent.
+
+
+Figure 4: Examples of k-means clusters $(k = 5)$ formed by the features extracted from the UNet decoder blocks $\{6,8,10,12\}$ on the diffusion steps $\{50,200,400,600,800\}$ . The clusters from the middle blocks spatially span coherent semantic objects and parts.
+
+# 3.2 DDPM-BASED REPRESENTATIONS FOR FEW-SHOT SEMANTIC SEGMENTATION
+
+The potential effectiveness of the intermediate DDPM activations observed above implies their usage as image representations for dense prediction tasks. Figure 1 schematically presents our overall approach for image segmentation, which exploits the discriminability of these representations. In more detail, we consider a few-shot semi-supervised setup, when a large number of unlabeled images $\{X_1,\ldots ,X_N\} \subset \mathbb{R}^{H\times W\times 3}$ from the particular domain are available, and only for $n$ training images $\{X_{1},\dots,X_{n}\} \subset \mathbb{R}^{H\times W\times 3}$ the groundtruth $K$ -class semantic masks $\{Y_{1},\ldots ,Y_{n}\} \subset \mathbb{R}^{H\times W\times \{1,\dots,K\}}$ are provided.
+
+As a first step, we train a diffusion model on the whole $\{X_1,\ldots ,X_N\}$ in an unsupervised manner. Then, this diffusion model is used to extract the pixel-level representations of the labeled images using the subset of the UNet blocks and diffusion steps $t$ . In this work, we use the representations from the middle blocks $B = \{5,6,7,8,12\}$ of the UNet decoder and later steps $t = \{50,150,250\}$ of the reverse diffusion process. These blocks and time steps are motivated by the insights from Section 3.1 but intentionally not tuned for each dataset.
+
+While the feature extraction at the particular time step is stochastic, we fix the noise for all timesteps $t$ and ablate this in Section 4.1. The extracted representations from all blocks $B$ and steps $t$ are upsampled to the image size and concatenated, forming the feature vectors for all pixels of the training images. The overall dimension of the pixel-level representations is 8448.
+
+Then, following (Zhang et al., 2021), we train an ensemble of independent multi-layer perceptrons (MLPs) on these feature vectors, which aim to predict a semantic label of each pixel available for training images. We adopt the ensemble configuration and training settings from (Zhang et al., 2021) and exploit them across all other methods in our experiments, see Appendix C for details.
+
+To segment a test image, we extract its DDPM-based pixel-wise representations and use them to predict the pixel labels by the ensemble. The final prediction is obtained by majority voting.
+
+# 4 EXPERIMENTS
+
+This section experimentally confirms the advantage of the DDPM-based representations for the semantic segmentation problem. We start from a thorough comparison to the existing alternatives and then dissect the reasons for the DDPM success by additional analysis.
+
+Datasets. In our evaluation, we mainly work with the "bedroom", "cat" and "horse" categories from LSUN (Yu et al., 2015) and FFHQ-256 (Karras et al., 2019). As a training set for each dataset, we consider several images for which the fine-grained semantic masks are collected following the protocol from (Zhang et al., 2021). For each dataset, a professional assessor was hired to annotate train and test samples. We denote the collected datasets as Bedroom-28, FFHQ-34, Cat-15, Horse-21, where the number corresponds to the number of semantic classes.
+
+| Dataset | RealTrain | RealTest | GAN | DDPM | Total |
| Bedroom-28 | 40 | 20 | 40 | 40 | 140 |
| FFHQ-34 | 20 | 20 | 20 | 20 | 80 |
| Cat-15 | 30 | 20 | 30 | 30 | 110 |
| Horse-21 | 30 | 30 | 30 | 30 | 120 |
| CelebA-19 | 20 | 500 | — | — | 520 |
| ADE-Bedroom-30 | 50 | 650 | — | — | 700 |
+
+Table 1: Number of annotated images for each dataset used in our evaluation.
+
+Additionally, we consider two datasets, which, in contrast to others, have publicly available annotations and sizable evaluation sets:
+
+- ADE-Bedroom-30 is a subset of the ADE20K dataset (Zhou et al., 2018), where we extract only images of bedroom scenes with 30 most frequent classes. We resize each image to 256 for the smaller side and then crop them to obtain the $256 \times 256$ samples.
+- CelebA-19 is a subset of the CelebAMask-HQ dataset (Lee et al., 2020), which provides the annotation for 19 facial attributes. All images are resized to 256 resolution.
+
+The number of annotated images for each dataset are in Table 1. Other details are in Appendix E.
+
+Methods. In the evaluation, we compare our method (denoted as DDPM) to several prior approaches which tackle the few-shot semantic segmentation setup. First, we describe the baselines that produce a large set of annotated synthetic images to train a segmentation model:
+
+- **DatasetGAN** (Zhang et al., 2021) — this method exploits the discriminability of pixel-level features produced by GANs. In more detail, assessors annotate a few GAN-produced images. Then, the latent codes of these images are used to obtain the intermediate generator activations, which are considered as pixel-level representations. Given these representations, a classifier is trained to predict a semantic label for each pixel. This classifier is then used to label new synthetic GAN images, which, for their part, serve as a training set for the DeepLabV3 segmentation model (Chen et al., 2017). For each dataset, we increase the number of synthetic images until the performance on the validation set is not saturated. According to (Zhang et al., 2021), we also remove $10\%$ of synthetic samples with the most uncertain predictions.
+- DatasetDDPM mirrors the DatasetGAN baseline with the only difference being that GANs are replaced with DDPMs. We include this baseline to compare the GAN-based and DDPM-based representations in the same scenario.
+
+Note that our segmentation method described in Section 3.2 is more straightforward compared to DatasetGAN and DatasetDDPM since it does not require auxiliary steps of the synthetic dataset generation and training the segmentation model on it.
+
+Then, we consider a set of baselines that allow extracting intermediate activations from the real images directly and use them as pixel-level representations similarly to our method. In contrast to DatasetGAN and DatasetDDPM, these methods can potentially be beneficial due to the absence of the domain gap between real and synthetic images.
+
+- MAE (He et al., 2021) — one of the state-of-the-art self-supervised methods, which learns a denoising autoencoder to reconstruct missing patches. We use ViT-Large (Dosovitskiy et al., 2021) as a backbone model and reduce the patch size to $8 \times 8$ to increase the spatial dimensions of the feature maps. We pretrain all models on the same datasets as DDPM using the official code2. The feature extraction for this method is described in Appendix F.
+- SwAV (Caron et al., 2020) — one more recent self-supervised approach. We consider a twice wider ResNet-50 model for evaluation. All models are pretrained on the same datasets as DDPM also using the official source code3. The input image resolution is 256.
+- GAN Inversion employs the state-of-the-art method (Tov et al., 2021) to obtain the latent codes for real images. We map the annotated real images to the GAN latent space, which allows computing the intermediate generator activations and using them as pixel-level representations.
+
+| Method | Bedroom-28 | FFHQ-34 | Cat-15 | Horse-21 | CelebA-19* | ADE Bedroom-30* |
| ALAE | 20.0 ± 1.0 | 48.1 ± 1.3 | — | — | 49.7 ± 0.7 | 15.0 ± 0.5 |
| VDVAE | — | 57.3 ± 1.1 | — | — | 54.1 ± 1.0 | — |
| GAN Inversion | 13.9 ± 0.6 | 51.7 ± 0.8 | 21.4 ± 1.7 | 17.7 ± 0.4 | 51.5 ± 2.3 | 11.1 ± 0.2 |
| GAN Encoder | 22.4 ± 1.6 | 53.9 ± 1.3 | 32.0 ± 1.8 | 26.7 ± 0.7 | 53.9 ± 0.8 | 15.7 ± 0.3 |
| SwAV | 42.4 ± 1.7 | 56.9 ± 1.3 | 45.1 ± 2.1 | 54.0 ± 0.9 | 52.4 ± 1.3 | 30.6 ± 1.6 |
| MAE | 45.0 ± 2.0 | 58.8 ± 1.1 | 52.4 ± 2.3 | 63.4 ± 1.4 | 57.8 ± 0.4 | 31.7 ± 1.8 |
| DatasetGAN | 31.3 ± 2.3 | 57.0 ± 1.1 | 36.5 ± 2.3 | 45.4 ± 1.4 | — | — |
| DatasetDDPM (Ours) | 47.9 ± 2.9 | 56.0 ± 0.9 | 47.6 ± 1.5 | 60.8 ± 1.0 | — | — |
| DDPM (Ours) | 49.4 ± 1.9 | 59.1 ± 1.4 | 53.7 ± 3.3 | 65.0 ± 0.8 | 59.9 ± 1.0 | 34.6 ± 1.7 |
+
+Table 2: The comparison of the segmentation methods in terms of mean IoU. (*) On CelebA-19 and ADE Bedroom-30, we evaluate models trained on FFHQ-256 and LSUN Bedroom, respectively.
+
+- GAN Encoder — while GAN Inversion struggles to reconstruct images from LSUN domains, we also consider the activations of the pretrained GAN encoder used for GAN Inversion.
+- VDVAE (Child, 2021) — state-of-the-art autoencoder model. The intermediate activations are extracted from both encoder and decoder and concatenated. While there are no pretrained models on the LSUN datasets, we evaluate this model only on the publicly available checkpoint4 on FFHQ-256. Note that VAEs are still significantly inferior to GANs and DDPMs on LSUN.
+- ALAE (Pidhorskyi et al., 2020) adopts StyleGANv1 generator and adds an encoder network to the adversarial training. We extract features from the encoder model. In our evaluation, we use publicly available models on LSUN-Bedroom and FFHQ-10245.
+
+Generative pretrained models. In our experiments, we use the state-of-the-art StyleGAN2 (Karras et al., 2020) models for the GAN-based baselines and the state-of-the-art pretrained ADMs (Dhariwal & Nichol, 2021) for our DDPM-based method. Since there is not a pretrained model for FFHQ-256, we train it ourselves using the official implementation6. For evaluation on the ADE-Bedroom-30 dataset, we use the models (including the baselines) pretrained on LSUN-Bedroom. For Celeba-19, we evaluate the models trained on FFHQ-256.
+
+Main results. The comparison of the methods in terms of the mean IoU measure is presented in Table 2. The results are averaged over 5 independent runs for different data splits. We also report per class IoUs in Appendix D. Additionally, we provide several qualitative examples of segmentation with our method in Figure 5. Below we highlight several key observations:
+
+- The proposed method based on the DDPM representations significantly outperforms the alternatives on most datasets.
+- The MAE baseline is the strongest competitor to the DDPM-based segmentation and demonstrates comparable results on the FFHQ-34 and Cat-15 datasets.
+- The SwAV baseline underperforms compared to the DDPM-based segmentation. We attribute this behavior to the fact that this baseline is trained in the discriminative fashion and can suppress the details, which are needed for fine-grained semantic segmentation. This result is consistent with the recent findings in (Cole et al., 2021), which shows that the state-of-the-art contrastive methods produce representations, which are suboptimal for fine-grained problems.
+- DatasetDDPM outperforms its counterpart DatasetGAN against most benchmarks. Note that both these methods use the DeepLabV3 network. We attribute this superiority to the higher quality of DDPM synthetics, therefore, a smaller domain gap between synthetic and real data.
+- On most datasets, DDPM outperforms the DatasetDDPM competitor. We provide an additional experiment to investigate this in the discussion section below.
+
+Overall, the proposed DDPM-based segmentation outperforms the baselines that exploit alternative generative models and also the baselines trained in the self-supervised fashion. This result highlights the potential of using the state-of-the-art DDPMs as strong unsupervised representation learners.
+
+
+Figure 5: The examples of segmentation masks predicted by our method on the test images along with the groundtruth annotated masks.
+
+| Bedroom-28 | Cat-15 | Horse-21 |
| Train data | Real | DDPM | GAN | Real | DDPM | GAN | Real | DDPM | GAN |
| DatasetGAN | — | — | 31.3 ± 2.3 | — | — | 36.5 ± 2.3 | — | — | 45.4 ± 1.4 |
| DatasetDDPM | — | 47.9 ± 2.9 | — | — | 47.6 ± 1.5 | — | — | 60.8 ± 1.0 | — |
| DDPM | 49.4 ± 1.9 | 48.7 ± 2.6 | 43.3 ± 2.9 | 53.7 ± 3.3 | 47.9 ± 2.7 | 41.1 ± 2.2 | 65.0 ± 0.8 | 62.4 ± 1.0 | 60.0 ± 1.0 |
+
+Table 3: Performance of DDPM-based segmentation when trained on real and synthetic images. When trained on DDPM-produced data, DDPM demonstrates comparable performance to Dataset-DDPM. When trained on GAN-produced data, DDPM still significantly outperforms DatasetGAN, but the gap between them reduces.
+
+# 4.1 DISCUSSION
+
+The effect of training on real data. The proposed DDPM method is trained on annotated real images, while DatasetDDPM and DatasetGAN are trained on synthetic ones, which are typically less natural, diverse, and can lack objects of particular classes. Moreover, synthetic images are harder for human annotation since they might have some distorted objects that are difficult to assign to a particular class. In the following experiment, we quantify the performance drop caused by training on real or synthetic data. Specifically, Table 3 reports the performance of the DDPM approach trained on real, DDPM-produced and GAN-produced annotated images. As can be seen, training on real images is very beneficial on the domains where the fidelity of generative models is still relatively low, e.g., LSUN-Cat, which indicates that annotated real images are a more reliable source of supervision. Moreover, if the DDPM method is trained on synthetic images, its performance becomes on par with DatasetDDPM. On the other hand, when trained on GAN-produced samples, DDPM significantly outperforms DatasetGAN. We attribute this to the fact that DDPMs provide more semantically-valuable pixel-wise representations compared to GANs.
+
+Sample-efficiency. In this experiment, we evaluate the performance of our method when it utilizes less annotated data. We provide mIoU for four datasets in Table 4. Importantly, DDPM is still able to outperform most baselines in Table 2, using significantly less supervision.
+
+The effect of stochastic feature extraction. Here, we investigate whether our method can benefit from the stochastic feature extraction described in Section 3.2. We consider the deterministic case, when the noise $\epsilon \sim N(0,I)$ is sampled once and used in (2) to obtain $x_{t}$ for all timesteps $t$ during both training and evaluation. Then, we compare it to the following stochastic options:
+
+First, different $\epsilon_{t}$ are sampled for different timesteps $t$ and shared during the training and evaluation. Second, one samples different noise for all timesteps at each training iteration; during the evaluation the method also uses unseen noise samples.
+
+
+(a) Bedroom-28
+
+
+(b) Horse-21
+Figure 6: mIoU degradation for different image corruption levels on the Bedroom-28 and Horse-21 datasets. DDPM demonstrates higher robustness and preserves its advantage for all distortion levels.
+
+ | Bedroom-28 | Cat-15 | Horse-21 |
| Method | 40 | 20 | 10 | 30 | 20 | 10 | 30 | 20 | 10 |
| DDPM | 49.4 ± 1.9 | 46.2 ± 3.6 | 38.2 ± 2.9 | 53.7 ± 3.3 | 49.2 ± 4.2 | 42.0 ± 4.8 | 65.0 ± 0.8 | 63.8 ± 0.7 | 56.9 ± 2.4 |
+
+Table 4: Evaluation of the proposed method with a different number of labeled training data. Even using less annotated data, DDPM still outperforms most baselines in Table 2.
+
+| Share Train/Test | Share for t | Bedroom-28 | FFHQ-34 |
| + | + | 49.3 ± 1.9 | 59.1 ± 1.4 |
| + | - | 49.1 ± 2.2 | 59.3 ± 1.5 |
| - | - | 48.9 ± 1.6 | 59.3 ± 1.4 |
+
+Table 5: Performance of the DDPM-based method for different feature extraction variations. All considered stochastic options provide a similar mIoU to the deterministic one.
+
+The results are provided in Table 5. As one can see, the difference in the performance is marginal. We attribute this behavior to the following reasons:
+
+- Our method uses later $t$ of the reverse diffusion process where the noise magnitude is low.
+- Since we exploit the deep layers of the UNet model, the noise might not affect the activations from these layers significantly.
+
+Robustness to input corruptions. In this experiment, we investigate the robustness of DDPM-based representations. First, we learn pixel classifiers on the clean images using the DDPM, SwAV and MAE representations on the Bedroom-28 and Horse-21 datasets. Then, 18 diverse corruption types, adopted from (Hendrycks & Dietterich, 2019), are applied to test images. Each corruption has five levels of severity. In Figure 6, we provide mean IoUs computed over all corruption types for 1, 3, 5 levels of severity, denoted as "weak", "medium" and "strong", respectively.
+
+One can observe that the proposed DDPM-based method demonstrates higher robustness and preserves its advantage over the SwAV and MAE models even for severe image distortions.
+
+# 5 CONCLUSION
+
+This paper demonstrates that DDPMs can serve as representation learners for discriminative computer vision problems. Compared to GANs, diffusion models allow for a straightforward computation of these representations for real images, and one does not need to learn an additional encoder, which maps images to the latent space. This DDPM's advantage and superior generative quality provide state-of-the-art performance in the few-shot semantic segmentation task. The notable restraint of the DDPM-based segmentation is a requirement of high-quality diffusion models trained on the dataset at hand, which can be challenging for complex domains, like ImageNet or MSCOCO. However, given the rapid research progress on DDPM, we expect they will reach these milestones in the nearest future, thereby extending the range of applicability for the corresponding representations.
+
+# REFERENCES
+
+Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
+Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017.
+Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever.
+Generative pretraining from pixels. In ICML, 2020a.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020b.
+Rewon Child. Very deep {vae}s generalize autoregressive models and can outperform them on images. In International Conference on Learning Representations, 2021.
+Elijah Cole, Xuan Yang, Kimberly Wilber, Oisin Mac Aodha, and Serge Belongie. When does contrastive visual representation learning work? arXiv preprint arXiv:2105.05837, 2021.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Prafulla Dhariwal and Alex Nichol. Diffusion models beat gans on image synthesis. 2021.
+Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. NeurIPS, 2019.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. ICLR, 2021.
+Danil Galeev, Konstantin Sofiuk, Danila Rukhovich, Mikhail Romanov, Olga Barinova, and Anton Konushin. Learning high-resolution domain-specific representations with a gan generator. In S+SSPR, 2020.
+Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. arXiv:2111.06377, 2021.
+Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
+Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. 2020.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4401-4410, 2019.
+Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8107-8116, 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.
+Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: Towards diverse and interactive facial image manipulation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+Daiqing Li, Junlin Yang, Karsten Kreis, Antonio Torralba, and Sanja Fidler. Semantic segmentation with generative models: Semi-supervised learning and strong out-of-domain generalization. In CVPR, 2021a.
+
+Haoying Li, Yifan Yang, Meng Chang, Huajun Feng, Zhihai Xu, Qi Li, and Yueting Chen. Srdiff: Single image super-resolution with diffusion probabilistic models. 2021b.
+Luke Melas-Kyriazi, Christian Rupprecht, Iro Laina, and Andrea Vedaldi. Finding an unsupervised image segmenter in each of your deep generative models. arXiv preprint arXiv:2105.08127, 2021.
+Chenlin Meng, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. Sdedit: Image synthesis and editing with stochastic differential equations. 2021.
+Prafulla Nichol, Alex & Dhariwal. Improved denoising diffusion probabilistic models. ICML, 2021.
+Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
+Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015.
+Chitwan Sahara, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. 2021.
+Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015.
+Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In NeurIPS, 2019.
+Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. NeurIPS, 2020.
+Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. 2021.
+Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or. Designing an encoder for stylegan image manipulation. arXiv preprint arXiv:2102.02766, 2021.
+Nontawat Tritrong, Pitchaporn Rewatbowornwong, and Supasorn Suwajanakorn. Repurposing gans for one-shot semantic part segmentation. In CVPR, 2021.
+Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the gan latent space. In ICML, 2020.
+Andrey Voynov, Stanislav Morozov, and Artem Babenko. Object segmentation without labels with large-scale generative models. ICML, 2021.
+Changxi Xu, Jianjin & Zheng. Linear semantics in generative adversarial networks. In CVPR, 2021.
+Yinghao Xu, Yujun Shen, Jiapeng Zhu, Ceyuan Yang, and Bolei Zhou. Generative hierarchical features from synthesizing images. In CVPR, 2021.
+Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
+Yuxuan Zhang, Huan Ling, Jun Gao, Kangxue Yin, Jean-Francois Lafleche, Adela Barriuso, Antonio Torralba, and Sanja Fidler. Datasetgan: Efficient labeled data factory with minimal human effort. In CVPR, 2021.
+Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 127:302-321, 2018.
+
+# APPENDIX
+
+# A EVOLUTION OF PREDICTIVE PERFORMANCE
+
+
+Figure 7: The evolution of predictive performance of DDPM-based pixel-wise representations for different UNet blocks and diffusion steps on LSUN-Cat and LSUN-Bedroom. The blocks are numbered from the deep to shallow ones.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: The evolution of predictive performance of DDPM-based pixel-wise representations on the FFHQ-256, LSUN-Cat and LSUN-Bedroom datasets for classes with the smallest (Left) and largest (Right) average areas.
+
+
+
+B DATASETDDPM & DATASETGAN SATURATION
+
+| Dataset | DatasetDDPM | DatasetGAN |
| 10k | 20K | 30K | 40K | 50K | 10K | 20K | 30K | 40K | 50K |
| Bedroom-28 | 45.1 ± 2.3 | 46.2 ± 2.3 | 46.1 ± 2.8 | 47.8 ± 2.3 | 47.9 ± 2.9 | 30.6 ± 2.3 | 30.4 ± 3.1 | 30.9 ± 2.4 | 30.9 ± 2.4 | 31.3 ± 2.7 |
| FFHQ-34 | 55.9 ± 0.8 | 55.8 ± 0.7 | 55.9 ± 0.7 | 56.0 ± 0.8 | 55.9 ± 0.7 | 56.4 ± 1.0 | 56.9 ± 1.0 | 57.0 ± 1.1 | 57.0 ± 1.2 | 57.0 ± 1.2 |
| Cat-15 | 43.6 ± 3.0 | 46.4 ± 1.7 | 46.2 ± 1.9 | 47.4 ± 1.7 | 47.6 ± 1.5 | 34.7 ± 2.8 | 34.8 ± 2.9 | 36.3 ± 2.3 | 35.8 ± 2.5 | 36.5 ± 2.3 |
| Horse-21 | 57.0 ± 1.2 | 59.5 ± 0.5 | 59.0 ± 2.0 | 60.4 ± 1.1 | 60.8 ± 0.9 | 41.6 ± 2.0 | 43.1 ± 1.8 | 45.4 ± 1.4 | 44.5 ± 1.2 | 44.6 ± 1.4 |
+
+Table 6: Performance of DatasetDDPM and DatasetGAN for ${10K} - {50K}$ synthetic images in the training dataset. Mean IoU of both methods saturates at ${30K} - {50K}$ of synthetic data.
+
+# C TRAINING SETUP
+
+The ensemble of MLPs consists of 10 independent models. Each MLP is trained for $\sim 4$ epochs using the Adam optimizer (Kingma & Ba, 2015) with 0.001 learning rate. The batch size is 64. This setting is used for all methods and datasets.
+
+MLP architecture. We adopt the MLP architecture from (Zhang et al., 2021). Specifically, we use MLPs with two hidden layers with ReLU nonlinearity and batch normalization. The sizes of hidden layers are 128 and 32 for datasets with a number of classes less than 30, and 256 and 128 for others.
+
+Also, we evaluate the performance of the proposed method for twice wider / deeper MLPs on the Bedroom-28 and FFHQ-34 datasets and do not observe any noticeable difference, see Table 7.
+
+| Method | Bedroom-28 | FFHQ-34 |
| Original MLP | 49.4 | 59.1 |
| Wider MLP | 49.5 | 59.1 |
| Deeper MLP | 49.3 | 58.9 |
+
+Table 7: Performance of the proposed method for twice wider / deeper MLP architecture within the ensemble. More expressive MLPs do not improve the performance.
+
+
+D PERCLASSIOUS
+(a) Horse-21
+
+
+
+
+(c) FFHQ-34
+Figure 9: Per class IoUs for DatasetGAN, DatasetDDPM and DDPM.
+
+
+(b) Cat-15
+(d) Bedroom-28
+
+
+(a) Bedroom-28
+
+
+(b) FFHQ-34
+
+
+(c) Horse-21
+
+
+(d) Cat-15
+Figure 10: Number of instances of each semantic class in the annotated real and synthetic train sets.
+
+# E DATASET DETAILS
+
+# E.1 CLASS NAMES
+
+Bedroom-28: [bed, footboard, headboard, side rail, carpet, ceiling, chandelier, curtain, cushion, floor, table, table top, picture, pillow, lamp column, lamp shade, wall, window, curtain rod, window frame, chair, picture frame, plinth, door, pouf, wardrobe, plant, table staff]
+
+FFHQ-34: [background, head, cheek, chin, ear, helix, lobule, bottom lid, eyelashes, iris, pupil, sclera, tear duct, top lid, eyebrow, forehead, frown, hair, sideburns, jaw, moustache, inferior lip, oral commissure, superior lip, teeth, neck, nose, ala of nose, bridge, nose tip, nostril, philtrum, temple, wrinkles]
+
+Cat-15: [background, back, belly, chest, leg, paw, head, ear, eye, mouth, tongue, tail, nose, whiskers, neck]
+
+Horse-21: [background, person, back, barrel, bridle, chest, ear, eye, forelock, head, hoof, leg, mane, muzzle, neck, nostril, tail, thigh, saddle, shoulder, leg protection]
+
+CelebA-19: [background, cloth, ear_r, eye_g, hair, hat, l_brow, l_ear, l_eye, l_lip, mouth, neck, neck_1, nose, r_brow, r_ear, r_eye, skin, u_lip]
+
+ADE-Bedroom-30: [wall, bed, floor, table, lamp, ceiling, painting, windowpane, pillow, curtain, cushion, door, chair, cabinet, chest, mirror, rug, armchair, book, sconce, plant, wardrobe, clock, light, flower, vase, fan, box, shelf, television]
+
+# E.2 CLASS STATISTICS
+
+In Figure 10, we report the statistics of classes computed over annotated real images as well as annotated synthetic images produced by GAN and DDPM.
+
+# F EXTRACTING REPRESENTATIONS FROM MAE
+
+To obtain pixelwise representations, we apply the model to a fully observed image ( $mask\_ratio = 0$ ) of resolution 256 and extract feature maps from the deepest 12 ViT-L blocks. The feature maps from each block have $1024 \times 32 \times 32$ dimensions. Similarly to other methods, we upsample the extracted feature maps to $256 \times 256$ and concatenate them. The overall dimension of the pixel representation is 12288.
+
+In addition, we investigated other feature extraction strategies and got the following observations:
+
+1. Including activations from the decoder did not provide any noticeable gains;
+2. Extracting activations right after self-attention layers caused slightly inferior performance;
+3. Extracting activations from every second encoder block also provided a bit worse results.
\ No newline at end of file
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/images.zip b/labelefficientsemanticsegmentationwithdiffusionmodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6b3e4cb108a261fe3d126b3e76c7b260579919da
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f4ea836255f0509347a13444b14fb5fc63991d9e08067f7a4940240d20f4432
+size 804038
diff --git a/labelefficientsemanticsegmentationwithdiffusionmodels/layout.json b/labelefficientsemanticsegmentationwithdiffusionmodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..3983838373b46cdb5d6fc610d890765b48119773
--- /dev/null
+++ b/labelefficientsemanticsegmentationwithdiffusionmodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dd2a6178b07af1babbb14c309473d955e8c390239ffd535a41639c364e551e76
+size 432814
diff --git a/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_content_list.json b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..94fde17d6aedc3a266d6d7cbcd9e07c7610abf71
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d65b131dded40d2f6a239268c0344b9246af48d74ebf919a1b045d4448ca32df
+size 170059
diff --git a/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_model.json b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5e783e1ffc79f0e9e0885e2627363fdd146f94a0
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:36705946f453f4689114e78cd20c010eb500af472bdd8586ed1675c8bbb12a6e
+size 194782
diff --git a/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_origin.pdf b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..16e48fb4c3cb15a2aff6ef3decaa1fda1f78ff19
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/8b0bd673-a761-4b92-93f2-7475f97e47a9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5dcec60c19a70a8f4cd9656205556b947464e1678a1b6e5897f2c25681c3bc33
+size 4260143
diff --git a/labelleakageandprotectionintwopartysplitlearning/full.md b/labelleakageandprotectionintwopartysplitlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..4b03f7ef6dd9c38cc5190bb947ad2ccfef85e6f7
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/full.md
@@ -0,0 +1,747 @@
+# LABEL LEAKAGE AND PROTECTION IN TWO-PARTY SPLIT LEARNING
+
+Oscar Li $^{1\ddagger}$ ,* Jiankai Sun $^{2\S}$ , Xin Yang $^{2}$ , Weihao Gao $^{2}$ , Hongyi Zhang $^{2}$ , Junyuan Xie $^{2}$ , Virginia Smith $^{1}$ , Chong Wang $^{2}$
+
+$^{1}$ Carnegie Mellon University $^{2}$ ByteDance Inc.
+
+# ABSTRACT
+
+Two-party split learning is a popular technique for learning a model across feature-partitioned data. In this work, we explore whether it is possible for one party to steal the private label information from the other party during split training, and whether there are methods that can protect against such attacks. Specifically, we first formulate a realistic threat model and propose a privacy loss metric to quantify label leakage in split learning. We then show that there exist two simple yet effective methods within the threat model that can allow one party to accurately recover private ground-truth labels owned by the other party. To combat these attacks, we propose several random perturbation techniques, including Marvell, an approach that strategically finds the structure of the noise perturbation by minimizing the amount of label leakage (measured through our quantification metric) of a worst-case adversary. We empirically1 demonstrate the effectiveness of our protection techniques against the identified attacks, and show that Marvell in particular has improved privacy-utility tradeoffs relative to baseline approaches.
+
+# 1 INTRODUCTION
+
+With increasing concerns over data privacy in machine learning, federated learning (FL) (McMahan et al., 2017) has become a promising direction of study. Based on how sensitive data are distributed among parties, FL can be classified into different categories, notable among which are horizontal FL and vertical FL (Yang et al., 2019). In contrast to horizontal FL where the data are partitioned by examples, vertical FL considers data partitioned by features (including labels). As a canonical example of vertical FL, consider an online media platform $A$ which displays advertisements from company $B$ to its users, and charges $B$ for each conversion (e.g., a user clicking the ad and buying the product). In this case, both parties have different features for each user: $A$ has features on the user's media viewing records, while $B$ has the user's conversion labels. $B$ 's labels are not available to $A$ because each user's purchase behaviors happen entirely on $B$ 's website/app.
+
+If both parties want to jointly learn a model to predict conversion without data sharing, split learning (Gupta & Raskar, 2018; Vepakomma et al., 2018) can be used to split the execution of a deep network between the parties on a layer-wise basis. In vanilla split learning, before training begins, both parties use Private Set Intersection (PSI) protocols (Kolesnikov et al., 2016; Pinkas et al., 2018) to find the intersection of their data records and achieve an example ID alignment. This alignment paves the way for the split training phase. During training (Figure 1), the party without labels (non-label party) sends the intermediate layer (cut layer) outputs rather than the raw data to the party with labels (label party), and the label party completes the rest of the forward computation to obtain the training loss. To compute the gradients with respect to model parameters, the label party initiates backpropagation from its training loss and computes its own parameters' gradients. To allow the non-label party to also compute gradients of its parameters, the label party also computes the gradients with respect to the cut layer outputs and communicates this information back to the non-label party. As a result of the ID alignment, despite not knowing the label party's raw label data, the non-label party can identify the gradient value returned by the label party for each example.
+
+At first glance, the process of split learning appears privacy-preserving because only the intermediate computations of the cut layer—rather than raw features or labels—are communicated between the two parties. However, such "gradient sharing" schemes have been shown to be vulnerable to privacy leakage in horizontal FL settings (e.g., Zhu et al., 2019). In vertical FL (and specifically split learning), it remains unclear whether the raw data can similarly be leaked during communi
+
+
+Figure 1: Communication diagram of two-party split training for an example of online advertising. We study whether it is possible for the communicated gradient $g$ to leak private label information.
+
+cation. In particular, as the raw labels often contain highly sensitive information (e.g., what a user has purchased (in online advertising) or whether a user has a disease or not (in disease prediction) Vepakomma et al. (2018)), developing a rigorous understanding of the threat of label leakage and its protection is particularly important. Towards this goal, we make the following contributions:
+
+1. We formalize a threat model for label leakage in two-party split learning in the context of binary classification (Section 3.1), and propose specific privacy quantification metrics to measure the severity of such threats (Section 3.2).
+2. We identify two simple and realistic methods within this threat model which can accurately recover the label party's private label information (Section 3.3).
+3. We propose several random perturbation techniques to limit the label-stealing ability of the non-label party (Section 4). Among them, our principled approach Marvell directly searches for the optimal random perturbation noise structure to minimize label leakage (as measured via our quantification metric) against a worst-case adversarial non-label party.
+4. We experimentally demonstrate the effectiveness of our protection techniques and MARVELL's improved privacy-utility tradeoffs compared to other protection baselines (Section 5).
+
+# 2 RELATED WORK
+
+Privacy leakage in split learning. Although raw data is not shared in federated learning, sensitive information may still be leaked when gradients and/or model parameters are communicated between parties. In horizontal FL, Zhu et al. (2019) showed that an honest-but-curious server can uncover the raw features and labels of a device by knowing the model architecture, parameters, and communicated gradient of the loss on the device's data. Based on their techniques, Zhao et al. (2020) showed that the ground truth label of an example can be extracted by exploiting the directions of the gradients of the weights connected to the logits of different classes. Here we study a different setting—two-party split learning (in vertical FL) (Yang et al., 2019), where no party has access to the model architecture or model parameters of the other party. In this setting, Vepakomma et al. (2019) studied how the forward communication of feature representations can leak the non-label party's raw data to the label party. We instead study whether label information may be leaked from the label party to the non-label party during the backward communication. Despite the importance of maintaining the privacy of these labels, we are unaware of prior work that has studied this problem.
+
+Privacy protection and quantification. Techniques to protect communication privacy in FL generally fall into three categories: 1) cryptographic methods such as secure multi-party computation (e.g., Bonawitz et al., 2017); 2) system-based methods including trusted execution environments (Subramanyan et al., 2017); and 3) perturbation methods that shuffle or modify the communicated messages (e.g., Abadi et al., 2016; McMahan et al., 2018; Erlingsson et al., 2019; Cheu et al., 2019; Zhu et al., 2019). Our protection techniques belong to the third category, as we add random perturbations to the gradients to protect the labels. Many randomness-based protection methods have been proposed in the domain of horizontal FL. In this case, differential privacy (DP) (Dwork, 2006; Dwork et al., 2014) is commonly used to measure the proposed random mechanisms' ability to anonymize the identity of any single participating example in the model iterates. However, in split learning, after PSI, both parties know exactly the identity of which example has participated in a given gradient update. As we explain in Section 3.1, the object we aim to protect (the communicated cut layer gradients), unlike the model iterates, is not an aggregate function of all the examples but are instead example-specific. As a result, DP and its variants (e.g. label DP (Chaudhuri & Hsu, 2011; Ghazi et al., 2021)) are not directly applicable metrics in our setting, and we instead propose a different metric (discussed in Section 3.2).
+
+# 3 LABEL LEAKAGE IN SPLIT LEARNING
+
+We first introduce the two-party split learning problem for binary classification, and then formally describe our threat model and privacy quantification metrics with two concrete attack examples.
+
+# 3.1 TWO-PARTY SPLIT LEARNING IN BINARY CLASSIFICATION
+
+Problem setup. Consider two parties learning a composition model $h \circ f$ jointly for a binary classification problem over the domain $\mathcal{X} \times \{0,1\}$ (Figure 1). The non-label party owns the representation function $f: \mathcal{X} \to \mathbb{R}^d$ and each example's raw feature $X \in \mathcal{X}$ while the label party owns the logit function $h: \mathbb{R}^d \to \mathbb{R}$ and each example's label $y \in \{0,1\}^2$ . Let $\ell = h(f(X))$ be the logit of the positive class whose predicted probability is given through the sigmoid function: $\widetilde{p}_1 = 1 / (1 + \exp(-\ell))$ . We measure the loss of such prediction through the cross entropy loss $L = \log(1 + \exp(-\ell)) + (1 - y)\ell$ . During model inference, the non-label party computes $f(X)$ and sends it to the label party who will then execute the rest of forward computation in Figure 1.
+
+Model training (Figure 1: backward gradient computation). To train the model using gradient descent, the label party starts by first computing the gradient of the loss $L$ with respect to the logit $\frac{dL}{d\ell} = (\widetilde{p}_1 - y)$ . Using the chain rule, the label party can then compute the gradient of $L$ with respect to its function $h$ 's parameters and perform the gradient updates. To also allow the non-label party to learn its function $f$ , the label party needs to additionally compute the gradient with respect to cut layer feature $f(X)$ and communicate it to the non-label party. We denote this gradient by $g := \nabla_{f(X)}L = (\widetilde{p}_1 - y)\nabla_zh(z)|_{z = f(X)} \in \mathbb{R}^d$ (by chain rule). After receiving $g$ , the non-label party continues the backpropagation towards $f$ 's parameters and also perform the gradient updates.
+
+Why Not Differential Privacy? Note that for a given iteration, the non-label party randomly chooses $B$ example IDs to form a batch. Therefore, the identity of which examples are used is known to the non-label party by default. In addition, the communicated features $f(X)$ and returned gradients $g$ will both be matrices in $\mathbb{R}^{B \times d}$ with each row belonging to a specific example in the batch. The different gradients (rows of the matrix) are not with respect to the same model parameters, but are instead with respect to different examples' cut-layer features; thus, no averaging over or shuffling of the rows of the gradient matrix can be done prior to communication to ensure correct computation of $f$ 's parameters on the non-label party side. This example-aware and example-specific nature of the communicated gradient matrix makes differential privacy (which focuses on anonymizing an example's participation in an aggregate function) inapplicable for this problem (see also Section 2).
+
+# 3.2 THREAT MODEL AND PRIVACY QUANTIFICATION
+
+Below we specify several key aspects of our threat model, including the adversary's objective and capabilities, our metric for quantifying privacy loss, and the possible inclusion of side information.
+
+Adversary's objective. At a given moment in time during training (with $f$ and $h$ fixed), since the communicated cut layer gradient $g$ is a deterministic function of $y$ (see Section 3.1), we consider an adversarial non-label party whose objective is to recover the label party's hidden label $y$ based on the information contained in $g$ for every training example.
+
+Adversary's capability. We consider an honest-but-curious non-label party which cannot tamper with training by selecting which examples to include in a batch or sending incorrect features $f(X)$ ; instead, we assume that the adversary follows the agreed-upon split training procedure while trying to guess the label $y$ . This can be viewed as a binary classification problem where the (input, output) distribution is the induced distribution of $(g, y)$ . We allow the adversary to use any binary classifier $q: \mathbb{R}^d \to \{0, 1\}$ to guess the labels. This classifier can be represented by a (scoring function $r$ , threshold $t$ ) tuple, where $r: \mathbb{R}^d \to \mathbb{R}$ maps an example's cut layer gradient to a real-valued score and the threshold $t \in \mathbb{R}$ determines a cut-off so that $q(g) = 1$ if $r(g) > t$ and $q(g) = 0$ if $r(g) \leq t$ . Moving forward, we use this tuple representation to describe adversarial non-label party classifiers.
+
+Privacy loss quantification. As we consider binary classification, a natural metric to quantify the performance of an adversary's scoring function $r$ is the AUC of its ROC curve. Denote the unperturbed class-conditional distributions of the cut-layer gradients by $P^{(1)}$ and $P^{(0)}$ for the
+
+
+
+
+
+
+
+
+Figure 2: Distributions of quantities discussed in Observations 1-4 after the first 100, 200, 300, 400, 500 steps of stochastic gradient descent training of the WDL model on Criteo (see experiments).
+
+
+
+positive and negative class, respectively. The ROC curve of a scoring function $r$ is a parametric curve $t \mapsto (\mathrm{FPR}_r(t), \mathrm{TPR}_r(t)) \in [0,1]^2$ which maps a threshold value $t \in \mathbb{R}$ to the corresponding (False Positive Rate, True Positive Rate) tuple of the classifier represented by $(r,t)$ , with $\mathrm{FPR}_r(t) \coloneqq P^{(0)}(\{g : r(g) > t\})$ and $\mathrm{TPR}_r(t) \coloneqq P^{(1)}(\{g : r(g) > t\})$ . The AUC of the ROC curve of a scoring function $r$ (denote by $\mathrm{AUC}(r)$ ) can be expressed as an integral:
+
+$$
+\mathrm {A U C} (r) = \int_ {\infty} ^ {- \infty} \mathrm {T P R} _ {r} (t) d \mathrm {F P R} _ {r} (t) \in [ 0, 1 ] \quad (\text {L e a k A U C})
+$$
+
+(more details on this expression see Appendix A.1.) We use this value as the privacy loss quantification metric for a specific adversary scoring function $r$ and refer to it as the leak AUC. This metric summarizes the predictive performance of all classifiers that can be constructed through all threshold values $t$ and removes the need to tune this classifier-specific hyperparameter. The leak AUC being close to 1 implies that the corresponding scoring function $r$ can very accurately recover the private label, whereas a value of around 0.5 means $r$ is non-informative in predicting the labels. In practice, during batch training, the leak AUC of $r$ can be estimated at every gradient update iteration using the minibatch of cut-layer gradients together with their labels.
+
+Side information. Among all the scoring functions within our threat model, it is conceivable that only some would recover the hidden labels accurately. Picking such effective ones would require the non-label party to have population-level side information specifically regarding the properties of (and distinction between) the positive and negative class's cut-layer gradient distributions. Since we allow the adversary to pick any specific (measurable) scoring function, we implicitly allow for such population-level side information for the adversary. However, we assume the non-label party has no example-level side information that is different from example by example. Thus we also don't use local DP for privacy quantification (detailed explanation in Appendix A.8). Next we provide two examples scoring functions which use population-level side-information to effectively recover the label.
+
+# 3.3 PRACTICAL ATTACK METHODS
+
+Attack 1: Norm-based scoring function. Note that $\| g\| _2 = |\widetilde{p}_1 - y|\cdot \| \nabla_ah(a)|_{a = \boldsymbol {f}(X)}\| _2$ . We make the following observations for $|\widetilde{p}_1 - y|$ and $\| \nabla_{a}h(a)|_{a = \boldsymbol {f}(X)}\| _2$ , which hold true for a wide range of real-world learning problems.
+
+- Observation 1: Throughout training, the model tends to be less confident about a positive example being positive than a negative example being negative. In other words, the confidence gap of a positive example $1 - \widetilde{p}_1 = |\widetilde{p}_1 - y|$ (when $y = 1$ ) is typically larger than the confidence gap of a negative example $1 - \widetilde{p}_0 = \widetilde{p}_1 = |\widetilde{p}_1 - y|$ (when $y = 0$ ) (see Figure 2(a)). This observation is particularly true for problems like advertising conversion prediction and disease prediction, where there is inherently more ambiguity for the positive class than the negative. For example, in advertising, uninterested users of a product will never click on its ad and convert, but those interested, even after clicking, might make the purchase only a fraction of the time depending on time/money constraints. (See A.2 for such an ambiguity even for a class-balanced setting.)
+- Observation 2: Throughout training, the norm of the gradient vector $\left\| \nabla_{z}h(z)\right\|_{z = \boldsymbol{f}(X)}\|_{2}$ is on the same order of magnitude (has similar distribution) for both the positive and negative examples (Figure 2(b)). This is natural because $\nabla_{a}h(a)\big|_{a = \boldsymbol{f}(X)}$ is not a function of $y$ .
+
+As a consequence of Observation 1 and 2, the gradient norm $\| g\| _2$ of the positive instances are generally larger than that of the negative ones (Figure 2(c)). Thus, the scoring function $r_n(g) =$ $\| g\| _2$ is a strong predictor of the unseen label $y$ . We name the privacy loss (leak AUC) measured against the attack $r_n$ the norm leak AUC. In Figure 2(c), the norm leak AUCs are consistently above 0.9, signaling a high level of label leakage throughout training.
+
+Attack 2: Direction-based scoring function. We now show that the direction of $g$ (in addition to its magnitude) can also leak the label. For a pair of examples, $(X_{a},y_{a}),(X_{b},y_{b})$ , let their respective predicted positive class probability be $\widetilde{p}_{1,a}$ , $\widetilde{p}_{1,b}$ and their communicated gradients be $g_{a}$ , $g_{b}$ . Let $\cos : \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}$ denote the cosine similarity function $\cos(g_{a},g_{b}) = g_{a}^{T}g_{b} / (\|g_{a}\|_{2}\|g_{b}\|_{2})$ . It is easy to see that $\cos(g_{a},g_{b}) = \operatorname{sgn}(\widetilde{p}_{1,a} - y_{a}) \cdot \operatorname{sgn}(\widetilde{p}_{1,a} - y_{b}) \cdot \cos(\nabla_{z}h(z)|_{z=f(X_{a})},\nabla_{z}h(z)|_{z=f(X_{b})})$ , where $\operatorname{sgn}(x)$ is the sign function which returns 1 if $x \geq 0$ , and -1 if $x < 0$ . We highlight two additional observations that can allow us to use cosine similarity to recover the label.
+
+- Observation 3: When the examples $a, b$ are of different classes, the term $\operatorname{sgn}(\widetilde{p}_{1,a} - y_a) \cdot \operatorname{sgn}(\widetilde{p}_{1,a} - y_b) = -1$ is negative. On the other hand, when examples $a, b$ are of the same class (both positive/both negative), this product will have a value of 1 and thus be positive.
+- Observation 4: Throughout training, for any two examples $a, b$ , their gradients of the function $h$ always form an acute angle, i.e. $\cos (\nabla_z h(z)|_{z = \pmb{f}(X_a)}, \nabla_z h(z)|_{z = \pmb{f}(X_b)}) > 0$ (Figure 2(d)). For neural networks that use monotonically increasing activation functions (such as ReLU, sigmoid, tanh), this is caused by the fact that the gradients of these activation functions with respect to its inputs are coordinatewise nonnegative and thus always lie in the first closed hyperorthant.
+
+Since $\cos(g_{a}, g_{b})$ is the product of the terms from Observation 3 and 4, we see that for a given example, all the examples that are of the same class result in a positive cosine similarity, while all opposite class examples result in a negative cosine similarity. If the problem is class-imbalanced and the non-label party knows there are fewer positive examples than negative ones, it can thus determine the label of each example: the class is negative if more than half of the examples result in positive cosine similarity; otherwise it is positive. For many practical applications, the non-label party may reasonably guess which class has more examples in the dataset a priori without ever seeing any data—for example, in disease prediction, the percentage of the entire population having a certain disease is almost always much lower than $50\%$ ; in online advertising conversion prediction, the conversion rate (fraction of positive examples) is rarely higher than $30\%$ . Note that the non-label party doesn't need knowledge of the exact sample proportion of each class for this method to work.
+
+To simplify this attack for evaluation, we consider an even worse oracle scenario where the non-label party knows the clean gradient of one positive example $g_{+}$ . Unlike the aforementioned practical majority counting attack which needs to first figure out the direction of one positive gradient, this oracle scenario assumes the non-label party is directly given this information. Thus, any protection method capable of defending this oracle attack would also protect against the more practical one. With $g_{+}$ given, the direction-based scoring function $r_d$ is simply $r_d(g) = \cos(g, g_{+})$ . We name the privacy loss (leak AUC) against this oracle attack $r_d$ the cosine leak AUC. In practice, we randomly choose a positive class clean gradient from each batch as $g_{+}$ for evaluation. For iterations in Figure 2(e), the cosine leak AUC all have the highest value of 1 (complete label leakage).
+
+# 4 LABEL LEAKAGE PROTECTION METHODS
+
+In this section, we first introduce a heuristic random perturbation approach designed to prevent the practical attacks identified in Section 3.3. We then propose a theoretically justified method that aims to protect against the entire class of scoring functions considered in our threat model (Section 3.2).
+
+# 4.1 A HEURISTIC PROTECTION APPROACH
+
+Random perturbation and the isotropic Gaussian baseline. To protect against label leakage, the label party should ideally communicate essential information about the gradient without communicating its actual value. Random perturbation methods generally aim to achieve this goal. One obvious consideration for random perturbation is to keep the perturbed gradients unbiased. In other words, suppose $\tilde{g}$ is the perturbed version of an example's true gradient $g$ , then we want $\mathbb{E}[\tilde{g} \mid g] = g$ . By chain rule and linearity of expectation, this ensures the computed gradients of the non-label party's parameters $f$ will also be unbiased, a desirable property for stochastic optimization. Among unbiased perturbation methods, a simple approach is to add iid isotropic Gaussian noise to every gradient to mix the positive and negative gradient distribution before sending to the non-label party.
+
+Although isotropic Gaussian noise is a valid option, it may not be optimal because 1) the gradients are vectors but not scalars, so the structure of the noise covariance matrix matters. Isotropic noise might neglect the direction information; 2) due to the asymmetry of the positive and negative gradient distribution, the label party could add noise with different distributions to each class's gradients.
+
+Norm-alignment heuristic. We now introduce an improved heuristic approach of adding zero-mean Gaussian noise with non-isotropic and example-dependent covariance. [Magnitude choice] As we have seen that $\| g\| _2$ can be different for positive and negative examples and thus leak label information, this heuristic first aims to make the norm of each perturbed gradient indistinguishable from one another. Specifically, we want to match the expected squared 2-norm of every perturbed gradient in a mini-batch to the largest squared 2-norm in this batch (denote by $\| g_{\mathrm{max}}\| _2^2$ ). [Direction choice] In addition, as we have seen empirically from Figure 2(e), the positive and negative gradients lie close to a one-dimensional line in $\mathbb{R}^d$ , with positive examples pointing in one direction and negative examples in the other. Thus we consider only adding noise (roughly speaking) along "this line". More concretely, for a gradient $g_{j}$ in the batch, we add a zero-mean Gaussian noise vector $\eta_{j}$ supported only on the one-dimensional space along the line of $g_{j}$ . In other words, the noise's covariance is the rank-1 matrix $\operatorname {Cov}[\eta_j] = \sigma_j^2 g_jg_j^T$ . To calculate $\sigma_{j}$ , we aim to match $\mathbb{E}[\| g_j + \eta_j\| _2^2 ] = \| g_{\mathrm{max}}\| _2^2$ . A simple calculation gives $\sigma_{j} = \sqrt{\|g_{\mathrm{max}}\|_{2}^{2} / \|g_{j}\|_{2}^{2} - 1}$ . Since we align to the maximum norm, we name this heuristic protection method max_norm. The advantage of max_norm is that it has no parameter to tune. Unfortunately, it does not have a strong theoretical motivation, cannot flexibly trade-off between model utility and privacy, and may be broken by some unknown attacks.
+
+# 4.2 OPTIMIZED PERTURBATION METHOD: MARVELL
+
+Motivated by the above issues of max_norm, we next study how to achieve a more principled trade-off between model performance (utility) and label protection (privacy). To do so, we directly minimize the worst-case adversarial scoring function's leak AUC under a utility constraint. We name this protection method Marvell (optimized perturbAtion to pReVEnt Label Leakage).
+
+Noise perturbation structure. Due to the distribution difference between the positive and negative class's cut layer gradients, we consider having the label party additively perturb the randomly sampled positive $g^{(1)}$ and negative $g^{(0)}$ gradients with independent zero-mean random noise vectors $\eta^{(1)}$ and $\eta^{(0)}$ with possibly different distributions (denoted by $D^{(1)}$ and $D^{(0)}$ ). We use $\widetilde{P}^{(1)}$ and $\widetilde{P}^{(0)}$ to denote the induced perturbed positive and negative gradient distributions. Our goal is to find the optimal noise distributions $D^{(1)}$ and $D^{(0)}$ by optimizing our privacy objective described below.
+
+Privacy protection optimization objective. As the adversarial non-label party in our threat model is allowed to use any measurable scoring function $r$ for label recovery, we aim to protect against all such scoring functions by minimizing the privacy loss of the worst case scoring function measured through our leak AUC metric. Formally, our optimization objective is $\min_{D^{(1)}, D^{(0)}} \max_r \mathrm{AUC}(r)$ . Here to compute $\mathrm{AUC}(r)$ , the $\mathrm{FPR}_r(t)$ and $\mathrm{TPR}_r(t)$ needs to be computed using the perturbed distributions $\widetilde{P}^{(1)}$ and $\widetilde{P}^{(0)}$ instead of the unperturbed $P^{(1)}$ and $P^{(0)}$ (Section 3.2). Since AUC is difficult to directly optimize, we consider optimizing an upper bound through the following theorem:
+
+Theorem 1. For $0 \leq \epsilon < 4$ and any perturbed gradient distributions $\widetilde{P}^{(1)}$ and $\widetilde{P}^{(0)}$ that are absolutely continuous with respect to each other,
+
+$$
+\mathrm {K L} (\widetilde {P} ^ {(1)} \parallel \widetilde {P} ^ {(0)}) + \mathrm {K L} (\widetilde {P} ^ {(0)} \parallel \widetilde {P} ^ {(1)}) \leq \epsilon \quad i m p l i e s \quad \max _ {r} \mathrm {A U C} (r) \leq \frac {1}{2} + \frac {\sqrt {\epsilon}}{2} - \frac {\epsilon}{8}.
+$$
+
+From Theorem 1 (proof in Appendix A.3), we see that as long as the sum KL divergence is below 4, the smaller sumKL is, the smaller $\max_r\mathrm{AUC}(r)$ is. $(1 / 2 + \sqrt{\epsilon} /2 - \epsilon /8$ decreases as $\epsilon$ decreases.) Thus we can instead minimize the sum KL divergence between the perturbed gradient distributions:
+
+$$
+\operatorname {s u m K L} ^ {*} := \min _ {D ^ {(1)}, D ^ {(0)}} \mathrm {K L} \left(\widetilde {P} ^ {(1)} \| \widetilde {P} ^ {(0)}\right) + \mathrm {K L} \left(\widetilde {P} ^ {(0)} \| \widetilde {P} ^ {(1)}\right). \tag {1}
+$$
+
+Utility constraint. In an extreme case, we could add infinite noise to both the negative and positive gradients. This would minimize (1) optimally to 0 and make the worst case leak AUC 0.5, which is equivalent to a random guess. However, stochastic gradient descent cannot converge under infinitely large noise, so it is necessary to control the variance of the added noise. We thus introduce the noise power constraint: $p \cdot \mathrm{tr}(\mathrm{Cov}[\eta^{(1)}]) + (1 - p) \cdot \mathrm{tr}(\mathrm{Cov}[\eta^{(0)}]) \leq P$ , where $p$ is the fraction of positive examples (already known to the label party); $\mathrm{tr}(\mathrm{Cov}[\eta^{(i)}])$ denotes the trace of the covariance matrix of the random noise $\eta^{(i)}$ ; and the upper bound $P$ is a tunable hyperparameter to control the level of noise: larger $P$ would achieve a lower sumKL and thus lower worst-case leak AUC and better privacy; however, it would also add more noise to the gradients, leading to slower optimization
+
+convergence and possibly worse model utility. We weight each class's noise level $\mathrm{tr}(\mathrm{Cov}[\eta^{(i)}])$ by its example proportion $(p$ or $1 - p)$ since, from an optimization perspective, we want to equally control every training example's gradient noise. The constrained optimization problem becomes:
+
+$$
+\min _ {D ^ {(1)}, D ^ {(0)}} \mathrm {K L} (\widetilde {P} ^ {(1)} \| \widetilde {P} ^ {(0)}) + \mathrm {K L} (\widetilde {P} ^ {(0)} \| \widetilde {P} ^ {(1)}) \text {s . t .} p \cdot \operatorname {t r} (\operatorname {C o v} [ \eta^ {(1)} ]) + (1 - p) \cdot \operatorname {t r} (\operatorname {C o v} [ \eta^ {(0)} ]) \leq P. \tag {2}
+$$
+
+Optimizing the objective in practice. To solve the optimization problem we first introduce some modelling assumptions. We assume that the unperturbed gradient of each class follows a Gaussian distribution: $g^{(1)} \sim \mathcal{N}(\bar{g}^{(1)}, vI_{d \times d})$ and $g^{(0)} \sim \mathcal{N}(\bar{g}^{(0)}, uI_{d \times d})$ . Despite this being an approximation, as we see later in Section 5, it can achieve strong protection quality against our identified attacks. In addition, it makes the optimization easier (see below) and provides us with insight on the optimal noise structure. We also search for perturbation distributions that are Gaussian: $D^{(1)} = \mathcal{N}(0, \Sigma_1)$ and $D^{(0)} = \mathcal{N}(0, \Sigma_0)$ with commuting covariance matrices: $\Sigma_1\Sigma_0 = \Sigma_0\Sigma_1$ . The commutative requirement slightly restricts our search space but also makes the optimization problem more tractable. Our goal is to solve for the optimal noise structure, i.e. the positive semidefinite covariance matrices $\Sigma_0, \Sigma_1$ . Let $\Delta g := \bar{g}^{(1)} - \bar{g}^{(0)}$ denote the difference between the positive and negative gradient's mean vectors. We now have the following theorem (proof and interpretation in Appendix A.4):
+
+Theorem 2. The optimal $\Sigma_1^*$ and $\Sigma_0^*$ to (2) with the above assumptions have the form:
+
+$$
+\Sigma_ {1} ^ {*} = \frac {\lambda_ {1} ^ {(1) *} - \lambda_ {2} ^ {(1) *}}{\| \Delta g \| _ {2} ^ {2}} (\Delta g) (\Delta g) ^ {\top} + \lambda_ {2} ^ {(1) *} I _ {d}, \quad \Sigma_ {0} ^ {*} = \frac {\lambda_ {1} ^ {(0) *} - \lambda_ {2} ^ {(0) *}}{\| \Delta g \| _ {2} ^ {2}} (\Delta g) (\Delta g) ^ {\top} + \lambda_ {2} ^ {(0) *} I _ {d}, \tag {3}
+$$
+
+where $(\lambda_1^{(0)*},\lambda_2^{(0)*},\lambda_1^{(1)*},\lambda_2^{(1)*})$ is the solution to the following 4-variable optimization problem:
+
+$$
+\min _ {\lambda_ {1} ^ {(0)}, \lambda_ {1} ^ {(1)}, \lambda_ {2} ^ {(0)}, \lambda_ {2} ^ {(1)}} (d - 1) \frac {\lambda_ {2} ^ {(0)} + u}{\lambda_ {2} ^ {(1)} + v} + (d - 1) \frac {\lambda_ {2} ^ {(1)} + v}{\lambda_ {2} ^ {(0)} + u} + \frac {\lambda_ {1} ^ {(0)} + u + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(1)} + v} + \frac {\lambda_ {1} ^ {(1)} + v + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(0)} + u}
+$$
+
+$$
+\begin{array}{l} s. t. \quad p \lambda_ {1} ^ {(1)} + p (d - 1) \lambda_ {2} ^ {(1)} + (1 - p) \lambda_ {1} ^ {(0)} + (1 - p) (d - 1) \lambda_ {2} ^ {(0)} \leq P, \\ - \lambda_ {1} ^ {(1)} \leq 0, - \lambda_ {1} ^ {(0)} \leq 0, - \lambda_ {2} ^ {(1)} \leq 0, - \lambda_ {2} ^ {(0)} \leq 0, \lambda_ {2} ^ {(1)} - \lambda_ {1} ^ {(1)} \leq 0, \lambda_ {2} ^ {(0)} - \lambda_ {1} ^ {(0)} \leq 0 \\ \end{array}
+$$
+
+Additional details of Marvell. By Theorem 2, our optimization problem over two positive semidefinite matrices is reduced to a much simpler 4-variable optimization problem. We include a detailed description of how the constants in the problem are estimated in practice and what solver we use in a full description of the Marvell algorithm in Appendix A.5. Beyond optimization details, it is worth noting how to set the power constraint hyperparameter $P$ in Equation 2 in practice. As directly choosing $P$ requires knowledge of the scale of the gradients in the specific application and the scale could also shrink as the optimization converges, we instead express $P = s\|\Delta g\|_2^2$ , and tune for a fixed hyperparameter $s > 0$ . This alleviates the need to know the scale of the gradients in advance, and the resulting value of $P$ can also dynamically change throughout training as the distance between the two gradient distributions' mean $\|\Delta g\|_2$ changes.
+
+# 5 EXPERIMENTS
+
+In this section, we first describe our experiment setup and then demonstrate the label protection quality of Marvell as well as its privacy-utility trade-off relative to baseline approaches.
+
+Empirical Setup. We use three real-world binary classification datasets for evaluation: Criteo and Avazu, two online advertising prediction datasets with millions of examples; and ISIC, a healthcare image dataset for skin cancer prediction. All three datasets exhibit severe label leakage problem without protection. (see Appendix A.6.1 on dataset and preprocessing details). We defer similar results on Avazu to Appendix A.7 and focus on Criteo and ISIC in this section. For Criteo, we train a Wide&Deep model (Cheng et al., 2016) where the non-label party owns the embedding layers for input features and the first three 128-unit ReLU activated MLP layers (first half of the deep part) while the label party owns the remaining layers of the deep part and the entire wide part of the model3. For ISIC, we train a model with 6 convolutional layers each with 64 channels followed by a 64-unit ReLU MLP layer, and the cut layer is after the fourth convolutional layer. In this case, an example's cut layer feature $f(X)$ and gradient $g$ are both in $\mathbb{R}^{5\times 5\times 64}$ . We treat such tensors as vectors in $\mathbb{R}^{1600}$ to fit into our analysis framework (for additional model architecture and training details see Appendix A.6.2, A.6.3).
+
+
+Figure 3: Norm and cosine leak AUC (computed every batch) at the cut layer and at the first layer under no protection vs. Marvell with different scale hyperparameter $s$ throughout the ISIC training.
+
+
+
+
+
+
+
+# 5.1 LABEL LEAKAGE AND MARVELL'S STRONG AND FLEXIBLE PROTECTION
+
+We first evaluate the protection quality of Marvell against the norm and cosine attacks discussed in Section 3.3. We also compare against the leakage metrics when no protection is applied (no_noise). As the results across the three datasets are highly similar, we use ISIC as an example (other datasets see Appendix A.7.1). We see in Figure 3(a)(b) that unlike no_noise where the label information is completely leaked (leak AUC $\approx 1$ ) throughout training, Marvell achieves a flexible degree of protection (by varying $s$ ) against both the norm 2(a) and direction attacks 2(b) on the cut layer gradients and has strong protection (leak AUC $\approx 0.5$ ) at $s = 4.0$ . Additionally, it is natural to ask whether the gradients of layers before the cut layer (on the non-label party side) can also leak the labels as the non-label party keeps back propagating towards the first layer. In Figure 3(c)(d), we compute the leak AUC values when using the non-label party's first layer activation gradient as inputs to the scoring functions to predict $y$ . Without protection, the first layer gradient still leaks the label very consistently. In constraint, Marvell still achieves strong privacy protection at the first layer ( $s = 4.0$ ) despite the protection being analyzed at the cut layer.
+
+# 5.2 PRIVACY-UTILITY TRADE-OFF COMPARISON
+
+After showing Marvell can provide strong privacy protection against our identified attacks, we now see how well it can preserve utility by comparing its privacy-utility tradeoff against other protection baselines: no-noise, isotropic Gaussian (iso), and our proposed heuristic max_norm. Similar to how we allow Marvell to use a power constraint to depend on the current iteration's gradient distribution through $P = s\| \Delta g\| _2^2$ , we also allow iso to have such type of dependence—specifically, we add $\eta \sim \mathcal{N}(\mathbf{0},(t / d)\cdot \| g_{\mathrm{max}}\| _2^2 I_{d\times d})$ to every gradient in a batch with $t$ a tunable privacy hyperparameter to be fixed throughout training. To trace out the complete tradeoff curve for Marvell and iso, we conduct more than 20 training runs for each protection method with a different value of privacy hyperparameter ( $s$ for Marvell, $t$ for iso) in each run on every dataset. (Note that no.noise and max_norm do not have privacy hyperparameters.)
+
+We present the tradeoffs between privacy (measured through norm and cosine leak AUC at cut layer/first layer) and utility (measured using test loss and test AUC) in Figure 4. To summarize the leak AUC over a given training run, we pick the $95\%$ quantile over the batch-computed leak AUCs throughout all training iterations. This quantile is chosen instead of the mean because we want to measure the most-leaked iteration's privacy leakage (highest leak AUC across iterations) to ensure the labels are not leaked at any points during training. $95\%$ quantile is chosen instead of the max $(100\%)$ as we want this privacy leak estimate to be robust against randomness of the training process.
+
+Privacy-Utility Tradeoff comparison results. In measuring the privacy-utility tradeoff, we aim to find a method that consistently achieves a lower leak AUC (better privacy) for the same utility value.
+
+- [Marvell vs iso] As shown in Figure 4, Marvell almost always achieves a better tradeoff than iso against both of our proposed attacks at both the cut layer and the first layer on both the ISIC and Criteo datasets. It is important to note that although the utility constraint is in terms of training loss optimization, Marvell's better tradeoff still translates to the generalization performance when the utility is measured through test loss or test AUC. Additionally, despite achieving reasonable (though still worse than Marvell) privacy-utility tradeoff against the norm-based attack, iso performs much worse against the direction-based attack: on ISIC, even after applying a significant amount of isotropic noise (with $t > 20$ ), iso's cosine leak AUC is still higher than 0.9 at the cut layer (Figure 4(b,f)). In contrast, Marvell is effective against this direction-based attack with a much lower cosine leak AUC ≈ 0.6.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Privacy (norm & cosine leak AUC) vs Utility (test loss & test AUC) trade-off of protection methods (Marvell, iso, no_noise, max_norm) at the cut and first layer on ISIC and Criteo.
+
+
+
+
+
+
+
+- [max_norm heuristic] Beyond Marvell, we see that our heuristic approach max_norm can match and sometimes achieve even lower (Figure 4(a,f,i)) leak AUC value than Marvell at the same utility level. We believe this specifically results from our norm and direction consideration when designing this heuristic. However, without a tunable hyperparameter, max_norm cannot tradeoff between privacy and utility. Additionally, unlike Marvell which is designed to protect against the entire class of adversarial scoring functions, max_norm might still fail to protect against other future attack methods beyond those considered here.
+
+In summary, our principled method Marvell significantly outperforms the isotropic Gaussian baseline, and our proposed max_norm heuristic can also work particularly well against the norm- and direction-based attacks which we identified in Section 3.3.
+
+# 6 CONCLUSION
+
+In this paper, we formulate a label leakage threat model in the two-party split learning binary classification problem through a novel privacy loss quantification metric (leak AUC). Within this threat model, we provide two simple yet effective attack methods that can accurately uncover the private labels of the label party. To counter such attacks, we propose a heuristic random perturbation method max_norm as well as a theoretically principled method Marvell which searches for the optimal noise distributions to protect against the worst-case adversaries in the threat model. We have conducted extensive experiments to demonstrate the effectiveness of Marvell and max_norm over the isotropic Gaussian perturbation baseline iso.
+
+Open questions and future work. Our work is the first we are aware of to identify, rigorously quantify, and protect against the threat of label leakage in split-learning, and opens up a number of worthy directions of future study. In particular, as the model parameters are updated every batch in our problem setup, the true gradient of an example and the gradient distribution would both change. An interesting question is whether the adversarial non-label party can remember the stale gradient of the same example from past updates (possibly separated by hundreds of updates steps) in order to recover the label information in the current iteration in a more complex threat model. It would also be interesting to build on our results to study whether there exist attack methods when the classification problem is multiclass instead of binary, and when the split learning scenario involves more than two parties with possibly more complicated training communication protocols (e.g., Vepakomma et al., 2018).
+
+Ethics Statement. In our paper, we have identified a realistic threat of label leakage in the two-party split learning binary classification problem. We aim to raise awareness about potential privacy issues in this problem domain, where many industrial applications have been deployed. Beyond making such threats clear, we have taken the first steps towards protection—we have proposed both heuristic and principled methods that can preserve label privacy. We hope our work will pave the way for future analyses that make the two-party split learning framework more effective and secure.
+
+Reproducibility Statement. To make our paper reproducible, we provide:
+
+Proofs of our Theorem 1 and Theorem 2 in Appendix A.3,A.4;
+- Detailed experiment description including 1) data preprocessing, 2) model architecture, 3) training algorithm and hyperparameters in Appendix A.6.
+- Source code with running instructions (in README.md) at https://github.com/OscarcarLi/label-protection.
+
+# REFERENCES
+
+Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 308-318, 2016.
+Avazu. Avazu click-through rate prediction, 2015. URL https://www.kaggle.com/c/avazu-ctr-prediction/data.
+Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacy-preserving machine learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175-1191, 2017.
+Kamalika Chaudhuri and Daniel Hsu. Sample complexity bounds for differentially private learning. In Proceedings of the 24th Annual Conference on Learning Theory, pp. 155-186. JMLR Workshop and Conference Proceedings, 2011.
+Heng-Tze Cheng, Levent Koc, Jeremiah Harmsen, Tal Shaked, Tushar Chandra, Hrishi Aradhye, Glen Anderson, Greg Corrado, Wei Chai, Mustafa Ispir, et al. Wide & deep learning for recommender systems. In Proceedings of the 1st workshop on deep learning for recommender systems, pp. 7-10, 2016.
+Albert Cheu, Adam Smith, Jonathan Ullman, David Zeber, and Maxim Zhilyaev. Distributed differential privacy via shuffling. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 375-403. Springer, 2019.
+Criteo. Criteo display advertising challenge, 2014. URL https://www.kaggle.com/c/criteo-display-ad-challenge/data.
+Cynthia Dwork. Differential privacy. In Michele Bugliesi, Bart Preneel, Vladimiro Sassone, and Ingo Wegener (eds.), Automata, Languages and Programming, pp. 1-12, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. ISBN 978-3-540-35908-1.
+Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9(3-4):211-407, 2014.
+Ulfar Erlingsson, Vitaly Feldman, Ilya Mironov, Ananth Raghunathan, Kunal Talwar, and Abhradeep Thakurta. Amplification by shuffling: From local to central differential privacy via anonymity. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 2468-2479. SIAM, 2019.
+Badih Ghazi, Noah Golowich, Ravi Kumar, Pasin Manurangsi, and Chiyuan Zhang. On deep learning with label differential privacy. arXiv preprint arXiv:2102.06062, 2021.
+Otchrist Gupta and Ramesh Raskar. Distributed learning of deep neural network over multiple agents. Journal of Network and Computer Applications, 116:1-8, 2018.
+
+ISIC. Siim-isic melanoma classification, 2020. URL https://www.kaggle.com/c/siim-isic-melanoma-classification/data.
+Vladimir Kolesnikov, Ranjit Kumaresan, Mike Rosulek, and Ni Trieu. Efficiently batched oblivious prf with applications to private set intersection. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, CCS '16, pp. 818-829, 2016.
+Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273-1282. PMLR, 2017.
+H. Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=BJ0hF1Z0b.
+Benny Pinkas, Thomas Schneider, and Michael Zohner. Scalable private set intersection based on oT extension. ACM Transactions on Privacy and Security (TOPS), 21(2):1-35, 2018.
+Pramod Subramanyan, Rohit Sinha, Ilia Lebedev, Srinivas Devadas, and Sanjit A Seshia. A formal foundation for secure remote execution of enclaves. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 2435-2450, 2017.
+Praneeth Vepakomma, Otkrist Gupta, Tristan Swedish, and Ramesh Raskar. Split learning for health: Distributed deep learning without sharing raw patient data. arXiv preprint arXiv:1812.00564, 2018.
+Praneeth Vepakomma, Otkrist Gupta, Abhimanyu Dubey, and Ramesh Raskar. Reducing leakage in distributed deep learning for sensitive health data. arXiv preprint arXiv:1812.00564, 2019.
+Qiang Yang, Yang Liu, Tianjian Chen, and Yongxin Tong. Federated machine learning: Concept and applications. ACM Transactions on Intelligent Systems and Technology (TIST), 10(2):1-19, 2019.
+Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. idlg: Improved deep leakage from gradients. arXiv preprint arXiv:2001.02610, 2020.
+Ligeng Zhu, Zhijian Liu, and Song Han. Deep leakage from gradients. In Advances in Neural Information Processing Systems, pp. 14774-14784, 2019.
+
+# A APPENDIX
+
+# Appendix Outline
+
+A.1 Expressing $\mathrm{AUC}(r)$ as an integral
+A.2 Toy Class-balanced Example of Positive Example Prediction Lacking Confidence
+A.3 Proof of Theorem 1
+A.4 Proof and Interpretation of Theorem 2
+A.5 Marvell Algorithm Description
+
+A.5.1 Marvell Time Complexity
+A.5.2 Marvell Empirical Run Time
+
+A.6 Data Setup and Experimental Details
+
+A.6.1 Dataset Preprocessing
+A.6.2 Model Architecture Details
+A.6.3 Model Training Details
+
+A.7 Complete Experimental Results
+
+A.7.1 AUC Progression for Avazu and Criteo
+A.7.2 Complete Privacy-Utility Tradeoffs
+A.7.3 Impact of Activation Gradients' Layer Location on the Corresponding Leak AUC
+
+A.8 Reasons why we don't use local DP in our setup
+
+# A.1 EXPRESSING AUC $(r)$ AS AN INTEGRAL
+
+Recall that the ROC curve of a scoring function $r: \mathbb{R}^d \to \mathbb{R}$ is a parametric curve $c_r: \mathbb{R} \to [0,1]^2$ such that $c_r(t) = (\mathrm{FPR}_r(t), \mathrm{TPR}_r(t))$ , with
+
+$$
+\operatorname {F P R} _ {r}: \mathbb {R} \rightarrow [ 0, 1 ], \text {s u c h t h a t} \operatorname {F P R} _ {r} (t) := P ^ {(0)} \left(\left\{g \in \mathbb {R} ^ {d}: r (g) > t \right\}\right)
+$$
+
+$$
+\mathrm {T P R} _ {r}: \mathbb {R} \rightarrow [ 0, 1 ], \text {s u c h t h a t} \mathrm {T P R} _ {r} (t) := P ^ {(1)} \left(\left\{g \in \mathbb {R} ^ {d}: r (g) > t \right\}\right).
+$$
+
+We notice that $\mathrm{FPR}_r$ and $\mathrm{TPR}_r$ are both monotonically decreasing functions in $t$ with
+
+$$
+\lim _ {t \to - \infty} \operatorname {F P R} _ {r} (t) = 1, \quad \lim _ {t \to \infty} \operatorname {F P R} _ {r} (t) = 0
+$$
+
+$$
+\lim _ {t \rightarrow - \infty} \operatorname {T P R} _ {r} (t) = 1, \lim _ {t \rightarrow \infty} \operatorname {T P R} _ {r} (t) = 0.
+$$
+
+However, $\mathrm{FPR}_r$ and $\mathrm{TPR}_r$ does not need to be differentiable everywhere with respect to $t$ . Thus we cannot simply express the area under the curve using $\int_{-\infty}^{-\infty}\mathrm{TPR}_r(t)$ $\mathrm{FPR}_r'(t)dt$ . On the other hand, because both $\mathrm{FPR}_r$ and $\mathrm{TPR}_r$ are functions of bounded variations, we can express the area under the parametric curve $c_{r}$ through the Riemann-Stieltjes integral which involves integrating the function $\mathrm{TPR}_r$ with respect to the function $\mathrm{FPR}_r$ :
+
+$$
+\operatorname {A U C} (r) = \int_ {t = \infty} ^ {t = - \infty} \operatorname {T P R} _ {r} (t) d \operatorname {F P R} _ {r} (t)
+$$
+
+Here the integration boundary is from $\infty$ to $-\infty$ in order to ensure the integral evaluates to a positive value.
+
+# A.2 TOY CLASS-BALANCED EXAMPLE OF POSITIVE EXAMPLE PREDICTION LACKING CONFIDENCE
+
+As mentioned in Observation 1 of norm-based attack in Section 3.3, for many practical applications, there is inherently more ambiguity for the positive class than the negative class. To make this more concrete, let's consider a simple toy example.
+
+Suppose the binary classification problem is over the real line. Here, $50\%$ of the data is positive and lies uniformly in the interval $[0, 1]$ . On the other hand, the remaining negative data (the other $50\%$ of the total data) is a mixture distribution: $10\%$ of the negative data also lies uniformly in $[0, 1]$ , while the rest $90\%$ of the negative data lies uniformly in $[1, 2]$ .
+
+$$
+p (x \mid y = 1) = \mathbb {1} (x \in [ 0, 1 ]), \quad p (y = 1) = 0. 5.
+$$
+
+$$
+p (x \mid y = 0) = 0. 1 \cdot \mathbb {1} (x \in [ 0, 1 ]) + 0. 9 \cdot \mathbb {1} (x \in [ 1, 2 ]), \quad p (y = 0) = 0. 5.
+$$
+
+This setup mirrors our online advertising example where for all the users interested in the product (with feature $x \in [0,1]$ ), only a part of them would actually make the purchase after clicking on its advertisement.
+
+In this case, the best possible probabilistic classifiers $C^{\mathrm{opt}}$ that can be ever learned, by Bayes Rule, would predict any example in [0, 1] to be of the positive class with probability $\frac{10}{11}$ , while it would predict any example in [1, 2] to be of the negative class with probability 1:
+
+$$
+C ^ {\mathrm {o p t}} (y = 1 \mid x) = \left\{ \begin{array}{l l} \frac {1 0}{1 1} & \text {i f} x \in [ 0, 1 ] \\ 0 & \text {i f} x \in [ 1, 2 ] \end{array} \right..
+$$
+
+Thus even for this best possible classifier $C^{\mathrm{opt}}$ , every positive example would have a confidence gap of $\frac{1}{11}$ while $90\%$ of the negative examples (the ones in [1, 2]) would have a confidence gap of 0. Hence we see that in this toy example, our empirical observation of the lack of prediction confidence for positive examples would still hold true.
+
+Besides, it is important to notice that this lack of positive prediction confidence phenomenon happens even in this class-balanced toy example $(p(y = 1) = p(y = 0) = 0.5)$ . Thus, Observation 1 does not require the data distribution to be class-imbalanced to hold, which further demonstrates the generality of our norm-based attack.
+
+# A.3 PROOF OF THEOREM 1
+
+(Theorem 1). For $0 \leq \epsilon < 4$ and any perturbed gradient distributions $\widetilde{P}^{(1)}$ and $\widetilde{P}^{(0)}$ that are absolutely continuous with respect to each other,
+
+$$
+\mathrm {K L} (\widetilde {P} ^ {(1)} \| \widetilde {P} ^ {(0)}) + \mathrm {K L} (\widetilde {P} ^ {(0)} \| \widetilde {P} ^ {(1)}) \leq \epsilon \quad \text {i m p l i e s} \quad \max _ {r} \mathrm {A U C} (r) \leq \frac {1}{2} + \frac {\sqrt {\epsilon}}{2} - \frac {\epsilon}{8}.
+$$
+
+Proof of Theorem 1. Combining Pinsker's inequality with Jensen's inequality, we can obtain an upper bound of total variation distance by the symmetrized KL divergence (sumKL) for a pair of distributions $(P,Q)$ that are absolutely continuous with respect to each other:
+
+$$
+\operatorname {T V} (P, Q) \leq \frac {1}{2} \left(\sqrt {\operatorname {K L} (P \| Q) / 2} + \sqrt {\operatorname {K L} (Q \| P) / 2}\right) \leq \frac {1}{2} \sqrt {\operatorname {K L} (P \| Q) + \operatorname {K L} (Q \| P)}. \tag {4}
+$$
+
+By our assumption, this implies that $\mathrm{TV}(\widetilde{P}^{(1)},\widetilde{P}^{(0)})\leq \frac{\sqrt{\epsilon}}{2}$ . By the equivalent definition of total variation distance $\mathrm{TV}(\widetilde{P}^{(1)},\widetilde{P}^{(0)})) = \max_{A\subset \mathbb{R}^d}[\widetilde{P}^{(1)}(A) - \widetilde{P}^{(0)}(A)]$ , we know that for any $A\subset \mathbb{R}^d$ , $\widetilde{P}^{(1)}(A) - \widetilde{P}^{(0)}(A)\leq \frac{\sqrt{\epsilon}}{2}$ . For any scoring function $r$ and any threshold value $t$ , let $A = \{g:r(g) > t\}$ , then we have $\mathrm{TPR}_r(t) - \mathrm{FPR}_r(t) = \widetilde{P}^{(1)}(A) - \widetilde{P}^{(0)}(A)\leq \frac{\sqrt{\epsilon}}{2}$ .
+
+Therefore, the AUC of the scoring function $r$ can be upper bounded in the following way:
+
+$$
+\begin{array}{l} \operatorname {A U C} (r) = \int_ {\infty} ^ {- \infty} \operatorname {T P R} _ {r} (t) d \operatorname {F P R} _ {r} (t) (5) \\ \leq \int_ {\infty} ^ {- \infty} \min \left(\mathrm {F P R} _ {r} (t) + \frac {\sqrt {\epsilon}}{2}, 1\right) d \mathrm {F P R} _ {r} (t), (6) \\ \end{array}
+$$
+
+where in (6) we use the additional fact that $\mathrm{TPR}_r(t)\leq 1$ for all $t\in \mathbb{R}$ .
+
+When $\epsilon \in [0,4)$ , we have $1 - \frac{\sqrt{\epsilon}}{2} \in (0,1]$ . As $\mathrm{FPR}_r(t)$ is a monotonically nonincreasing function in $t$ with range in $[0,1]$ , the set $\left\{t : \mathrm{FPR}_r(t) \leq 1 - \frac{\sqrt{\epsilon}}{2}\right\} \neq \phi$ is not empty. Let $k := \inf \left\{t : \mathrm{FPR}_r(t) \leq 1 - \frac{\sqrt{\epsilon}}{2}\right\}$ . Again by $\mathrm{FPR}_r(t)$ being a monotonically nonincreasing function in $t$ , we can break the integration in Equation (6) into two terms:
+
+$$
+\begin{array}{l} \operatorname {A U C} (r) \\ = \int_ {\infty} ^ {k} \min \left(\mathrm {F P R} _ {r} (t) + \frac {\sqrt {\epsilon}}{2}, 1\right) d \mathrm {F P R} _ {r} (t) + \int_ {k} ^ {- \infty} \min \left(\mathrm {F P R} _ {r} (t) + \frac {\sqrt {\epsilon}}{2}, 1\right) d \mathrm {F P R} _ {r} (t) (7) \\ \leq \int_ {\infty} ^ {k} \left(\mathrm {F P R} _ {r} (t) + \frac {\sqrt {\epsilon}}{2}\right) d \mathrm {F P R} _ {r} (t) + \int_ {k} ^ {- \infty} 1 d \mathrm {F P R} _ {r} (t) (8) \\ = \left[ \frac {\left[ \mathrm {F P R} _ {r} (t) \right] ^ {2}}{2} + \frac {\sqrt {\epsilon}}{2} \mathrm {F P R} _ {r} (t) \right] \left| _ {t = \infty} ^ {t = k} + \mathrm {F P R} _ {r} (t) \right| _ {t = k} ^ {t = - \infty} (9) \\ \leq \frac {\left(1 - \frac {\sqrt {\epsilon}}{2}\right) ^ {2}}{2} + \frac {\sqrt {\epsilon}}{2} \left(1 - \frac {\sqrt {\epsilon}}{2}\right) + \left[ 1 - \left(1 - \frac {\sqrt {\epsilon}}{2}\right) \right] (10) \\ = \frac {1}{2} + \frac {\sqrt {\epsilon}}{2} - \frac {\epsilon}{8} (11) \\ \end{array}
+$$
+
+Since this inequality is true for any scoring function $r$ , it is true for the maximum value. Thus the proof is complete.
+
+# A.4 PROOF AND INTERPRETATION OF THEOREM 2
+
+(Theorem 2). The optimal $\Sigma_1^*$ and $\Sigma_0^*$ to the following problem
+
+$$
+\min _ {\Sigma_ {0}, \Sigma_ {1} \in \mathbb {S}} K L (\mathcal {N} (\bar {g} ^ {(1)}, v I + \Sigma_ {1}) \| \mathcal {N} (\bar {g} ^ {(0)}, u I + \Sigma_ {0})) + K L (\mathcal {N} (\bar {g} ^ {(0)}, u I + \Sigma_ {0}) \| \mathcal {N} (\bar {g} ^ {(1)}, v I + \Sigma_ {1}))
+$$
+
+subject to
+
+$$
+\Sigma_ {0} \Sigma_ {1} = \Sigma_ {1} \Sigma_ {0},
+$$
+
+$$
+p \cdot \operatorname {t r} \left(\Sigma_ {1}\right) + (1 - p) \cdot \operatorname {t r} \left(\Sigma_ {0}\right) \leq P,
+$$
+
+$$
+\Sigma_ {1} \succeq \mathbf {0},
+$$
+
+$$
+\Sigma_ {0} \succeq \mathbf {0}.
+$$
+
+have the form:
+
+$$
+\Sigma_ {1} ^ {*} = \frac {\lambda_ {1} ^ {(1) *} - \lambda_ {2} ^ {(1) *}}{\| \Delta g \| _ {2} ^ {2}} (\Delta g) (\Delta g) ^ {\top} + \lambda_ {2} ^ {(1) *} I _ {d}, \quad \Sigma_ {0} ^ {*} = \frac {\lambda_ {1} ^ {(0) *} - \lambda_ {2} ^ {(0) *}}{\| \Delta g \| _ {2} ^ {2}} (\Delta g) (\Delta g) ^ {\top} + \lambda_ {2} ^ {(0) *} I _ {d}, \tag {12}
+$$
+
+where $(\lambda_1^{(0)*},\lambda_2^{(0)*},\lambda_1^{(1)*},\lambda_2^{(1)*})$ is the solution to the following 4-variable optimization problem:
+
+$$
+\begin{array}{l} \min _ {\lambda_ {1} ^ {(0)}, \lambda_ {1} ^ {(1)}, \lambda_ {2} ^ {(0)}, \lambda_ {2} ^ {(1)}} (d - 1) \frac {\lambda_ {2} ^ {(0)} + u}{\lambda_ {2} ^ {(1)} + v} + (d - 1) \frac {\lambda_ {2} ^ {(1)} + v}{\lambda_ {2} ^ {(0)} + u} + \frac {\lambda_ {1} ^ {(0)} + u + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(1)} + v} + \frac {\lambda_ {1} ^ {(1)} + v + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(0)} + u} \\ s. t. \quad p \lambda_ {1} ^ {(1)} + p (d - 1) \lambda_ {2} ^ {(1)} + (1 - p) \lambda_ {1} ^ {(0)} + (1 - p) (d - 1) \lambda_ {2} ^ {(0)} \leq P, \\ - \lambda_ {1} ^ {(1)} \leq 0, - \lambda_ {1} ^ {(0)} \leq 0, - \lambda_ {2} ^ {(1)} \leq 0, - \lambda_ {2} ^ {(0)} \leq 0, \\ \lambda_ {2} ^ {(1)} - \lambda_ {1} ^ {(1)} \leq 0, \quad \lambda_ {2} ^ {(0)} - \lambda_ {1} ^ {(0)} \leq 0 \\ \end{array}
+$$
+
+Proof of Theorem 2. By writing out the analytical close-form of the KL divergence between two Gaussian distributions, the optimization can be written as:
+
+$$
+\begin{array}{l} \min _ {\Sigma_ {0}, \Sigma_ {1} \in \mathbb {S}} \operatorname {t r} ((\Sigma_ {1} + v I) ^ {- 1} (\Sigma_ {0} + u I)) + \operatorname {t r} ((\Sigma_ {0} + u I) ^ {- 1} (\Sigma_ {1} + v I)) + \\ \left(\bar {g} ^ {(1)} - \bar {g} ^ {(0)}\right) ^ {\top} \left(\left(\Sigma_ {1} + v I\right) ^ {- 1} + \left(\Sigma_ {0} + u I\right) ^ {- 1}\right) \left(\bar {g} ^ {(1)} - \bar {g} ^ {(0)}\right) \\ \end{array}
+$$
+
+subject to
+
+$$
+\begin{array}{l} \Sigma_ {0} \Sigma_ {1} = \Sigma_ {1} \Sigma_ {0}, \\ \begin{array}{c} p \cdot \operatorname {t r} \left(\Sigma_ {1}\right) + (1 - p) \cdot \operatorname {t r} \left(\Sigma_ {0}\right) \leq P, \\ \Sigma_ {1} \succ 0 \end{array} (13) \\ \begin{array}{l} \Sigma_ {1} \succeq \mathbf {0}, \end{array} (13) \\ \Sigma_ {0} \succeq \mathbf {0}. \\ \end{array}
+$$
+
+By the commutative constraint on the two positive semidefinite matrices $\Sigma_{1}$ and $\Sigma_0$ , we know that we can factor these two matrices using the same set of eigenvectors. We thus write:
+
+$$
+\Sigma_ {0} = Q ^ {\top} \operatorname {d i a g} \left(\lambda_ {1} ^ {(0)}, \dots , \lambda_ {d} ^ {(0)}\right) Q,
+$$
+
+$$
+\Sigma_ {1} = Q ^ {\top} \operatorname {d i a g} \left(\lambda_ {1} ^ {(1)}, \dots , \lambda_ {d} ^ {(1)}\right) Q, \tag {14}
+$$
+
+where $Q \in \mathbb{R}^{d \times d}$ is an orthogonal matrix and the eigenvalues $\lambda_i^{(0)}, \lambda_i^{(1)}$ are nonnegative and decreasing in value.
+
+Using this alternative expression of $\Sigma_{1}$ and $\Sigma_0$ , we can express the optimization in terms of $\{\lambda_i^{(1)}\}, \{\lambda_i^{(0)}\}, Q$ :
+
+$$
+\begin{array}{l} \min _ {\{\lambda_ {i} ^ {(1)} \}, \{\lambda_ {i} ^ {(0)} \}, Q} \sum_ {i = 1} ^ {d} \frac {\lambda_ {i} ^ {(0)} + u}{\lambda_ {i} ^ {(1)} + v} + \sum_ {i = 1} ^ {d} \frac {\lambda_ {i} ^ {(1)} + v}{\lambda_ {i} ^ {(0)} + u} + \\ \left[ Q \left(\bar {g} ^ {(1)} - \bar {g} ^ {(0)}\right) \right] ^ {\top} \operatorname {d i a g} \left(\dots , \frac {1}{\lambda_ {i} ^ {(0)} + u} + \frac {1}{\lambda_ {i} ^ {(1)} + v}, \dots\right) Q \left(\bar {g} ^ {(1)} - \bar {g} ^ {(0)}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \text {s u b j e c t} \quad p \left(\sum_ {i = 1} ^ {d} \lambda_ {i} ^ {(1)}\right) + (1 - p) \left(\sum_ {i = 1} ^ {d} \lambda_ {i} ^ {(0)}\right) \leq P \\ - \lambda_ {i} ^ {(1)} \leq 0, \forall i \in [ d ] \\ - \lambda_ {i} ^ {(0)} \leq 0, \forall i \in [ d ]. \\ \lambda_ {i} ^ {(1)} \geq \lambda_ {j} ^ {(1)}, \forall i < j. \\ \lambda_ {i} ^ {(0)} \geq \lambda_ {j} ^ {(0)}, \forall i < j. \\ Q \text {o r t h o g o n a l .} \\ \end{array}
+$$
+
+For any fixed feasible $\{\lambda_i^{(1)}\}, \{\lambda_i^{(0)}\}$ , we see that the corresponding minimizing $Q$ will set its first row to be the unit vector in the direction of $\Delta g$ . Thus by first minimizing $Q$ , the optimization objective reduces to:
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {d} \frac {\lambda_ {i} ^ {(0)} + u}{\lambda_ {i} ^ {(1)} + v} + \sum_ {i = 1} ^ {d} \frac {\lambda_ {i} ^ {(1)} + v}{\lambda_ {i} ^ {(0)} + u} + \frac {g}{\lambda_ {1} ^ {(0)} + u} + \frac {g}{\lambda_ {1} ^ {(1)} + v} \\ = \sum_ {i = 2} ^ {d} \frac {\lambda_ {i} ^ {(0)} + u}{\lambda_ {i} ^ {(1)} + v} + \sum_ {i = 2} ^ {d} \frac {\lambda_ {i} ^ {(1)} + v}{\lambda_ {i} ^ {(0)} + u} + \frac {\lambda_ {1} ^ {(1)} + v + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(0)} + u} + \frac {\lambda_ {1} ^ {(0)} + u + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(1)} + v} \\ \end{array}
+$$
+
+We see that for the pair of variables $(\lambda_i^{(1)},\lambda_i^{(0)})$ ( $i\geq 2$ ), the function $\frac{\lambda_i^{(0)} + u}{\lambda_i^{(1)} + v} +\frac{\lambda_i^{(1)} + v}{\lambda_1^{(0)} + u}$ is strictly convex over the line segment $p\lambda_i^{(1)} + (1 - p)\lambda_i^{(0)} = c$ for any nonnegative $c$ and attains the minimum value at $\lambda_i^{(1)} = 0$ when $u < v$ and $\lambda_i^{(0)} = 0$ when $u\geq v$ . Suppose without loss of generality $u\geq v$ , then for the optimal solution we must have $\lambda_i^{(0)} = 0$ for all $i\geq 2$ . Under this condition, we notice that the function $m(x) = \frac{u}{x + v} +\frac{x + v}{u}$ is strictly convex on the positive reals. Thus for all $\left\{\lambda_i^{(1)}\right\}$ that satisfies $\sum_{i = 2}^{d}\lambda_{i}^{(1)} = c$ for a fixed nonnegative $c$ , by Jensen inequality, we have
+
+$$
+\begin{array}{l} \frac {1}{d - 1} \sum_ {i = 2} ^ {d} \left(\frac {u}{\lambda_ {i} ^ {(1)} + v} + \frac {\lambda_ {i} ^ {(1)} + v}{u}\right) \\ = \frac {1}{d - 1} \sum_ {i = 2} ^ {d} m \left(\lambda_ {i} ^ {(1)}\right) \\ \geq m \left(\frac {1}{d - 1} \sum_ {i = 2} ^ {d} \lambda_ {i} ^ {(1)}\right) \\ = m \left(\frac {c}{d - 1}\right). \\ \end{array}
+$$
+
+From this, we see that the optimal solution's variables $\{\lambda_i^{(1)}\}$ must take on the same value $(\frac{c}{d - 1})$ for all $i \geq 2$ . The case when $u \leq v$ is similar. As a result, we have proved that at the optimal solution, we must have:
+
+$$
+\lambda_ {i} ^ {(0)} = \lambda_ {j} ^ {(0)} \text {a n d} \lambda_ {i} ^ {(1)} = \lambda_ {j} ^ {(1)}, \text {f o r} i, j \geq 2.
+$$
+
+Hence, the optimization problem over the $2d$ variables $\left\{\lambda_i^{(1)}\right\}_{i = 1}^d\bigcup \left\{\lambda_i^{(0)}\right\}_{i = 1}^d$ can be reduced to an optimization problem over the four variables $\left\{\lambda_1^{(1)},\lambda_2^{(1)},\lambda_1^{(0)},\lambda_2^{(0)}\right\}$ :
+
+$$
+\min _ {\lambda_ {1} ^ {(0)}, \lambda_ {1} ^ {(1)}, \lambda_ {2} ^ {(0)}, \lambda_ {2} ^ {(1)}} (d - 1) \frac {\lambda_ {2} ^ {(0)} + u}{\lambda_ {2} ^ {(1)} + v} + (d - 1) \frac {\lambda_ {2} ^ {(1)} + v}{\lambda_ {2} ^ {(0)} + u} + \frac {\lambda_ {1} ^ {(0)} + u + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(1)} + v} + \frac {\lambda_ {1} ^ {(1)} + v + \| \Delta g \| _ {2} ^ {2}}{\lambda_ {1} ^ {(0)} + u} \tag {15}
+$$
+
+subject to $p\lambda_1^{(1)} + p(d - 1)\lambda_2^{(1)} + (1 - p)\lambda_1^{(0)} + (1 - p)(d - 1)(\lambda_2^{(0)}) \leq P$
+
+$$
+\begin{array}{l} - \lambda_ {1} ^ {(1)} \leq 0 \\ - \lambda_ {1} ^ {(0)} \leq 0 \\ - \lambda_ {2} ^ {(1)} \leq 0 \\ - \lambda_ {2} ^ {(0)} \leq 0 \\ \lambda_ {2} ^ {(1)} - \lambda_ {1} ^ {(1)} \leq 0 \\ \lambda_ {2} ^ {(0)} - \lambda_ {1} ^ {(0)} \leq 0. \\ \end{array}
+$$
+
+Given the optimal solution to the above 4-variable problem $(\lambda_1^{(0)*},\lambda_2^{(0)*},\lambda_1^{(1)*},\lambda_2^{(1)*})$ , we can set $Q$ to be any orthogonal matrix whose first row is the vector $\frac{\Delta g}{\|\Delta g\|_2}$ . Plugging this back into the expression of $\Sigma_{1}$ and $\Sigma_0$ in Equation (14) gives us the final result.
+
+Thus the proof is complete.
+
+
+
+Remark (Interpreting the optimal $\Sigma_1^*$ and $\Sigma_0^*$ ). From the form of the optimal solution in (12), we see that the optimal covariance matrices are both linear combinations of two terms: a rank one matrix $(\Delta g)(\Delta g)^\top$ and the identity matrix $I_d$ . Because a zero-mean Gaussian random vector with covariance matrix $(A + B)$ can be constructed as the sum of two independent zero-mean Gaussian random vectors with covariance matrices $A$ and $B$ respectively, we see that the optimal additive noise random variables $\eta^{(1)}$ and $\eta^{(0)}$ each consist of two independent components: one random component lies along the line that connects the positive and negative gradient mean vectors (whose covariance matrix is proportional to $\Delta g\Delta g^\top$ ); the other component is sampled from an isotropic Gaussian. The use of the first random directional component and the fact that the isotropic Gaussian component have different variance scaling for the positive and negative class clearly distinguishes Marvell from the isotropic Gaussian baseline iso.
+
+Remark (How to solve). By analyzing the KKT condition of this four variable problem we can find that the optimal solution must exactly lie on the hyperplane $p\lambda_1^{(1)} + p(d - 1)\lambda_2^{(1)} + (1 - p)\lambda_1^{(0)} + (1 - p)(d - 1)\lambda_2^{(0)} = P$ . From the proof above we additionally know that $\lambda_2^{(1)*} = 0$ if $u < v$ and $\lambda_2^{(0)*} = 0$ if $u \geq v$ . Thus the problem is further reduced to a 3-variable problem. If we consider keeping one of the 3 remaining variables' values fixed, then the feasible region becomes restricted to a line segment. We can simply perform a line search optimization of the convex objective and find the optimal values for the remaining two free variables. We can then alternate over which one of the three variables to fix and optimize over the other two. This optimization procedure would eventually converge and give us the optimal solution. This approach mimics the Sequential Minimal Optimization technique used to solve the dual of the support vector machine (SVM).
+
+# A.5 MARVELL ALGORITHM DESCRIPTION
+
+We use $\mathbf{1} \in \mathbb{R}^d$ to denote the vector with 1 in each coordinate. We use $g[j]$ to denote the $j$ -th row of the matrix $g$ and $y[j]$ to denote the $j$ -th coordinate of the vector $y$ .
+
+# Algorithm 1: Marvell algorithm
+
+input: $g\in \mathbb{R}^{B\times d}$ a size- $B$ batch of unperturbed gradients $y\in \{0,1\} ^B$ the label for each example in the batch $s,$ privacy hyperparameter for the power constraint $P$
+
+# output: $\tilde{g}\in \mathbb{R}^{B\times d}$ , batch of perturbed gradients
+
+// Step 1: estimate the optimization constants from the batch gradients using maximum likelihood estimation (MLE)
+
+1 $p\gets \frac{\mathbf{1}^T y}{d}$ / $\star$ positive fraction \*/
+2 $\bar{g}^{(1)}\gets \frac{1}{1^T y} g^T y$ ; / $\star$ positive mean $\star/$
+3 $\bar{g}^{(0)}\gets \frac{1}{B - \mathbf{1}^T y} g^T (\mathbf{1} - y);$ / $\star$ negative mean $\star/$
+4 $\Delta g = \bar{g}^{(1)} - \bar{g}^{(0)}$
+5 $v\gets \frac{1}{d\cdot(\mathbf{1}^T y)}\sum_{j = 1}^{B}y[j]\cdot \left\| g[j] - \bar{g}^{(1)}\right\| _2^2;$
+6 $u\gets \frac{1}{d\cdot(B - 1^T y)}\sum_{j = 1}^{B}(1 - y[j])\cdot \left\| g[j] - \bar{g}^{(0)}\right\| _2^2;$ / $\star$ negative covariance $\star /$
+7 $P\gets s\cdot \| \Delta g\| _2^2$ : /* power constraint hyperparameter \*/
+
+// Step 2: optimize the four-variable problem
+
+# 8 if $u < v$ then
+
+9 \(\lambda_2^{(1)}\gets 0\) /\* this variable is optimal at \(0\star /
+
+10 | Randomly initialize the optimization variables $\lambda_1^{(1)},\lambda_1^{(0)},\lambda_2^{(0)}$ in the feasible region in (15).
+
+# 11 else
+
+12 $\lambda_2^{(0)}\gets 0$ /\* this variable is optimal at O \*/
+
+13 Randomly initialize the optimization variables $\lambda_1^{(1)},\lambda_2^{(1)},\lambda_1^{(0)}$ in the feasible region in (15).
+
+# 14 end
+
+# 15 while not converged do
+
+Fix one of the newly updated optimization variables;
+
+// The 4-variable optimal solution lies on a hyperplane in $\mathbb{R}^4$ (see Appendix A.4 Remark) so fixing two variables gives us a line-segment
+
+17 Update the remaining two optimization variables by performing 1-d line-search minimization of the convex function (15) while satisfying the constraints;
+
+# 18 end
+
+// Step 3: compute the optimal covariance matrices
+
+19 $\Sigma_1^* \gets \frac{\lambda_1^{(1)} - \lambda_2^{(1)}}{\|\Delta g\|_2^2} (\Delta g)(\Delta g)^\top + \lambda_2^{(1)} I_d;$
+
+20 $\Sigma_0^* \gets \frac{\lambda_1^{(0)} - \lambda_2^{(0)}}{\|\Delta g\|_2^2} (\Delta g)(\Delta g)^\top + \lambda_2^{(0)} I_d;$
+
+// Step 4: perturb the gradients
+
+21 $\tilde{g}\gets \mathbf{0}_{B\times d};$ /\* an empty matrix to store the perturbed gradients \*/
+
+# 22 for $j\gets 1$ to $B$ do
+
+23 if $y[j] = 1$ then
+
+24 | $\tilde{g}[j] \gets g[j] + \eta^{(1)}$ , where $\eta^{(1)} \sim \mathcal{N}(\mathbf{0}, \Sigma_1^*)$ ;
+
+25 else $y[j] = 0$
+
+26 | $\tilde{g}[j] \gets g[j] + \eta^{(0)}$ , where $\eta^{(0)} \sim \mathcal{N}(\mathbf{0}, \Sigma_0^*)$ ;
+
+# 27 end
+
+# 28 end
+
+# A.5.1 MARVELL TIME COMPLEXITY
+
+The Marvell algorithm in 1 consists of the following steps:
+
+Step 1. Compute the positive and negative gradient mean and their difference (line 1 - 4). This amounts to averaging over at most $B$ numbers over each of the $d$ gradient dimensions. Thus would have a time complexity of $O(Bd)$ .
+Step 2. Compute the positive and negative covariance constants $u$ and $v$ (line 5, 6). This operation also takes $O(Bd)$ as it averages over squares of coordinate differences.
+Step 3. Use the results from step 1 and 2, solve the 4-variable optimization problem (line 7-18). Here because the constant size of the number of optimization variables. Solving this problem up to a fixed precision takes constant time $O(1)$
+Step 4. Perform the actual random perturbation (line 19 - 28). Because of the additive structure of each class's covariance matrix, for every example's gradient in the batch, we can independently sample one random Gaussian vector with rank-1 covariance and also another spherical Gaussian random vector and add both vectors to this gradient for perturbation. This step would take $O(d)$ for each example and thus takes $O(Bd)$ in total.
+
+As a result, the entire Marvell algorithm has a time complexity of $O(Bd)$ . This can be further sped up through parallel computation using multi-threading/multi-core. Considering backpropagation through the cut layer would also require $O(Bd)$ time complexity, the Marvell algorithm would not slow down the split-learning process in any significant way at all.
+
+# A.5.2 MARVELL EMPIRICAL RUN TIME
+
+Empirically, in Table 1, we present the average amount of time it takes to run Marvell with the privacy hyperparameter value $s = 4$ for the three models (one for each dataset) we considered in our experiments ( $s$ value is chosen as it achieves good privacy protection as shown with purple line in Figure 3, 5, 6). We also compare it to the average time it takes to run one update iteration. We additionally include the $95\%$ confidence interval for the mean estimator of the run time. Here we notice that the total run time of Marvell only takes up a very small amount of the total training time for each method, further corroborating our algorithm's time efficiency advantage.
+
+ | batch size B | cut layer feature dimension d | average Marvell run time (seconds / run) | average update time (seconds / iteration) |
| ISIC | 128 | 1600 = 5 × 5 × 64 | 1.79 × 10-2 ± 7.03 × 10-5 | 3.94 × 10-1 ± 4.05 × 10-3 |
| Criteo | 1024 | 128 | 1.68 × 10-2 ± 8.67 × 10-5 | 4.84 ± 3.28 × 10-1 |
| Avazu | 32768 | 128 | 1.75 × 10-2 ± 1.47 × 10-4 | 6.22 ± 3.71 × 10-1 |
+
+Table 1: Average run time of Marvell $(s = 4)$ and average total update time per iteration for models trained on ISIC, Criteo, and Avazu.
+
+# A.6 DATA SETUP AND EXPERIMENTAL DETAILS
+
+We first describe how we preprocess each of the datasets in A.6.1. We then describe the model architecture used for each dataset in A.6.2. Finally, we describe what the training hyperparameters are used for each dataset/model combination and the amount of compute used for the experiments in A.6.3.
+
+# A.6.1 DATASET PREPROCESSING
+
+[Criteo] Every record of Criteo has 27 categorical input features and 14 real-valued input features. We first replace all the NA values in categorical features with a single new category (which we represent using the empty string) and replace all the NA values in real-valued features with 0. For each categorical feature, we convert each of its possible value uniquely to an integer between 0 (inclusive) and the total number of unique categories (exclusive). For each real-valued feature, we linearly normalize it into [0, 1]. We then randomly sample $10\%$ of the entire Criteo publicly provided training set as our entire dataset (for faster training to generate privacy-utility trade-off comparison) and further make the subsampled dataset into a $90\% - 10\%$ train-test split.
+
+[Avazu] Unlike Criteo, each record in Avazu only has categorical input features. We similarly replace all NA value with a single new category (the empty string), and for each categorical feature, we convert each of its possible value uniquely to an integer between 0 (inclusive) and the total number of unique categories (exclusive). We use all the records in provided in Avazu and randomly split it into $90\%$ for training and $10\%$ for test.
+
+[ISIC] The official SIIM-ISIC Melanoma Classification dataset has a total 33126 of skin lesion images with less than $2\%$ positive examples. Because for image classification model training it is desirable to use a batch size of $\sim 10^2$ , it is highly likely that there won't be any positive examples sampled in a batch of such size. Thus to make the label leakage problem more severe, we modify the dataset by retaining all the 584 positive examples and randomly choosing $584 \times 9$ examples out of all the negative examples. By doing this, we enforce that there are $10\%$ positive examples in this modified dataset. We randomly split these 5840 examples into a $80\% - 20\%$ training and test split. We also resize the images to size $84 \times 84$ for efficient model training.
+
+# A.6.2 MODEL ARCHITECTURE DETAILS
+
+[Criteo, Avazu] We use a popular deep learning model architecture WDL (Cheng et al., 2016) for online advertising. Here the deep and wide part each first processes the categorical features in a given record by applying an embedding lookup for every categorical feature's value. We use an embedding dimension of 4 for the deep part and embedding dimension of 1 for the wide part. After the lookup, the deep/wide embeddings are then concatenated with the continuous features to form the raw input vectors for both the deep part and wide part respectively. (This step is skipped for Avazu as it has no continuous features.) Then the wide part computes the wide part logit value through a real-valued linear function (with bias) of its raw input vectors, while the deep part processes its raw input features using 6 ReLU-activated 128-unit MLP layers before producing a single deep part logit. The two logits are summed up to form the final logic value. The cut layer is after the output of the 3rd ReLU layer on the deep part.
+
+[ISIC] Every input image after resizing is of size $84 \times 84 \times 3$ . We use a convolutional model with 6 convolutional layers each with 64 channels $3 \times 3$ filter size with $1 \times 1$ stride size. Each convolutional layer is followed by a ReLU activation function whose output is then max pooled with $2 \times 2$ window and stride size $2 \times 2$ . The max-pooled output of the 6th layer is then flattened and pass into a 64-unit ReLU-activated MLP layer before finally being linearly transformed into a single logit score. The cut layer is after the output of the 4th max pool layer. Thus the cut layer feature and gradient are both of shape $5 \times 5 \times 64$ .
+
+# A.6.3 MODEL TRAINING DETAILS
+
+Because the protection mechanism requires adding noise to the cut layer gradient, the induced variance of the gradients of non-label party's $f$ -parameters becomes larger. Thus to ensure smooth
+
+optimization and sufficient training loss minimization, we use a slightly smaller learning rate than what is normally used.
+
+[Criteo] We use the Adam optimizer with a batch size of 1024 and a learning rate of $1e - 4$ throughout the entire training of 5 epochs (approximately 20k stochastic gradient updates).
+
+[ISIC] We use the Adam optimizer with a batch size of 128 and a learning rate of $1e - 5$ throughout the entire training of 1000 epochs (approximately 35k stochastic gradient updates).
+
+[Avazu] We use the Adam optimizer with a batch size of 32768 and a learning rate of $1e - 4$ throughout the entire training of 5 epochs (approximately 5.5k stochastic gradient updates).
+
+We conduct our experiments over 16 Nvidia 1080Ti GPU card. Each run of Avazu takes about 11 hours to finish on a single GPU card occupying 8GB of GPU RAM. Each run of Criteo takes about 37 hours to finish on a single GPU card using 5 GB of GPU RAM. Each run of ISIC takes about 12 hours to finish on a single GPU card occupying 4GB of GPU RAM.
+
+# A.7 COMPLETE EXPERIMENTAL RESULTS
+
+# A.7.1 LEAK AUC PROGRESSION FOR AVAZU AND CRITEO
+
+In addition to the leak AUC progression on ISIC shown in Figure 3 in the main paper, we also show the leak AUC progression on the Avazu and Criteo datasets throughout training here in Figure 5 and Figure 6. We similarly compare Marvell with different levels of protection strength ( $s$ values) against the no protection baseline no_noise. As we can see, Marvell still achieves strong and flexible privacy protection on these two datasets against our label attacks at different model layers.
+
+
+Figure 5: Norm and cosine leak AUC (computed every batch) at the cut layer and at the first layer of no_noise (no protection) vs. Marvell with different scale hyperparameter $s$ throughout the Avazu training.
+
+
+Figure 6: Norm and cosine leak AUC (computed every batch) at the cut layer and at the first layer of no_noise (no protection) vs. Marvell with different scale hyperparameter s throughout the Criteo training.
+
+# A.7.2 COMPLETE PRIVACY-UTILITY TRADEOFFS
+
+We show additional Privacy-Utility tradeoff results for all three datasets considered in this paper. (Some of the plots have already been shown in the main paper but we still include them here for completeness and ease of reference.) For each dataset, we compare the privacy-utility tradeoff over multiple measures of privacy and utility:
+
+# Privacy
+
+We consider our introduced privacy metrics using the activation gradient from the cut layer and the first layer of the non-label party :
+
+- $95\%$ norm leak AUC at cut layer
+- $95\%$ cosine leak AUC at cut layer
+- $95\%$ norm leak AUC at first layer
+- $95\%$ cosine leak AUC at first layer
+
+# Utility
+
+We consider three metrics of utility:
+
+- training loss (train loss): the lowest loss achieved on the training set throughout training. This directly measures how much the random protection perturbation influences the optimization.
+- test loss. Because we only control the training optimization stochastic gradient's variance, measuring test loss directly tells us how much impact the training optimization random perturbation influences beyond optimization but on the learned model's generalization ability.
+- test AUC. As we are dealing with binary classification problem (where performance is commonly measured through test AUC), we also naturally consider it as a utility metric.
+
+As shown in Figure 7,8,9, Marvell consistently outperforms the isotropic Gaussian baseline over all the different privacy-utility definitions. In addition, our proposed heuristic max_norm is also particularly effective against our identified norm and direction-based attacks.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: Privacy (norm and cosine leak AUC) vs Utility (train loss, test loss, and test AUC) trade-off of protection methods (Marvell, iso, no-noise, max_norm) at the cut layer and first layer on Avazu.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Privacy (norm and cosine leak AUC) vs Utility (train loss, test loss, and test AUC) trade-off of protection methods (Marvell, iso, no_noise, max_norm) at the cut layer and first layer on Criteo.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 9: Privacy (norm and cosine leak AUC) vs Utility (train loss, test loss, and test AUC) trade-off of protection methods (Marvell, iso, no_noise, max_norm) at the cut layer and first layer on ISIC.
+
+
+
+
+
+
+
+# A.7.3 IMPACT OF ACTIVATION GRADIENTS' LAYER LOCATION ON THE CORRESPONDING LEAK AUC
+
+In Section 5.1, we have shown that the activation gradients of not only the cut layer but also the first layer can leak the label if no protection is applied. In this section, we analyze the effect of this layer location on the degree of label leakage under our proposed attacks measured through leak AUC. Here, for the convolutional neural network trained on ISIC, we have allocated 4 Conv-ReLU-MaxPool layers on the non-label party side. Here each of these 4 layers' activation (from ReLU output) gradients can be used to infer the label. In Figure 10, we plot the progression of norm and cosine leak AUC for layer 2 and 3 in addition to the first layer (layer 1) and the cut layer (layer 4) when applying no protection or Marvell with $s = 4$ . We notice that when no protection is applied, the norm and cosine leak AUC are approximately the same across the layers and both at a very high level, indicating a strong degree of label leakage. In contrast, when Marvell is applied, the leak AUCs are much lowered to a reasonable level of around 0.6 throughout all the layers. Empirically, we notice that the leak AUCs for a given training iteration are close among all the layers with a maximum difference of around 0.05. Here it is unclear whether the earlier layers' gradients would leak the labels more than the cut layer or not — for norm leak AUC, the earlier layers have a higher AUC values (more leakage) than the cut layer, while for cosine leak AUC, the earlier layers have a lower AUC values (less leakage) than the cut layer. Further understanding the relationship between these leak AUC values across different layers is an open question motivated by our observations here.
+
+ISIC, non-label party's convolution network f with four Conv-ReLU-MaxPool layers
+
+layer 1 (first layer) layer 2 layer 3 layer 4 (cut layer)
+
+
+Figure 10: For a non-label party's four-layer convolutional architecture trained on ISIC, we plot the progression of the norm or cosine leak AUC computed using the activation gradients from each of the four layers throughout training in (a), (b) when no random protection is applied and in (c), (d) when using Marvell with privacy hyperparameter $s = 4$ at the cut layer (layer 4). The four curves overlap in (b) at the value of 1.0. For each layer's data in each figure, a 1-d Gaussian kernel with standard deviation of 5 is convolved with the raw 1-d array of leak AUC values to smooth out the fluctuations and make the different layers' degree of leakage more visually distinct.
+
+
+
+
+
+Beyond the four layer convolutional neural network trained on ISIC, we also train a new MLP model architecture on Criteo. Here instead of having 3 128-unit ReLU-activated MLP layers for the non-label party's function $f$ as described in Section A.6.2, we use 8 such layers for $f$ while keeping every other architectural component the same. We plot the progression of leak AUC values on each of the eight layers in Figure 11. Here the observations are very similar to what we see in Figure 10, confirming our aforementioned conclusions in this section.
+
+
+Criteo, non-label party's MLP network f with eight 128-unit ReLU-activated MLP layers
+
+
+Figure 11: For a non-label party's eight-layer MLP architecture trained on Criteo, we plot the progression of the norm or cosine leak AUC computed using the activation gradients from each of the eight layers throughout training in (a), (b) when no random protection is applied and in (c), (d) when using Marvell with privacy hyperparameter $s = 4$ at the cut layer (layer 4). The eight curves overlap in (b) at the value of 1.0. For each layer's data in each figure, a 1-d Gaussian kernel with standard deviation of 100 is convolved with the raw 1-d array of leak AUC values to smooth out the fluctuations and make the different layers' degree of leakage more visually distinct.
+
+
+
+
+
+| layer 1 (first layer) | layer 3 | layer 5 | layer 7 |
| layer 2 | layer 4 | layer 6 | layer 8 (cut layer) |
+
+# A.8 REASONS WHY WE DON'T USE LOCAL DP IN OUR SETUP
+
+It is possible to use a local differential privacy definition to analyze our problem setup if we treat any single training example as a dataset and two examples (dataset) are adjacent if they share the same $X$ but have the opposite label $y$ . Then one can analyze the activation gradient computation function's local DP properties. However, we choose not to use local DP in our setup for the following two reasons:
+
+1. We are not aware of any attacks associated with local DP that are suitable for practical use in our problem setup. In contrast, our leak AUC privacy quantification metrics have corresponding concrete, realistic attack methods that the non-label party can use in practice.
+2. Even if there exists a practical attack associated with local DP, this attack would require example-level side information as the activation gradient distributions would be examplespecific. Distinguishing between such gradient distributions for a pair of adjacent examples (with same $X$ but opposite label $y$ ) would require knowledge about the two distributions specific to this example pair itself. As we have mentioned in Section 3.2, we do not assume the non-label party would realistically have access to such fine-grained knowledge. Instead, in our setup, the non-label party uses a scoring function that only takes in the communicated cut layer gradient without any additional information.
\ No newline at end of file
diff --git a/labelleakageandprotectionintwopartysplitlearning/images.zip b/labelleakageandprotectionintwopartysplitlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..82830a2dcf72d5eaa10b64c917d773d1e3a0de32
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5a0232d33b781f62a53b0c6717ab2287d225fc5947471a3e96e183f5e690c00e
+size 1413507
diff --git a/labelleakageandprotectionintwopartysplitlearning/layout.json b/labelleakageandprotectionintwopartysplitlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..bc5ca1232f33e583b896a1d60f97169a077639a6
--- /dev/null
+++ b/labelleakageandprotectionintwopartysplitlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4514759dc04b7a803e2fcecd23e0387dbcad2b6162e3dcda29aa3f2876dacb57
+size 1024738
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_content_list.json b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9052d6b4dd979213cc9c52b281923c569759be8d
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8819f14453fd9e8af4d21911f015498be8cf5a6836737e146317c6a10365123c
+size 112620
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_model.json b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..00bc56189c9769e6948a19cdf6d5542ac2378c54
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:43593611a82cbdcdf97a30f9e4769d7b7487ccff1e9d18a0dd0bd15e22ce1e95
+size 146028
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_origin.pdf b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c2cf98d65e803801fa629d5584171eaf343109cb
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/b1f75d70-00b9-4b72-bb9a-3bc4b204d369_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fcd30c023a79b98375c6f3771a906102500826b2dc212c61a208ccbd6b4a4409
+size 4164987
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/full.md b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0c37d5c29ba5f80c12557619bd9c00a285ec2ace
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/full.md
@@ -0,0 +1,535 @@
+# LANGUAGE-BIASED IMAGE CLASSIFICATION: EVALUATION BASED ON SEMANTIC REPRESENTATIONS
+
+Yoann Lemesle*
+
+INRIA, France
+
+ENS Rennes, France
+
+Masataka Sawayama†*
+
+INRIA
+
+France
+
+Guillermo Valle-Perez
+
+INRIA
+
+France
+
+Maxime Adolphe
+
+INRIA
+
+France
+
+Hélène Sauzéon
+
+INRIA, France
+
+Université de Bordeaux, France
+
+Pierre-Yves Oudeyer
+
+INRIA, France
+
+Microsoft Research Montreal
+
+# ABSTRACT
+
+Humans show language-biased image recognition for a word-embedded image, known as picture-word interference. Such interference depends on hierarchical semantic categories and reflects that human language processing highly interacts with visual processing. Similar to humans, recent artificial models jointly trained on texts and images, e.g., OpenAI CLIP, show language-biased image classification. Exploring whether the bias leads to interference similar to those observed in humans can contribute to understanding how much the model acquires hierarchical semantic representations from joint learning of language and vision. The present study introduces methodological tools from the cognitive science literature to assess the biases of artificial models. Specifically, we introduce a benchmark task to test whether words superimposed on images can distort the image classification across different category levels and, if it can, whether the perturbation is due to the shared semantic representation between language and vision. Our dataset is a set of word-embedded images and consists of a mixture of natural image datasets and hierarchical word labels with superordinate/basic category levels. Using this benchmark test, we evaluate the CLIP model. We show that presenting words distorts the image classification by the model across different category levels, but the effect does not depend on the semantic relationship between images and embedded words. This suggests that the semantic word representation in the CLIP visual processing is not shared with the image representation, although the word representation strongly dominates for word-embedded images.
+
+# 1 INTRODUCTION
+
+Language is not only a fundamental tool enabling humans to communicate with each other: it also shapes other aspects of perception and cognition, ranging from influencing visual processing to enabling abstract thinking (Vygotsky, 1934; Miller, 1951; Waxman & Markow, 1995; Colas et al., 2021). Analogous to this human ability, recent artificial intelligence technology has also utilized language to drive the training of visual skills in machines. For instance, the OpenAI team introduced CLIP (Contrastive Language-Image Pre-training), consisting of joint learning of language and vision (Radford et al., 2021). The CLIP model efficiently learns visual concepts from natural language supervision and can be applied to various visual tasks in a zero-shot manner. Joint learning of language and vision has also been utilized in the Visual Question Answering (VQA) literature, where artificial models are asked to answer questions about visual content (Antol et al., 2015; Lu et al., 2016; Fukui et al., 2016).
+
+| Classification task type |
| What is the superordinate category of the image? | What is the basic category of the image? | What is the superordinate category of the image? | What is the basic category of the image? |
| Superimposed words |
| Superordinate word | Basic word |
+
+
+(S/S)
+New prediction: electronic $|99.00\%$ Original prediction: animal $45.72\% \rightarrow 0.19\%$
+Figure 1: Overview of our benchmark test. Our dataset is a set of word-superimposed images consisting of the natural image datasets and hierarchical word labels. The classification tasks are divided into four conditions: superordinate image classification for the image with the superordinate category word (S/S), superordinate image classification for the image with the basic word (S/B), basic image classification for the image with the superordinate category word (B/S), and basic classification for the image with basic category word (B/B). The classification examples by the CLIP model are shown in Appendix A1.
+
+
+(B/S)
+New prediction: dog | 50.97% Original prediction: dog | $60.78\% \rightarrow 50.97\%$
+
+
+(S/B)
+New prediction: electronic | 40.00% Original prediction: animal | $45.72\% \rightarrow 14.94\%$
+
+
+(B/B)
+New prediction:
+laptop | 85.38%
+Original prediction:
+dog | 60.78% → 4.46%
+
+While joint training with language effectively fosters the acquisition of general abilities for visual recognition/understanding, its abstraction can produce biased recognition for either humans or machines. The Stroop effect known in human cognitive science literature is one of such biases (Stroop, 1935). When human participants observe a mismatched word, where the word "red" is printed with the "blue" color, and are asked to answer the "color" of the word, their response to the word can be slower than when they see the word "red" with the "red" color. In addition to the color-word interference, language also interferes with human image category recognition, known as picture-word interference (Rosinski, 1977; Lupker, 1979). When a participant observes an image coupled with an incongruent category word (e.g., Figure 1), the image categorization speed can be delayed. Similar to the effect in humans, recent deep learning systems jointly trained on language and vision, e.g., CLIP, show object recognition interference when words are embedded in images (Goh et al., 2021). Specifically, by simply adding a handwritten word to an image, the object recognition can be biased to the superimposed word.
+
+A critical aspect of picture-word interference in humans is that it depends on the semantic relationship between images and superimposed words. For instance, the reaction time on the image classification for word-superimposed images is slower when the image category is semantically similar to the word one (Rosinski, 1977). Based on the accumulated findings, previous works have commonly suggested that at least two different processes mediate the effect in humans, as introduced in detail in Section 2.2. Specifically, when a participant observes a word-superimposed image, an activation process synthesizes semantic representations corresponding to the superimposed word and image (Figure 2, activation process). Based on the representations, it has been assumed that a selection process decides which possible activation is the answer for the current task.(Figure 2, selection process). The activated representation is shared across visual word forms and images, and the dual activation by words and images confuses the decision in the selection process.
+
+These human cognitive findings raise the question of whether interference in artificial models have some similarities with those observed in humans. Indeed, some artificial models show language-biased image classification, but one possibility is that the bias might emerge irrespective of the semantic interaction between words and images. When we consider a model with text and image encoders for picture-word interference (Figure 2), we can regard the functional role of the image encoder as synthesizing semantic representations for word-superimposed images. Although picture-
+
+
+Figure 2: Process diagram of the CLIP model for our task. This figure is created based on Radford et al. (2021). The list of superordinate or basic word labels was used for the classification depending on the task type. We regard the image/text encoder as the selection/activation process in human picture-word interference, as discussed in the main text.
+
+word interference in humans depends on shared semantic representations of written words and images, this is not the only mechanism that can produce the interference. For instance, the image encoder of the model may assign the written word "dog" a different semantic representation than the visual image "dog" and show strong preferential activation to written words while ignoring image contents. Since joint learning of language and vision is expected to enable machines to acquire highly interacted representations of texts and images to solve various general tasks, observing such independent representations and a bias for one of them can be problematic and show a limit of the joint training process.
+
+In this study, we import methodological tools from the cognitive science literature to assess biases of artificial models in image classification for word-superimposed images. Specifically, we introduce a paradigm to evaluate picture-word interference, in which an agent has to predict the image superordinate/basic category for images with superordinate/basic words (Figure 1). Our benchmark dataset is a set of images with superimposed words and consists of a mixture of natural image datasets (Cichy et al., 2016; Mohsenzadeh et al., 2019) and hierarchical word labels (Lin et al., 2014; Krizhevsky et al., 2009). Our benchmark task aims to test artificial models with a text encoder and an image encoder (Figure 2). The task enables us to test 1) whether language-biased decisions happen across superordinate/basic object category levels and 2) the extent to which picture-word interference in artificial models depends on the semantic similarity between superimposed words and images. Furthermore, by importing a methodological tool from the neuroscience literature, called representational similarity analysis (RSA) (Kriegeskorte et al., 2008a), we can also test 3) whether the image encoder has a common semantic representation for superimposed words and images. Out of various joint learning models of language and vision, the present study evaluates the CLIP model using the dataset because the model consists of dual processing of visual and text encoders and is developed to be applied to various general visual tasks without fine-tuning the dataset. To anticipate the result, we show that 1) presenting words disturbs the CLIP image classification even across different category levels, 2) the effect does not depend on the semantic relationship between images and words, and 3) the superimposed word representation in the CLIP image encoder is not shared with the image representation. The present study provides an open-source code to reproduce the results and the full dataset (https://github.com/flowersteam/picture-word-interference).
+
+# 2 RELATED WORKS
+
+Joint learning of language and vision in artificial models: Some recent works in machine learning have reported language-biased image recognition for artificial models trained with joint learning of
+
+language and vision. One example is the CLIP model (Radford et al., 2021). The CLIP architecture consists of an image encoder and a text encoder (Figure 2). The image encoder is based on a ResNet (He et al., 2016) or Vision Transformer (Dosovitskiy et al., 2020), and the text encoder is a Language Transformer model (Vaswani et al., 2017). The model is trained on a large dataset of image-text pairs with contrastive objectives, where it learns to align text and image representations for each pair. The pre-trained model can be used for various visual tasks in a zero-shot manner. For instance, when the model is applied for the image classification task, the learned text encoder synthesizes a zero-shot linear classifier for the descriptions, including classification labels, e.g., "a photograph of [label]" (Figure 2). The learned image encoder outputs the representation for an input image, and the text classifier decides which label representation is the closest to the image representation. Language-biased image classification is reported in the CLIP image classification task as a typographic attack (Goh et al., 2021). As shown in Figure 1, when a written word is superimposed on an image, the CLIP classifies the image category as the superimposed word.
+
+Another example of language-biased image classification is reported in the context of the Visual Question Answering (VQA) task (Antol et al., 2015; Lu et al., 2016; Fukui et al., 2016). This task's goal is to answer questions about visual content, e.g., a text question "What color is the dog?" for a dog image. The task also needs joint learning of language and vision, i.e., an image encoder to recognize what the visual content is and a text encoder to understand the question. However, joint learning tends to be biased by superficial correlations between texts and images in the training data and ignore visual input to solve a task (Agrawal et al., 2016). For instance, even when a model sees a green (untypical) banana and is asked about its color, the model tends to answer "the color is yellow" while ignoring the actual image content. Based on the observations, recent VQA models have attempted to remove the biases (Agrawal et al., 2018; Ramakrishnan et al., 2018).
+
+Picture-word interference in humans: It is essential to understand how the language-biased processing in artificial models is related to the human mechanisms discussed in the cognitive science literature. This subsection reviews the functional connection between text/image encoders in artificial models and picture-word interference in humans (Figure 2). Picture-word interference refers to language-biased recognition for word-superimposed images, and previous works in cognitive science have investigated this effect using various experimental paradigms (reviewed by Burki et al. (2020)). Here, we focus on interference when a participant observes a word-superimposed image and answers the image category for the image to compare the underlying cognitive mechanisms with artificial models (Rosinski, 1977).
+
+The discussion about what type of mechanisms mediate picture-word interference is still controversial in the cognitive science literature, especially the stage at which the interference emerges. However, we can summarize common functional mechanisms shared across different theoretical views and ask whether artificial models acquire these fundamental components in the current study. First, most views assume that visual words and images activate common semantic representations, i.e., a written word "dog" activates similar semantic representations to an image "dog." Second, they commonly assume that interference emerges due to some types of selection process. The type of selection process is extensively debated and differs depending on the views. One is the lexical selection hypothesis, and the selection works to compare the semantic representation competitively (Levelt et al., 1999; Roelofs, 1992). This selection relies on relative activation in semantic representations, and picture-word interference emerges because the activation by words induces misselection when it is semantically close to the activation by images. However, the lexical selection is inconsistent with some behavioral findings, e.g., the activation amplitude does not always correspond to the effect size of interference. Another theoretical view assumes the response selection, which is closer to the decision stage than the lexical selection (Finkbeiner & Caramazza, 2006). Since the response selection assumes additional processing for relative activated representations, it can explain the inconsistency of the phenomenon with the lexical selection assumption.
+
+We first ask whether one observes patterns of interference at the behavioral level that are similar to humans and then study more precisely the learned representations to see if the mechanisms proposed to explain human interference could also be at play in the artificial model. To investigate machine mechanisms in terms of the cognitive science findings, we regard an image encoder in the artificial model as the processing to activate semantic representations from images (Figure 2). We also consider a text encoder as the selection process, which tries to find the answers according to the task objectives (superordinate/basic selection).
+
+# 3 LANGUAGE-BIASED IMAGE CLASSIFICATION TEST
+
+Our dataset is a set of word-superimposed images. We use the two image datasets from the cognitive neuroscience literature on object recognition (Cichy et al., 2016; Mohsenzadeh et al., 2019), which include 118 and 156 images with natural object categories. Previous works recorded the spatiotemporal neural activity using fMRI and MEG measurements for the images. The first dataset was annotated with 118 basic categories (Cichy et al., 2016) and the second one with five superordinate categories (faces, bodies, animals, objects, and scenes) (Mohsenzadeh et al., 2019). For the word labels, we extracted the superordinate category words from the MS-COCO dataset and the basic category words from the MS-COCO and CIFAR-100 datasets (Lin et al., 2014; Krizhevsky et al., 2009). The MS-COCO dataset had the "person" label for superordinate and basic categories. We used this label only for the superordinate category because it was a higher category than other person-related basic labels in CIFAR-100. We removed multi-word labels and duplicates (including the plural of an already existing label) when compounding the MS-COCO and CIFAR-100 basic word label sets. The numbers of superordinate and basic word labels were 12 and 138, respectively. We superimposed all labels on each image, and thus, our word-superimposed image dataset included 41,100 images in total. The color of superimposed words was red and bordered by white lines to enhance the word visibility considering future usage in human experiments. Since the image dataset is supposed to observe objects in the foveal vision, we put the words in the center of the image with a size that largely does not hide the original object.
+
+The classification task was to answer the image label for word-superimposed images. The classification label belonged either to the superordinate or the basic category. The set of labels in the superordinate and basic categories were the same as the words used to make the word-superimposed images. Therefore, the stimulus conditions were divided into four, corresponding to two classification types and two superimposed word categories (Figure 1). The former index S of "S/S" in Figure 1 indicates the classification task level (superordinate or basic), and the latter shows the category level of the word superimposed on the image (superordinate or basic). In addition to these conditions, we used no-word images to evaluate the original prediction by the model.
+
+# 4 EXPERIMENTS AND RESULTS
+
+# 4.1 EXPERIMENTAL SETUP
+
+Performing image classification with the pre-trained CLIP model needs the input of a list of candidate classification labels (or a textual representation of them) for the text encoder and an image for the image encoder (Figure 2). We used the sentence of "a photo of a [label]" for the text encoder. The two encoders output the representations of texts and the image respectively. We then computed the similarities of text and image representations for a set of labels, passed them through the softmax function to obtain the probability of each label for a given input image, and extracted the label with the highest value for the final classification (Radford et al., 2021). We present the results of the pre-trained CLIP image encoder using a Vision Transformer (ViT-B/32) in the main text and those of other image encoders in Appendix C.
+
+# 4.2 LABEL SWITCHING RATE
+
+To test whether superimposing the word affects the classification, we first evaluated the label switching rate. We defined a label-switched image as a word-superimposed image with a different image classification than the corresponding no-word image. The label switching rate refers to the ratio between the number of label-switched images and the total number of images under each classification/superimposed-word condition.
+
+Table 1 shows the results of the label switching rates for each condition. When the classification task type is consistent with the superimposed word category (i.e., the S/S and B/B conditions), the choices of the classification labels include the same word as that superimposed on the image. For these conditions, the CLIP model switched the original classification with high rates. These findings suggest that the model can detect the visual word form on the image and match it with the classification label. These are consistent with the previous work reporting the language-biased image classification of the CLIP model (Goh et al., 2021).
+
+ | Superordinate prediction | Basic prediction |
| Superordinate word | (S/S) 92.77 % | (B/S) 41.24 % |
| Basic word | (S/B) 28.29 % | (B/B) 73.97 % |
+
+Table 1: CLIP's label switching rate for word-superimposed images.
+
+
+(a) Semantic similarity
+
+
+(B/S)
+
+
+(S/B)
+
+
+(B/B)
+
+
+(b) Spelling similarity
+
+
+(B/S)
+
+
+(S/B)
+Figure 3: Results of the (a) semantic and (b) spelling similarity analyses.
+
+
+(B/B)
+
+In contrast, when the classification type is different from the superimposed word category (i.e., the S/B and B/S conditions), the classification labels do not include the same word as the superimposed one. Even under the conditions, the CLIP model showed label-switching for some of the word-superimposed images. Furthermore, some of the switched new labels were related to the superimposed words (Appendix G). The findings suggest that the model can match the meaning of the written word in the image with the label category across different levels. However, it remains unclear whether the image encoder acquires a common semantic representation for the images and the visual word forms. There is also a possibility that the superimposed words are separately represented from the images in the image encoder. (e.g., a superimposed word "dog" is differently represented from an image of a dog). Even so, the label switching across different categories can emerge when the label activation of the text encoder can match with the representation of the superimposed word. To understand the semantic relationship, we evaluated the following semantic similarity between images and superimposed words for the label-switched and unswitched images.
+
+# 4.3 SEMANTIC SIMILARITY
+
+We evaluated the semantic similarity between the original prediction labels for no-word images and the superimposed words to test the semantic dependency in picture-word interference. Specifically, we calculated the vector representations of these labels using a pre-trained Word2Vec model (Mikolov et al., 2013b;a), and then measured the cosine similarity between the two vector representations. If picture-word interference in CLIP depends on the semantic similarity between superimposed words and images, we would expect the similarity in the label-switched condition would be higher than that in the unswitched condition. Figure 3a shows the semantic similarity distribution for the label-switched and unswitched images in the CLIP model. The results show that for all task type and word category conditions, the semantic similarity distributions on the label-switched condition were similar to those on the unswitched condition. This finding suggests that picture-word interference in the CLIP model does not depend on the semantic relationship between images and superimposed words, suggesting that the CLIP image encoder does not acquire a common semantic representation across superimposed words and images.
+
+
+Figure 4: Results of the representational similarity analysis. See also Appendices B1 and H1.
+
+# 4.4 SPELLING SIMILARITY
+
+In addition to the semantic similarity, we evaluated the spelling similarity using the Jaro-Winkler metric (Winkler, 1990) to test how the superimposed word is related to the image category. If the CLIP image encoder acquires a common representation of superimposed words and images based on the edit distance, this metric should change with the label-switched/unswitched condition. Figure 3b shows the result of the CLIP model on the spelling similarity for the label-switched and unswitched images. As in the semantic similarity, the distribution median for the task conditions was always similar between the label-switched and unswitched conditions.
+
+# 4.5 REPRESENTATIONAL SIMILARITY ANALYSIS (RSA)
+
+We also used a methodological tool from the cognitive neuroscience literature, called representational similarity analysis (RSA) (Kriegeskorte et al., 2008a), to understand what is represented in the image encoder for word-superimposed images. RSA refers to an image-by-image similarity assessment of intermediate representations in a brain or model. By computing representational dissimilarity matrices (RDMs) for no-word images and word-superimposed images, we can evaluate how the representation for the no-word images in the CLIP image encoder is affected by adding words on the image. We input one of the two datasets (156 images) (Mohsenzadeh et al., 2019) for this analysis because it consisted of the previously defined superordinate categories. In addition to the CLIP model, we evaluated the two feed-forward convolutional networks (i.e., VGG-19 and ResNet-152) trained for object category classification using ImageNet without joint learning of language and vision to confirm whether presenting words as image manipulation can affect the image encoder without joint learning.
+
+Figure 4 shows the results of the RSA. Each matrix indicates the image-by-image cosine dissimilarity between intermediate features for the paired images. For the features, we used the last fully connected layer for VGG-19/ResNet-152 and the visual encoder output for the CLIP model. The top, middle, and bottom rows show the results for the original images, the word-superimposed images
+
+| prompt | S/S | B/S | S/B | B/B |
| "a red word label over a picture of a X" | 87.69 % | 44.16 % | 29.64 % | 66.23 % |
| "a word is printed in a red font over a picture of a X" | 91.34 % | 44.86 % | 35.29 % | 69.72 % |
| "a photo of a word written in a red font over a picture of a X" | 86.53 % | 43.07 % | 30.78 % | 62.69 % |
| "a text that says X" | 96.78 % | 52.50 % | 54.58 % | 88.22 % |
| "a word of a X is printed in a red font over a picture" | 95.48 % | 51.65 % | 46.28 % | 78.02 % |
| "a photo of the word X written in a red font over a picture" | 96.22 % | 53.58 % | 42.91 % | 85.05 % |
| "a photo of the word Y written in a red font over a picture of a X" | 34.34 % | 35.33 % | 31.04 % | 34.92 % |
+
+Table 2: CLIP's label switching rate for word-superimposed images on different prompts. The red-colored texts are the prompts that specify that the image content is what should be predicted. The blue-colored texts are the prompts that specify that the superimposed word is what should be predicted. The X means the label to be answered by the model. The orange-colored text is the condition in which a prompt varies according to the superimposed word on each image.
+
+with the "animal" label, and the word-superimposed images with the "person" label, respectively. Each left image is one example in the 156 images. The results of other word-embeddings are shown in Appendices B1 and H1.
+
+For VGG-19 and ResNet-152, we observed some representational clusters according to the superordinate categories (i.e., the squared clusters around the diagonal line in each panel with lower dissimilarity values) (Figure 4, top, VGG-19 and ResNet-152). It has been known that higher cortical areas in humans and monkeys also show such categorical clusters for RDMs of natural scene images (Kriegeskorte et al., 2008b; Cichy et al., 2014). Similar to these feed-forward models, the CLIP image encoder also showed representational clusters depending on the superordinate categories (Figure 4, top, CLIP), suggesting that the encoder has a hierarchical structure for visual images.
+
+In contrast, the results of the CLIP model for word-superimposed images showed different representations from that of original images (Figure 4, middle and bottom, CLIP). First, the dissimilarity values for word-superimposed images were generally lower than those for original images (i.e., the representations of all images are similar to each other). The results are consistent with the strong language bias of the CLIP model. As in the other analyses, presenting words on the image shift the CLIP image classification to the direction of the superimposed word. This means that when we put a single word on the different images, their representations can be similar.
+
+Most importantly, our analysis showed that adding words to images did not produce categorically selective effects on the representation of the image encoder. Specifically, we observed category-related squares similar to the original one around the diagonal line of each representational matrix for word-superimposed images (Figure 4, middle and bottom, CLIP). In addition, even when we put different word labels, "person" and "animal," these representational matrices remained similar. If the superimposed words were similarly represented in the image encoder to the image category, presenting words on the image should selectively affect the original image category representation and depend on what words were superimposed. The current results are inconsistent with the hypothesis and suggest that the CLIP image encoder has different representations of word forms (i.e., superimposed words) from visual image representations.
+
+# 4.6 PROMPT DEPENDENCY
+
+The CLIP model is not trained for image classification but just for matching between images and texts. One may consider that the language-biased classification emerges because the task objective for the model, which is defined by the prompt "a photo of X," is ambiguous. The prompt can be both "a photo of the written word" and "a photo of the image content." We tested various prompts to explore the effect of prompts. First, we created three prompts that specify that the image content is what should be predicted by the CLIP model (red in Table 2) and three prompts that specify that the superimposed word is what should be predicted by the CLIP model (blue in Table 2). The label switching rate refers to the ratio of switching word-superimposed images with a different image classification than the corresponding no-word images. In addition to these fixed prompts, we created a prompt that varies according to the superimposed word on each image. We used a prompt "a photo of the word Y written in a red font over a picture of a X," where X is the label to be answered by
+
+the model and Y is the same variable word as superimposed on each image (orange in Table 2). For instance, we used a prompt "a photo of the word electric in a red font over a picture of a X" when the superimposed word is "electric," and a prompt "a photo of the word dog in a red font over a picture of a X" when the superimposed word is "dog."
+
+Table 2 shows the results of the label-switching rate for different prompts. The results showed that the rate changed with the different prompts, i.e., the focus of the task (image content or superimposed word). When the prompt was focused on the image content (red in Table 2) the switching rates were lower than when it was focused on the superimposed word (blue in Table 2). However, the language-biased classification was high for all conditions. The results on the variable prompt (orange in Table 2) showed that the label switching rate for the S/S and B/B conditions decreased more than the prompt conditions that specify the image content (red in Table 2). The finding suggests that describing the superimposed word in the prompt is effective in decreasing the language-biased classification. Even so, the label-switching rates were still high, more than $30\%$ for all conditions. In addition, we analyzed the semantic similarity between the image and superimposed words for label-switched and unswitched images. The results showed that, in any prompts, the semantic relationship did not explain the label-switching effect (Appendix Figure D1).
+
+# 5 DISCUSSION AND CONCLUSION
+
+The present study developed a benchmark test for language-supervised visual models to evaluate the language biases in image classification. Experiments we presented show that adding printed words over images leads to high classification switching rates across different categories of superimposed words and different classification tasks. The finding suggests that the CLIP image encoder can recognize the visual word form as a word, and the model can match the visual word representation with the classification label representations across different category levels. However, the semantic similarity analysis showed that the language-biased image classification in the CLIP model was irrespective of the semantic/spelling relationship between image and superimposed word categories. This finding is different from human findings and suggests that the CLIP image encoder does not acquire the semantic word representation shared with the image representation. The RSA results supported the hypothesis by showing that presenting words on images did not affect the no-word image representation selectively to specific categories.
+
+We consider multiple steps for an artificial model with joint learning of language and vision to acquire semantic compositionality for visual word and image categories. First, an image encoder needs to recognize the visual word form as a word. Next, the semantic representation for words and images needs to be shared in the image encoder. That is, the written word "dog" needs to have the same semantic representation as the image "dog." The present study showed that the CLIP model acquires the first step, but the second step remains challenging. Our language-biased image classification test enables researchers to evaluate step-by-step semantic interactions in joint learning of language and vision.
+
+A remaining question is how the CLIP model acquires the biased representations in the image encoder. The presented results may be improved by further studying them as a function of potential biases in the training data of CLIP itself: for example, it would be useful to understand in the first place how CLIP acquired the ability to visually recognize superimposed words and why we observed a bias favoring the superimposed words over the whole image. In particular, we can ask whether the written words are in the training data and if they are, whether there are adversarial examples in the training data like our word-superimposed images.
+
+Picture-word interference in humans is a phenomenon showing a language-biased effect in terms of image classification. However, this can also be considered as a developmental product humans acquire, where such bias could have functionalities. Some human studies have shown that picture-word interference is inextricably linked to facilitation effects of language priming for image category recognition (Finkbeiner & Caramazza, 2006). The finding reminds us that acquiring human-like biased representations for artificial models can have a functional meaning to process world information efficiently in natural environments. The current efforts to manage language-biased image recognition in artificial models are mainly aimed to remove the biases (Agrawal et al., 2018; Ramakrishnan et al., 2018). However, one direction might be to make the biases more human-like by controlling joint learning curricula of language and vision (c.f., Sigaud et al. (2021)).
+
+# 6 REPRODUCIBILITY STATEMENT
+
+All the source codes are available at our GitHub repository (https://github.com/flowersteam/picture-word-interference) to create the word-superimposed images from the image datasets (Cichy et al., 2016; Mohsenzadeh et al., 2019) and to reproduce the current analysis results, which are also shared in the supplementary materials of the ICLR submission. The analysis relies on the pre-trained models shared in the previous studies (e.g., CLIP).
+
+# REFERENCES
+
+Aishwarya Agrawal, Dhruv Batra, and Devi Parikh. Analyzing the behavior of visual question answering models. arXiv preprint arXiv:1606.07356, 2016.
+Aishwarya Agrawal, Dhruv Batra, Devi Parikh, and Aniruddha Kembhavi. Don't just assume; look and answer: Overcoming priors for visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4971-4980, 2018.
+Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE international conference on computer vision, pp. 2425-2433, 2015.
+Audrey Burki, Shereen Elbuy, Sylvain Madec, and Shravan Vasishth. What did we learn from forty years of research on semantic interference? a bayesian meta-analysis. Journal of Memory and Language, 114:104125, 2020.
+Radoslaw Martin Cichy, Dimitrios Pantazis, and Aude Oliva. Resolving human object recognition in space and time. Nature neuroscience, 17(3):455-462, 2014.
+Radoslaw Martin Cichy, Dimitrios Pantazis, and Aude Oliva. Similarity-based fusion of meg and fmri reveals spatio-temporal dynamics in human cortex during visual object recognition. *Cerebral Cortex*, 26(8):3563-3579, 2016.
+Cédric Colas, Tristan Karch, Clément Moulin-Frier, and Pierre-Yves Oudeyer. Language as a cognitive tool: Dall-e, humans and vygotskian rl agents, March 2021. URL https://hal.archives-ouvertes.fr/hal-03159786.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
+Matthew Finkbeiner and Alfonso Caramazza. Now you see it, now you don't: On turning semantic interference into facilitation in a stroop-like task. Cortex, 42(6):790-796, 2006.
+Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. arXiv preprint arXiv:1606.01847, 2016.
+Gabriel Goh, Nick Cammarata †, Chelsea Voss †, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal neurons in artificial neural networks. *Distill*, 2021. doi: 10.23915/distill.00030. https://distill.pub/2021/multimodal-neurons.
+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.
+Emmanuel Keuleers and Marc Brysbaert. Wuggy: A multilingual pseudoword generator. Behavior research methods, 42(3):627-633, 2010.
+Nikolaus Kriegeskorte, Marieke Mur, and Peter A Bandettini. Representational similarity analysis connecting the branches of systems neuroscience. Frontiers in systems neuroscience, 2:4, 2008a.
+
+Nikolaus Kriegeskorte, Marieke Mur, Douglas A Ruff, Roozbeh Kiani, Jerzy Bodurka, Hossein Esteky, Keiji Tanaka, and Peter A Bandettini. Matching categorical object representations in inferior temporal cortex of man and monkey. Neuron, 60(6):1126-1141, 2008b.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
+Willem JM Levelt, Ardi Roelofs, and Antje S Meyer. A theory of lexical access in speech production. Behavioral and brain sciences, 22(1):1-38, 1999.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740-755. Springer, 2014.
+Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. Advances in neural information processing systems, 29:289-297, 2016.
+Stephen J Lupker. The semantic nature of response competition in the picture-word interference task. Memory & Cognition, 7(6):485-495, 1979.
+Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a.
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013b.
+George Armitage Miller. Language and communication. 1951.
+Yalda Mohsenzadeh, Caitlin Mullin, Benjamin Lahner, Radoslaw Martin Cichy, and Aude Oliva. Reliability and generalizability of similarity-based fusion of meg and fmri data in human ventral and dorsal visual streams. Vision, 3(1):8, 2019.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. CoRR, abs/2103.00020, 2021. URL https://arxiv.org/abs/2103.00020.
+Sainandan Ramakrishnan, Aishwarya Agrawal, and Stefan Lee. Overcoming language priors in visual question answering with adversarial regularization. arXiv preprint arXiv:1810.03649, 2018.
+Ardi Roelofs. A spreading-activation theory of lemma retrieval in speaking. Cognition, 42(1-3): 107-142, 1992.
+Richard R Rosinski. Picture-word interference is semantically based. Child Development, pp. 643-647, 1977.
+Olivier Sigaud, Hugo Caseles-Dupré, Cédric Colas, Ahmed Akakzia, Pierre-Yves Oudeyer, and Mohamed Chetouani. Towards teachable autonomous agents. arXiv preprint arXiv:2105.11977, 2021.
+J Ridley Stroop. Studies of interference in serial verbal reactions. Journal of experimental psychology, 18(6):643, 1935.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017.
+Lev S Vygotsky. Thought and language. MIT press, 1934.
+Sandra R Waxman and Dana B Markow. Words as invitations to form categories: Evidence from 12-to 13-month-old infants. Cognitive psychology, 29(3):257-302, 1995.
+William E Winkler. String comparator metrics and enhanced decision rules in the fellegi-sunter model of record linkage. 1990.
+
+# A PREDICTION EXAMPLE FOR WORD-SUPERIMPOSED IMAGES.
+
+
+What is the superordinate category of the image?
+New prediction:
+electronic|99.81%
+Original prediction:
+
+
+(S/S)
+(B/S)
+What is the basic category of the image?
+New prediction:
+keyboard | 20.17%
+Original prediction:
+
+
+(S/B)
+What is the superordinate category of the image?
+New prediction:
+electronic | 45.91%
+Original prediction:
+
+
+(B/B)
+What is the basic
+category of the image?
+New prediction:
+laptop | 91.56%
+Original prediction:
+
+
+outdoor |
+$37.66\% \rightarrow 0.02\%$
+New prediction:
+electronic | 99.00%
+Original prediction:
+
+
+tulip
+89.31%→3.19%
+New prediction:
+dog | 50.97%
+Original prediction:
+
+
+outdoor |
+$37.66\% \rightarrow 15.61\%$
+New prediction:
+electronic $40.00\%$
+Original prediction:
+
+
+tulip |
+89.31% → 1.33%
+New prediction:
+laptop | 85.38%
+Original prediction:
+
+
+animal
+45.72% → 0.19%
+New prediction:
+electronic | 98.69%
+Original prediction:
+food |
+96.88%→0.53%
+Figure A1: Prediction example for word-superimposed images using the CLIP model (ViT-B/32). For each stimulus condition (S/S, B/S, S/B, and B/B in Figure 1), the "new prediction" indicates the image classification probability for the word-superimposed image. The original prediction means the image classification probability for no-word images. We also show the extent to which the original prediction changed with the word attachment.
+
+
+dog |
+$60.78\% \rightarrow 50.97\%$
+New prediction:
+laptop | 19.38%
+Original prediction:
+plate |
+40.00%→12.31%
+
+
+animal |
+45.72%→14.94%
+New prediction:
+food | 72.25%
+Original prediction:
+food |
+96.88%→72.25%
+
+
+dog |
+$60.78\% \rightarrow 4.46\%$
+New prediction:
+laptop | 93.00%
+Original prediction:
+plate |
+40.00% → 2.99%
+
+# B REPRESENTATIONAL SIMILARITY ANALYSIS USING WORD-SUPERIMPOSED IMAGES.
+
+
+original (no-word)
+
+
+electronic
+
+
+vehicle
+
+
+outdoor
+
+
+indoor
+
+
+accessory
+
+
+sports
+
+
+kitchen
+
+
+food
+
+
+furniture
+
+
+appliance
+
+
+Figure B1: Results of the RSA. In addition to the labels "animal" and "animal" in Figure 4, we show the results of other words. Based on the CLIP image encoder (ViT-B/32) outputs, we calculated the image-by-image representation dissimilarity matrices. Similar to the results of the word labels "animal" and "person," presenting words on the images did not affect the no-word representation in a category-selective way. These results are consistent with the finding in the main text, suggesting that semantic word representations in the CLIP image encoder are different from image representations.
+
+# C EVALUATION OF DIFFERENT IMAGE ENCODERS OF THE CLIP MODEL
+
+The image encoder of the CLIP pre-trained model is based on ResNets (He et al., 2016) or Vision Transformers (Vaswani et al., 2017). To explore the extent to which the language-biased image classification depends on the network architecture, we investigated the misclassification rate and the semantic relationship using various encoders in addition to a Vision Transformer model (ViT-B/32) used in the main text. Specifically, for the ResNets, we used a ResNet-50, a ResNet-101, and two models which follow EfficientNet-style model scaling (a ResNet 50x4 and a ResNet 50x16). For the Vision Transformer, we used a ViT-B/16 in addition to a ViT-B/32. We used the pre-trained CLIP networks using these architectures, which are shared by the previous work (Radford et al., 2021). The experimental procedure is the same as that of the main text.
+
+Figure C1 shows the results of misclassification rates for the CLIP models using various image encoders. Even when the other architectures were used for the image encoder training, the results were consistent with the performance of the ViT-B/32 version. The misclassification rate was high when the classification type was consistent with the superimposed word level (S/S and B/B). In addition, the CLIP models showed significant misclassification across different category conditions under the other conditions (S/B and B/S).
+
+The results of semantic similarity analysis and the RDA also did not depend on the architecture types (Figures C2 and C3, respectively). The semantic similarity analysis showed the median similarity of the label-switched images was not different from that of the unswitched images Figures C2 for all architectures. The RDA showed that the image encoder representation for no-word images changed with the architectures (Figures C3, first and fourth rows). However, the effect of attaching words did not change with the architecture. For all architectures, the overall dissimilarity across image-by-image pairs decreased for word-superimposed images, but the representation displacements were not selective to the original image representation.
+
+
+Figure C1: Results of misclassification rates for the CLIP models using various image encoders. The misclassification rate was plotted according to the stimulus condition (S/S, S/B, B/S, or B/B). Different color labels indicate different architectures.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure C2: Results of semantic similarity analysis for the CLIP model using various image encoders. The semantic similarity analysis of Figure 3 was conducted for the CLIP models with the image encoder of a ViT-B/32, ViT-B/16, ResNet-50x16, ResNet-50x4, ResNet-101, and ResNet-59. The results of the ViT-B/32 image encoder were replotted from Figure 3. Different color labels indicate different architectures. Each row shows the stimulus condition (S/S, B/S, S/B, or B/B).
+
+
+
+
+
+
+
+
+
+
+
+
+Figure C3: Results of the representational similarity analysis (RSA) for the CLIP model using various image encoders. The analysis method was the same as Figure 4, except that we also used the CLIP models with other image encoders than a ViT-B/32. The results of the ViT-B/32 image encoder were replotted from Figure 4.
+
+# D PROMPT DEPENDENCY OF LANGUAGE-BIASED IMAGE CLASSIFICATION
+
+
+(S/S)
+
+
+Prompt:"a photo of X"
+(B/S)
+
+
+(S/B)
+Prompt: "a text that says X"
+
+
+(B/B)
+
+
+(S/S)
+
+
+(B/S)
+
+
+(S/B)
+Figure D1: Results of semantic similarity analysis. The same analysis as Fig was conducted for different prompts shown in Table G1.
+
+
+(B/B)
+
+
+Prompt: "a red word label over a picture of a X"
+(S/S)
+
+
+(S/B)
+Prompt:" a photo of the word Y written in a red font over a picture of a X"
+
+
+(B/S)
+
+
+(B/B)
+
+
+(S/S)
+(S/B)
+
+
+(B/S)
+
+
+
+
+(B/B)
+
+# E PREDICTION PROBABILITY
+
+The prediction probability analysis indicates how label switching relies on the prediction confidence (i.e., the probability of the classified label in the label list) for no-word images and how the original prediction confidence decreases by presenting words. Figure E1 shows the results of the prediction probability analysis. Different panels show different stimulus conditions, as indicated in Figure 1. The original prediction means the probability for no-word images. In the figure, the original prediction is categorized into label-switched or unswitched conditions. The label-switched and unswitched conditions refer to if the original prediction is switched in the new prediction for word-superimposed images. The new prediction shows the probability of the label before and after adding the superimposed word, for the label-switched word-superimposed images.
+
+In the original prediction, the probabilities for the label-switched images were lower than those of the unswitched images. The trend was notable when the task type condition was inconsistent with the superimposed word category (the B/S and S/B conditions). These results suggest that picture-word interference is more effective when the original prediction is not confident. In addition, the original prediction probability drastically decreased in the new prediction for the word-superimposed image (two red plots in each panel of Figure E1). However, we must be aware that a label prediction probability depends on other label predictions and that it can be lower if the other label prediction is high. We show how the original image representation is changed/unchanged by presenting words in the next section. Furthermore, the prediction probability analysis showed that the new label confidence for the label-switched images (the blue plot in Figure E1) was high when the classification task type was consistent with the superimposed word category (the S/S and B/B conditions). This trend is consistent with the results of the label switching rate analysis.
+
+
+
+
+
+
+Figure E1: Results of the prediction probability analysis.
+
+
+
+F EFFECT OF PSEUDOWORD
+
+ | animal (control) | atipol | alipil | mzwxnmsczp |
| Label switching rates | 57.66 % | 26.64 % | 28.46 % | 18.25 % |
+
+Table F1: Label switching rate for nonsense pseudowords.
+
+
+
+
+
+
+
+
+Figure F1: Results of the representational analysis for nonsense pseudowords.
+
+
+
+
+
+We conducted an additional experiment using nonsense pseudowords and random words. We created two pseudowords from the word "animal" by a multilingual pseudoword generator, Wuggy (Keuleers & Brysbaert, 2010). We also used one random word used in a previous human study (Finkbeiner & Caramazza, 2006). Results showed that the label switching rate decreased for these words (Table G1). We also analyzed the RDM for the images on which these words were superimposed. Our results showed that when nonsense pseudo and random words were superimposed on the images, the effect of words on the representation was weaker than meaningful words. The finding suggests that presenting meaningful words on the images can be a factor affecting the representation of the image encoder.
+
+# G RELATIONSHIP BETWEEN SWITCHED LABEL PREDICTION AND SUPERIMPOSED WORDS
+
+ | S/S | B/S | S/B | B/B |
| Consistency rates | 99.28 % | 45.70 % | 36.30 % | 93.49 % |
+
+Table G1: Consistency rates between the switched labels and the superimposed words. We calculated the ratio that the switched labels and the superimposed words were consistent in the label-switched image. This table results from the prompt "a photo of X" using the ViT/32 image encoder. When the prediction category class is same as the superimposed word class (the S/S and B/B conditions), most switched labels were the same word as superimposed on the images (more than $90\%$ ) (e.g., a "dog" prediction for a superimposed word "dog"). When the prediction category class is different from the superimposed one (the S/S and B/B condition), parts of switched labels were the consistent category with superimposed words across different category levels (e.g., a "animal" prediction for a superimposed word "dog").
+
+# H RELATIONSHIP BETWEEN NO-WORD IMAGES AND WORD-SUPERIMPOSED IMAGES
+
+
+Figure H1: Relationship between no-word and word-superimposed images. We analyzed the representational dissimilarity matrices (RDMs) between no-word images and word-superimposed images for the CLIP image encoder (ViT/32). The vertical axis of each panel shows the no-word images, and the horizontal axis shows the word-superimposed images for the center and right panel. The left panel is the same as the no-word result in Figure 4. If the image encoder has a shared semantic representation for both the superimposed words and the images, the RDMs should show the category-specific similarity when the image category is consistent with the superimposed word. For instance, when the word "animal" is superimposed on the image, the similarity between the word-superimposed images and the animal images should be selectively high. However, results did not show any category-specific similarity, and the RDMs were similar even different words were superimposed. The results are consistent with that the CLIP image encoder has different representations of word forms from visual image representations.
+
+
+
+
\ No newline at end of file
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/images.zip b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..8cb1c75f3a6694e119609151454ed66f20f12221
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:087bc134dc37e1b006d6c29cade4d1d7f31483f5cc9e6ba49bbab37d9890387e
+size 1360894
diff --git a/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/layout.json b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5ed6c158a11ad0c7e3f1c5050313e8e07aea98c9
--- /dev/null
+++ b/languagebiasedimageclassificationevaluationbasedonsemanticrepresentations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7deca7f94f0b7dc6109e4bbdab92c98490eeb4309781924311f61b1c3f56dfa5
+size 615228
diff --git a/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_content_list.json b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4cb414121c9e24fce4d97d45f68ad53dc72a6b92
--- /dev/null
+++ b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a5198ef0b1c3a0febee88474e06485ee8e69eaf98677ed8e89ceec7b0accc001
+size 75872
diff --git a/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_model.json b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8905d3c119e37257501de072cc2fb1f5bc663bec
--- /dev/null
+++ b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:213758464f252add130df438a08f7ea473fb337b97aca0019983ce50bb492754
+size 94150
diff --git a/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_origin.pdf b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..22eb5c3d68d1dabc505a3b5825baefbd4910db4d
--- /dev/null
+++ b/languagedrivensemanticsegmentation/d554e1b2-bbd4-441a-b20c-7eeb005cc781_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:574767389bd361a71989b954c94003747497dbb12b5ab28cd5d4df5fb77f93ef
+size 3758689
diff --git a/languagedrivensemanticsegmentation/full.md b/languagedrivensemanticsegmentation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..e15fcbb04aae26af0ebbaba05aca46486f5cd750
--- /dev/null
+++ b/languagedrivensemanticsegmentation/full.md
@@ -0,0 +1,266 @@
+# LANGUAGE-DRIVEN SEMANTIC SEGMENTATION
+
+Boyi Li
+
+Cornell University, Cornell Tech
+
+Kilian Q. Weinberger
+
+Cornell University
+
+Serge Belongie
+
+University of Copenhagen
+
+Vladlen Koltun
+
+Apple
+
+René Ranftl
+
+Intel Labs
+
+# ABSTRACT
+
+We present LSeg, a novel model for language-driven semantic image segmentation. LSeg uses a text encoder to compute embeddings of descriptive input labels (e.g., "grass" or "building") together with a transformer-based image encoder that computes dense per-pixel embeddings of the input image. The image encoder is trained with a contrastive objective to align pixel embeddings to the text embedding of the corresponding semantic class. The text embeddings provide a flexible label representation in which semantically similar labels map to similar regions in the embedding space (e.g., "cat" and "furry"). This allows LSeg to generalize to previously unseen categories at test time, without retraining or even requiring a single additional training sample. We demonstrate that our approach achieves highly competitive zero-shot performance compared to existing zero- and few-shot semantic segmentation methods, and even matches the accuracy of traditional segmentation algorithms when a fixed label set is provided. Code and demo are available at https://github.com/isl-org/lang-seg.
+
+# 1 INTRODUCTION
+
+Semantic segmentation is a core problem in computer vision, with the aim of partitioning an image into coherent regions with their respective semantic class labels. Most existing methods for semantic segmentation assume a limited set of semantic class labels that can potentially be assigned to a pixel. The number of class labels is dictated by the training dataset and typically ranges from tens (Everingham et al., 2015) to hundreds (Zhou et al., 2019; Mottaghi et al., 2014) of distinct categories. As the English language defines several hundred thousand nouns (Li et al., 2020c), it is likely that the limited size of the label set severely hinders the potential recognition performance of existing semantic segmentation models.
+
+The main reason for the restricted label sets in existing methods is the cost of annotating images to produce sufficient training data. To create training datasets, human annotators must associate every single pixel in thousands of images with a semantic class label – a task that is extremely labor intensive and costly even with small label sets. The complexity of the annotation rises significantly as the number of labels increases since the human annotator has to be aware of the fine-grained candidate labels. Additionally, inter-annotator consistency becomes an issue when objects are present in an image that could fit multiple different descriptions or are subject to a hierarchy of labels.
+
+Zero- and few-shot semantic segmentation methods have been proposed as a potential remedy for this problem. Few-shot approaches (Shaban et al., 2017; Rakelly et al., 2018; Siam et al., 2019; Wang et al., 2019; Zhang et al., 2019; Nguyen & Todorovic, 2019; Liu et al., 2020b; Wang et al., 2020; Tian et al., 2020; Boudiaf et al., 2021; Min et al., 2021) offer ways to learn to segment novel classes based on only a few labeled images. However, these approaches still require labeled data that includes the novel classes in order to facilitate transfer. Zero-shot methods, on the other hand, commonly leverage word embeddings to discover or generate related features between seen and unseen classes (Bucher et al., 2019; Gu et al., 2020) without the need for additional annotations. Existing works in this space use standard word embeddings (Mikolov et al., 2013) and focus on the image encoder.
+
+In this work, we present a simple approach to leveraging modern language models to increase the flexibility and generality of semantic segmentation models. Our work is inspired by the CLIP model
+
+
+Figure 1: Example results. LSeg is able to handle unseen labels as well as label sets of arbitrary length and order. This enables flexible synthesis of zero-shot semantic segmentation models on the fly. From left to right, labels that are removed between runs are underlined, whereas labels that are added are marked in bold red.
+
+for image classification (Radford et al., 2021), which pairs high-capacity image and text encoders to produce robust zero-shot classifiers. We propose to use state-of-the-art text encoders that have been co-trained on visual data, such as CLIP, to embed labels from the training set into an embedding space and to train a visual encoder to produce per-pixel embeddings from an input image that are close to the corresponding label embeddings. Since the text encoder is trained to embed closely related concepts near one another (for example, "dog" is closer to "pet" than to "vehicle"), we can transfer the flexibility of the text encoder to the visual recognition module while only training on the restricted label sets that are provided by existing semantic segmentation datasets. An example is shown in Figure 1 (top row), where the model can successfully label pixels belonging to the class "pet" although the training set did not contain this label.
+
+Our approach enables the synthesis of zero-shot semantic segmentation models on the fly. That is, a user can arbitrarily expand, shrink, or reorder the label set for any image at test time. We further introduce an output module that can spatially regularize the predictions while maintaining this flexibility. We demonstrate several examples of the flexibility of our model in Figure 1. LSeg is able to output different segmentation maps based on the provided label set. For instance, in the last row, output (a) recognizes the chair and identifies all non-chair objects as "other" since these are the only two labels provided to the model. When labels are added, as in (b) and (c), the model is able to successfully segment other objects with the expanded label set.
+
+We conduct quantitative evaluation on a variety of zero- and few-shot semantic segmentation tasks. Our approach outperforms existing methods in zero-shot settings and is competitive across multiple few-shot benchmarks. Unlike the state-of-the-art baselines we compare to, our approach does not require additional training samples. Our experiments also show that introducing the text embeddings incurs only a negligible loss in performance when compared to standard fixed-label segmentation methods.
+
+# 2 RELATED WORK
+
+Generalized semantic segmentation. The majority of existing semantic segmentation models are restricted to a fixed label set that is defined by the labels that are present in the training dataset (Minaee et al., 2021). Few-shot semantic segmentation methods aim to relax the restriction of a fixed label set when one or a few annotated examples of novel classes are available at test time. These approaches
+
+learn to find reliable visual correspondences between a query image that is to be labeled and labeled support images that may contain novel semantic classes (Shaban et al., 2017; Rakelly et al., 2018; Siam et al., 2019; Wang et al., 2019; Zhang et al., 2019; Nguyen & Todorovic, 2019; Liu et al., 2020b; Wang et al., 2020; Tian et al., 2020; Wang et al., 2020; Tian et al., 2020; Boudiaf et al., 2021; Min et al., 2021). While this strategy can significantly enhance the generality of the resulting model, it requires the availability of at least one labeled example image with the target label set, something that is not always practical.
+
+Zero-shot semantic segmentation approaches aim to segment unseen objects without any additional samples of novel classes. Text embeddings of class labels play a central role in these works. Bucher et al. (2019) and Gu et al. (2020) propose to leverage word embeddings together with a generative model to generate visual features of unseen categories, while Xian et al. (2019) propose to project visual features into a simple word embedding space and to correlate the resulting embeddings to assign a label to a pixel. Hu et al. (2020) propose to use uncertainty-aware learning to better handle noisy labels of seen classes, while Li et al. (2020b) introduce a structured learning approach to better exploit the relations between seen and unseen categories. While all of these leverage text embeddings, our paper is, to the best of our knowledge, the first to show that it is possible to synthesize zero-shot semantic segmentation models that perform on par with fixed-label and few-shot semantic segmentation methods.
+
+A variety of solutions have been proposed (Zhang et al., 2020b; Liu et al., 2020a; Perera et al., 2020; Zhou et al., 2021) for open-set recognition (Scheirer et al., 2012; Geng et al., 2020). These aim to provide a binary decision about whether or not a given sample falls outside the training distribution, but do not aim to predict the labels of entirely new classes.
+
+Finally, a different line of work explores cross-domain adaptation methods for semantic segmentation by using feature alignment, self-training, and information propagation strategies (Yang et al., 2021; Wang et al., 2021). The target of these works is to enhance the transferability of models to novel visual domains, but they do not address the issue of a restricted label set. As such they are orthogonal to our work.
+
+Language-driven recognition. Language-driven recognition is an active area of research. Common tasks in this space include visual question answering (Antol et al., 2015), image captioning (Vinyals et al., 2014), and image-text retrieval (Li et al., 2020a). CLIP (Radford et al., 2021) demonstrated that classic recognition tasks that are not commonly associated with language can strongly benefit from language assistance. CLIP uses contrastive learning together with high-capacity language models and visual feature encoders to synthesize extremely robust models for zero-shot image classification. Recent works have extended this basic paradigm to perform flexible object detection. ViLD (Gu et al., 2021) introduces an advanced zero-shot object detection method that leverages CLIP, whereas MDETR (Kamath et al., 2021) proposes an end-to-end approach that modulates a transformer-based baseline detector with text features that are obtained from a state-of-the-art language model. Like CLIP, these works have shown that the robustness and generality of object detection models can be strongly improved by language assistance. Our work is inspired by these approaches and presents, to the best of our knowledge, the first approach to flexibly synthesize zero-shot semantic segmentation models by leveraging high-capacity language models.
+
+# 3 LANGUAGE-DRIVEN SEMANTIC SEGMENTATION
+
+Our approach, Language driven Semantic segmentation (LSeg) embeds text labels and image pixels into a common space, and assigns the closest label to each pixel. We illustrate the framework in Figure 2 and describe each part in detail below.
+
+Text encoder. The text encoder embeds the set of $N$ potential labels into a continuous vector space $\mathbb{R}^C$ , producing $N$ vectors $T_{1},\ldots ,T_{n}\in \mathbb{R}^{C}$ as outputs (blue vectors in Figure 2). Multiple network architectures are possible, and we use the pretrained Contrastive Language-Image Pre-training (CLIP) throughout (Radford et al., 2021). By design, the set of output vectors is invariant to the ordering of the input labels and allows their number, $N$ , to vary freely.
+
+Image encoder. Similar to the text encoder, the image encoder produces an embedding vector for every input pixel (after downsampling). We leverage dense prediction transformers (DPT) (Ranft
+
+
+Figure 2: Overview. A text encoder embeds labels into a vector space. An image encoder extracts per-pixel embeddings from the image and correlates the feature of each pixel to all label embeddings. The image encoder is trained to maximize the correlation between the text embedding and the image pixel embedding of the ground-truth class of the pixel. A final spatial regularization block spatially regularizes and cleans up the predictions.
+
+et al., 2021) as the underlying architecture. Assume $H \times W$ is the input image size and $s$ is a user-defined downsampling factor ( $s = 2$ in our implementation). We define $\tilde{H} = \frac{H}{s}$ , $\tilde{W} = \frac{W}{s}$ . The output is a dense embedding $I \in \mathbb{R}^{\tilde{H} \times \tilde{W} \times C}$ (green tensor in Figure 2). We refer to the embedding of pixel $(i,j)$ as $I_{ij}$ .
+
+Word-pixel correlation tensor. After the image and the labels are embedded, we correlate them by the inner product, creating a tensor of size $\tilde{H} \times \tilde{W} \times N$ (orange tensor in Figure 2), defined as
+
+$$
+f _ {i j k} = I _ {i j} \cdot T _ {k}. \tag {1}
+$$
+
+We refer to the $N$ -dimensional vector of inner products between the embedding of pixel $(i,j)$ and all $N$ words as $F_{ij} \in \mathbb{R}^N$ , where $F_{ij} = (f_{ij1}, f_{ij2}, \ldots, f_{ijk})^T$ . During training, we encourage the image encoder to provide pixel embeddings that are close to the text embedding of the corresponding ground-truth class. Specifically, given the text embeddings $T_k \in \mathbb{R}^C$ of $N$ labels and the image embedding $I_{ij} \in \mathbb{R}^C$ of pixel $i,j$ , we aim to maximize the dot product of the entry $f_{ijk}$ that corresponds to the ground-truth label $k = y_{ij}$ of pixel $i,j$ . We achieve this by defining a pixelwise softmax objective over the whole image:
+
+$$
+\sum_ {i, j = 1} ^ {H, W} \operatorname {s o f t m a x} _ {y _ {i j}} \left(\frac {F _ {i j}}{t}\right), \tag {2}
+$$
+
+where $t$ is a user-defined temperature parameter that we set to $t = 0.07$ (Wu et al., 2018; Radford et al., 2021). During training, we minimize a per-pixel softmax with cross-entropy loss (with temperature scaling) as is standard in semantic segmentation1.
+
+Spatial regularization. Due to memory constraints, the image encoder predicts pixel embeddings at lower resolution than the input image resolution. We use an additional post-processing module that spatially regularizes and upsamples the predictions to the original input resolution. During this process, we have to ensure that all operations stay equivariant with respect to the labels. In other words, there should be no interactions between the input channels, whose order is defined by the order of the words and can thus be arbitrary. We evaluate two functions that fulfill this property: a simple cascade of depthwise convolutions (Chollet, 2017) followed by non-linear activations (DepthwiseBlock), and another block that additionally augments the depthwise convolutions with the result of a max-pooling operation over the set of labels (BottleneckBlock) (Li et al., 2019). In a final step we use bilinear interpolation to recover predictions at the original resolution. We refer to these functions as "spatial regularization blocks" and illustrate them in Figure 3.
+
+Training details. We initialize the backbone of the image encoder with the official ImageNet pretrained weights from ViT (Dosovitskiy et al., 2021) or ResNet (He et al., 2016)2 and initialize the decoder of DPT randomly. During training we freeze the text encoder and only update the weights of the image encoder. We provide the full label set that is defined by each training set to the text encoder for each image.
+
+Our model can be trained on any semantic segmentation dataset and supports flexible mixing of multiple datasets through the text encoder. Existing semantic segmentation models assign a fixed channel in the output to represent
+
+the probability of a pixel being the corresponding semantic class. In contrast, our approach can dynamically handle label sets with varying length, content, and order. This property allows synthesizing arbitrary zero-shot semantic segmentation models by simply changing the labels that are fed to the text encoder.
+
+
+Figure 3: Illustration of BottleneckBlock and DepthwiseBlock.
+
+
+
+# 4 EXPERIMENTS
+
+We designed LSeg primarily for the zero-shot setting, where labels that are used for inference have never been seen during training. However, due to a lack of a standardized protocol and sufficient datasets and baselines for the zero-shot setting, we compare LSeg to zero- and few-shot semantic segmentation models on few-shot benchmarks. Note that few-shot methods have access to more information and are thus expected to yield higher accuracy. However, the need for labeled samples severely restricts their flexibility compared to our approach.
+
+# 4.1 EXPERIMENTAL SETUP
+
+We follow the protocol of the recent state-of-the-art few-shot method HSNet (Min et al., 2021) and evaluate on three widely-used few-shot semantic segmentation benchmarks: PASCAL-5 $^i$ (Everingham et al., 2015), COCO-20 $^i$ (Lin et al., 2014), and FSS-1000 (Li et al., 2020c). Following a standard protocol for few-shot segmentation, we use the mean intersection over union (mIoU) and foreground-background intersection of union (FB-IoU) as the evaluation metrics. The mIoU calculates the average IoU over all classes, FB-IoU computes mean value of foreground and background IoUs in fold $i$ and ignores the object classes.
+
+When not stated otherwise we use an LSeg model with the text encoder provided by CLIP-ViT-B/32 and leverage DPT with a ViT-L/16 backbone as the image encoder. For datasets that provide a background or unknown class, we set the corresponding background label to "other". We use SGD with momentum 0.9 and a polynomial learning rate scheduler with decay rate 0.9. We train with a batch size of 6 on six Quadro RTX 6000.
+
+# 4.2 PASCAL- $5^{i}$ AND COCO- $20^{i}$
+
+PASCAL-5 $^i$ and COCO-20 $^i$ are few-shot segmentation datasets that have been created from PASCAL VOC 2012 (Everingham et al., 2015) and the COCO dataset (Lin et al., 2014), respectively. PASCAL-5 $^i$ is composed of 20 object classes with corresponding mask annotations and has been evenly divided into 4 folds of 5 classes each. We denote different folds by $5^i$ , where $i \in \{0,1,2,3\}$ . Similarly, COCO-20 $^i$ is composed of 4 folds of 20 classes each.
+
+We compare LSeg to various state-of-the-art few-shot models: OSLSM (Shaban et al., 2017), CoFCN (Rakelly et al., 2018), AMP-2 (Siam et al., 2019), PANet (Wang et al., 2019), PGNet (Zhang et al., 2019), FWB (Nguyen & Todorovic, 2019), PPNet (Liu et al., 2020b), DAN (Wang et al., 2020), PFENet (Tian et al., 2020), RePRI (Boudiaf et al., 2021), and HSNet (Min et al., 2021). These few-shot methods propose strategies to segment unseen objects based on pretraining on seen categories and finetuning with a few images from the target class. In addition, we also compare
+
+| Model | Backbone | Method | 50 | 51 | 52 | 53 | mean | FB-IoU |
| OSLSM | VGG16 | 1-shot | 33.6 | 55.2 | 40.9 | 33.5 | 40.8 | 61.3 |
| co-FCN | 1-shot | 36.7 | 50.6 | 44.9 | 32.4 | 41.1 | 60.1 |
| AMP-2 | 1-shot | 41.9 | 50.2 | 46.7 | 34.7 | 43.4 | 61.9 |
| PANet | ResNet50 | 1-shot | 44.0 | 57.5 | 50.8 | 44.0 | 49.1 | - |
| PGNet | 1-shot | 56.0 | 66.9 | 50.6 | 50.4 | 56.0 | 69.9 |
| FWB | ResNet101 | 1-shot | 51.3 | 64.5 | 56.7 | 52.2 | 56.2 | - |
| PPNet | 1-shot | 52.7 | 62.8 | 57.4 | 47.7 | 55.2 | 70.9 |
| DAN | 1-shot | 54.7 | 68.6 | 57.8 | 51.6 | 58.2 | 71.9 |
| PFENet | 1-shot | 60.5 | 69.4 | 54.4 | 55.9 | 60.1 | 72.9 |
| RePRI | 1-shot | 59.6 | 68.6 | 62.2 | 47.2 | 59.4 | - |
| HSNet | 1-shot | 67.3 | 72.3 | 62.0 | 63.1 | 66.2 | 77.6 |
| SPNet | ResNet101 | zero-shot | 23.8 | 17.0 | 14.1 | 18.3 | 18.3 | 44.3 |
| ZS3Net | zero-shot | 40.8 | 39.4 | 39.3 | 33.6 | 38.3 | 57.7 |
| LSeg | ResNet101 | zero-shot | 52.8 | 53.8 | 44.4 | 38.5 | 47.4 | 64.1 |
| LSeg | ViT-L/16 | zero-shot | 61.3 | 63.6 | 43.1 | 41.0 | 52.3 | 67.0 |
+
+Table 1: Comparison of mIoU and FB-IoU (higher is better) on PASCAL-5 $^i$ .
+
+| Model | Backbone | Method | 200 | 201 | 202 | 203 | mean | FB-IoU |
| PPNet | ResNet50 | 1-shot | 28.1 | 30.8 | 29.5 | 27.7 | 29.0 | - |
| PMM | 1-shot | 29.3 | 34.8 | 27.1 | 27.3 | 29.6 | - |
| RPMM | 1-shot | 29.5 | 36.8 | 28.9 | 27.0 | 30.6 | - |
| RePRI | 1-shot | 32.0 | 38.7 | 32.7 | 33.1 | 34.1 | - |
| FWB | ResNet101 | 1-shot | 17.0 | 18.0 | 21.0 | 28.9 | 21.2 | - |
| DAN | 1-shot | - | - | - | - | 24.4 | 62.3 |
| PFENet | 1-shot | 36.8 | 41.8 | 38.7 | 36.7 | 38.5 | 63.0 |
| HSNet | 1-shot | 37.2 | 44.1 | 42.4 | 41.3 | 41.2 | 69.1 |
| ZS3Net | ResNet101 | zero-shot | 18.8 | 20.1 | 24.8 | 20.5 | 21.1 | 55.1 |
| LSeg | ResNet101 | zero-shot | 22.1 | 25.1 | 24.9 | 21.5 | 23.4 | 57.9 |
| LSeg | ViT-L/16 | zero-shot | 28.1 | 27.5 | 30.0 | 23.2 | 27.2 | 59.9 |
+
+Table 2: Comparison of mIoU and FB-IoU (higher is better) on COCO- ${20}^{i}$ .
+
+to the competitive zero-shot baseline ZS3Net (Bucher et al., 2019), which adopts the DeepLabv3+ framework and to Xian et al. (2019) which leverages DeepLabv2. We follow their official code, training setting and training steps on the basis of their provided model pretrained on ImageNet (Deng et al., 2009). We follow the common experimental setup (Nguyen & Todorovic, 2019) and conduct cross-validation over all folds. Assuming that $n_i$ is the number of classes in fold $i$ , for each fold $i$ , we use images of other folds for training and randomly sampled 1000 images of target fold $i$ for evaluation. We show PASCAL-5 $^i$ and COCO-20 $^i$ results in Tables 1 and 2. Our model (with the same ResNet101 backbone) outperforms the zero-shot baseline by a considerable margin across folds and datasets and is even competitive with several few-shot methods. We also observe an obvious edge of LSeg by using a larger backbone (ViT-L/16).
+
+# 4.3 FSS-1000
+
+FSS-1000 (Li et al., 2020c) is a recent benchmark dataset for few-shot segmentation. It consists of 1000 object classes with pixelwise annotated segmentation masks. It contains a significant number of unseen or unannotated objects in comparison to previous datasets such as PASCAL and COCO. Following the standard protocol, we split the 1000 classes into training, validation, and test classes, with 520, 240, and 240 classes, respectively. We use a base learning rate of 0.05 and train the model for 60 epochs.
+
+Table 3 compares our approach to state-of-the-art few-shot models. Notably, under the same ResNet101, LSeg could achieve comparative results of the state-of-the-art one-shot method. Also, LSeg even outperforms a state-of-the-art one-shot method: $87.8\mathrm{mIoU}$ (ours) vs. 86.5 mIoU (HSNet) with a larger backbone ViT-L/16, indicating that LSeg generalizes very well to unseen categories. Figure 4 shows examples of segmentation results on unseen categories.
+
+| Model | Backbone | Method | mIoU |
| OSLSM | VGG16 | 1-shot | 70.3 |
| GNet | 1-shot | 71.9 |
| FSS | 1-shot | 73.5 |
| DoG-LSTM | 1-shot | 80.8 |
| DAN | ResNet101 | 1-shot | 85.2 |
| HSNet | 1-shot | 86.5 |
| LSeg | ResNet101 | zero-shot | 84.7 |
| LSeg | ViT-L/16 | zero-shot | 87.8 |
+
+
+Figure 4: LSeg zero-shot semantic segmentation results on unseen categories of FSS-1000 dataset.
+
+# 5 EXPLORATION AND DISCUSSION
+
+# 5.1 ABLATION STUDIES
+
+We further empirically explore various properties of LSeg. We conduct experiments on the ADE20K dataset (Zhou et al., 2019), which is a standard semantic segmentation dataset that includes a diversity of images and provides pixelwise segmentation of 150 different categories. We set the base learning rate to 0.004 and train the model for 240 iterations. We use SGD with momentum 0.9 and a polynomial learning rate scheduler with decay rate 0.9. We use LSeg with DPT and a smaller ViT-B/32 backbone together with the CLIP ViT-B/32 text encoder unless stated otherwise.
+
+Spatial regularization blocks. We first conduct an ablation study on the two variants of the spatial regularization blocks for cleaning up the output. We ablate the different types of blocks as well as stacking various numbers of blocks ( $N \in [0,1,2,4]$ ). The results are shown in Table 4. We notice that a consistent improvement can be achieved by adding a few regularization blocks. The strongest improvement is achieved by stacking two BottleneckBlocks, an addition to the architecture that incurs little overhead.
+
+Text encoders. LSeg supports arbitrary text encoders in principle. We show the influence of using different text encoders in Table 5, where we ablate various encoders that are provided by the CLIP
+
+Table 3: Comparison of mIoU on FSS-1000.
+
+| Block Type | Metric | # depth |
| 0 | 1 | 2 | 4 |
| DepthwiseBlock | pixAcc [%] | 79.70 | 79.72 | 79.78 | 7.67 |
| mIoU [%] | 37.83 | 39.19 | 39.45 | 0.18 |
| pixAcc [%] | 79.70 | 79.64 | 79.70 | 79.68 |
| BottleneckBlock | mIoU [%] | 37.83 | 39.16 | 39.79 | 38.78 |
+
+Table 4: Ablation study on the depth of BottleneckBlock and DepthwiseBlock before the last layer. For both Pixel Accuracy (pixAcc) and mIoU, higher is better. For depth=1, we directly feed the output to reshape without activation.
+
+zero-shot image classification model (Radford et al., 2021). Note that all text encoders feature the same transformer-based architecture that purely operates on text. The main difference between the encoders is the image encoder that was paired during CLIP pretraining (for example, the text encoder denoted by "ViT-B/32" was trained in conjunction with a ViT-B/32 image encoder) and the size of the embedding dimension.
+
+We observe that using $\mathrm{RN}50\times 16$ achieves the best performance among all text encoders and surpasses the weakest ViT-B/32 text encoder by $2.5\%$ . We conjecture that this is because of the larger size of the embedding that is provided by this encoder.
+
+Comparison on a fixed label set. Language assistance helps boost the recognition performance on unannotated or unseen classes. However, there might be a concern that this flexibility hurts the performance on tasks that have a fixed label set. To test this, we train LSeg on ADE20K using the standard protocol on this dataset, where the training and test labels are fixed (that is, there are no unseen class labels at test time). We compare the results to highly competitive standard semantic segmentation models, including OCNet (Yuan et al., 2020), ACNet (Fu et al., 2019), DeeplabV3 (Chen et al., 2017; Zhang et al., 2020a), and DPT (Ranftl et al., 2021). The results are listed in Table 6. We find that LSeg performs competitively when using the $\mathrm{RN}50\times 16$ text encoder and incurs only a negligible loss in performance when compared to the closest fixed-label segmentation method (DPT).
+
+# 5.2 QUALITATIVE FINDINGS
+
+We finally train LSeg on a mix of 7 different datasets (Lambert et al., 2020), including ADE20K (Zhou et al., 2019), BDD (Yu et al., 2020), Cityscapes (Cordts et al., 2016), COCO-Panoptic (Lin et al., 2014; Caesar et al., 2018), IDD (Varma et al., 2019), Mapillary Vistas (Neuhold et al., 2017), and SUN RGBD (Song et al., 2015). Note that we train our model on the original label sets that are provided by these datasets without any preprocessing or relabeling. We follow the same training protocol as on ADE20K and train LSeg with a ViT-L/16 backbone and a ViT-B/32 text encoder for 200 epochs with a base learning rate of 0.004. If there are multiple labels for one class, we only use the first label that is provided during training. We select images from the web and show the results in Figure 5 to illustrate the use of the resulting model.
+
+Related but previously unseen labels. We illustrate some salient examples of the capabilities of LSeg to generalize to new classes in Figure 5(a). In the first row, on the left we first start with the label set "sky", "road", "house", and "plant", and observe that the model is capable of segmenting the image into the provided classes. We then change the label "house" to "building" and the label "plant" to "greenery". The model produces a similar segmentation as before on this different but semantically related label set. This is despite the fact that the label "greenery" or even "green" was not present in any of the training images. A similar effect is shown in the second row, where LSeg successfully
+
+| Method | Backbone | Text Encoder (fixed) | embedding dimension | pixAcc [%] | mIoU [%] |
| LSeg | ViT-B/32 | ViT-B/32 | 512 | 79.70 | 37.83 |
| LSeg | ViT-B/32 | ViT-B/16 | 512 | 79.77 | 38.69 |
| LSeg | ViT-B/32 | RN50 × 4 | 640 | 79.85 | 38.93 |
| LSeg | ViT-B/32 | RN50 × 16 | 768 | 80.26 | 40.36 |
+
+Table 5: Ablation study on LSeg with fixed text encoders of different CLIP pretrained models.
+
+| Method | Backbone | Text Encoder | pixAcc [%] | mIoU [%] |
| OCNet | ResNet101 | - | - | 45.45 |
| ACNet | ResNet101 | - | 81.96 | 45.90 |
| DeeplabV3 | ResNeSt101 | - | 82.07 | 46.91 |
| DPT | ViT-L/16 | - | 82.70 | 47.63 |
| LSeg | ViT-L/16 | ViT-B/32 | 82.46 | 46.28 |
| LSeg | ViT-L/16 | RN50 × 16 | 82.78 | 47.25 |
+
+Table 6: Comparison of semantic segmentation results on the ADE20K validation set. For LSeg, we conduct experiments with fixed text encoders of ViT-B/32 and $\mathrm{RN}50\times 16$ CLIP pretrained models.
+
+
+Figure 5: LSeg examples with related but previously unseen labels, and hierarchical labels. Going from left to right, labels that are removed between runs are underlined, whereas labels that are added are marked in bold red.
+
+segments the image and correctly assigns the labels "cake" or "dessert" (again, the label "dessert" was not seen during training), while successfully suppressing the label "bread" which is both visually and semantically related.
+
+Hierarchical unseen labels. Figure 5(b) demonstrates that LSeg can implicitly provide correct segmentation maps for hierarchies of labels. In the first row, the model is able to recognize the "cat", "plant" and "grass" segments of the image, as expected since these labels are present in the training set. When replacing "cat" with the label "furry", we notice that the model is able to successfully recognize this parent category (that is, most cats are furry, but not all furry objects are cats). Similarly, when removing the label "grass", we notice that the original "grass" region is merged into "plant", again an indication of an implicit hierarchy that is afforded by the flexibility of the text embeddings. The second row illustrates a similar scenario, where LSeg recognizes the sofa and other objects. However, the small shelf on the left is segmented as the unknown category "other". When we change "sofa" to "furniture", LSeg successfully identifies both the sofa and the small shelf as "furniture". Note that "furniture" never appeared in the training label set.
+
+Failure cases. While LSeg in general achieves very promising results, we also observe some failure cases, as illustrated in Figure 6. The left image illustrates that LSeg is only trained with positive samples from a class. When the test-time input labels do not contain any of the true labels for the corresponding pixel, the model assigns the highest probability to the closest label in the text embedding space. In this specific example, the model assigns the label "toy" since
+
+
+(a)
+Figure 6: Failure cases.
+
+
+(b)
+
+the visual features of the dog are apparently closer to "toy" than to "grass" in the embedding space and there is no other label that can explain the visual features. A second failure case is shown on the right, where the model focuses on a single most likely object when multiple explanations are consistent with the label set. In this specific example, the windows of the house are labeled as "house" instead of window, even thought the label "window" is available as a choice. We hope that these failure cases can inform future work, which could involve augmenting training with negative samples or building fine-grained language-driven semantic segmentation models that can potentially assign multiple labels when multiple explanations fit the data well.
+
+# 6 CONCLUSION
+
+We introduced LSeg, a novel method and architecture for training language-driven semantic segmentation models. LSeg enables a flexible label representation that maps semantically similar labels to similar regions in an embedding space and learns to correlate visual concepts in this space to produce semantic segmentations. Our formulation enables the synthesis of zero-shot semantic segmentation models with arbitrary label sets on the fly. Our empirical results show that the resulting models are strong baselines for zero-shot semantic segmentation and can even rival few-shot segmentation models while not sacrificing accuracy on existing fixed label sets.
+
+# ACKNOWLEDGEMENT
+
+This work was supported in part by the Pioneer Centre for AI, DNRF grant number P1. KQW is supported by grants from the National Science Foundation NSF (IIS-2107161, III-1526012, IIS-1149882, and IIS-1724282), the Cornell Center for Materials Research with funding from the NSF MRSEC program (DMR-1719875), and SAP America.
+
+# ETHICS STATEMENT
+
+We proposed a novel approach to solve the generalized semantic segmentation problem. We use public computer vision datasets and leverage pretrained language models for our experiments. We do not believe that our code or method are inherently subject to concerns of discrimination / bias / fairness, inappropriate potential applications, impact, privacy and security issues, legal compliance, research integrity or research practice issues. However, image datasets and language models may be subject to bias that may be inherited by models trained with our approach.
+
+# REPRODUCIBILITY
+
+Our code is reproducible and can be implemented based on the method description in Section 3 as well as training details in Section 4 and 5. We provide an interactive demo for people to try with input images of their choosing.
+
+# REFERENCES
+
+Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: Visual Question Answering. In International Conference on Computer Vision, 2015.
+Malik Boudiaf, Hoel Kervadec, Ziko Imtiaz Masud, Pablo Piantanida, Ismail Ben Ayed, and Jose Dolz. Few-shot segmentation without meta-learning: A good transductive inference is all you need? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13979-13988, 2021.
+Maxime Bucher, Tuan-Hung Vu, Matthieu Cord, and Patrick Pérez. Zero-shot semantic segmentation. Advances in Neural Information Processing Systems, 32:468-479, 2019.
+Holger Caesar, Jasper Uijlings, and Vittorio Ferrari. Coco-stuff: Thing and stuff classes in context. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1209-1218, 2018.
+Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017.
+François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1251-1258, 2017.
+Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3213-3223, 2016.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
+M. Everingham, S. M. A. Eslami, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The Pascal visual object classes challenge: A retrospective. International Journal of Computer Vision, 111(1):98-136, January 2015.
+Jun Fu, Jing Liu, Yuhang Wang, Yong Li, Yongjun Bao, Jinhui Tang, and Hanqing Lu. Adaptive context network for scene parsing. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6748-6757, 2019.
+
+Chuanxing Geng, Sheng-jun Huang, and Songcan Chen. Recent advances in open set recognition: A survey. IEEE transactions on pattern analysis and machine intelligence, 2020.
+Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. Zero-shot detection via vision and language knowledge distillation. arXiv preprint arXiv:2104.13921, 2021.
+Zhangxuan Gu, Siyuan Zhou, Li Niu, Zihan Zhao, and Liqing Zhang. Context-aware feature generation for zero-shot semantic segmentation. In ACM International Conference on Multimedia, 2020.
+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.
+Ping Hu, Stan Sclaroff, and Kate Saenko. Uncertainty-aware learning for zero-shot semantic segmentation. In Advances in Neural Information Processing Systems, 2020.
+Aishwarya Kamath, Mannat Singh, Yann LeCun, Ishan Misra, Gabriel Synnaeve, and Nicolas Carion. Mdetr-modulated detection for end-to-end multi-modal understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021.
+John Lambert, Zhuang Liu, Ozan Sener, James Hays, and Vladlen Koltun. Mseg: A composite dataset for multi-domain semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2879-2888, 2020.
+Boyi Li, Felix Wu, Kilian Q Weinberger, and Serge Belongie. Positional normalization. In Advances in Neural Information Processing Systems, pp. 1620-1632, 2019.
+Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In AAAI, 2020a.
+Peike Li, Yunchao Wei, and Yi Yang. Consistent structural relation learning for zero-shot segmentation. Advances in Neural Information Processing Systems, 33, 2020b.
+Xiang Li, Tianhan Wei, Yau Pun Chen, Yu-Wing Tai, and Chi-Keung Tang. Fss-1000: A 1000-class dataset for few-shot segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2869-2878, 2020c.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740-755. Springer, 2014.
+Bo Liu, Hao Kang, Haoxiang Li, Gang Hua, and Nuno Vasconcelos. Few-shot open-set recognition using meta-learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8798-8807, 2020a.
+Yongfei Liu, Xiangyi Zhang, Songyang Zhang, and Xuming He. Part-aware prototype network for few-shot semantic segmentation. In European Conference on Computer Vision, pp. 142-158. Springer, 2020b.
+Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. In Yoshua Bengio and Yann LeCun (eds.), 1st International Conference on Learning Representations, ICLR 2013, Scottsdale, Arizona, USA, May 2-4, 2013, Workshop Track Proceedings, 2013. URL http://arxiv.org/abs/1301.3781.
+Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021.
+Shervin Minaee, Yuri Y Boykov, Fatih Porikli, Antonio J Plaza, Nasser Kehtarnavaz, and Demetri Terzopoulos. Image segmentation using deep learning: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021.
+Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille. The role of context for object detection and semantic segmentation in the wild. In IEEE Conference on Computer Vision and Pattern Recognition, 2014.
+Gerhard Neuhold, Tobias Ollmann, Samuel Rota Bulo, and Peter Kontschieder. The mapillary vistas dataset for semantic understanding of street scenes. In Proceedings of the IEEE international conference on computer vision, pp. 4990-4999, 2017.
+Khoi Nguyen and Sinisa Todorovic. Feature weighting and boosting for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 622-631, 2019.
+
+Pramuditha Perera, Vlad I Morariu, Rajiv Jain, Varun Manjunatha, Curtis Wigington, Vicente Ordonez, and Vishal M Patel. Generative-discriminative feature representations for open-set recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11814-11823, 2020.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning, pp. 8748-8763, 2021.
+Kate Rakelly, Evan Shelhamer, Trevor Darrell, Alyosha Efros, and Sergey Levine. Conditional networks for few-shot semantic segmentation. In International Conference on Learning Representations Workshop, 2018.
+René Ranftl, Alexey Bochkovskiy, and Vladlen Koltun. Vision transformers for dense prediction. In The IEEE International Conference on Computer Vision, 2021.
+Walter J Scheirer, Anderson de Rezende Rocha, Archana Sapkota, and Terrance E Boult. Toward open set recognition. IEEE transactions on pattern analysis and machine intelligence, 35(7):1757-1772, 2012.
+Amirreza Shaban, Shray Bansal, Zhen Liu, Irfan Essa, and Byron Boots. One-shot learning for semantic segmentation. In *British Machine Vision Conference*, 2017.
+Mennatullah Siam, Boris N Oreshkin, and Martin Jagersand. Amp: Adaptive masked proxies for few-shot segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5249-5258, 2019.
+Shuran Song, Samuel P Lichtenberg, and Jianxiong Xiao. Sun rgb-d: A rgb-d scene understanding benchmark suite. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 567-576, 2015.
+Zhuotao Tian, Hengshuang Zhao, Michelle Shu, Zhicheng Yang, Ruiyu Li, and Jiaya Jia. Prior guided feature enrichment network for few-shot segmentation. IEEE Transactions on Pattern Analysis & Machine Intelligence, (01):1-1, 2020.
+Girish Varma, Anbumani Subramanian, Anoop Namboodiri, Manmohan Chandraker, and CV Jawahar. Idd: A dataset for exploring problems of autonomous navigation in unconstrained environments. In 2019 IEEE Winter Conference on Applications of Computer Vision, pp. 1743-1751. IEEE, 2019.
+Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. CoRR, abs/1411.4555, 2014. URL http://arxiv.org/abs/1411.4555.
+Haochen Wang, Xudong Zhang, Yutao Hu, Yandan Yang, Xianbin Cao, and Xiantong Zhen. Few-shot semantic segmentation with democratic attention networks. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIII 16, pp. 730-746. Springer, 2020.
+Kaixin Wang, Jun Hao Liew, Yingtian Zou, Daquan Zhou, and Jiashi Feng. Panet: Few-shot image semantic segmentation with prototype alignment. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9197-9206, 2019.
+Yuxi Wang, Jian Liang, and Zhaoxiang Zhang. Give me your trained model: Domain adaptive semantic segmentation without source data. arXiv preprint arXiv:2106.11653, 2021.
+Zhirong Wu, Yuanjun Xiong, Stella Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance-level discrimination. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3733-3742, 2018.
+Yongqin Xian, Subhabrata Choudhury, Yang He, Bernt Schiele, and Zeynep Akata. Semantic projection network for zero-and few-label semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8256-8265, 2019.
+Jinyu Yang, Chunyuan Li, Weizhi An, Hehuan Ma, Yuzhi Guo, Yu Rong, Peilin Zhao, and Junzhou Huang. Exploring robustness of unsupervised domain adaptation in semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021.
+Fisher Yu, Haofeng Chen, Xin Wang, Wenqi Xian, Yingying Chen, Fangchen Liu, Vashisht Madhavan, and Trevor Darrell. Bdd100k: A diverse driving dataset for heterogeneous multitask learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2636-2645, 2020.
+Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part VI 16, pp. 173-190. Springer, 2020.
+
+Chi Zhang, Guosheng Lin, Fayao Liu, Jiushuang Guo, Qingyao Wu, and Rui Yao. Pyramid graph networks with connection attentions for region-based one-shot semantic segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9587-9595, 2019.
+Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li, and Alexander Smola. Resnest: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020a.
+Hongjie Zhang, Ang Li, Jie Guo, and Yanwen Guo. Hybrid models for open set recognition. In European Conference on Computer Vision, pp. 102-117. Springer, 2020b.
+Bolei Zhou, Hang Zhao, Xavier Puig, Tete Xiao, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 127(3): 302-321, 2019.
+Da-Wei Zhou, Han-Jia Ye, and De-Chuan Zhan. Learning placeholders for open-set recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4401-4410, 2021.
\ No newline at end of file
diff --git a/languagedrivensemanticsegmentation/images.zip b/languagedrivensemanticsegmentation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e3968fd345d3b114c71e543ae6ea0858a9862f6f
--- /dev/null
+++ b/languagedrivensemanticsegmentation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:afd041b8f1eab92e39703a77b4b35e66abf5e19406f9ad6fe0c9db095d6767b0
+size 535876
diff --git a/languagedrivensemanticsegmentation/layout.json b/languagedrivensemanticsegmentation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2106bbad73f57f9b1954563abb7766a89a405471
--- /dev/null
+++ b/languagedrivensemanticsegmentation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67608e7fad3c310c91041f4e705eef14e86440e180dcd890b6e21e6b3181fe8e
+size 341561
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_content_list.json b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..863950a1141af85a75bd67193fb60f6803ff39ac
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c34287b9a5743c7d7aa59525795f0eedbfceb8bf29e4e1503597b19226eaa3b
+size 79845
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_model.json b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..ded671f6eb156fce00522b07139ce7696a1a16dc
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6dc2ff085b26d057a633bb0b86b948374b5ffa436e774079f2a9850a255d2f05
+size 98464
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_origin.pdf b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..2f15923e9debe2ae34912e88b289dfb2bd6629f6
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/ca79b010-f8cf-4f29-a509-552578b25972_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:58f4545888db5f01a01625f6733be362faeb64a2f153d9b7df4cccb2ec6414e7
+size 1207909
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/full.md b/languagemodelcompressionwithweightedlowrankfactorization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..026040a2893a8a987f7c97ab166b97446fe3123c
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/full.md
@@ -0,0 +1,325 @@
+# LANGUAGE MODEL COMPRESSION WITH WEIGHTED LOW-RANK FACTORIZATION
+
+Yen-Chang Hsu\*1, Ting Hua\*1, Sung-En Chang2, Qian Lou1, Yilin Shen1, and Hongxia Jin1
+
+1Samsung Research America, 2Northeastern University,
+
+{yenchang.hsu, ting.hua, qian.lou, yilin.shen, hongxia.jin}@samsung.com,{chang.sun}@northeastern.edu
+
+# ABSTRACT
+
+Factorizing a large matrix into small matrices is a popular strategy for model compression. Singular value decomposition (SVD) plays a vital role in this compression strategy, approximating a learned matrix with fewer parameters. However, SVD minimizes the squared error toward reconstructing the original matrix without gauging the importance of the parameters, potentially giving a larger reconstruction error for those who affect the task accuracy more. In other words, the optimization objective of SVD is not aligned with the trained model's task accuracy. We analyze this previously unexplored problem, make observations, and address it by introducing Fisher information to weigh the importance of parameters affecting the model prediction. This idea leads to our method: Fisher-Weighted SVD (FWSVD). Although the factorized matrices from our approach do not result in smaller reconstruction errors, we find that our resulting task accuracy is much closer to the original model's performance. We perform analysis with the transformer-based language models, showing our weighted SVD largely alleviates the mismatched optimization objectives and can maintain model performance with a higher compression rate. Our method can directly compress a task-specific model while achieving better performance than other compact model strategies requiring expensive model pre-training. Moreover, the evaluation of compressing an already compact model shows our method can further reduce $9\%$ to $30\%$ parameters with an insignificant impact on task accuracy.
+
+# 1 INTRODUCTION
+
+Language models built with transformers (Devlin et al., 2018) have attained extensive success in natural language tasks such as language modeling (Radford et al., 2018), text classification (Wang et al., 2018), question answering (Rajpurkar et al., 2016), and summarization (Liu, 2019). The success is achieved by fine-tuning a big transformer model pre-trained with a large corpus. The target task for fine-tuning may only focus on a restricted scenario such as sentiment analysis (Socher et al., 2013) and multiple-choice question inference (Zellers et al., 2018). Having a big transformer model is often overkill for the target task and prohibits the model deployment to resource-constrained hardware. Therefore, language model compression raises immense interest.
+
+The popular strategy creates a compact model from scratch (Jiao et al., 2019) or a subset of the big model's layers (Sun et al., 2019; Sanh et al., 2019), then pre-trains with a large corpus and distills knowledge from the big model. This process is called generic pre-training (Wang et al., 2020b; Sun et al., 2019; Sanh et al., 2019) and is necessary for a compact model to achieve good performance on the target tasks. However, the generic pre-training could still cost considerable computational resources. For example, it takes 384 NVIDIA V100 GPU hours to get the pre-trained TinyBERT (Jiao et al., 2019) on the Wiki corpus dataset. So it may not be affordable for everyone who wants to create a compact model. In contrast, another line of strategy, specifically low-rank factorization (Golub & Reinsch, 1971; Noach & Goldberg, 2020), can potentially reduce a big model's parameters
+
+without the generic pre-training. Since the factorization aims to approximate the learned model parameters, the method has the nature of directly inheriting the knowledge of the big trained model.
+
+However, approximating the learned weights with standard factorization often loses most of the task performance. This work investigates this issue with the most popular strategy, which uses singular value decomposition (SVD) to compress the learned model weights. With SVD, the learned matrix is factorized into three matrices $(U,S,V)$ . The portion associated with small singular values will be truncated to produce a smaller version of factorized matrices. The multiplication of these smaller matrices will approximate the original one with fewer total parameters to achieve the model compression. In other words, SVD minimizes the reconstruction error with fewer parameters as its objective. However, this objective does not necessarily correlate to the ultimate goal of keeping task performance. Specifically, the SVD algorithm is biased to reconstruct the parameters associated with large singular values. As a result, the parameters mainly reconstructed by the ranks with small singular values will become the victim in the compression process. Are these victimized parameters less critical to achieving a good task performance? We argue that this is not true, and the optimization objective of SVD is not properly aligned with the target task objective. This paper is the first work to provide an empirical analysis of this issue, proposing a novel weighted SVD to mitigate it.
+
+Our weighted SVD addresses the above issue by assigning importance scores to the parameters. This score has to correlate to how much the task performance is affected by the parameter change. The Fisher information nicely fits into this purpose (Pascanu & Bengio, 2014). Besides, the calculation of Fisher information is usually simplified to accumulating a parameter's squared gradient over the training dataset based on its task objective (e.g. cross-entropy, regression error, etc.), conveniently providing the importance of each parameter in a model. Then we modify the optimization objective of factorization (i.e., reconstruction error) by multiplying it with Fisher information, providing a new objective that jointly considers matrix reconstruction error and the target task objective.
+
+In summary, this work makes the following contributions: (1) we analyze the issue of mismatched objectives between factorization and the target task for model compression; (2) we propose a novel compression strategy with the SVD weighted by the Fisher information; (3) we perform extensive analysis on varied language tasks, showing our Fisher-weighted SVD can compress an already compact model, and it can achieve comparable compression rate and performance with methods that require an expensive generic model pre-training.
+
+# 2 BACKGROUND
+
+# 2.1 MODEL COMPRESSION WITH LOW-RANK APPROXIMATION
+
+Given a matrix $W \in \mathbb{R}^{N \times M}$ , the low-rank approximation is achieved via singular value decomposition (SVD):
+
+$$
+W \approx U S V ^ {T}, \tag {1}
+$$
+
+where $U \in \mathbb{R}^{N \times r}$ , $V \in \mathbb{R}^{M \times r}$ , and $k$ is the rank of matrix $W$ . $S$ is a diagonal matrix of nonzero singular values $\text{diag}(\sigma_1, \ldots, \sigma_r)$ , where $\sigma_1 \geq \sigma_2 \geq \dots \geq \dots \geq \dots \geq \sigma_k > 0$ . The low-rank approximation with targeted rank $r$ is obtained by setting zeros to $\sigma_{r+1}, \ldots, \sigma_k$ .
+
+Given input data $X \in \mathbb{R}^{1 \times N}$ , a linear layer in neural networks is represented below with the weight matrix $W \in \mathbb{R}^{N \times M}$ and bias $b \in \mathbb{R}^{1 \times M}$ :
+
+$$
+Z = X W + b \approx (X U S) V ^ {T} + b. \tag {2}
+$$
+
+Factorizing $W$ with Equation (1) leads to Equation (2), which can be implemented with two smaller linear layers: 1) The first layer has $Nr$ parameters without bias. Its weight matrix is $US$ . 2) The second layer has $Mr$ parameters plus bias. Its weight matrix and bias are $V$ and $b$ , correspondingly. The total number of parameters for approximating $W$ is $Nr + Mr$ . In the case of full rank matrix and $M = N$ , the model size is reduced when $r < 0.5N$ . For example, if we set $r$ to reserve the largest $30\%$ singular values, the method will reduce about $40\%$ of the parameters from $W$ . In general, the reduced size will be $NM - (Nr + Mr)$ .
+
+Low rank approximation in neural networks has been extensively studied (Jaderberg et al., 2014; Zhang et al., 2015; Denton et al., 2014). In more recent works, SVD is often applied to compress the word embedding layer (Chen et al., 2018a; Acharya et al., 2019). Noach & Goldberg (2020)
+
+applies SVD to the transformer layers, but it does not investigate why SVD gives a very poor result without fine-tuning. Our work explores this issue and provides a weighted version to address it.
+
+# 2.2 FISHER INFORMATION
+
+The Fisher information measures the amount of information that an observable dataset $D$ carries about a model parameter $w$ . The computation of its exact form is generally intractable since it requires marginalizing over the space of $D$ , which includes data and its labels. Therefore, most of the previous works estimate its empirical Fisher information:
+
+$$
+I _ {w} = E \left[ \left(\frac {\partial}{\partial w} \log p (D | w)\right) ^ {2} \right] \approx \frac {1}{| D |} \sum_ {i = 1} ^ {| D |} \left(\frac {\partial}{\partial w} \mathcal {L} \left(d _ {i}; w\right)\right) ^ {2} = \hat {I} _ {w}. \tag {3}
+$$
+
+The estimated information $\hat{I}_w$ accumulates the squared gradients over the training data $d_i \in \mathcal{D}$ , where $\mathcal{L}$ is the target task objective (e.g., cross-entropy for a classification task, or mean squared error for a regression task). This approximation provides a straight intuition: the parameters that change the task objective with a large absolute gradient are important to the target task; therefore, those parameters should be reconstructed better than others in the compression process.
+
+The above estimation of Fisher information computes only the first-order derivatives and has been shown to measure the importance of parameters effectively. Kirkpatrick et al. (2017) and Hua et al. (2021) use it to avoid the model catastrophic forgetting in a continual learning scenario. Liu et al. (2021) and Molchanov et al. (2019) use it or a similar variant to help the structured model pruning. However, no previous work has explored its potential in assisting SVD for model compression.
+
+# 3 MODEL COMPRESSION WITH SVD MAY LOSE PERFORMANCE QUICKLY
+
+The singular values in $S$ implicitly give an importance score for a group of parameters. Since the small singular values will be truncated first, those parameters affected by the truncation are expected to be not important for the task performance. We verify the above assumption with a brute force attack: truncate one singular value at a time, then reconstruct the matrix, put it into a model, evaluate and get its performance. Ideally, we hope to see less performance drop when we truncate the smaller singular values. This process can be written as having the reconstructed model weights $\bar{W}_i$ with the $i$ -th singular value be truncated:
+
+$$
+\bar {W} _ {i} = u _ {1} \sigma_ {1} v _ {1} ^ {T} + \dots + u _ {i - 1} \sigma_ {i - 1} v _ {i - 1} ^ {T} + u _ {i + 1} \sigma_ {i + 1} v _ {i + 1} ^ {T} + \dots + u _ {k} \sigma_ {k} v _ {k} ^ {T}, \tag {4}
+$$
+
+where $u_{i}$ and $v_{i}$ are the $i$ -th column in $U$ and $V$ , correspondingly.
+
+Applying this brute force attack to test a deep neural network is not straightforward since a model can have hundreds of linear layers. Therefore, we truncate a group of singular values together instead of only one. Specifically, we split the singular values of a layer into 10 groups sorted by their values. The 1st group has the top $10\%$ singular values, while the 10th group contains the smallest $10\%$
+
+
+Figure 1: The grouped truncation and its performance. The truncation of the 10th group, which has the smallest singular values resulting from SVD, is expected to have a minor performance impact (i.e., follow the ideal trend of red dashed line), but this may not be true in actual cases (blue bar).
+
+
+Figure 2: The dilemma of vanilla SVD. Some parameters (the overlap of meshed orange and green) that significantly impact the task performance may not be reconstructed well by SVD because their associated singular values are small and truncated.
+
+
+Figure 3: The schematic effect of our Fisher-Weighted SVD (FWSVD). $\hat{I}$ is a diagonal matrix containing estimated Fisher information of parameters. By involving Fisher information to weigh the importance, our method reduces the overlap between meshed orange and green, making less performance drop after truncation.
+
+values. When we truncate a specific group, e.g., 5th group, the 5th group of all the layers in a model are truncated together. In other words, we observe the summed impact in a rank group. This results in a smoothed trend for the observation.
+
+Figure 1 plots the result of truncating the 10 groups separately in a standard 12-layer BERT model (Devlin et al., 2018) trained for STS-B task (Cer et al., 2017). The red dashed line shows an ideal trend which has a smaller performance drop with the tail groups. The blue bars show the actual performance drop. The 10th group surprisingly caused a performance drop as large as the 2nd group. This means the parameters associated with the 10th group are as important as the 2nd group. However, the magnitude of singular value does not reflect this importance, causing a model to lose its performance quickly even when truncating only a small portion.
+
+# 4 FISHER-WEIGHTED LOW-RANK APPROXIMATION
+
+The issue in Section 3 has an intuitive cause: the optimization objective of SVD does not consider each parameter's impact on the task performance. This issue is illustrated in Figure 2, and we address it by introducing the Fisher information into SVD's optimization objective, described as below.
+
+In the generic low-rank approximation, its objective minimizes $||W - AB||_2$ . SVD can solve this problem efficiently by having $A = US$ and $B = V^T$ . Since we can obtain the importance of each element $W_{ij}$ in $W$ , we weigh the individual reconstruction error by multiplying with the estimated Fisher information $\hat{I}_{W_{ij}}$ :
+
+$$
+\min _ {A, B} \sum_ {i, j} \hat {I} _ {W _ {i j}} \left(W _ {i j} - (A B) _ {i j}\right) ^ {2}. \tag {5}
+$$
+
+In general, weighted SVD does not have a closed-form solution (Srebro & Jaakkola, 2003) when each element has its weight. To make our method easy to deploy and analyze, we propose a simplification by making the same row of the $W$ matrix to share the same importance. The importance for the row $i$ is defined to be the summation of the row, i.e., $\hat{I}_{W_i} = \sum_j \hat{I}_{W_{ij}}$ .
+
+Define the diagonal matrix $\hat{I} = \text{diag}(\sqrt{\hat{I}_{W_1}}, \ldots, \sqrt{\hat{I}_{W_N}})$ , then the optimization problem of Equation (5) can be written as:
+
+$$
+\min _ {A, B} \left\| \hat {I} W - \hat {I} A B \right\| _ {2}. \tag {6}
+$$
+
+Equation 6 can be solved by the standard SVD on $\hat{I}W$ . We use the notation $svd(\hat{I}W) = (U^{*}, S^{*}, V^{*})$ , then the solution of Equation (6) will be $A = \hat{I}^{-1} U^{*} S^{*}$ , and $B = V^{*T}$ . In other words, the solution is the result of removing the information $\hat{I}$ from the factorized matrices. Figure 3 illustrates this process and its schematic effect of reducing the overlap between important parameters and poorly reconstructed parameters. We will measure this overlap with the performance drop analysis of Section 3. Lastly, to compress $W$ , we will have $A = \hat{I}^{-1} U_{r}^{*} S_{r}^{*}$ , and $B = V_{r}^{*T}$ , where $r$ denotes the truncated $U^{*}$ , $S^{*}$ , and $V^{*}$ with reserving only $r$ ranks.
+
+We call the above method FWSVD in this paper. One thing to highlight is that since we share the same optimization process with the standard SVD, any advantage we observed will be the result of a direct contribution from the $\hat{I}$ in Equation (6).
+
+# 5 EXPERIMENTS
+
+# 5.1 THE PATHS TO A COMPRESSED LANGUAGE MODEL
+
+This section describes how we obtain a compressed model under the popular pre-training schemes of language models. Figure 4 illustrates three paths that we examined for creating compressed language models. All the paths start from retraining a large transformer-based model pre-trained with a large language corpus in a self-supervised way, called the generic pre-training $(L\to L^{g})$
+
+The path-1 $(S\to S^g\to S^t)$ is a popular scheme that creates a small model first, then performs the generic distillation for the small model to learn the knowledge of the large model. The resulting small generic model $S^g$ will be fine-tuned with the target task dataset to obtain the task-specific model $S^t$ . The representative works of path-1 include DistilBERT (Sanh et al., 2019), TinyBERT (Jiao et al., 2019), MobileBERT (Sun et al., 2020), and MiniLM v1/v2 (Wang et al., 2020b;a). Some previous methods may include task-specific distillation $(L^{t}\rightarrow S^{t})$ and data augmentation (Jiao et al., 2019), but we exclude those from the scheme (and all the experiments in this paper) to make a fair and clean comparison across methods. The task-specific distillation and data augmentation are orthogonal to all the methods and can be jointly applied with low-rank factorization to make further improvements.
+
+The path-2 $(L^g\to L^t\to L^{tf})$ avoids the costly generic pre-training, directly compresses the task-specific model with factorization and task-specific fine-tuning (optional). Our analysis for the mismatched objectives phenomenon is based on this path. We also compare the models from path-1 and path-2, showing that path-2 can generate a model with a comparable performance under the same compression rate. Although path-2 requires much less training than path-1 (no generic pre-training for the compressed model).
+
+The path-3 $(S^t\to S^{tf})$ is a challenging setting that aims to compress an already compact model. This setting examines whether FWSVD can further improve the compression rate on models obtained by path-1. Our experiments show the answer is yes.
+
+With the three compression paths, we make four examinations as follows. Section 5.3: the comparison of path-1 versus path-2; Section 5.4: the compression of an already compact model (path-3); Section 5.5: the detailed comparison between FWSVD and vanilla SVD; Section 5.5.1: the empirical evidence for the schematic effects illustrated in Figures 2 and 3.
+
+# 5.2 EXPERIMENT SETUP
+
+# 5.2.1 LANGUAGE TASKS AND DATASETS
+
+We evaluate the methods of all three paths in Figure 4 on the General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019) and a token classification task. We include 2 single sentence tasks: CoLA (Warstadt et al., 2018) measured in Matthew's correlation, SST2 (Socher et al., 2013) measured in classification accuracy; 3 sentence similarity tasks: MRPC (Dolan et al., 2005) measured in F-1 score, STS-B (Cer et al., 2017) measured in Pearson-Spearman correlation, QQP (Chen et al., 2018b) measured in F-1 score; and 3 natural language inference tasks: MNLI (Williams et al., 2018) measured in classification accuracy with the average of the matched and mismatched subsets, QNLI (Rajpurkar et al., 2016) measured in accuracy. The token classification task
+
+
+Figure 4: The three paths to create compressed language models are examined in this paper. $L / S$ denote the initial models, $L^{g} / S^{g}$ are models after generic pre-training, $L^{t} / S^{t}$ correspond to task-specific models, and $L^{tf} / S^{tf}$ are factorized task-specific models. Detailed elaborations are in Sections 5.1 nad 5.2.2
+
+Table 1: Results of CoNLL and GLUE benchmark. G-Avg means the average of GLUE tasks, A-Avg denotes the average of all tasks, including CoNLL. Our FWSVD+fine-tuning is the best performer in terms of both average scores, without the expensive generic pre-training required by path-1 models (e.g., DistillBERT costs 720 V100 GPU hours for training).
+
+ | Model | #Param | CoNLL | CoLA | MNLI | MRPC | QNLI | QQP | SST-2 | STS-B | G-Avg | A-Avg |
| Original | BERTbase | 109.5M | 94.1 | 56.2 | 84.7 | 87.4 | 91.3 | 87.8 | 93.0 | 88.5 | 84.1 | 85.4 |
| Path-1 | DistilBERT | 67.0M | 93.2 | 49.8 | 82.2 | 88.7 | 89.3 | 86.7 | 90.4 | 86.1 | 81.9 | 83.3 |
| MiniLMv2 | 67.0M | 92.2 | 43.3 | 84.0 | 89.1 | 90.6 | 86.7 | 91.4 | 88.1 | 81.9 | 83.2 |
| Path-2 | BERT-PKD | 67.0M | - | 45.5 | 81.3 | 85.7 | 88.4 | 88.4 | 91.3 | 86.2 | 81.0 | - |
| BERT+SVD | 66.5M | 12.0 | 2.7 | 35.6 | 61.4 | 37.2 | 60.0 | 76.7 | 26.8 | 42.9 | 39.0 |
| +fine-tuning | 66.5M | 92.4 | 40.5 | 82.8 | 84.1 | 89.6 | 87.3 | 90.9 | 85.7 | 80.1 | 81.6 |
| BERT+FWSVD | 66.5M | 49.6 | 13.5 | 52.8 | 81.2 | 52.2 | 65.7 | 82.1 | 68.6 | 59.4 | 58.2 |
| +fine-tuning | 66.5M | 93.2 | 49.4 | 83.0 | 88.0 | 89.5 | 87.6 | 91.2 | 87.0 | 82.2 | 83.6 |
+
+we used is the named entity recognition (NER) on the CoNLL-2003 dataset (Sang & De Meulder, 2003). In summary, our evaluation includes 8 different natural language tasks.
+
+# 5.2.2 IMPLEMENTATION DETAILS AND THE BASELINE MODELS
+
+First of all, we use the same training configuration for all the experiments in this paper and avoid any hyperparameter screening to ensure a fair comparison.
+
+For the SOTA models on path-1 (MiniLMv2 and DistilBERT), we use the pre-trained generic compact models $(S^g)$ provided by the original authors as the starting point, then directly fine-tune them with 3 epochs on the target task training data. The fine-tuning is optimized by Adam with learning rate of $2\times 10^{-5}$ and batch size of 32 on one GPU.
+
+For the methods on path-2 (FWSVD and SVD), we start from the pre-trained generic large model $(L^{g})$ , which is the standard 12-layer BERT model (Devlin et al., 2018). Then we fine-tune it with the training setting exactly the same as we used for the path-1 models to get the large task-specific models $(L^{t})$ . The last step is applying the low-rank factorization (SVD or FWSVD) followed by another fine-tuning with the same training setting described above. The performance with and without fine-tuning will be both reported. We also note that we compress only the linear layers in the transformer blocks by reserving only $33\%$ of the ranks in this work. The setup intentionally makes a fair comparison to the path-1 methods. In other words, we do not compress the non-transformer modules such as the token embedding. Previous works (Chen et al., 2018a) have shown significant success in using low-rank factorization to compress the embedding layer, which occupies 23.4M $(21.3\%)$ parameters in the standard BERT model. Therefore, the results we reported for the path-2 methods still have room for improvement by applying our method to non-transformer modules. Lastly, we add BERT-PKD (Sun et al., 2019) based on its reproduced results (Chen et al., 2018a) for comparison. BERT-PKD uses knowledge distillation instead of factorization in the path-2 process.
+
+Table 2: Results of compressing an already compact model. The original task-specific models are directly downloaded from Huggingface pretrained models. Our FWSVD successfully reduces more parameters from all the compact models, while achieving the same level of accuracy. (ft: fine-tuning)
+
+| Original Compact Model (St) | Path-3 Compression (St → Stf) |
| Model-Task | #Param. | Perf. | #Param. | SVD | SVD+ft. | FWSVD | FWSVD+ft. |
| TinyBERT-STSB | 14.4M (7.8x) | 87.5 | 11.8M (-18%) | 73.8 | 86.1 | 84.9 | 88.0 |
| MiniLM-CoNLL | 22.7M (4.8x) | 88.5 | 18.4M (-19%) | 12.5 | 88.0 | 70.1 | 88.6 |
| MobileBERT-MNLI | 24.6M (4.4x) | 83.6 | 22.5M (-9%) | 36.4 | 81.9 | 51.1 | 82.5 |
| DistillBERT-MRPC | 66.9M (1.6x) | 88.7 | 46.7M (-30%) | 0.0 | 83.4 | 67.9 | 89.0 |
+
+Table 3: Results of compressing an already compact model. This table compresses ALBERT (Lan et al., 2019), which uses the parameter-sharing strategy to create the compact model. FWSVD preserves the performance significantly better than SVD in all 8 tasks, indicating its excellent compatibility in combining the parameter-sharing strategy. This experiment examines the path-3 process.
+
+| Model | #Param | CoNLL | CoLA | MNLI | MRPC | QNLI | QQP | SST-2 | STS-B | G-Avg | A-Avg |
| BERTbase | 109.5M | 94.1 | 56.2 | 84.7 | 87.4 | 91.3 | 87.8 | 93.0 | 88.5 | 84.1 | 85.4 |
| ALBERTlarge | 17.7M | 93.5 | 50.9 | 84.3 | 89.9 | 91.7 | 86.7 | 90.7 | 90.1 | 83.5 | 84.7 |
| w SVD | 15.2M (-14%) | 0.3 | 0.0 | 41.1 | 0.0 | 54.2 | 5.4 | 70.2 | 9.6 | 25.8 | 22.6 |
| w SVD+ft. | 15.2M (-14%) | 92.2 | 46.4 | 83.4 | 81.8 | 49.5 | 86.9 | 89.8 | 86.8 | 74.9 | 77.1 |
| w FWSVD | 15.2M (-14%) | 22.8 | 0.0 | 65.2 | 50.0 | 78.2 | 72.6 | 81.4 | 76.4 | 60.5 | 55.8 |
| w FWSVD+ft. | 15.2M (-14%) | 93.0 | 50.6 | 83.3 | 90.4 | 90.6 | 87.0 | 90.6 | 89.0 | 83.1 | 84.3 |
| ALBERTbase | 11.7M | 92.1 | 43.0 | 82.3 | 88.6 | 90.6 | 86.6 | 89.7 | 89.1 | 81.4 | 82.7 |
| w SVD | 9.6M (-18%) | 3.5 | 0.0 | 32.0 | 0.0 | 55.1 | 53.4 | 52.4 | 9.6 | 28.9 | 25.7 |
| w SVD+ft. | 9.6M (-18%) | 89.8 | 28.8 | 81.3 | 81.2 | 88.3 | 85.5 | 88.2 | 75.0 | 75.5 | 77.3 |
| w FWSVD | 9.6M (-18%) | 16.9 | 6.9 | 55.6 | 47.7 | 69.1 | 54.7 | 72.9 | 54.0 | 51.6 | 47.2 |
| w FWSVD+ft. | 9.6M (-18%) | 91.2 | 42.2 | 81.8 | 86.9 | 88.9 | 86.2 | 88.7 | 87.0 | 80.2 | 81.6 |
+
+For the path-3 experiments, we use the pre-trained task-specific compact models $(S^t)$ as the starting point. These pre-trained models have a much smaller size (TinyBERT-STSB, MiniLM-CoNLL, MobileBERT-MNLI) or a better performance (DistilBERT-MRPC) than the models we used in the path-1 and path-2, indicating they may contain denser knowledge in their compact models. Therefore, compressing these models introduces a significant challenge. In order to have better coverage for all tasks, we additionally use ALBERTlarge and ALBERTbase (Lan et al., 2019) as the already compact models to generate all 8 task-specific models $(S^{g}\rightarrow S^{t})$ . Then follow path-3 to compress the compact models. All the training involved here has the same setting as described in path-1.
+
+Lastly, our implementation and experiments are built on top of the popular HuggingFace Transformers library (Wolf et al., 2020). All other unspecified training settings use the default configuration of the library. Since no hyperparameter tuning is involved in our experiments, we directly report the results on the dev set of all the datasets, making the numbers convenient to compare and verify.
+
+# 5.3 PATH-1 VERSUS PATH-2
+
+Table 1 reports the results of the GLUE benchmark and a NER task. Our FWSVD with fine-tuning achieves an average score of 83.6, beating all other path-1 and path-2 methods. This is a non-trivial accomplishment since FWSVD with fine-tuning does not need the expensive generic pre-training. Furthermore, FWSVD has consistent performance retention for all the tasks; it contrasts the path-1 methods, which may have a more considerable variance. For example, DistilBERT is good at CoLA but poor at STS-B; oppositely, MiniLMv2 is a strong performer at STS-B but is weak with CoLA. In contrast, FWSVD+fine-tuning does not show an obvious shortcoming.
+
+
+(a) COLA
+
+
+(b) NER (CoNLL-2003)
+
+
+(c) STS-B
+Figure 5: FWSVD versus SVD by varying the ratio of reserved ranks. The model with a rank ratio 1.0 indicates the full-rank reconstruction with the same accuracy as the original model (i.e., the $L^t$ in Figure 4). Note that all the models here do not have fine-tuning after factorization.
+
+# 5.4 COMPRESSING AN ALREADY COMPACT MODEL
+
+The setting of path-3 targets to further compress the lightweight models. This is challenging as the compact models are already $1.6\mathrm{x}\sim 7.8\mathrm{x}$ smaller than the original BERT. The results in Table 2 demonstrate the effectiveness of FWSVD on further reducing the number of parameters. The original SVD is almost useless without fine-tuning, while our FWSVD can still retain a significant part of the performance. For example, SVD ends with a zero accuracy when compressing DistillBERT, while our FWSVD keeps a score of 67.9 under the same setting. When combined with fine-tuning, FWSVD can cut off $30\%$ redundancy for DistillBERT. Even for the highly compact model TinyBERT (only 14.4M parameters), FWSVD+fine-tuning still successfully reduces $18\%$ of the parameters without any performance loss. More interestingly, the TinyBERT, MiniLM, and DistillBERT-MRPC compressed by FWSVD+fine-tuning exceed the original performance slightly. The result suggests FWSVD+fine-tuning might introduce a small regularization effect to improve the model's generalizability.
+
+Lastly, Table 3 examines the compatibility between SVD/FWSVD and the parameter-sharing strategy of the ALBERT model. The average score of ALBERT-large is $84.7\%$ . The performance of FWSVD $(84.3\%)$ is far better than that of SVD $(77.1\%)$ when both reducing $14\%$ parameters, suggesting FWSVD is more robust than SVD in combining the parameter-sharing strategy.
+
+# 5.5 FWSVD VERSUS SVD
+
+In Table 1, FWSVD consistently produces much better results than SVD on all tasks. On average, FWSVD without fine-tuning obtains an absolute improvement of $17.5\%$ over SVD. To highlight, FWSVD without fine-tuning can maintain a significant portion of performance in challenging tasks such as CoNLL and STS-B, where SVD completely fails. With fine-tuning, FWSVD provides better initialization for fine-tuning and consistently achieves a better or comparable performance.
+
+Figure 5 plots the performance trend with respect to the change of targeted rank ratio, where the full-rank reconstruction corresponds to the results at rank ratio 1.0. These results demonstrate the apparent advantage of FWSVD over standard SVD. First, at each rank ratio, FWSVD shows significant improvements over SVD. Second, the performance of FWSVD keeps growing with the increase of rank ratio, while SVD shows fluctuations in its trend. Specifically, two tasks (COLA and STS-B) in Figure 5 show that SVD has abrupt performance drops at some points. On the STS-B task, the performance of SVD at rank ratio 0.3 is significantly lower than having a smaller rank ratio of 0.2. In contrast, FWSVD shows a much stable trend of increasing performance along with the rank ratio.
+
+# 5.5.1 REVISIT THE BRUTE FORCE ATTACK
+
+This section applies the same analysis of Section 3, but adds FWSVD to see if it matches the task's objective better. In Figure 6a, the red bars are significantly lower than the blue bars, especially for the tail groups, which will be truncated first. We specifically highlight group-10 in 6a, which has the smallest $10\%$ singular values. The height of the blue bar is equivalent to the size of the overlapped (green and meshed orange) region in Figures 2. Similarly, its red bar (close to zero) is equivalent to the overlapped region in Figure 3. In other words, the illustrations of Figures 2 and 3 are strongly supported by the results here. Although FWSVD shows a smaller performance drop
+
+
+(a) STS-B performance drop
+
+
+(b) STS-B reconstruction error
+Figure 6: Results of grouped rank truncation on STS-B task. In (a), FWSVD shows a consistent trend of having less performance drop with the small singular value groups (group 10 has the smallest singular values), mitigating the issue of Figure 1. In (b), FWSVD results in a larger reconstruction error with almost all truncated groups, although FWSVD retains the model accuracy better than SVD.
+
+shown by Figure 6a, it has a more significant reconstruction error than SVD in many cases (see Figure 6b), especially with the rank groups that will be truncated first (e.g., groups 5 to 10). In other words, FWSVD's objective (Equation 6) aligns with the task objective better by sacrificing the reconstruction error.
+
+# 6 LIMITATION AND FUTURE WORK
+
+FWSVD has two limitations. First, FWSVD relies on a given task objective and a target task training dataset to compute the importance matrix; thus, it is more proper to compress a task-specific model $(e.g., L^t$ or $S^t)$ than the pre-trained generic model $(e.g., L^g)$ . In contrast, the vanilla SVD can apply to any case. In other words, FWSVD trades the method's applicability for the target task performance. Second, FWSVD only uses a simplified importance matrix that gives the same importance for the parameters on the same row of matrix $W$ . Although this strategy is simple and effective, it does not fully utilize the Fisher information. Therefore, a future improvement can be made by directly seeking an element-wise factorization solution for Equation (5).
+
+# 7 CONCLUSION
+
+In this work, we investigate why using standard low-rank factorization (SVD) to compress the model may quickly lose most of its performance, pointing out the issue of the mismatched optimization objectives between the low-rank approximation and the target task. We provide empirical evidence and observations for the issue, and propose a new strategy, FWSVD, to alleviate it. Our FWSVD uses the estimated Fisher information to weigh the importance of parameters for the factorization and achieve significant success in compressing an already compact model. Furthermore, FWSVD reuses the existing SVD solver and can still implement its factorized matrices with linear layers; therefore, it is simple to implement and deploy. We believe FWSVD could be one of the most easy-to-use methods with good performance for language model compression.
+
+# REFERENCES
+
+Anish Acharya, Rahul Goel, Angeliki Metallinou, and Inderjit Dhillon. Online embedding compression for text classification using low rank matrix factorization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 6196-6203, 2019.
+Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. SemEval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 1-14, Vancouver, Canada, August 2017. Association for Computational Linguistics.
+
+Patrick H Chen, Si Si, Yang Li, Ciprian Chelba, and Cho-Jui Hsieh. Groupreduce: block-wise low-rank approximation for neural language model shrinking. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 11011-11021, 2018a.
+Zihan Chen, Hongbo Zhang, Xiaoji Zhang, and Leqi Zhao. Quora question pairs. 2018b.
+Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in neural information processing systems, pp. 1269-1277, 2014.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
+Bill Dolan, Chris Brockett, and Chris Quirk. Microsoft research paraphrase corpus. Retrieved March, 29(2008):63, 2005.
+Gene H Golub and Christian Reinsch. Singular value decomposition and least squares solutions. In Linear algebra, pp. 134-151. Springer, 1971.
+Ting Hua, Yilin Shen, Changsheng Zhao, Yen-Chang Hsu, and Hongxia Jin. Hyperparameter-free continuous learning for domain classification in natural language understanding. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2669-2678, 2021.
+Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
+Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019.
+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. volume 114, pp. 3521-3526. National Acad Sciences, 2017.
+Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942, 2019.
+Liyang Liu, Shilong Zhang, Zhanghui Kuang, Aojun Zhou, Jing-Hao Xue, Xinjiang Wang, Yimin Chen, Wenming Yang, Qingmin Liao, and Wayne Zhang. Group fisher pruning for practical network compression. In International Conference on Machine Learning, pp. 7021-7032. PMLR, 2021.
+Yang Liu. Fine-tune bert for extractive summarization. arXiv preprint arXiv:1903.10318, 2019.
+Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11264-11272, 2019.
+Matan Ben Noach and Yoav Goldberg. Compressing pre-trained language models by matrix decomposition. In Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, pp. 884-889, 2020.
+Razvan Pascanu and Yoshua Bengio. Revisiting natural gradient for deep networks. In In International Conference on Learning Representations (ICLR), 2014.
+Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding with unsupervised learning. 2018.
+Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383-2392, 2016.
+
+Erik Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pp. 142-147, 2003.
+Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
+Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631-1642, 2013.
+Nathan Srebro and Tommi Jaakkola. Weighted low-rank approximations. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 720–727, 2003.
+Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. arXiv preprint arXiv:1908.09355, 2019.
+Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. Mobilebert: a compact task-agnostic bert for resource-limited devices. arXiv preprint arXiv:2004.02984, 2020.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, 2019.
+Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong, and Furu Wei. Minilmv2: Multihead self-attention relation distillation for compressing pretrained transformers. arXiv preprint arXiv:2012.15828, 2020a.
+Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. Minilm: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. arXiv preprint arXiv:2002.10957, 2020b.
+Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. 2018.
+Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT 2018, pp. 1112-1122. Association for Computational Linguistics (ACL), 2018.
+Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierrick Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38-45, Online, October 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020.emnlp-demos.6.
+Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. Swag: A large-scale adversarial dataset for grounded commonsense inference. arXiv preprint arXiv:1808.05326, 2018.
+Xiangyu Zhang, Jianhua Zou, Kaiming He, and Jian Sun. Accelerating very deep convolutional networks for classification and detection. IEEE transactions on pattern analysis and machine intelligence, 38(10):1943-1955, 2015.
+
+# A SUPPLEMENTARY
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(g)
+
+
+(h)
+Figure 7: The grouped rank truncation experiment. The experiments are the same with Figure 6a, but we use $\mathrm{ALBERT}_{\mathrm{base}}$ (11.7M parameters) model for this figure.
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(g)
+
+
+(h)
+Figure 8: The grouped rank truncation experiment. The experiments are the same with Figure 6a, but this figure includes all 8 language tasks with $\mathrm{BERT}_{\text {base }}$ (109.5M parameters) model. FWSVD has a smaller performance drop with those groups truncated first (e.g., group 5 to 10) in all the cases. SVD usually shows a significant drop with group 10, which has the smallest singular values and is truncated first. FWSVD has no such issue in all cases.
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+(g)
+
+
+(h)
+Figure 9: This figure shows only groups 3 to 10 of Figure 8 to better visualize the groups of a smaller performance drop.
+
+Table 4: The raw values for Figure 6a. We additionally include the averaged singular values for each truncated group. The singular values from FWSVD are multiplied with Fisher information; thus their scales are different from SVD.
+
+| Truncated group | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| SVD performance drop | 25.4% | 6.7% | 2.8% | 2.2% | 1.1% | 0.9% | 0.7% | 0.4% | 0.1% | 4.9% |
| FWSVD performance drop | 24.1% | 6.1% | 2.7% | 1.5% | 0.8% | 0.6% | 0.2% | 0.3% | 0.2% | 0.2% |
| SVD average singular value | 2.674 | 1.933 | 1.622 | 1.381 | 1.176 | 0.994 | 0.828 | 0.671 | 0.519 | 0.353 |
| FWSVD average singular value | 1093 | 631 | 510 | 424 | 355 | 298 | 247 | 201 | 157 | 110 |
\ No newline at end of file
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/images.zip b/languagemodelcompressionwithweightedlowrankfactorization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..fbf508466bc9b6a5134272afabf16d6a198d1079
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f343272a8d2c0b8b44ce336dabb1869e124edce0c8c629b1f1652dd5988a304f
+size 698849
diff --git a/languagemodelcompressionwithweightedlowrankfactorization/layout.json b/languagemodelcompressionwithweightedlowrankfactorization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..cfbab7a1aca734228d75297dca991a9d624cf49b
--- /dev/null
+++ b/languagemodelcompressionwithweightedlowrankfactorization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:376734dde8ea33d24074c4d3a09712a89660d2209d629907af085b34fcedf382
+size 443317
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_content_list.json b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c38578a1bf8e0a8712d2d63ca8924a936846dacb
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad63f23f359fb58771e112f0664be7d16a3ff2fe25cba2efdba53e3169c563de
+size 334775
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_model.json b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a5d12124a4068a9ef6276906d3c4a4afb4f2208f
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2bf096aec59cc21187db6a2106372c3c3d981a1fc7f0b0fe491e59cb0270e392
+size 378680
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_origin.pdf b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..72ca4912a0fa862b6fc824ef5f8a02f3a8b04042
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/c9896b89-f197-483d-8015-eef586bc8108_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8cce958a9ddfab97bb9050ed83653fb5cc7a53b0a9be8f725a56f40c77ae1a2e
+size 1768222
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/full.md b/largelearningratetameshomogeneityconvergenceandbalancingeffect/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..82e88147ef160e9b734f510d7ce5069d268889a0
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/full.md
@@ -0,0 +1,1798 @@
+# LARGE LEARNING RATE TAMES HOMOGENEITY: CONVERGENCE AND BALANCING EFFECT
+
+Yuqing Wang, Minshuo Chen, Tuo Zhao, Molei Tao
+
+Georgia Institute of Technology
+
+{ywang3398,mchen393,tourzhao,mtao}@gatech.edu
+
+# ABSTRACT
+
+Recent empirical advances show that training deep models with large learning rate often improves generalization performance. However, theoretical justifications on the benefits of large learning rate are highly limited, due to challenges in analysis. In this paper, we consider using Gradient Descent (GD) with a large learning rate on a homogeneous matrix factorization problem, i.e., $\min_{X,Y} \| A - XY^{\top} \|_{\mathbb{F}}^{2}$ . We prove a convergence theory for constant large learning rates well beyond $2 / L$ , where $L$ is the largest eigenvalue of Hessian at the initialization. Moreover, we rigorously establish an implicit bias of GD induced by such a large learning rate, termed 'balancing', meaning that magnitudes of $X$ and $Y$ at the limit of GD iterations will be close even if their initialization is significantly unbalanced. Numerical experiments are provided to support our theory.
+
+# 1 INTRODUCTION
+
+Training machine learning models such as deep neural networks involves optimizing highly nonconvex functions. Empirical results indicate an intimate connection between training algorithms and the performance of trained models (Le et al., 2011; Bottou et al., 2018; Zhang et al., 2021; Soydaner, 2020; Zhou et al., 2020). Especially for widely used first-order training algorithms (e.g., GD and SGD), the learning rate is of essential importance and has received extensive focus from researchers (Smith, 2017; Jastrzebski et al., 2017; Smith, 2018; Gotmare et al., 2018; Liu et al., 2019; Li & Arora, 2019). A recent perspective is that large learning rates often lead to improved testing performance compared to the counterpart trained with small learning rates (Smith & Topin, 2019; Yue et al., 2020). Towards explaining the better performance, a common belief is that large learning rates encourage the algorithm to search for flat minima, which often generalize better and are more robust than sharp ones (Seong et al., 2018; Lewkowycz et al., 2020).
+
+Despite abundant empirical observations, theoretical understandings of the benefits of large learning rate are still limited for non-convex functions, partly due to challenges in analysis. For example, the convergence (of GD or SGD) under large learning rate is not guaranteed. Even for globally smooth functions, very few general results exist if the learning rate exceeds certain threshold (Kong & Tao, 2020). Besides, popular regularity assumptions such as global smoothness for simplified analyses are often absent in homogeneous models, including commonly used ReLU neural networks.
+
+This paper theoretically studies the benefits of large learning rate in a matrix factorization problem
+
+$$
+\min _ {X, Y} \frac {1}{2} \| A - X Y ^ {\top} \| _ {\mathsf {F}} ^ {2}, \quad \text {w h e r e} A \in \mathbb {R} ^ {n \times n}, X, Y \in \mathbb {R} ^ {n \times d}. \tag {1}
+$$
+
+We consider Gradient Descent (GD) for solving (1): at the $k$ -th iteration, we have
+
+$$
+X _ {k + 1} = X _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) Y _ {k} \quad \text {a n d} \quad Y _ {k + 1} = Y _ {k} + h (A ^ {\top} - Y _ {k} X _ {k} ^ {\top}) X _ {k},
+$$
+
+where $h$ is the learning rate. Despite its simple formula, problem (1) serves as an important foundation of a variety of problems, including matrix sensing (Chen & Wainwright, 2015; Bhojanapalli et al., 2016; Tu et al., 2016), matrix completion (Keshavan et al., 2010; Hardt, 2014), and linear neural networks (Ji & Telgarsky, 2018; Gunasekar et al., 2018).
+
+Problem (1) possesses several intriguing properties. Firstly, the objective function is non-convex, and critical points are either global minima or saddles (see e.g., Baldi & Hornik (1989); Li et al. (2019b); Valavi et al. (2020a); Chen et al. (2018)). Secondly, problem (1) is homogeneous in $X$ and $Y$ , meaning that rescaling $X, Y$ to $aX, a^{-1}Y$ for any $a \neq 0$ will not change the objective's value. This property is shared by commonly used ReLU neural networks. A direct consequence of homogeneity is that global minima of (1) are non-isolated and can be unbounded. The curvatures at these global minima are highly dependent on the magnitudes of $X, Y$ . When $X, Y$ have comparable magnitudes, the largest eigenvalue of Hessian is small, and this corresponds to a flat minimum; on the contrary, unbalanced $X$ and $Y$ give a sharp minimum. Last but not the least, the homogeneity impairs smoothness conditions of (1), rendering the gradient being not Lipschitz continuous unless $X, Y$ are bounded. See a formal discussion in Section 2.
+
+Existing approaches for solving (1) often uses explicit regularization (Ge et al., 2017; Tu et al., 2016; Cabral et al., 2013; Li et al., 2019a), or infinitesimal (or diminishing) learning rates for controlling the magnitudes of $X, Y$ (Du et al., 2018; Ye & Du, 2021). In this paper, we go beyond the scope of aforementioned works, and analyze GD with a large learning rate for solving (1). In particular, we allow the learning rate $h$ to be as large as approximately $4 / L$ (see more explanation in Section 2), where $L$ denotes the largest eigenvalue of Hessian at GD initialization. In connection to empirical observations, we provide positive answers to the following two questions:
+
+Does $GD$ with large learning rate converge at least for some cases of (1)? Does larger learning rate biases toward flatter minima (i.e., $X, Y$ with comparable magnitudes)?
+
+We theoretically show the convergence of GD with large learning rate for the two situations $n = 1, d \in \mathbb{N}^{+}$ or $d = 1, n \in \mathbb{N}^{+}$ with isotropic $A$ . We also observe a, perhaps surprising, "balancing effect" for general matrix factorization (i.e., any $d, n,$ and $A$ ), meaning that when $h$ is sufficiently large, the difference between $X$ and $Y$ shrinks significantly at the convergence of GD compared to its initial, even if the initial point is close to an unbalanced global minimum. In fact, with a proper large learning rate $h$ , $\| X_{k} - Y_{k}\|_{\mathsf{F}}^{2}$ may decrease by an arbitrary factor at its limit. The following is a simple example of our theory for $n = 1$ (i.e. scalar factorization), and more general results will be presented later with a precise bound for $h$ depending on the initial condition and $A$ .
+
+Theorem 1.1 (Informal version of Thm.3.1 & 3.2). Given scalar $A$ and initial condition $X_0, Y_0 \in \mathbb{R}^{1 \times d}$ chosen almost everywhere, with learning rate $h \lesssim 4 / L$ , $GD$ converges to a global minimum $(X, Y)$ satisfying $\| X\|_{\mathsf{F}}^2 + \| Y\|_{\mathsf{F}}^2 \leq \frac{2}{h}$ . Consequently, its extent of balancing is quantified by $\| X - Y\|_{\mathsf{F}}^2 \leq \frac{2}{h} - 2A$ .
+
+We remark that having a learning rate $h \approx 4 / L$ is far beyond the commonly analyzed regime in optimization. Even for globally $L$ -smooth objective, traditional theory requires $h < 2 / L$ for GD convergence and $h = 1 / L$ is optimal for convex functions (Boyd et al., 2004), not to mention that our problem (1) is never globally $L$ -smooth due to homogeneity. Modified equation provides a tool for probing intermediate learning rates (see Hairer et al. (2006, Chapter 9) for a general review, and Kong & Tao (2020, Appendix A) for the specific setup of GD), but the learning rate here is too large for modified equation to work (see Appendix C). In fact, besides blowing up, GD with large learning rate may have a zoology of limiting behaviors (see e.g., Appendix B for convergence to periodic orbits under our setup, and Kong & Tao (2020) for convergence to chaotic attractors).
+
+Our analyses (of convergence and balancing) leverage various mathematical tools, including a proper partition of state space and its dynamical transition (specifically invented for this problem), stability theory of discrete time dynamical systems (Alligood et al., 1996), and geometric measure theory (Federer, 2014).
+
+The rest of the paper is organized as: Section 2 provides the background of studying (1) and discusses related works; Section 3 presents convergence and balancing results for scalar factorization problems; Section 4 generalizes the theory to rank-1 matrix approximation; Section 5 studies problem (1) with arbitrary $A$ and its arbitrary-rank approximation; Section 6 summarizes the paper and discusses broadly related topics and future directions.
+
+# 2 BACKGROUND AND RELATED WORK
+
+Notations. $\| v\|$ is $\ell_2$ norm of a column or row vector $v$ . $\| M\|_{\mathsf{F}}$ is the Frobenius norm of a matrix $M$ .
+
+Sharp and flat minima in (1) We discuss the curvatures at global minima of (1). To ease the presentation, consider simplified versions of (1) with either $n = 1$ or $d = 1$ . In this case, $X$ and $Y$ become vectors and we denote them as $x, y$ , respectively. We show the following proposition characterizing the spectrum of Hessian at a global minimum.
+
+Proposition 2.1. When $n = 1, d \in \mathbb{N}^+$ or $d = 1, n \in \mathbb{N}^+$ in (1), the largest eigenvalue of Hessian at a global minimum $(x,y)$ is $\| x\|^2 + \| y\|^2$ and the smallest eigenvalue is 0.
+
+Homogeneity implies global minimizers of (1) are not isolated, which is consistent with the 0 eigenvalue. On the other hand, if the largest eigenvalue $\| x\|^2 + \| y\|^2$ is large (or small), then the curvature at such a global minimum is sharp (or flat), in the direction of the leading eigenvector. Meanwhile, note this sharpness/flatness is an indication of the balancedness between magnitudes of $x, y$ at a global minimum. To see this, singular value decomposition (SVD) yields that at a global minimum, $(x, y)$ satisfies $\left\| xy^\top \right\|_F^2 = \sigma_{\max}^2(A)$ . Therefore, large $\| x\|^2 + \| y\|^2$ is obtained when $\left\| x\right\| - \left\| y\right\|$ is large, i.e., $x$ and $y$ magnitudes are unbalanced, and small $\| x\|^2 + \| y\|^2$ is obtained when balanced.
+
+Large learning rate We study smoothness properties of (1) and demonstrate that our learning rate is well beyond conventional optimization theory. We first define the smoothness of a function.
+
+Definition 2.2 (L-smooth). A function $f \in \mathcal{C}^1$ defined on $\mathbb{R}^N$ is $L$ -smooth if for all $u_1, u_2 \in \mathbb{R}^N$ ,
+
+$$
+\left\| \nabla f \left(u _ {1}\right) - \nabla f \left(u _ {2}\right) \right\| \leq L \| u _ {1} - u _ {2} \|. \tag {2}
+$$
+
+If further $f \in \mathcal{C}^2$ , then $\nabla^2 f \preceq LI$ . Moreover, if we have (2) for $u_1, u_2 \in \mathcal{X} \subseteq \mathbb{R}^N$ , we call it locally $L$ -smooth.
+
+In traditional optimization (Nesterov, 2003; Polyak, 1987; Nesterov, 1983; Polyak, 1964; Beck & Teboulle, 2009), most analyzed objective functions often satisfy (i) (some relaxed form of) convexity or strong convexity, and (ii) $L$ -smoothness. Choosing a step size $h < 2 / L$ guarantees the convergence of GD to a minimum by the existing theory (reviewed in Appendix F.3). Our choice of learning rate $h \approx 4 / L$ (more precisely, $4 / L_0$ ; see below) goes beyond the classical analyses.
+
+Besides, in our problem (1), the regularity is very different. Even simplified versions of (1), i.e., with either $n = 1$ or $d = 1$ , suffer from (i) non-convexity and (ii) unbounded eigenvalues of Hessian, i.e., no global smoothness (see Appendix F.2 for more details). As shown in Du et al. (2018); Ye & Du (2021); Ma et al. (2021), decaying or infinitesimal learning rate ensures that the GD trajectory stays in a locally smooth region. However, the gap between the magnitudes of $X, Y$ can only be maintained in that case. We show, however, that larger learning rate can shrink this gap. More precisely, if initial condition is well balanced, there is no need to use large learning rate; otherwise, we can use learning rate as large as approximately $4 / L$ , and within this range, larger $h$ provides smaller gap between $X$ and $Y$ at the limit (i.e. infinitely many GD iterations).
+
+Related work Matrix factorization problems in various forms have been extensively studied in the literature. The version of (1) is commonly known as the low-rank factorization, although here $d$ can arbitrary and we consider both $d \leq \mathrm{rank}(A)$ and $d > \mathrm{rank}(A)$ cases. Baldi & Hornik (1989); Li et al. (2019b); Valavi et al. (2020b) provide landscape analysis of (1). Ge et al. (2017); Tu et al. (2016) propose to penalize the Frobenius norm of $\left\| X^{\top}X - Y^{\top}Y\right\|_{\mathsf{F}}^{2}$ to mitigate the homogeneity and establish global convergence guarantees of GD for solving (1). Cabral et al. (2013); Li et al. (2019a) instead penalize individual Frobenius norms of $\| X\|_{\mathsf{F}}^{2} + \| Y\|_{\mathsf{F}}^{2}$ . We remark that penalizing $\| X\|_{\mathsf{F}}^{2} + \| Y\|_{\mathsf{F}}^{2}$ is closely related to nuclear norm regularization, since the variational formula for nuclear norm $\| Z\|_{*}^{2} = \min_{Z = XY^{\top}}\| X\|_{\mathsf{F}}^{2} + \| Y\|_{\mathsf{F}}^{2}$ . More recently, Liu et al. (2021) consider using injected noise as regularization to GD and establish a global convergence (see also Zhou et al. (2019); Liu et al. (2022). More specifically, by perturbing the GD iterate $(X_{k},Y_{k})$ with Gaussian noise, GD will converge to a flat global optimum. On the other hand, Du et al. (2018); Ye & Du (2021); Ma et al. (2021) show that even without explicit regularization, when the learning rate of GD is infinitesimal,
+
+i.e., GD approximating gradient flow, $X$ and $Y$ maintain the gap in their magnitudes. Such an effect is more broadly recognized as implicit bias of learning algorithms (Neyshabur et al., 2014; Gunasekar et al., 2018; Soudry et al., 2018; Li et al., 2020; 2021). Built upon this implicit bias, Du et al. (2018) further prove that GD with diminishing learning rates converges to a bounded global minimum of (1), and this conclusion is recently extended to the case of a constant small learning rate (Ye & Du, 2021). Our work goes beyond the scopes of these milestones and considers matrix factorization with much larger learning rates.
+
+Additional results exist that demonstrate large learning rate can improve performance in various learning problems. Most of them involve non-constant learn rates. Specifically, Li et al. (2019c) consider a two-layer neural network setting, where using learning rate annealing (initially large, followed by small ones) can improve classification accuracy compared to training with small learning rates. Nakkiran (2020) shows that the observation in Li et al. (2019c) even exists in convex problems. Lewkowycz et al. (2020) study constant large learning rates, and demonstrate distinct algorithmic behaviors of large and small learning rates, as well as empirically illustrate large learning rate yields better testing performance on neural networks. Their analysis is built upon the neural tangent kernel perspective (Jacot et al., 2018), with a focus on the kernel spectrum evolution under large learning rate. Worth noting is, Kong & Tao (2020) also study constant large learning rates, and show that large learning rate provides a mechanism for GD to escape local minima, alternative to noisy escapes due to stochastic gradients.
+
+# 3 OVERPARAMERIZED SCALAR FACTORIZATION
+
+In order to provide intuition before directly studying the most general problem, we begin with a simple special case, namely factorizing a scalar by two vectors. It corresponds to (1) with $n = 1$ and $d \in \mathbb{N}^+$ , and this overparameterized problem is written as
+
+$$
+\min _ {x, y \in \mathbb {R} ^ {1 \times d}} \frac {1}{2} (\mu - x y ^ {\top}) ^ {2}, \tag {3}
+$$
+
+where $\mu$ is assumed without loss of generality to be a positive scalar. Problem (3) can be viewed as univariate regression using a linear two-layer neural network with the quadratic loss, which is studied in Lewkowycz et al. (2020) with atomic data distribution. Yet our analysis in the sequel can be used to study arbitrary univariate data distributions; see details in Section 6.
+
+Although simplified, problem (3) is still nonconvex and exhibits the same homogeneity as (1). The convergence of its large learning rate GD optimization was previously not understood, let alone balancing. Many results that we will obtain for (3) will remain true for more general problems.
+
+We first prove that GD converges despite of $>2 / L$ learning rate and for almost all initial conditions:
+
+Theorem 3.1 (Convergence). Given $(x_0^\top, y_0^\top) \in (\mathbb{R}^d \times \mathbb{R}^d) \backslash \mathcal{B}$ where $\mathcal{B}$ is some Lebesgue measure-0 set, when the learning rate $h$ satisfies
+
+$$
+h \leq \min \left\{\frac {4}{\| x _ {0} \| ^ {2} + \| y _ {0} \| ^ {2} + 4 \mu}, \frac {1}{3 \mu} \right\},
+$$
+
+GD converges to a global minimum.
+
+Theorem 3.1 says that choosing a constant learning rate depending on GD initialization guarantees the convergence for almost every starting point in the whole space. This result is even stronger than the already nontrivial convergence under small learning rate with high probability over random initialization (Ye & Du, 2021). Furthermore, the upper bound on $h$ is sufficiently large: on the one hand, suppose GD initialization $(x_0, y_0)$ is close to an unbalanced global minimum. By Proposition 2.1, we can check that the largest eigenvalue $L(x_0, y_0)$ of Hessian $\nabla^2 f(x_0, y_0)$ is approximately $\| x_0 \|^2 + \| y_0 \|^2$ . Consequently, our upper bound of $h$ is almost $4 / L$ , which is beyond $2 / L$ (see Section 2 for more details). On the other hand, we observe numerically that the $4 / L$ upper bound is actually very close to the stability limit of GD when initialized away from the origin (see more details in Appendix E).
+
+The convergence in Theorem 3.1 has an interesting searching-to-converging transition as depicted in Figure 1, where we observe two phases. In Phase 1, large learning rate drives GD to search for flat
+
+
+Figure 1: The dynamics of GD under different learning rate $h$
+
+
+small $h$
+
+regions, escaping from the attraction of sharp minima. After some iterations, the algorithm enters the vicinity of a global minimum with more balanced magnitudes in $x, y$ . Then in Phase 2, GD converges to the found balanced global minimum. We remark that the searching-to-converging transition also appears in Lewkowycz et al. (2020). However, the algorithmic behaviors are not the same. In fact, in our searching phase (phase 1), the objective function does not exhibit the blow-up phenomenon. In our convergence phase (phase 2), the analysis relies on a detailed state space partition (see Line 192) due to nonconvex nature of (3), while the analysis in Lewkowycz et al. (2020) is akin to monotone convergence in a convex problem.
+
+In comparison with the dynamics of small learning rate, we note that the searching phase (Phase 1) is vital to the convergence analysis. Meanwhile, the searching phase induces a balancing effect of large learning rate. The following theorem explicitly quantifies the extent of balancing.
+
+Theorem 3.2 (Balancing). Under the same initial condition and learning rate $h$ as Theorem 3.1, $GD$ for (3) converges to a global minimizer $(x,y)$ satisfying
+
+$$
+\left\| x \right\| ^ {2} + \left\| y \right\| ^ {2} \leq \frac {2}{h}.
+$$
+
+Consequently, its extent of balancing is quantified by
+
+$$
+\| x - y \| ^ {2} \leq \frac {2}{h} - 2 \mu .
+$$
+
+One special case of Theorem 3.2 is the following theorem, which states that no matter how close to a global minimum does GD start, if this minimum does not correspond to well-balanced norms, a large learning rate will take the iteration to a more balanced limit. We also demonstrate a sharp shrinkage in the distance between $x$ and $y$ .
+
+Corollary 3.3 (From 'unbalanced' to 'balanced'). For any $\delta \in (0, \mu)$ , let the $GD$ initialization satisfy
+
+$$
+\left(x _ {0}, y _ {0}\right) \in \left\{\left(u, v\right): \left| u v ^ {\top} - \mu \right| < \delta , \| u \| ^ {2} + \| v \| ^ {2} > 8 \mu \right\} \backslash \mathcal {B},
+$$
+
+where $\mathcal{B}$ is some Lebesgue measure-0 set. When the learning rate $h$ satisfies $h = \frac{4}{\|x_0\|^2 + \|y_0\|^2 + 4\mu}$ , the extent of balancing at the limiting point $(x,y)$ of $GD$ obeys
+
+$$
+\left\| x - y \right\| ^ {2} < \frac {1}{2} \left\| x _ {0} - y _ {0} \right\| ^ {2} + 2 \mu .
+$$
+
+Both Theorem 3.2 and Corollary 3.3 suggest that larger learning rate yields better balancing effect, as $\| x - y \|^2$ at the limit of GD may decrease a lot and is controlled by the learning rate. We remark that the balancing effect is a consequence of large learning rate, as small learning rate can only maintain the difference in magnitudes of $x, y$ (Du et al., 2018).
+
+In addition, the actual balancing effect can be quite strong with $\| x_{k} - y_{k}\|^{2}$ decreasing to be almost 0 at its limit under a proper choice of large learning rate. Figure 2 illustrates an almost perfect balancing case when $h = \frac{4}{\|x_0\|^2 + \|y_0\|^2 + 4} \approx 0.0122$ is chosen as the upper bound. The difference $\| x_{k} - y_{k}\|$ decreases from approximately 17.9986 to 0.0154 at its limit. Additional experiments with various learning rates and initializations can be found in Appendix A.
+
+Technical Overview We sketch the main ideas behind Theorem 3.1, which lead to the balancing effect in Theorem 3.2. Full proof is deferred to Appendix G.
+
+
+Figure 2: The objective function is $(1 - xy^{\top})^{2} / 2$ , where $x^{\top}, y^{\top} \in \mathbb{R}^{10}$ . Highly unbalanced initial condition is uniformly randomized, with the norms to be $\| x_0\| = 18$ , $\| y_0\| = 0.09$ .
+
+
+
+The convergence is proved by handling Phase 1 and 2 separately (see Fig.1). In Phase 1, we prove that $\| x_{k}\|^{2} + \| y_{k}\|^{2}$ has a decreasing trend as GD searches for flat minimum. We show that $\| x_k\|^2 +\| y_k\|^2$ may not be monotone, i.e., it either decreases every iteration or decreases every other iteration.
+
+In Phase 2, we carefully partition the state space and show GD at each partition will eventually enter a monotone convergence region. Note that the partition is based on detailed understanding of the dynamics and is highly nontrivial. Attentive readers may refer to Appendix G for more details. The combination of Phase 1 & 2 is briefly summarized as a proof flow chart in Figure 3.
+
+
+Figure 3: Proof overview of Theorem 3.1. At the $k$ -th iteration, we denote $(x_{k},y_{k})$ as the iterate and $s_k$ is defined as $x_{k + 1}y_{k + 1}^{\top} - \mu = s_k(x_ky_k^{\top} - \mu)$ .
+
+# 4 RANK-1 APPROX. OF ISOTROPIC $A$ (AN UNDER-PARAMETERIZED CASE)
+
+Given insights from scalar factorization, we consider rank-1 factorization of an isotropic matrix $A$ , i.e., $A = \mu I_{n\times n}$ with $\mu > 0$ , $d = 1$ , and $n \in \mathbb{N}^+$ . The corresponding optimization problem is
+
+$$
+\min _ {x, y \in \mathbb {R} ^ {n \times 1}} \frac {1}{2} \| \mu I _ {n \times n} - x y ^ {\top} \| _ {\mathsf {F}} ^ {2}. \tag {4}
+$$
+
+Although similar at an uncareful glance, Problems (4) and (3) are rather different unless $n = d = 1$ . First of all, Problem (4) is under-parameterized for $n > 1$ , while (3) is overparameterized. More importantly, we'll show that, when $(x,y)$ is a global minimum of (4), $x,y$ must be aligned, i.e., $x = \ell y$ for some $\ell > 0$ . In the scalar factorization problem, however, no such alignment is required. As a result, the set of global minima of (4) is an $n$ -dimensional submanifold embedded in a $2n$ -dimensional space, while in the scalar factorization problem the set of global minimum is a $(2d - 1)$ -dimensional
+
+submanifold — one rank deficient — in a $2d$ -dimensional space. We expect the convergence in (4) is more complicated than that in (3), since searching in (4) is demanding.
+
+To prove the convergence of large learning rate GD for (4), our theory consists of two steps: (i) show the convergence of the alignment between $x$ and $y$ (this is new); (ii) use that to prove the convergence of the full iterates (i.e., $x \& y$ ). Step (i) first:
+
+Theorem 4.1 (Alignment). Given $(x_0, y_0) \in (\mathbb{R}^n \times \mathbb{R}^n) \backslash \mathcal{B}$ , where $\mathcal{B}$ is some Lebesgue measure-0 set, when learning rate $h \leq \min \left\{\frac{4}{\|x_0\|^2 + \|y_0\|^2 + 4\sqrt{7}\mu}, \frac{1}{2\sqrt{7}\mu}\right\}$ , the iterator $(x_k, y_k)$ of $GD$ at the $k$ -th iteration satisfies $|\cos(\angle(x_k, y_k))| \to 1$ as $k \to \infty$ .
+
+Proof sketch. A sufficient condition for the convergence of $|\cos(\angle(x_k, y_k))|$ is $\|x_k\|^2 \|y_k\|^2 - (x_k^\top y_k)^2 \to 0$ . To ease the presentation, let $U_k = x_k^\top y_k$ , $V_k = x_k^\top x_k$ , and $W_k = y_k^\top y_k$ . By the GD update and some algebraic manipulation, we derive
+
+$$
+V _ {k + 1} W _ {k + 1} - U _ {k + 1} ^ {2} = r _ {k} \cdot (V _ {k} W _ {k} - U _ {k} ^ {2}),
+$$
+
+where $r_k = (1 - h(V_k + W_k) + h^2 (V_kW_k - \mu^2))^2$ . When $k$ is sufficiently large, we can show a uniform upper bound on $r_k < 1 - c$ for some constant $c > 0$ . In this way, we deduce that $V_{k}W_{k} - U_{k}^{2}$ will exponentially decay and converge to 0. More details are provided in Appendix H.
+
+Theorem 4.1 indicates that GD iterations will converge to the neighbourhood of $\{(x,y):x = \ell y$ , for some $\ell \in \mathbb{R}\backslash \{0\}\}$ . This helps establish the global convergence as stated in Step (ii).
+
+Theorem 4.2 (Convergence). Under the same initial conditions and learning rate $h$ as Theorem 4.1, $GD$ for (4) converges to a global minimum.
+
+Similar to the over-parametrized scalar case, this convergence can also be split into two phases where phase 1 motivates the balancing behavior with the decrease of $\| x_{k}\|^{2} + \| y_{k}\|^{2}$ , and phase 2 ensures the convergence. The following balancing theorem is thus obtained.
+
+Theorem 4.3 (Balancing). Under the same initial conditions and learning rate $h$ as Theorem 4.1, $GD$ for (4) converges to a global minimizer that obeys
+
+$$
+\left\| x \right\| ^ {2} + \left\| y \right\| ^ {2} \leq \frac {2}{h},
+$$
+
+and its extent of balancing is quantified by
+
+$$
+\| x - y \| ^ {2} \leq \frac {2}{h} - 2 \mu .
+$$
+
+This conclusion is the same as the one in Section 3. A quantitatively similar corollary like Corollary 3.3 can also be obtained from the above theorem, namely, if $x_0$ and $y_0$ start from an unbalanced point near a minimum, the limit will be a more balanced one.
+
+# 5 GENERAL MATRIX FACTORIZATION
+
+In this section, we consider problem (1) with an arbitrary matrix $A \in \mathbb{R}^{n \times n}$ . We replicate the problem formulation here for convenience,
+
+$$
+\min _ {X, Y \in \mathbb {R} ^ {n \times d}} \frac {1}{2} \left\| A - X Y ^ {\top} \right\| _ {\mathsf {F}} ^ {2}. \tag {5}
+$$
+
+Note this is the most general case with $n, d \in \mathbb{N}^+$ and any square matrix $A$ . Due to this generalization, we no longer utilize the convergence analysis and instead, establish the balancing theory via stability analysis of GD as a discrete time dynamical system.
+
+Let $\mu_1 \geq \mu_2 \geq \dots \geq \mu_n \geq 0$ be the singular values of $A$ . Assume for technical convenience $\| A \|_{\mathsf{F}}^2 = \sum_{i=1}^{n} \mu_i^2$ being independent of $d$ and $n$ . We denote the singular value decomposition of $A$ as $A = U D V^\top$ , where $U, D, V \in \mathbb{R}^{n \times n}$ , $U, V$ are orthogonal matrices and $D$ is diagonal. Then we establish the following balancing effect.
+
+Theorem 5.1. Given almost all the initial conditions, for any learning rate $h$ such that $GD$ for (5) converges to a point $(X,Y)$ , there exists $c = c(n,d) > c_0$ with constant $c_0 > 0$ independent of $h$ , $n$ , and $d$ , such that $(X,Y)$ satisfies
+
+$$
+c (\| X \| _ {\mathsf {F}} ^ {2} + \| Y \| _ {\mathsf {F}} ^ {2}) < \frac {2}{h},
+$$
+
+and the extent of balancing is quantified by $\left\| X - (UV^{\top})Y\right\|_{\mathsf{F}}^{2} < \frac{2}{ch} - 2\sum_{i=1}^{\min\{d,n\}} \mu_{i}$ , which means
+
+$$
+\left| \left\| X \right\| _ {\mathsf {F}} - \left\| Y \right\| _ {\mathsf {F}} \right| ^ {2} < \frac {2}{c h} - 2 \sqrt {\sum_ {i = 1} ^ {\min \{d , n \}} \mu_ {i} ^ {2}}.
+$$
+
+In particular, when $d = 1$ , i.e., rank-1 factorization of an arbitrary $A$ , the constant $c$ equals 1.
+
+We observe that the extent of balancing can be quantified under some rotation of $Y$ . This is necessary, since for factorizing a general matrix $A$ (which can be asymmetric), at a global minimum, $X, Y$ may only align after a rotation (which is however fixed by $A$ , independent of initial or final conditions). Figure 4 illustrates an example of the balancing effect under different learning rates. Evidently, larger learning rate leads to a more balanced global minimizer. Additional experiments with various dimensions, learning rates, and initializations can be found in Appendix A; a similar balancing effect is also shown for additional problems including matrix sensing and matrix completion there.
+
+
+Figure 4: Balancing effect of general matrix factorization. We independently generate elements in $A \in \mathbb{R}^{6 \times 6}$ from a Gaussian distribution. We choose $X, Y \in \mathbb{R}^{6 \times 100}$ and randomly pick a pair of initial point $(X_0, Y_0)$ with $\|X_0\|_{\mathsf{F}} = 1$ and $\|Y_0\|_{\mathsf{F}} = 9$ .
+
+
+
+
+
+
+
+Different from previous sections, Theorem 5.1 builds on stability analysis by viewing GD as a dynamical system in discrete time. More precisely, the proof of Theorem 5.1 (see Appendix I for details) consists of two parts: (i) the establishment of an easier but equivalent problem via the rotation of $X$ and $Y$ , (ii) stability analysis of the equivalent problem.
+
+For (i), by singular value decomposition (SVD), $A = U D V^{\top}$ , where $U, D, V \in \mathbb{R}^{n \times n}$ , $U$ and $V$ are orthogonal matrices, and $D$ is a non-negative diagonal matrix. Let $X_{k} = U R_{k}$ , $Y_{k} = V S_{k}$ . Then
+
+$$
+\begin{array}{l} \left\{ \begin{array}{l l} & X _ {k + 1} = X _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) Y _ {k} \\ & Y _ {k + 1} = Y _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) ^ {\top} X _ {k} \end{array} \right. \\ \Leftrightarrow \left\{ \begin{array}{l l} & U R _ {k + 1} = U R _ {k} + h (U D V ^ {\top} - U R _ {k} S _ {k} ^ {\top} V ^ {\top}) V S _ {k} \\ & V S _ {k + 1} = V S _ {k} + h (U D V ^ {\top} - U R _ {k} S _ {k} ^ {\top} V ^ {\top}) ^ {\top} U R _ {k} \end{array} \right. \\ \Leftrightarrow \left\{ \begin{array}{l l} & R _ {k + 1} = R _ {k} + h (D - R _ {k} S _ {k} ^ {\top}) S _ {k} \\ & S _ {k + 1} = S _ {k} + h (D - R _ {k} S _ {k} ^ {\top}) ^ {\top} R _ {k} . \end{array} \right. \\ \end{array}
+$$
+
+Therefore, GD for problem (5) is equivalent to GD for the following problem
+
+$$
+\min _ {R, S \in \mathbb {R} ^ {n \times d}} \frac {1}{2} \left\| D - R S ^ {\top} \right\| _ {\mathsf {F}} ^ {2}
+$$
+
+and it thus suffices to work with diagonal non-negative $A$ .
+
+For (ii), here is a brief description of the idea of stability analysis: consider each iteration of GD as a mapping $\psi$ from $u_{k}\sim (X_{k},Y_{K})$ to $u_{k + 1}\sim (X_{k + 1},Y_{k + 1})$ , where matrices $X$ and $Y$ are flattened
+
+and concatenated into a vector so that $\psi$ is a closed map on vector space $\mathbb{R}^{2dn}$ . GD iteration is thus a discrete time dynamical system on state space $\mathbb{R}^{2dn}$ given by
+
+$$
+u _ {k + 1} = \psi (u _ {k}) = u _ {k} - h \nabla f (u _ {k}),
+$$
+
+where $f$ is the objective function $f(u_{k}) = \frac{1}{2}\left\| A - X_{k}Y_{k}^{\top}\right\|_{F}^{2}$ , and gradient returns a vector that collects all component-wise partial derivatives.
+
+It's easy to see that any stationary point of $f$ , denoted by $u^{*}$ , is a fixed point of $\psi$ , i.e., $u^{*} = \psi(u^{*})$ . What fixed point will the iterations of $\psi$ converge to? For this, the following notions are helpful:
+
+Proposition 5.2. Consider a fixed point $u^{*}$ of $\psi$ . If all the eigenvalues of Jacobian matrix $\nabla \psi(u^{*})$ are of complex modulus less than 1, it is a stable fixed point.
+
+Proposition 5.3. Consider a fixed point $u^{*}$ of $\psi$ . If at least one eigenvalue of Jacobian matrix $\nabla \psi(u^{*})$ is of complex modulus greater than 1, it is an unstable fixed point.
+
+Roughly put, the stable set of an unstable fixed point is of negligible size when compared to that of a stable fixed point, and thus what GD converges to is a stable fixed point for almost all initial conditions (Alligood et al., 1996). Thus, we investigate the stability of each global minimum of $f$ (each saddle of $f$ is an unstable fixed point of $\psi$ and thus is irrelevant). By a detailed evaluation of $\nabla \psi$ 's eigenvalues (Appendix I), we see that a global minimum $(X,Y)$ of $f$ corresponds to a stable fixed point of GD iteration if $\left|1 - ch\left(\| X\|_{\mathsf{F}}^2 +\| Y\|_{\mathsf{F}}^2\right)\right| < 1$ , i.e., it is balanced as in Thm. 5.1.
+
+# 6 CONCLUSION AND DISCUSSION
+
+In this paper, we demonstrate an implicit regularization effect of large learning rate on the homogeneous matrix factorization problem solved by GD. More precisely, a phenomenon termed as "balancing" is theoretically illustrated, which says the difference between the two factors $X$ and $Y$ may decrease significantly at the limit of GD, and the extent of balancing can increase as learning rate increases. In addition, we provide theoretical analysis of the convergence of GD to the global minimum, and this is with large learning rate that can exceed the typical limit of $2 / L$ , where $L$ is the largest eigenvalue of Hessian at GD initialization.
+
+For the matrix factorization problem analyzed here, large learning rate avoids bad regularities induced by the homogeneity between $X$ and $Y$ . We feel it is possible that such balancing behavior can also be seen in problems with similar homogeneous properties, for example, in tensor decomposition (Kolda & Bader, 2009), matrix completion (Keshavan et al., 2010; Hardt, 2014), generalized phase retrieval (Candes et al., 2015; Sun et al., 2018), and neural networks with homogeneous activation functions (e.g., ReLU). Besides the balancing effect, the convergence analysis under large learning rate may be transplanted to other non-convex problems and help discover more implicit regularization effects.
+
+In addition, factorization problems studied here are closely related to two-layer linear neural networks. For example, one-dimensional regression via a two-layer linear neural network can be formulated as the scalar factorization problem (3): Suppose we have a collection of data points $(x_{i},y_{i})\in \mathbb{R}\times \mathbb{R}$ for $i = 1,\dots ,n$ . We aim to train a linear neural network $y = (u^{\top}v)x$ with $u,v\in \mathbb{R}^{d}$ for fitting the data. We optimize $u,v$ by minimizing the quadratic loss,
+
+$$
+\left(u ^ {*}, v ^ {*}\right) \in \arg \min _ {u, v} \frac {1}{n} \sum_ {i = 1} ^ {n} \left(y _ {i} - \left(u ^ {\top} v\right) x _ {i}\right) ^ {2} = \arg \min _ {u, v} \frac {1}{n} \left(\frac {\sum_ {i = 1} ^ {n} x _ {i} y _ {i}}{\sum_ {i = 1} ^ {n} x _ {i} ^ {2}} - u ^ {\top} v\right) ^ {2}. \tag {6}
+$$
+
+As can be seen, taking $\mu = \frac{\sum_{i=1}^{n} x_i y_i}{\sum_{i=1}^{n} x_i^2}$ recovers (3). In this regard, our theory indicates that training of $u, v$ by GD with large learning rate automatically balances $u, v$ , and the obtained minimum is flat. This may provide some initial understanding of the improved performance brought by large learning rates in practice. Note that (6) generalizes to arbitrary data distribution of training a two-layer linear network with atomic data (i.e., $x = 1$ and $y = 0$ ) in Lewkowycz et al. (2020).
+
+It is important to clarify, however, that there is a substantial gap between this demonstration and extensions to general neural networks, including deep linear and nonlinear networks. Although we suspect that large learning rate leads to similar balancing effect of weight matrices in the network, rigorous theoretical analysis is left as a future direction.
+
+# ACKNOWLEDGMENTS
+
+We thank anonymous reviewers and area chair for suggestions that improved the quality of this paper. The authors are grateful for partial supports from NSF DMS-1847802 (YW and MT) and ECCS-1936776 (MT).
+
+# REFERENCES
+
+Kathleen T Alligood, Tim D Sauer, and James A Yorke. *Chaos: an introduction to dynamical systems*. Springer, 1996.
+Pierre Baldi and Kurt Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural networks, 2(1):53-58, 1989.
+Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183-202, 2009.
+Srinadh Bhojanapalli, Anastasios Kyrillidis, and Sujay Sanghavi. Dropping convexity for faster semi-definite optimization. In Conference on Learning Theory, pp. 530-582. PMLR, 2016.
+Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. Siam Review, 60(2):223-311, 2018.
+Stephen Boyd, Stephen P Boyd, and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
+Ricardo Cabral, Fernando De la Torre, João P Costeira, and Alexandre Bernardino. Unifying nuclear norm and bilinear factorization approaches for low-rank matrix decomposition. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2488-2495, 2013.
+Emmanuel J Candes, Xiaodong Li, and Mahdi Soltanolkotabi. Phase retrieval via wirtinger flow: Theory and algorithms. IEEE Transactions on Information Theory, 61(4):1985-2007, 2015.
+Yudong Chen and Martin J Wainwright. Fast low-rank estimation by projected gradient descent: General statistical and algorithmic guarantees. arXiv preprint arXiv:1509.03025, 2015.
+Zhehui Chen, Xingguo Li, Lin F Yang, Jarvis Haupt, and Tuo Zhao. On landscape of lagrangian functions and stochastic search for constrained nonconvex optimization. arXiv preprint arXiv:1806.05151, 2018.
+Simon S Du, Wei Hu, and Jason D Lee. Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
+Herbert Federer. Geometric measure theory. Springer, 2014.
+Rong Ge, Chi Jin, and Yi Zheng. No spurious local minima in nonconvex low rank problems: A unified geometric analysis. In International Conference on Machine Learning, pp. 1233-1242. PMLR, 2017.
+Akhilesh Gotmare, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. A closer look at deep learning heuristics: Learning rate restarts, warmup and distillation. arXiv preprint arXiv:1810.13243, 2018.
+Suriya Gunasekar, Blake Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nathan Srebro. Implicit regularization in matrix factorization. In 2018 Information Theory and Applications Workshop (ITA), pp. 1-10. IEEE, 2018.
+Ernst Hairer, Marlis Hochbruck, Arieh Iserles, and Christian Lubich. Geometric numerical integration. Oberwolfach Reports, 3(1):805-882, 2006.
+
+Moritz Hardt. Understanding alternating minimization for matrix completion. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pp. 651-660. IEEE, 2014.
+Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. arXiv preprint arXiv:1806.07572, 2018.
+Stanislaw Jastrzebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in sgd. arXiv preprint arXiv:1711.04623, 2017.
+Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. arXiv preprint arXiv:1810.02032, 2018.
+Raghunandan H Keshavan, Andrea Montanari, and Sewoong Oh. Matrix completion from a few entries. IEEE transactions on information theory, 56(6):2980-2998, 2010.
+Tamara G Kolda and Brett W Bader. Tensor decompositions and applications. SIAM review, 51(3): 455-500, 2009.
+Lingkai Kong and Molei Tao. Stochasticity of deterministic gradient descent: Large learning rate for multiscale objective function. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 2625-2638. Curran Associates, Inc., 2020.
+Quoc V Le, Jiquan Ngiam, Adam Coates, Ahbik Lahiri, Bobby Prochnow, and Andrew Y Ng. On optimization methods for deep learning. In ICML, 2011.
+Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. 2020.
+Qiuwei Li, Zhihui Zhu, and Gongguo Tang. The non-convex geometry of low-rank matrix optimization. Information and Inference: A Journal of the IMA, 8(1):51-96, 2019a.
+Xingguo Li, Junwei Lu, Raman Arora, Jarvis Haupt, Han Liu, Zhaoran Wang, and Tuo Zhao. Symmetry, saddle points, and global optimization landscape of nonconvex matrix factorization. IEEE Transactions on Information Theory, 65(6):3489-3514, 2019b.
+Yan Li, Ethan X.Fang, Huan Xu, and Tuo Zhao. Implicit bias of gradient descent based adversarial training on separable data. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=HkgTTh4FDH.
+Yan Li, Caleb Ju, Ethan X Fang, and Tuo Zhao. Implicit regularization of bregman proximal point algorithm and mirror descent on separable data. arXiv preprint arXiv:2108.06808, 2021.
+Yuanzhi Li, Colin Wei, and Tengyu Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. arXiv preprint arXiv:1907.04595, 2019c.
+Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. arXiv preprint arXiv:1910.07454, 2019.
+Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. arXiv preprint arXiv:1908.03265, 2019.
+Tianyi Liu, Yan Li, Song Wei, Enlu Zhou, and Tuo Zhao. Noisy gradient descent converges to flat minima for nonconvex matrix factorization. 2021.
+Tianyi Liu, Yan Li, Enlu Zhou, and Tuo Zhao. Noise regularizes over-parameterized rank one matrix recovery, provably. arXiv preprint arXiv:2202.03535, 2022.
+Cong Ma, Yuanxin Li, and Yuejie Chi. Beyond procrustes: Balancing-free gradient descent for asymmetric low-rank matrix sensing. IEEE Transactions on Signal Processing, 69:867-877, 2021.
+Preetum Nakkiran. Learning rate annealing can provably help generalization, even for convex problems. 2020.
+
+Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2003.
+Yurii E Nesterov. A method for solving the convex programming problem with convergence rate of $(1 / k^{\wedge}2)$ . In Dokl. akad. nauk Sssr, volume 269, pp. 543-547, 1983.
+Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014.
+Boris T Polyak. Some methods of speeding up the convergence of iteration methods. Ussr computational mathematics and mathematical physics, 4(5):1-17, 1964.
+Boris T Polyak. Introduction to optimization. optimization software. Inc., Publications Division, New York, 1, 1987.
+Sihyeon Seong, Yegang Lee, Youngwook Kee, Dongyoon Han, and Junmo Kim. Towards flatter loss surface via nonmonotonic learning rate scheduling. In UAI, pp. 1020-1030, 2018.
+Leslie N Smith. Cyclical learning rates for training neural networks. In 2017 IEEE winter conference on applications of computer vision (WACV), pp. 464-472. IEEE, 2017.
+Leslie N Smith. A disciplined approach to neural network hyper-parameters: Part 1-learning rate, batch size, momentum, and weight decay. arXiv preprint arXiv:1803.09820, 2018.
+Leslie N Smith and Nicholay Topin. Super-convergence: Very fast training of neural networks using large learning rates. In Artificial Intelligence and Machine Learning for Multi-Domain Operations Applications, volume 11006, pp. 1100612. International Society for Optics and Photonics, 2019.
+Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. *The Journal of Machine Learning Research*, 19(1): 2822-2878, 2018.
+Derya Soydaner. A comparison of optimization algorithms for deep learning. International Journal of Pattern Recognition and Artificial Intelligence, 34(13):2052013, 2020.
+Ju Sun, Qing Qu, and John Wright. A geometric analysis of phase retrieval. Foundations of Computational Mathematics, 18(5):1131-1198, 2018.
+Stephen Tu, Ross Boczar, Max Simchowitz, Mahdi Soltanolkotabi, and Ben Recht. Low-rank solutions of linear matrix equations via procrustes flow. In International Conference on Machine Learning, pp. 964-973. PMLR, 2016.
+Hossein Valavi, Sulin Liu, and Peter Ramadge. Revisiting the landscape of matrix factorization. In Silvia Chiappa and Roberto Calandra (eds.), Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pp. 1629-1638. PMLR, 26-28 Aug 2020a.
+Hossein Valavi, Sulin Liu, and Peter J Ramadge. The landscape of matrix factorization revisited. arXiv preprint arXiv:2002.12795, 2020b.
+Tian Ye and Simon S Du. Global convergence of gradient descent for asymmetric low-rank matrix factorization. arXiv preprint arXiv:2106.14289, 2021.
+Xubo Yue, Maher Nouiehed, and Raed Al Kontar. Salr: Sharpness-aware learning rates for improved generalization. arXiv preprint arXiv:2011.05348, 2020.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning (still) requires rethinking generalization. Communications of the ACM, 64(3):107-115, 2021.
+Mo Zhou, Tianyi Liu, Yan Li, Dachao Lin, Enlu Zhou, and Tuo Zhao. Toward understanding the importance of noise in training neural networks. In International Conference on Machine Learning, pp. 7594-7602. PMLR, 2019.
+Pan Zhou, Jiashi Feng, Chao Ma, Caiming Xiong, Steven Ho, et al. Towards theoretically understanding why sgd generalizes better than adam in deep learning. arXiv preprint arXiv:2010.05627, 2020.
+
+# Supplementary Materials for “Large Learning Rate Tames Homogeneity: Convergence and Balancing Effect”
+
+# A ADDITIONAL EXPERIMENTS
+
+# A.1 MORE RESULTS FOR MATRIX FACTORIZATION
+
+In this section, we present more experiments with different choices of $n, d$ , various initializations and scalings, and a broader range of learning rates. All these experiments verify our claim on the balancing effect of large learning rate, i.e., the shrinkage of the gap between the magnitudes of $X$ and $Y$ exists for general matrix factorization problems, i.e., for any choice of $n, d \in \mathbb{N}^+$ .
+
+We first provide examples of scalar factorization in Figure 5, 6, and 7 to numerically justify our theory in Section 3. In the three figures, the initial conditions randomly generated, respectively with $(\| x_0\| ,\| y_0\|) = (9,1)$ , $(\| x_0\| ,\| y_0\|) = (19,1)$ , and $(\| x_0\| ,\| y_0\|) = (99,1)$ ; the learning rates are chosen within the range of Theorem 3.1 from large to small as $h_0,\frac{6}{7} h_0,\frac{5}{7} h_0,\frac{4}{7} h_0,\frac{3}{7} h_0,\frac{2}{7} h_0$ for the 1st-6th columns respectively where $h_0 = 4 / (\| x_0\|^2 +\| y_0\|^2 +8)$ . The learning rates of the left three columns are larger than $2 / L$ ( $L$ is the local Lipschitz constant of gradient near the initial condition), where we can see the decrease in the gap between $\| x_k\|$ and $\| y_{k}\|$ and larger learning rate leads to smaller gap; the right three correspond to $h < 2 / L$ where there are almost no changes in $\| x_{k}\|$ and $\| y_{k}\|$ as $k$ increases. Moreover, the loss does not decrease monotonically at the beginning of the iterations for all the $h > 2 / L$ cases while in the later iterations GD shows monotone convergence; for the right three columns ( $h < 2 / L$ cases), we can see monotone decrease of the loss. This validates our two-phase pattern of convergence (see e.g. Figure 1 and Section 3 for detailed explanation).
+
+
+Figure 5: Scalar factorization with $\| x_0\| = 9$ , $\| y_0\| = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $x_k$ and $y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+Then we experiment with the general matrix factorization as a supplement of our theory in Section 5 where we only rigorously prove the balancing effect given the convergence of GD. In the following examples, we show that there indeed exist large learning rates that trigger the shrinkage of the gap between $\|X_k\|_{\mathsf{F}}$ and $\|Y_k\|_{\mathsf{F}}$ and at the same time guarantee the convergence of GD. Figure 8, 9, and 10 correspond to the over-parameterized version of matrix factorization problem (5) with $A \in \mathbb{R}^{6 \times 6}$ (asymmetric, generated by i.i.d. Gaussian) and $X, Y \in \mathbb{R}^{6 \times 100}$ . The initial conditions are randomly generated with $(\|X_0\|_{\mathsf{F}}, \|Y_0\|_{\mathsf{F}}) = (9, 1)$ , $(\|X_0\|_{\mathsf{F}}, \|Y_0\|_{\mathsf{F}}) = (19, 1)$ , and
+
+
+Figure 6: Scalar factorization with $\| x_0\| = 19$ , $\| y_0\| = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $x_k$ and $y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+
+Figure 7: Scalar factorization with $\| x_0\| = 99$ , $\| y_0\| = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $x_k$ and $y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+$(\| X_0\|_{\mathsf{F}},\| Y_0\|_{\mathsf{F}}) = (99,1)$ respectively. Similarly, the learning rates are chosen from large to small as $h_0,\frac{6}{7} h_0,\frac{5}{7} h_0,\frac{4}{7} h_0,\frac{3}{7} h_0,\frac{2}{7} h_0$ for the 1st-6th columns respectively where $\frac{6}{7} h_0$ (the 2nd column) is picked near the stability limit. We also similarly provide two examples of the under-parameterized version in Figure 11 and 12. The two examples correspond to problem (5) with $A\in \mathbb{R}^{100\times 100}$ (asymmetric, similarly generated as the previous one) and $X,Y\in \mathbb{R}^{100\times 3}$ . Here we use a shifted loss which is to subtract the global minimum error.
+
+As is shown in Figure 8, 9, 10, 11, and 12, we can observe the similar phenomenon as the scalar case, in the sense that (1) larger learning rate gives a smaller the gap between $\|X_k\|_{\mathsf{F}}$ and $\|Y_k\|_{\mathsf{F}}$ in the limit, except for the overly large $h$ that causes GD to diverge; (2) when the learning rate becomes sufficiently big, a two-phase pattern of convergence appears, which does not manifest in traditional optimization analysis and thus indicates that the learning rate is already larger than that permitted by traditional theory, and yet one still has convergence.
+
+More precisely, the 2nd-4th columns are the large learning rate cases, where one observes a shrinkage of the unbalancedness and non-monotonicity of the loss at the beginning, while the right two columns correspond to the small learning rates for which $\|X_k\|_{\mathsf{F}}$ and $\|Y_k\|_{\mathsf{F}}$ barely change as $k$ increases, and the decrease of loss is monotone. These are all evidence of the consistency between the most general case of matrix factorization in Section 5 and the special cases in Section 3 and 4.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: General over-parameterized matrix factorization with $\| X_0\|_{\mathsf{F}} = 9$ $\| Y_0\|_{\mathsf{F}} = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_{k}$ and $Y_{k}$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 9: General over-parameterized matrix factorization with $\|X_0\|_{\mathsf{F}} = 19$ $\|Y_0\|_{\mathsf{F}} = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_k$ and $Y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+
+
+
+
+
+
+
+
+
+
+# A.2 MATRIX SENSING AND MATRIX COMPLETION
+
+As we demonstrated, the balancing effect is a nontrivial implicit bias created by large learning rate in GD, and this was rigorously established for the problem of matrix factorization. Matrix factorization already corresponds to a class of important problems as we consider arbitrary $n$ and $d$ ; however, we feel balancing is an effect even more general, and thus we now demonstrate it empirically on two related additional problems, namely matrix sensing and matrix completion.
+
+
+Figure 10: General over-parameterized matrix factorization with $\|X_0\|_{\mathsf{F}} = 99$ $\|Y_0\|_{\mathsf{F}} = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_k$ and $Y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same. Note the $x$ -axis range of the 1st row is shortened to better show the changes of $\|X_k\|_{\mathsf{F}}$ and $\|Y_k\|_{\mathsf{F}}$ at the beginning of the iterations.
+
+
+Figure 11: General under-parameterized matrix factorization with $\|X_0\|_{\mathsf{F}} = 9$ $\|Y_0\|_{\mathsf{F}} = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_k$ and $Y_k$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same. Note the $x$ -axis range of the 1st row is shortened to better show the changes of $\|X_k\|_{\mathsf{F}}$ and $\|Y_k\|_{\mathsf{F}}$ at the beginning of the iterations.
+
+In Figure 13, we consider matrix sensing corresponding to the problem
+
+$$
+\min _ {X, Y \in \mathbb {R} ^ {n \times d}} \frac {1}{2 m} \sum_ {i = 1} ^ {m} (b _ {i} - \langle A _ {i}, X Y ^ {\top} \rangle) ^ {2}.
+$$
+
+Here $A_{i}\in \mathbb{R}^{100\times 100}$ are generated from element-wise i.i.d. Gaussian; $b_{i}\in \mathbb{R}$ are generated from uniform distribution [0, 1]; $m = 10$ ; $X,Y\in \mathbb{R}^{100\times 6}$ ; $\langle U,V\rangle = \mathrm{tr}(V^{\top}U)$ . The problem is solved via GD. Experiments in the figure correspond to learning rates chosen from large to small as $h_0,\frac{4}{5} h_0,\frac{3}{5} h_0,\frac{2}{5} h_0$ where $h_0$ (the 1st column) is picked near the stability limit. We can see from the figure that matrix sensing exhibits a similar balancing effect with matrix factorization that larger learning rate leads to more balanced norms between $X$ and $Y$ .
+
+
+Figure 12: General under-parameterized matrix factorization with $\| X_0\|_{\mathbb{F}} = 19$ $\| Y_0\|_{\mathbb{F}} = 1$ . The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_{k}$ and $Y_{k}$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same. Note the $x$ -axis range of the 1st row is shortened to better show the changes of $\| X_k\| _F$ and $\| Y_k\| _F$ at the beginning of the iterations.
+
+In Figure 14, we consider matrix completion corresponding to the problem
+
+$$
+\min _ {X, Y \in \mathbb {R} ^ {n \times d}} \frac {1}{2} \left\| P _ {\Omega} (A - X Y ^ {T}) \right\| _ {\mathsf {F}} ^ {2},
+$$
+
+where $A \in \mathbb{R}^{10 \times 10}$ is a low-rank matrix with rank 2; $X, Y \in \mathbb{R}^{10 \times 2}$ ; $P_{\Omega}(U) = (U_{ij})_{(i,j) \in \Omega} + (0)_{(i,j) \notin \Omega}$ with sparsity $-0.6$ where sparsity=(number of non-zero elements)/(number of all elements). The problem is solved via GD. In the above mentioned figure, the learning rates are similarly chosen as the above matrix sensing example. Likewise, the decrease of learning rate results in the increase in the gap between the norms of $X$ and $Y$ .
+
+Both the matrix sensing and matrix completion above hold the same homogeneity property between $X$ and $Y$ . The "balancing effect" that we proved for matrix factorization is also observed when and only when the learning rate $h$ is large, in which case the norms of $X$ and $Y$ become close at the convergence of GD (and yes, GD still converges even though $h$ is large enough such that the convergence is not monotone.
+
+We feel the techniques invented and employed in this paper can extend to these two cases, but that is beyond the scope of this paper.
+
+# B GD CONVERGING TO PERIODIC ORBIT
+
+Consider the objective $(1 - xy)^2 / 2$ . Take step size $h = 1.9$ . Then GD can converge to periodic orbits with period 2, 3 and 4 respectively in Figure 15.
+
+# C MODIFIED EQUATION FAILS FOR LARGE LEARNING RATES
+
+Consider the objective function $f(x,y) = (1 - xy)^2 / 2$ . Then the GD update is the following
+
+$$
+\left\{ \begin{array}{l} x _ {k + 1} = x _ {k} + h \left(1 - x _ {k} y _ {k}\right) y _ {k} \\ y _ {k + 1} = y _ {k} + h \left(1 - y _ {k} x _ {k}\right) x _ {k} \end{array} \Rightarrow \binom {x _ {k + 1}} {y _ {k + 1}} = \binom {x _ {k}} {y _ {k}} + h (- \nabla f (x _ {k}, y _ {k})). \right. \tag {7}
+$$
+
+
+
+
+
+
+
+
+
+
+Figure 13: Matrix sensing. The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_{k}$ and $Y_{k}$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 14: Matrix completion. The $x$ -axis represents the number of iterations $k$ ; the $y$ -axis represents the value for the norm of $X_{k}$ and $Y_{k}$ in the first row, and the value for loss in the second row; the learning rate $h$ for each column is the same. Note the $x$ -axis range of the 1st row is shortened to better show the changes of $\|X_{k}\|_{\mathsf{F}}$ and $\|Y_{k}\|_{\mathsf{F}}$ at the beginning of the iterations.
+
+
+
+
+
+
+
+By backward error analysis (Hairer et al., 2006, Chapter 9), the modified equation can better approximate GD than gradient flow and is defined as follows
+
+$$
+\left( \begin{array}{l} \dot {x} \\ \dot {y} \end{array} \right) = - \nabla f (x, y) - \frac {h}{2} \nabla^ {2} f (x, y) \nabla f (x, y) + \mathcal {O} \left(h ^ {2}\right). \tag {8}
+$$
+
+Figure 16 shows the trajectories of the 1st order modified equation of (8) and GD (7) with initial condition $x = 4$ , $y = 10$ and $h = 0.026$ . The $x$ -axis represents the time $t$ and for GD, the time point for $k$ th step is $kh$ . We compare the absolute values of $x$ and $y$ of both methods due to the symmetry of the global minima $xy = 1$ . As is shown in the figure, even if GD almost converges to the most balanced minimizer, the solutions of modified equation are still far away from each other, $x \approx 0.1$ and $y \approx 9$ . Actually, large learning rate $h$ fall outside the convergence domain of the modified equation which thus is not an appropriate tool for the analysis of norm balancing.
+
+
+Figure 15: Three orbits of period 2, 3, and 4. The blue line are the orbits; the red line is a reference line of the global minima $xy = 1$ .
+
+
+
+
+
+
+Figure 16: Trajectories: modified equation vs GD
+
+# D PROOF OF PROPOSITION 2.1
+
+Proof of Proposition 2.1. This proposition is a direct consequence of Theorem F.2 and I.3.
+
+
+
+# E OVER-PARAMETRIZED SCALAR DECOMPOSITION: STABILITY LIMIT
+
+Consider the objective $(1 - xy)^2 / 2$ . Choose the initial condition to be $x_0 = 20$ , $y_0 = 0.07$ and use GD update. The upper bound of $h$ in Theorem 3.1 is $\frac{4}{x_0^2 + y_0^2 + 4\mu}$ , where $\mu = 1$ . In Figure 17, when $h = \frac{4}{x_0^2 + y_0^2 + 4}$ (the left one), GD converges; however, when $h$ is slightly larger than this bound, it blows up. Hence our restriction for $h$ is very close to the stability limit.
+
+# F OVERPARAMTRIZED OBJECTIVE: LARGE LEARNING RATE
+
+In this section, we use column vector instead of row vector for sake of better understanding, i.e., our objective function is $(\mu - x^{\top}y)^{2}/2$ .
+
+# F.1 EIGENVALUES OF HESSIAN
+
+Lemma F.1 (Matrix determinant lemma). Suppose $A$ is an invertible $n \times n$ matrix and $u, v \in \mathbb{R}^n$ are column vectors. Then
+
+$$
+\det (A + u v ^ {\top}) = \left(1 + v ^ {\top} A ^ {- 1} u\right) \det A.
+$$
+
+
+Figure 17: The loss with slightly different $h$ near its upper bound
+
+
+
+Theorem F.2. The eigenvalues of the Hessian of $(\mu - x^{\top}y)^{2}/2$ are $\pm (\mu - x^{\top}y)$ repeated $n - 1$ times and $\frac{1}{2}\big(\|x\|^2 + \|y\|^2 \pm \sqrt{(\|x\|^2 + \|y\|^2)^2 + 4(\mu - x^{\top}y)^2 - 8(\mu - x^{\top}y)x^{\top}y}\big)$ . Especially, at $x^{\top}y = \mu$ , the eigenvalues are $\|x\|^2 + \|y\|^2$ and $0$ repeated $2n - 1$ times.
+
+Proof. Consider the objective $f(x,y) = (\mu - x^\top y)^2 / 2$ . Its Hessian is the following
+
+$$
+\begin{array}{l} H = \left( \begin{array}{c c} y y ^ {\top} & (x ^ {\top} y - \mu) I _ {n} + y x ^ {\top} \\ (x ^ {\top} y - \mu) I _ {n} + x y ^ {\top} & x x ^ {\top} \end{array} \right) \\ = \left( \begin{array}{c c} 0 & (x ^ {\top} y - \mu) I _ {n} \\ (x ^ {\top} y - \mu) I _ {n} & 0 \end{array} \right) + \left( \begin{array}{c} y \\ x \end{array} \right) \left( \begin{array}{c} y \\ x \end{array} \right) ^ {\top}. \\ \end{array}
+$$
+
+Then to calculate the eigenvalues, we also need
+
+$$
+\lambda I _ {2 n} - H = \left( \begin{array}{c c} \lambda I _ {n} & (\mu - x ^ {\top} y) I _ {n} \\ (\mu - x ^ {\top} y) I _ {n} & \lambda I _ {n} \end{array} \right) - \left( \begin{array}{c} y \\ x \end{array} \right) \left( \begin{array}{c} y \\ x \end{array} \right) ^ {\top} \triangleq B - \left( \begin{array}{c} y \\ x \end{array} \right) \left( \begin{array}{c} y \\ x \end{array} \right) ^ {\top}.
+$$
+
+By Lemma F.1, we have for invertible $B$
+
+$$
+\det \left(B - \left( \begin{array}{c} y \\ x \end{array} \right) \left( \begin{array}{c} y \\ x \end{array} \right) ^ {\top}\right) = \left(1 - \left( \begin{array}{c} y \\ x \end{array} \right) ^ {\top} B ^ {- 1} \left( \begin{array}{c} y \\ x \end{array} \right)\right) \det B.
+$$
+
+Since $(\mu - x^{\top}y)I_{n}$ and $\lambda I_{n}$ commute, we have
+
+$$
+\det B = \det ((\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}) I _ {n}) = (\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}) ^ {n}.
+$$
+
+By the formula for inversion of block matrix, we have for $\lambda^2 - (\mu - x^\top y)^2 \neq 0$ ,
+
+$$
+B ^ {- 1} = \left( \begin{array}{c c} \frac {\lambda}{\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}} I _ {n} & - \frac {\mu - x ^ {\top} y}{\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}} I _ {n} \\ - \frac {\mu - x ^ {\top} y}{\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}} I _ {n} & \frac {\lambda}{\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}} I _ {n} \end{array} \right).
+$$
+
+Then combining all these and by the continuity of characteristic polynomial, we obtain the following expression for all $\lambda$
+
+$$
+\det (\lambda I _ {2 n} - H) = (\lambda^ {2} - (\mu - x ^ {\top} y) ^ {2}) ^ {n - 1} (\lambda^ {2} - \lambda (x ^ {\top} x + y ^ {\top} y) - (\mu - x ^ {\top} y) ^ {2} + 2 (\mu - x ^ {\top} y) x ^ {\top} y).
+$$
+
+When $x^{\top}y = \mu$ , it becomes
+
+$$
+\det (\lambda I _ {2 n} - H) = \lambda^ {2 n - 1} (\lambda - (x ^ {\top} x + y ^ {\top} y)).
+$$
+
+
+
+# F.2 LOCAL NON-CONVEXITY NEAR THE GLOBAL MINIMUM
+
+Consider the region $D = \{\delta > x^{\top}y - \mu > 0\}$ , a small neighbourhood of the global minima $\mu = x^{\top}y$ for some $\delta > 0$ . Consider two points $[x, y], [\bar{x}, \bar{y}] \in D$ with $x = c\bar{x}$ and $y = \bar{y}/c$ for $c > 0$ a constant.
+
+Then
+
+$$
+\begin{array}{l} f (x, y) + \langle \nabla f (x, y), [ \bar {x} - x, \bar {y} - y ] \rangle = (\mu - x ^ {\top} y) ^ {2} / 2 + (\mu - x ^ {\top} y) \left(y ^ {\top} (x - \bar {x}) + x ^ {\top} (y - \bar {y})\right) \\ = (\mu - \bar {x} ^ {\top} \bar {y}) ^ {2} / 2 + (2 - c - 1 / c) (\mu - \bar {x} ^ {\top} \bar {y}) \bar {x} ^ {\top} \bar {y} \\ \geq \left(\mu - \bar {x} ^ {\top} \bar {y}\right) ^ {2} / 2 = f (\bar {x}, \bar {y}). \\ \end{array}
+$$
+
+This contradicts the definition of convexity. Therefore the objective is not locally convex.
+
+# F.3 A REVIEW OF TRADITIONAL CONVERGENCE ANALYSIS OF GD UNDER $L$ -SMOOTHNESS
+
+For general function $f$ , GD is defined as follows
+
+$$
+x _ {k + 1} = x _ {k} - h \nabla f (x _ {k}). \tag {9}
+$$
+
+Theorem F.3. If $f: \mathbb{R}^N \to \mathbb{R}$ is $L$ -smooth, then with $h < \frac{2}{L}$ , $GD$ converges to a stationary point.
+
+Proof. Let $\min f = f^{*}$
+
+$$
+\begin{array}{l} f (x _ {k + 1}) \leq f (x _ {k}) + \langle \nabla f (x _ {k}), x _ {k + 1} - x _ {k} \rangle + \frac {L}{2} \| x _ {k + 1} - x _ {k} \| ^ {2} \\ = f (x _ {k}) - h \left(1 - \frac {L}{2} h\right) \| \nabla f (x _ {k}) \| ^ {2}. \\ \end{array}
+$$
+
+Then
+
+$$
+\begin{array}{l} \sum_ {k = 1} ^ {N} \| \nabla f (x _ {k}) \| ^ {2} \leq \frac {1}{h \left(1 - \frac {L}{2} h\right)} \left(f (x _ {0}) - f (x _ {N})\right) \\ \leq \frac {1}{h (1 - \frac {L}{2} h)} (f (x _ {0}) - f ^ {*}). \\ \end{array}
+$$
+
+Therefore $\lim_{k\to \infty}\| \nabla f(x_k)\| ^2 = 0$ , i.e., GD converges to a stationary point.
+
+
+
+# G PROOF OF THEOREM 3.1, THEOREM 3.2, AND COROLLARY 3.3
+
+In this section, we use column vectors for $x$ and $y$ instead of row vectors for better understanding. Then the objective function is $\frac{1}{2} (\mu - x^{\top} y)^{2}$ .
+
+The following Theorem G.1 and G.2 are the main theorems of the over-parametrized scalar case. Next, for sake of convenience, let $u_{k}^{2} = \| x_{k}\|^{2} + \| y_{k}\|^{2}$ .
+
+Theorem G.1 (Main 1). Let $h = \frac{4}{u_0^2 + 4c\mu}$ . Assume $c \geq 1$ and $u_0^2 > 8\mu$ . Then $GD$ converges to a point in $\{(x, y) : \| x \|^2 + \| y \|^2 \leq \frac{2}{h}, x^\top y = \mu \}$ except for a Lebesgue measure-0 set of $(x_0, y_0)$ .
+
+Proof. By Lemma G.7 and Lemma G.11, the theorem holds.
+
+
+
+Theorem G.2 (Main 2). Let $h = \frac{4}{8\mu + 4c\mu} = \frac{1}{(2 + c)\mu}$ . Assume $c \geq 1$ and $u_0^2 \leq 8\mu$ . Then $GD$ converges to a point in $\{(x,y) : \| x\|^2 + \| y\|^2 \leq \frac{2}{h}, x^\top y = \mu \}$ except for a Lebesgue measure-0 set of $(x_0, y_0)$ .
+
+Proof. For the measure-0 set, by Lemma G.5, the set of points converging to $\{\|x\|^2 + \|y\|^2 > \frac{2}{h}\}$ is measure-0; by the proof of Lemma G.11, the set of points converging to the origin is measure-0; also $\{u_0^2 = \|x\|^2 + \|y\|^2 = 0\}$ is a hyperplane and thus is measure-0. Hence the set of all the initial conditions not converging to $\{\|x\|^2 + \|y\|^2 > \frac{2}{h}, x^\top y = \mu\}$ is measure-0.
+
+Since $u_0^2 \leq 8\mu$ , if $u_0^2 > \frac{2}{h}$ , by Lemma G.7, it will decrease to $u_k^2 \leq \frac{2}{h}$ for some $k$ . Then by Lemma G.11, we have the convergence.
+
+With the above two theorems, we can prove all the theorems and corollary in Section 3.
+
+Proof of Theorem 3.1 and Theorem 3.2. From Theorem G.1, $h = \frac{4}{u_0^2 + 4c\mu}$ for $c \geq 1$ which implies $h \leq \frac{4}{u_0^2 + 4\mu}$ for all $u_0^2 > 8\mu$ . Similarly, for Theorem G.2, $h \leq \frac{1}{3\mu}$ . When $u_0^2 = 8\mu$ , $\frac{4}{u_0^2 + 4\mu} = \frac{4}{8\mu + 4\mu} = \frac{1}{3\mu}$ ; when $u_0^2 > 8\mu$ , $\frac{4}{u_0^2 + 4\mu} < \frac{1}{3\mu}$ ; when $u_0^2 < 8\mu$ , $\frac{4}{u_0^2 + 4\mu} > \frac{1}{3\mu}$ . Also, all the limit points are in $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ . Then we can get Theorem 3.1 and 3.2 where the second inequality of Theorem 3.2 is because at the global minimum $x^\top y = \mu$ and also $\|x - y\|^2 = \|x\|^2 + \|y\|^2 - 2x^\top y$ .
+
+Proof of Corollary 3.3. For $|x_0^\top y_0 - \mu| < \delta$ , $\| x_0\|^2 + \| y_0\|^2 > 8\mu$ , we have
+
+$$
+x _ {0} ^ {\top} y _ {0} < \mu + \delta \Rightarrow \| x _ {0} - y _ {0} \| ^ {2} = \| x _ {0} \| ^ {2} + \| y _ {0} \| ^ {2} - 2 x _ {0} ^ {\top} y _ {0} > \frac {4}{h} - 4 \mu - 2 (\mu + \delta) = \frac {4}{h} - 6 \mu - 2 \delta .
+$$
+
+Also, from Theorem 3.2, $\| x - y \|^2 \leq \frac{2}{h} - 2\mu$ and $\frac{2}{h} - 2\mu < \frac{4}{h} - 6\mu - 2\delta < \frac{4}{h} - 8\mu$ . We then obtain $\| x - y \|^2 \leq \frac{1}{2} \| x_0 - y_0 \|^2 + 2\mu$ .
+
+We will divide the proof of the two main theorems into two phases: (1) when $\frac{2}{h} < x_k^2 + y_k^2 < \frac{4}{h}$ , we would like to show that GD escapes to a smaller ball $x_k^2 + y_k^2 \leq \frac{2}{h}$ except for a measure-0 set; (2) once GD enters $x_k^2 + y_k^2 \leq \frac{2}{h}$ , it will converge to the global minimum inside this region except for a measure-0 set.
+
+# G.1 PHASE 1: $\frac{2}{h} < u_k^2 < \frac{4}{h}$
+
+We first deal with the situation where GD just converges in this region by showing that such points form a null set. This is stated in Theorem G.5.
+
+Theorem G.3 and Corollary G.4 are the preliminary of proving Theorem G.5. Also Corollary G.4 is a direct result of Theorem G.3.
+
+Theorem G.3. Let $f: \mathbb{R}^N \to \mathbb{R}^M$ and $f \in \mathcal{C}^1$ . If the set of critical points of $f$ is a null-set, i.e.,
+
+$$
+\mathcal {L} \left(\left\{x \in \mathbb {R} ^ {N}: \nabla f (x) \text {i s n o t i n v e r t i b l e} \right\}\right) = 0,
+$$
+
+then $\mathcal{L}(f^{-1}(B)) = 0$ for any null-set $B$ .
+
+Proof. Let $G = \{|\nabla f| \neq 0\}$ and $G$ is an open set, where $|\nabla f|$ denotes the determinant of $\nabla f$ . By implicit function theorem, we have $G \cap f^{-1}(z)$ is a $(N - 1)$ -submanifold in $\mathcal{C}^1$ .
+
+Consider $G \cap \{f \in B\} = \bigcup_{z \in B} G \cap f^{-1}(z)$ , where $\mathcal{L}(G \cap f^{-1}(z)) = 0$ from the above discussion. Hence, if $B$ is countable, $\mathcal{L}(G \cap \{f \in B\}) = 0$ .
+
+When $B$ is uncountable, using co-area formula from geometric measure theory, we have for any bounded open ball $B_r$ ,
+
+$$
+\int_ {G \cap B _ {r}} g | \nabla f | d \mathcal {L} = \int_ {\mathbb {R}} \int_ {f ^ {- 1} (z) \cap G \cap B _ {r}} g (x) d \mathcal {L} _ {N - 1} (x) d z = \int_ {B} \int_ {f ^ {- 1} (z) \cap G \cap B _ {r}} g (x) d \mathcal {L} _ {N - 1} (x) d z.
+$$
+
+Let $g$ be the indicator of $\bigcup_{z \in B} G \cap B_r \cap f^{-1}(z)$ . Then since $B$ is a null-set, we have
+
+$$
+\begin{array}{l} \int_ {B} \int_ {f ^ {- 1} (z) \cap G \cap B _ {r}} g (x) d \mathcal {L} _ {N - 1} (x) d z = \int_ {B} \int_ {f ^ {- 1} (z) \cap G \cap B _ {r}} d \mathcal {L} _ {N - 1} (x) d z = 0 \\ \Rightarrow \int_ {G \cap B _ {r}} g | \nabla f | d \mathcal {L} = 0. \\ \end{array}
+$$
+
+Then $g|\nabla f| = 0$ a.e. in $G \cap B_r$ . Also, $|\nabla f| \neq 0$ a.e.. Therefore, $g = 0$ a.e. in $G \cap B_r$ , i.e.,
+
+$$
+\mathcal {L} \left(\bigcup_ {z \in B} G \cap B _ {r} \cap f ^ {- 1} (z)\right) = \int g d \mathcal {L} = 0.
+$$
+
+Since we can find a sequence of bounded open ball $B_r$ , s.t., $\mathbb{R}^N = \bigcup_{r=1}^\infty B_r$ , and also $\mathcal{L}(G^c) = 0$ , we have
+
+$$
+\mathcal {L} (f ^ {- 1} (B)) \leq \mathcal {L} \left(\bigcup_ {z \in B} G \cap f ^ {- 1} (z)\right) + \mathcal {L} (G ^ {c}) = \mathcal {L} \left(\bigcup_ {r = 1} ^ {\infty} \bigcup_ {z \in B} G \cap B _ {r} \cap f ^ {- 1} (z)\right) + \mathcal {L} (G ^ {c}) = 0.
+$$
+
+
+
+Corollary G.4. Let $\psi : \mathbb{R}^{2d} \to \mathbb{R}^{2d}$ be the GD iteration map, i.e., $\psi(x,y) = [x + h(\mu - x^{\top}y)y, y + h(\mu - x^{\top}y)x]^{\top}$ . Then if
+
+$$
+\mathcal {L} \left(\left\{\det (D \psi) = 0 \right\}\right) = 0,
+$$
+
+then $\mathcal{L}(\psi^{-1}(B)) = 0$ for any null-set $B$ .
+
+Lemma G.5. Given $h = \frac{4}{u_0^2 + 4c\mu}$ and $u_k^2 > \frac{2}{h}$ , $GD$ will not converge to the points in $\{\|x\|^2 + \|y\|^2 > \frac{2}{h}, x^\top y = \mu\}$ , except for a measure-0 set.
+
+Proof. For $d = 1$
+
+$$
+\det (D \psi) = 1 - h x ^ {2} - h y ^ {2} - 3 h ^ {2} x ^ {2} y ^ {2} + 4 h ^ {2} x y \mu - h ^ {2} \mu^ {2} = p _ {1} (x, y) \dots p _ {m} (x, y) = 0,
+$$
+
+where $p_i(x,y)$ is irreducible polynomial and $p_i(x,y) = 0$ is a co-dimensional-1 manifold. Then $\{(x,y):\operatorname*{det}(D\psi) = 0\} = \bigcup_{i = 1}^{m}\{p_i(x,y) = 0\}$ are measure zero, i.e., $\mathcal{L}(\{\operatorname*{det}(D\psi) = 0\}) = 0$ . Similarly for $d > 1$ , we also have $\mathcal{L}(\{\operatorname*{det}(D\psi) = 0\}) = 0$ .
+
+From the GD iteration, we have
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) \cdot (1 - h (\| x _ {k} \| ^ {2} + \| y _ {k} \| ^ {2}) - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k})).
+$$
+
+Then let $B = \{(x,y):1 - h(\| x\| ^2 +\| y\| ^2) - h^2 x^\top y(\mu -x^\top y) = 0\}$ . For any $(x,y)\in B$ , let $[x_{+},y_{+}]^{\top} = \psi (x,y)$ . Then $x_{+}y_{+} = \mu$ . Similarly, $\mathcal{L}(B) = 0$ . By Corollary G.4 $\mathcal{L}(\psi^{-1}(B)) = 0$ and then $\mathcal{L}(\psi^{-n}(B)) = \mathcal{L}(\psi^{-1}\circ \dots \circ \psi^{-1}(B)) = 0$ . Let $\psi^{-0}(B) = B$ and $G = \bigcup_{i = 0}^{\infty}\psi^{-n}(B)$ . Hence
+
+$$
+\mathcal {L} (G) = \mathcal {L} \left(\bigcup_ {i = 0} ^ {\infty} \psi^ {- n} (B)\right) \leq \sum_ {i = 0} ^ {\infty} \mathcal {L} (\psi^ {- n} (B)) = 0.
+$$
+
+Moreover, for any $0 < \epsilon < \mu$ , assume $|x_k^\top y_k - \mu| < \epsilon$ . When $u_k^2 \geq \frac{2}{h} + \epsilon h(\mu + \epsilon)$ ,
+
+$$
+\begin{array}{l} \left| x _ {k + 1} ^ {\top} y _ {k + 1} - \mu \right| = \left| x _ {k} ^ {\top} y _ {k} - \mu \right| \cdot \left| 1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k}) \right| \\ = \left| x _ {k} ^ {\top} y _ {k} - \mu \right| \cdot \left(- 1 + h u _ {k} ^ {2} + h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)\right) \\ \geq \left| x _ {k} ^ {\top} y _ {k} - \mu \right| \cdot \left(- 1 + h \left(\frac {2}{h} + \epsilon h (\mu + \epsilon)\right) - h ^ {2} (\mu + \epsilon) \epsilon\right) \\ > \left| x _ {k} ^ {\top} y _ {k} - \mu \right|. \\ \end{array}
+$$
+
+Hence, $\{\| x\|^2 + \| y\|^2 > \frac{2}{h}, x^\top y = \mu\}$ is not the limit of this GD map $\psi$ , except for the measure-0 set $G$ .
+
+Next we show that GD will be bounded inside $\{\| x\|^2 + \| y\|^2 < \frac{4}{h}\}$ .
+
+Lemma G.6. Given $h = \frac{4}{u_0^2 + 4c\mu}$ , then for $0 \leq k < \min \{k : u_k^2 \leq \frac{2}{h}\}$ , we have $u_k^2 \leq \frac{4}{h} - 3\mu < \frac{4}{h}$ for all $k$ .
+
+Proof. First $u_0^2 = \frac{4}{h} - 4c\mu \leq \frac{4}{h} - 4\mu < \frac{4}{h}$ . Then if $x_0^\top y_0 > \mu$ or $x_0^\top y_0 < -\frac{h\mu u_0^2}{4 - h u_0^2}$ , from Lemma G.8, $u_1^2 < u_0^2 < \frac{4}{h}$ . If $-\frac{h\mu u_0^2}{4 - h u_0^2} \leq x_0^\top y_0 < \mu$ , from Lemma G.9 and its proof, $u_2^2 < u_0^2 < \frac{4}{h}$ and $u_1 \leq u_0^2 + \frac{\mu}{c} \leq u_0^2 + \mu \leq \frac{4}{h} - 3\mu < \frac{4}{h}$ . Therefore, iteratively we have $u_k^2 < \frac{4}{h}$ .
+
+Therefore, without loss of generality, we can just assume $u_{k}^{2} \leq u_{0}^{2}$ for a fixed $k$ th iteration that we need to analyze because for every two steps there exists an $i$ th iteration such that $u_{i}^{2} \leq u_{0}^{2}$ and we can choose $k = i$ to do the analysis.
+
+Lemma G.8 and G.9 describe one-step or two-step decay of $u_{k}^{2}$ , which lead to the primary result, Lemma G.7, in phase one. Moreover, the proof of Lemma G.7 contains a finer characterization of $u_{k}^{2}$ making it possible to end phase one and enter phase two.
+
+Lemma G.7. Given $h = \frac{4}{u_0^2 + 4c\mu}$ for $c \geq 1$ , $GD$ will enter $\{\| x\|^2 + \| y\|^2 \leq \frac{2}{h}\}$ except for a measure-0 set of initial conditions.
+
+Proof. By Lemma G.6 and its discussion, assume without loss of generality $\frac{2}{h} < u_k^2 \leq u_0^2$ . From Lemma G.8 and G.9, the region where the decrease of $u_k^2$ may be small is when $x_k, y_k$ are close to $x_k^\top y_k = \mu$ or $x_k^\top y_k = -\frac{h\mu u_k^2}{4 - h u_k^2}$ .
+
+Since
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) (1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k})),
+$$
+
+consider $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ . From the proof of Lemma G.9, we know when $x_k^\top y_k = -\frac{h \mu u_k^2}{4 - h u_k^2}$ , $s_k < -1 + 2h^2 \mu^2 < 0$ . Therefore, there exists $\delta > 0$ , s.t., for all $x_k, y_k \in \{|x_k^\top y_k + \frac{h \mu u_k^2}{4 - h u_k^2}| < \delta, \frac{2}{h} < u_k^2 \leq u_0^2\}$ , $s_k < 0$ . Then $x_{k+1}^\top y_{k+1} > \mu$ . Hence, when $-\delta \leq x_k^\top y_k + \frac{h \mu u_k^2}{4 - h u_k^2} < 0$ , we will skip this step and consider the decrease of the next step with $x_{k+1}^\top y_{k+1} > \mu$ . Also, there exist $\beta_1 = \beta_1(\delta) > 0$ , s.t., when $x_k^\top y_k + \frac{h \mu u_k^2}{4 - h u_k^2} < -\delta$ ,
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) < - \beta_ {1}.
+$$
+
+From the proof of Lemma G.9, when $-\frac{h\mu u_k^2}{4 - h u_k^2} \leq x_k^\top y_k \leq 0$ , for $\beta_2 = \max \{h\mu^2 (4 - h u_0^2)(1 - 2h^2\mu^2)^2,h\mu^2 (8 - h(2u_0^2 +\frac{\mu}{c}))\} >0$
+
+$$
+u _ {k + 2} ^ {2} - u _ {k} ^ {2} < \max \{- h (\mu - x _ {k} ^ {\top} y _ {k}) \mu (4 - h u _ {k + 1} ^ {2}) (1 - 2 h ^ {2} \mu^ {2}) ^ {2}, - h (\mu - x _ {k} ^ {\top} y _ {k}) ^ {2} (8 - h (u _ {k} ^ {2} + u _ {k + 1} ^ {2})) \}
+$$
+
+$$
+\leq - \beta_ {2}.
+$$
+
+Fix an small $\epsilon$ in $0 < \epsilon < \mu$ . When $x_{k}^{\top}y_{k} \geq \mu + \epsilon$ , from the proof of Lemma G.8, we have for $\beta_{3} = 4h\mu \epsilon > 0$ ,
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} \leq 4 h \mu (\mu - x _ {k} ^ {\top} y _ {k}) \leq - 4 h \mu \epsilon = - \beta_ {3}.
+$$
+
+When $0 < x_{k}^{\top}y_{k}\leq \mu -\epsilon$ with $\epsilon >0$ , from the proof of Lemma G.9, we have for $\beta_{4} = h\epsilon^{2}(8 - h(2u_{0}^{2} + \frac{\mu}{c})) > 0,$
+
+$$
+u _ {k + 2} ^ {2} - u _ {k} ^ {2} \leq - h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) ^ {2} \left(8 - h \left(u _ {k} ^ {2} + u _ {k + 1} ^ {2}\right)\right) \leq - \beta_ {4}.
+$$
+
+When $|x_k^\top y_k - \mu| < \epsilon$ , assume $|x_k^\top y_k - \mu| = \epsilon_k$ . In this case, we have $s_k < 0$ meaning GD oscillates around $x^\top y = \mu$ . Also, if $0 < x_k^\top y_k < \mu$ and $u_k^2 > \frac{2}{h}$ , $s_k = 1 - h u_k^2 - h^2 x^\top y (\mu - x^\top y) < -1$ , i.e., if GD is in $0 < x^\top y < \mu$ , then we have $|x_{k+1}^\top y_{k+1} - \mu| > |x_k^\top y_k - \mu|$ . Hence we only need to focus on the other side which is $x_k^\top y_k > \mu$ . From Lemma G.5, if $u_k^2 \geq \frac{2}{h} + \epsilon h (\mu + \epsilon)$ , $|x_{k+1}^\top y_{k+1} - \mu| > |x_k^\top y_k - \mu|$ . Then within finite steps (note all these steps satisfy either one-step or two-step decrease of $u_k^2$ ; we ignore these steps only because the decrease maybe small), we will have either $|x_k^\top y_k - \mu|$ keeps increasing or $u_K^2 < \frac{2}{h} + \epsilon_K h (\mu + \epsilon_K)$ (here we also consider $x_K^\top y_K > \mu$ ). For the former one, the decrease of $u_k^2$ for each step will be lower bounded away from 0; for the latter one, from the discussion above, $u_{K+1}^2 - u_K^2 \leq -4h\mu\epsilon_K \Rightarrow u_{K+1}^2 \leq \frac{2}{h}$ .
+
+From Lemma G.5, we know GD will not terminate in finite steps except for measure-0 set. From all the discussion above, we have that $u_{k}^{2}$ decreases by a constant for either one-step or two-step except and hence GD will enter $\| x\| ^2 +\| y\| ^2\leq \frac{2}{h}$ except for a measure-0 set.
+
+Lemma G.8. Given $h = \frac{4}{u_0^2 + 4c\mu}$ and $u_k^2 < \frac{4}{h}$ , when $x_k^\top y_k > \mu$ or $x_k^\top y_k < -\frac{h\mu u_k^2}{4 - h u_k^2}$ , we have $u_{k+1}^2 - u_k^2 < 0$ .
+
+Proof.
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(4 x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)\right)
+$$
+
+If $x_{k}^{\top}y_{k} > \mu$ , by $u_{k}^{2} < \frac{4}{h}$
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(4 x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)\right) \leq 4 h \mu \left(\mu - x _ {k} ^ {\top} y _ {k}\right) < 0.
+$$
+
+If $x_{k}^{\top}y_{k} < -\frac{h\mu u_{k}^{2}}{4 - h u_{k}^{2}} \Rightarrow x_{k}^{\top}y_{k} < \mu$ , then,
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) < 0.
+$$
+
+Lemma G.9. Given $h = \frac{4}{u_0^2 + 4c\mu}$ , $c > \max \left\{\frac{1}{2}, 2h\mu \right\}$ , $c > 0$ , and $u_k^2 \leq u_0^2$ , when $-\frac{h\mu u_k^2}{4 - h u_k^2} \leq x_k^\top y_k < \mu$ , then $u_{k+2}^2 - u_k^2 < 0$ .
+
+Proof. For every $u_k^2$ , there exist a constant $c_k > 0$ , s.t. $h = \frac{4}{u_k^2 + 4c_k\mu}$ . Since $\frac{2}{h} < u_k^2 \leq u_0^2 < \frac{4}{h}$ , we have $c \leq c_k < \frac{1}{2h\mu}$ . Since
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) (1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k})) = (x _ {k} ^ {\top} y _ {k} - \mu) s _ {k},
+$$
+
+then $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ is bounded by the value at $x_k^\top y_k = -\frac{h \mu u_k^2}{4 - h u_k^2}$ or $x_k^\top y_k = \mu$ , i.e.,
+
+$$
+s _ {k} = 1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k}) \leq \max \left\{1 - h u _ {k} ^ {2} + \frac {4 h ^ {3} u _ {k} ^ {2} \mu^ {2}}{(4 - h u _ {k} ^ {2}) ^ {2}}, 1 - h u _ {k} ^ {2} \right\}
+$$
+
+Since $u_k^2 > \frac{2}{h}$ , we have $1 - h u_k^2 < -1$ . For the other one, since $u_k^2 > \frac{2}{h}$ and $c_k < \frac{1}{2h\mu}$ ,
+
+$$
+1 - h u _ {k} ^ {2} + \frac {4 h ^ {3} u _ {k} ^ {2} \mu^ {2}}{(4 - h u _ {k} ^ {2}) ^ {2}} = \frac {(1 - 3 c _ {k} ^ {2}) u _ {k} ^ {2} + 4 c _ {k} ^ {3} \mu}{c _ {k} ^ {2} (u _ {k} ^ {2} + 4 c _ {k} \mu)} < - 1 + 2 h ^ {2} \mu^ {2},
+$$
+
+where $c > \frac{h\mu + \sqrt{2 - h^2\mu^2}}{2(1 - h^2\mu^2)}$ . This is because either $u_0^2 > 8\mu \Rightarrow h\mu < \frac{1}{3\mu}$ or $h \leq \frac{1}{3\mu}$ and then $\frac{h\mu + \sqrt{2 - h^2\mu^2}}{2(1 - h^2\mu^2)} < 1 \leq c$ . Also note here this is $c$ not $c_k$ ; this value $-1 + 2h^2\mu^2$ is achieved when $u_k^2 = 2/h$ and $c_k = \frac{h\mu + \sqrt{2 - h^2\mu^2}}{2(1 - h^2\mu^2)}$ or $\frac{1}{2h\mu}$ .
+
+Also, when $0 \leq x_{k}^{\top} y_{k} < \mu$ ,
+
+$$
+s _ {k} = 1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \leq 1 - h u _ {k} ^ {2} < - 1.
+$$
+
+We then prove $4 - hu_{k + 1}^{2} > 0$ . When $x_{k}^{\top}y_{k} < \mu$
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right).
+$$
+
+The maximum is achieved at $x_{k}^{\top}y_{k} = \frac{2 - hu_{k}^{2}}{4 - hu_{k}^{2}}\mu$ , i.e., $u_{k + 1}^{2} - u_{k}^{2}\leq \frac{\mu}{c_{k}}\leq \frac{\mu}{c}$ . Hence $4 - hu_{k + 1}^{2} > 0$ when $c > 1 / 2$ .
+
+Since $x_{k}^{\top}y_{k} < \mu$ and $s_k\leq 0$
+
+$$
+\begin{array}{l} u _ {k + 2} ^ {2} - u _ {k} ^ {2} = u _ {k + 2} ^ {2} - u _ {k + 1} ^ {2} + u _ {k + 1} ^ {2} - u _ {k} ^ {2} \\ = h (\mu - x _ {k + 1} ^ {\top} y _ {k + 1}) ((4 - h u _ {k + 1} ^ {2}) x _ {k + 1} ^ {\top} y _ {k + 1} + h u _ {k + 1} ^ {2} \mu) \\ + h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) \\ = h (\mu - x _ {k} ^ {\top} y _ {k}) \left(\left((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + s _ {k} \left(h u _ {k + 1} ^ {2} \mu + (4 - h u _ {k + 1} ^ {2}\right) \left(s _ {k} \left(x _ {k} ^ {\top} y _ {k} - \mu\right) + \mu\right)\right)) \\ = h (\mu - x _ {k} ^ {\top} y _ {k}) \big (x _ {k} ^ {\top} y _ {k} (4 - h u _ {k} ^ {2}) + s _ {k} ^ {2} (4 - h u _ {k + 1} ^ {2}) (x _ {k} ^ {\top} y _ {k} - \mu) + h u _ {k} ^ {2} \mu + s _ {k} (h u _ {k + 1} ^ {2} \mu + (4 - h u _ {k + 1} ^ {2}) \mu) \big). \\ \end{array}
+$$
+
+When $0 \leq x_{k}^{\top}y_{k} < \mu$ , $s < -1$ , then
+
+$$
+u _ {k + 2} ^ {2} - u _ {k} ^ {2} \leq - h (\mu - x _ {k} ^ {\top} y _ {k}) ^ {2} (8 - h (u _ {k} ^ {2} + u _ {k + 1} ^ {2})) < 0
+$$
+
+When $-\frac{h\mu u_k^2}{4 - h u_k^2} \leq x_k^\top y_k < 0$ , $s_k \leq 0$ , then for $c \geq 2h\mu$
+
+$$
+\begin{array}{l} u _ {k + 2} ^ {2} - u _ {k} ^ {2} < h (\mu - x _ {k} ^ {\top} y _ {k}) \mu (- 4 + h u _ {k} ^ {2} + 8 h ^ {2} \mu^ {2} - (4 - h u _ {k + 1} ^ {2}) (1 - 2 h ^ {2} \mu^ {2}) ^ {2}) \\ < - h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \mu \left(4 - h u _ {k + 1} ^ {2}\right) \left(1 - 2 h ^ {2} \mu^ {2}\right) ^ {2} < 0 \\ \end{array}
+$$
+
+where this bound is achieved by taking $s_k = -1 + 2h^2\mu^2$ and $x_{k}^{\top}y_{k} = 0$ .
+
+
+
+# G.2 PHASE 2: $u_{k}^{2}\leq \frac{2}{h}$
+
+In this part, we will show the convergence of GD in Lemma G.11.
+
+There are two convergence patterns: (i) transversal convergence, i.e., oscillating around the valley; (ii) unilateral convergence, i.e., converging from one side of the valley.
+
+The key point of the proof of pattern (i) is to analyze the change of $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ . We know $x_{k+1}^\top y_{k+1} - \mu = s_k(x_k^\top y_k - \mu)$ , i.e., $s_k$ measures the change of the loss. If for some constant $K > 0$ we have $|s_k| < 1 \forall k \geq K$ such that $|x_k^\top y_k - \mu|$ is guaranteed to decrease to 0, then the convergence follows. Moreover, we will need to analyze $s_{2k}$ and $s_{2k+1}$ separately because in this case $s_k < 0$ and $x_k^\top y_k - \mu$ changes sign at each step.
+
+For pattern (ii), we will show that the trajectory of GD is bounded in a subset of this region $|s_k| < 1$ that guarantees the decrease of the loss.
+
+Before presenting our main result in phase 2, we first show a boundedness theorem when GD enters this phase.
+
+Lemma G.10. Once $GD$ enters $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ , it will stay bounded inside $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h} + 2\mu\}$ and re-enter $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ within finite steps where the number of such steps do not depend on the number of iteration.
+
+Proof. If at step $K$ , $u_{K}^{2} \leq \frac{2}{h}$ , then from Lemma G.15, $u_{K+1}^{2} \leq \frac{2}{h} + \mu$ and it returns to phase 1. From the proof of Lemma G.9, $u_{K+2}^{2} \leq u_{K+1}^{2} + \mu \leq \frac{2}{h} + 2\mu$ and we know either $u_{K+2}^{2} < u_{K+1}^{2}$ or $u_{K+3}^{2} < u_{K+1}^{2}$ and so on until it re-enters $u_{i}^{2} \leq \frac{2}{h}$ for some $i \geq K$ . Therefore, all the $u_{k}^{2} \leq \frac{2}{h} + 2\mu$ once GD enters $\{\|x\|^{2} + \|y\|^{2} \leq \frac{2}{h}\}$ .
+
+Then by Lemma G.10, we can always pick a $k$ th iteration such that $u_{k}^{2} \leq \frac{2}{h}$ . Also, when $u_{0}^{2} > 8\mu$ , we have $h\mu < \frac{1}{3}$ . Together with the choice of $h = \frac{1}{(2 + c)\mu}$ when $0 < u_{0}^{2} \leq 8\mu$ , we have $h\mu \leq \frac{1}{3}$ . Then we obtain the following convergence of GD inside phase 2.
+
+Lemma G.11. Given $h\mu \leq \frac{1}{3}$ , if $GD$ enters $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ , it converges to $x^\top y = \mu$ inside this region except for a measure-0 set of initial conditions.
+
+Proof. First, from Corollary G.4, we know the set of points converging to $(0,0)$ in finite steps is measure 0. For all the other points, we have the following discussion.
+
+If $s_k = 0$ , then $x_{k + 1}^{\top}y_{k + 1} = \mu$ , i.e., it converges.
+
+If $x_{k}^{\top}y_{k} < -\mu$ and $\frac{1}{h} + 2h\mu^{2} < u_{k}^{2} \leq \frac{2}{h}$ , then by Lemma G.14,
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) ((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu) \leq 2 h (\mu^ {2} - (x _ {k} ^ {\top} y _ {k}) ^ {2}) < 0.
+$$
+
+Hence for $\delta_1 > 0$ , when $-\mu - \delta_1 < x_k^\top y_k < -\mu$ , we have $x_{k+1}^\top y_{k+1} > \mu$ and we will skip this step and directly consider the $(k+1)$ th iteration; when $x_k^\top y_k \leq -\mu - \delta_1$ , $u_{k+1}^2 - u_k^2 \leq -2h((\mu + \delta_1)^2 - \mu^2)$ . Namely when $x_k^\top y_k < -\mu$ , either $u_{k+1}^2$ is some constant away from $u_k^2$ or we can ignore the decrease in this step and directly look at the next one with $x_{k+1}^\top y_{k+1} > \mu$ .
+
+If $x_{k}^{\top}y_{k} < -\mu$ and $u_{k}^{2}\leq \frac{1}{h} +2h\mu^{2}$ , then
+
+$$
+\begin{array}{l} u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(4 x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)\right) \\ \leq h (\mu - x _ {k} ^ {\top} y _ {k}) (4 x _ {k} ^ {\top} y _ {k} + (1 + 2 h ^ {2} \mu^ {2}) (\mu - x _ {k} ^ {\top} y _ {k})) \\ \leq - 4 h \mu^ {2} (1 - 2 h ^ {2} \mu^ {2}) < 0. \\ \end{array}
+$$
+
+If $x_{k}^{\top}y_{k} > 3\mu$ , then $u_{k + 1}^{2} - u_{k}^{2}\leq 2h(\mu^{2} - x_{k}^{2}y_{k}^{2}) < - 16h\mu^{2}$ . Also, when $u_{k}^{2}\leq 6\mu$ , $x_{k}^{\top}y_{k}\leq 3\mu$
+
+Next, for the rest of the region, we first consider $\frac{1}{h} + 2h\mu^2 < u_k^2 \leq \frac{2}{h}$ (by Lemma G.10, we are always able to find $u_k^2 \leq \frac{2}{h}$ ). In this region, by Lemma G.18, we know $s_k < 0$ , i.e., $(x_{k+1}^\top y_k - \mu)(x_{k+1}^\top y_{k+1} - \mu) < 0$ . We divide the whole region into two parts: $x_k^\top y_k > \mu$ and $x_k^\top y_k < \mu$ . Therefore all the $x_{k+2i}$ should be on the same side for $i$ such that $\frac{1}{h} + 2h\mu^2 < u_{k+2i}^2 \leq \frac{2}{h}$ .
+
+If $-\mu \leq x_{k}^{\top}y_{k} < \mu$ and $s_k \leq -1$ , by Lemma G.16, we have $u_{k+2}^2 - u_k^2 \leq -4h(1 - h\mu)(\mu - x_{k}^{\top}y_{k})^2 < 0$ . Hence when GD does not converge, i.e., $\{(x_{k+2n}, y_{k+2n})\}_{n=0}^{\infty}$ does not converge, $u_{k}^2$ will keep decreasing with $u_{k+2i}^2 \leq \frac{2}{h}$ for all $K + 2i$ with $i \geq 0$ such that $s_{k+2i} \leq -1$ . Moreover, there exists $N > 0$ s.t. $s_{k+2N} > -1$ because $s_k = 1 - hu_k^2 - h^2 x_k^{\top}y_k(\mu - x_k^{\top}y_k)$ and if $x_{k+2i}, y_{k+2i}$ is the first iteration to leave this region, then it has to satisfy $x_{k+2i}^{\top}y_{k+2i} < -\mu$ which implies $s_{k+2i} > -1$ , and then it follows from Lemma G.13 and G.12 just as the following two paragraphs of discussion; if it never leaves this region and GD is not converging, i.e., $|\mu - x_k^{\top}y_k|$ has a lower bound, then $u_{k+2i}^2$ will keep decreasing until $s_{k+2N} > -1$ (from the proof of Lemma G.12, if $\mu - x_k^{\top}y_k$ is very small, then $s_{k+1} < s_k$ meaning both sides are blowing up and therefore $|\mu - x_k^{\top}y_k|$ has a lower bound if $s_k \leq -1$ ).
+
+If $-\mu \leq x_k^\top y_k < \mu$ and $s_k > -1$ , from Lemma G.12 and Lemma G.13, similar to the previous discussion, there exists $N_1 > 0$ , s.t., for all $k > N_1$ , $s_k > \min\{-1 + c_0, -1 + c_1(\mu - x_k^\top y_k)^2\}$ for some $c_0, c_1 > 0$ , namely $|\mu - x_k^\top y_k|$ strictly decreases. Then it will either converge in $\frac{1}{h} + 2h\mu^2 < \|x\|^2 + \|y\|^2 \leq \frac{2}{h}$ or enter $\|x\|^2 + \|y\|^2 \leq \frac{1}{h} + 2h\mu^2$ .
+
+If $\mu < x_k^\top y_k \leq 3\mu$ , from the definition of $s_k$ , we have $s_k > -1$ . Also by Lemma G.13, we know $s_m > \min \{-1 + c_0, -1 + c_1 (\mu - x_k^\top y_k)^2\}$ for all $m > k$ . Hence similarly, it will either converge or enter $u_k^2 \leq \frac{1}{h} + 2h\mu^2$ .
+
+Then we consider $u_{k}^{2} \leq \frac{1}{h} + 2h\mu^{2}$ . From Lemma G.17 and Lemma G.20, we know $|s_k| < 1$ and will be away from 1 by a constant in this area. We will show that GD stays bounded in the converging domain. If $s_k \leq 0$ , it follows from the previous discussion and the proof of Lemma G.17 and Lemma G.20. If $s_k > 0$ , when the trajectory is in $\{|x^{\top}y| > \mu\}$ , from Lemma G.14, we have $u_{k+1}^{2} < u_{k}^{2}$ ; when it is in $\{|x^{\top}y| < \mu\}$ , then $|x_{k+1} - y_{k+1}| < |x_k - y_k|$ from Lemma G.19. Hence the trajectory will stay inside the monotone decreasing region. Next, since $|\mu - x_k^\top y_k|$ monotonically decreases and is lower bounded by 0, we have that $|\mu - x_k^\top y_k|$ converges. If $|\mu - x_k^\top y_k|$ converges to $C > 0$ , then $\min \{-1 + c_0, -1 + c_1 (\mu - x_k^\top y_k)^2\} < s_k < 1 - c_2$ for some $c_0, c_1, c_2 > 0$ meaning $|\mu - x_k^\top y_k|$ does not converge to C. Contradiction. Therefore, $|\mu - x_k^\top y_k|$ converges to 0.
+
+Lemma G.12. When $-\mu \leq x_k^\top y_k < \mu$ and $\frac{1}{h} + 2h\mu^2 < u_k^2 \leq \frac{2}{h} + 2\mu$ , if $s_k > -1$ , then $s_{k+2} > \min\{-\frac{3}{4} - \frac{h^2\mu^2}{4}, -\frac{5h^2\mu^2}{2}, -1 + h^2 (\mu - x_k^\top y_k)^2\} > -1$ , for $\frac{9}{2} h^2\mu^2 < 1$ .
+
+Proof. From previous statement, $s_k < 0$ when $u_k^2 > \frac{1}{h} + 2h\mu^2$ . For $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ , let $\epsilon = \mu - x_k^\top y_k$ . Then $x_{k+1}^\top y_{k+1} - \mu = -s_k \epsilon$ .
+
+$$
+s _ {k + 1} = 1 - h u _ {k + 1} ^ {2} - h ^ {2} x _ {k + 1} ^ {\top} y _ {k + 1} (\mu - x _ {k + 1} ^ {\top} y _ {k + 1}) = s _ {k} - h ^ {2} \epsilon \mu (3 + s _ {k}) + h ^ {2} \epsilon^ {2} (3 + s _ {k} ^ {2} - h u _ {k} ^ {2}).
+$$
+
+Hence if $\epsilon$ is very small, we have $s_{k + 1} < s_k$ . Also, $x_{k + 2}y_{k + 2} - \mu = s_{k + 1}(x_{k + 1}^{\top}y_{k + 1} - \mu) = -s_{k + 1}s_k\epsilon$ . Moreover, $u_{k + 1}^2 \leq \frac{2}{h} + 2\mu$ by Lemma G.6.
+
+$$
+\begin{array}{l} s _ {k + 2} = 1 - h u _ {k + 2} ^ {2} - h ^ {2} x _ {k + 2} ^ {\top} y _ {k + 2} \left(\mu - x _ {k + 2} ^ {\top} y _ {k + 2}\right) \\ = s _ {k} - h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} s _ {k + 1}\right) + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right)\right) \\ \geq s _ {k} - h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} s _ {k + 1}\right) + h ^ {2} \epsilon^ {2} \left(1 + \left(1 + s _ {k + 1} ^ {2}\right) s _ {k} ^ {2}\right) \\ \stackrel {s _ {k + 1} = \mu / (2 s _ {k} \epsilon)} {\geq} s _ {k} - \frac {h ^ {2} \mu^ {2}}{4} - h ^ {2} \epsilon (3 + 4 s _ {k}) + h ^ {2} \epsilon^ {2} (1 + s _ {k} ^ {2}) \\ \end{array}
+$$
+
+If $3 + 4s_{k}\geq 0$ ,then
+
+$$
+\begin{array}{l} s _ {k + 2} \geq s _ {k} - \frac {h ^ {2} \mu^ {2}}{4} - h ^ {2} \epsilon (3 + 4 s _ {k}) + h ^ {2} \epsilon^ {2} (1 + s _ {k} ^ {2}) \\ \begin{array}{c} \epsilon = (3 + 4 s _ {k}) \mu / (2 (1 + s _ {k} ^ {2})) \\ \geq \end{array} s _ {k} - \frac {h ^ {2} \mu^ {2}}{4} - \frac {h ^ {2} \mu^ {2} (3 + 4 s _ {k}) ^ {2}}{4 (1 + s _ {k} ^ {2})} \\ \stackrel {s _ {k} = 0 \text {o r} s _ {k} = - 3 / 4} {\geq} \min \left\{- \frac {3}{4} - \frac {h ^ {2} \mu^ {2}}{4}, - \frac {5 h ^ {2} \mu^ {2}}{2} \right\} > - 1. \\ \end{array}
+$$
+
+If $3 + 4s_k < 0$ , i.e., $-1 < s_k < -\frac{3}{4}$ , then
+
+$$
+\begin{array}{l} s _ {k + 2} = s _ {k} - h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} s _ {k + 1}\right) + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right)\right) \\ = s _ {k} - h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} \left(s _ {k} - h ^ {2} \epsilon \mu \left(3 + s _ {k}\right) + h ^ {2} \epsilon^ {2} \left(3 + s ^ {2} - h u _ {k} ^ {2}\right)\right)\right) \\ + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right)\right) \\ = s _ {k} - h ^ {2} \mu \epsilon \left(s _ {k} \left(3 + s _ {k}\right) + 3 + s _ {k}\right) - h ^ {4} \mu \epsilon^ {3} s _ {k} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2}\right) \\ + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right) + h ^ {2} \mu^ {2} s _ {k} \left(3 + s _ {k}\right)\right). \\ \end{array}
+$$
+
+When $-1 < s_k < \frac{1 - 3h^2\epsilon\mu}{h^2\epsilon\mu}$ , $s_k - h^2\mu \epsilon (s_k(3 + s_k) + 3 + s_k) > -1$ . Since $\epsilon \leq 2\mu$ , we have $\frac{1 - 3h^2\epsilon\mu}{h^2\epsilon\mu} \geq \frac{1 - 6h^2\mu^2}{2h^2\mu^2} \geq -\frac{3}{4}$ for $\frac{9}{2} h^2\mu^2 < 1$ . Also,
+
+$$
+\begin{array}{l} - h ^ {4} \mu \epsilon^ {3} s _ {k} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2}\right) > \frac {3}{4} h ^ {4} \mu \epsilon^ {3} > 0, \\ h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right) + h ^ {2} \mu^ {2} s _ {k} \left(3 + s _ {k}\right)\right) > h ^ {2} \epsilon^ {2} > 0. \\ \end{array}
+$$
+
+Hence
+
+$$
+\begin{array}{l} s _ {k + 2} > - 1 - h ^ {4} \mu \epsilon^ {3} s _ {k} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2}\right) \\ + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right) + h ^ {2} \mu^ {2} s _ {k} \left(3 + s _ {k}\right)\right) > - 1 + h ^ {2} \epsilon^ {2} \\ \end{array}
+$$
+
+
+
+Lemma G.13. When $x_{k}^{\top}y_{k} > \mu$ and $\frac{1}{h} + 2h\mu^{2} < u_{k}^{2} \leq \frac{2}{h} + 2\mu$ , if $s_{k} > -1$ , then $s_{k+1} > s_{k}$ and $s_{k+2} > \min\{-1 + h^{2}(\mu - x_{k}^{\top}y_{k})^{2}(\frac{1}{2} - \frac{3}{2}h^{2}\mu^{2}), -\frac{1}{2} - \frac{3}{2}h^{4}(\mu - x_{k}^{\top}y_{k})^{2}\mu^{2}\}$ for $8h^{2}\mu^{2} < 1$ . Moreover, if $u_{k+1}^{2} \leq \frac{2}{h}$ , $s_{k} \leq -1$ , and $s_{k+1} > -1$ , then $s_{k+2} > s_{k} + h^{2}(\mu - x_{k}^{\top}y_{k})^{2}(1 - 8h^{2}\mu^{2})$ .
+
+Proof. From previous statement, $s_k < 0$ when $u_k^2 > \frac{1}{h} + 2h\mu^2$ . Without loss of generality, we can just assume $u_k^2 < \frac{3}{h}$ (otherwise $u_{k+2}^2 < \frac{3}{h}$ and we can use this as our starting point). For $x_k^\top y_k > \mu$ , $s_k = 1 - hu_k^2 - h^2 x_k^\top y_k(\mu - x_k^\top y_k)$ . Let $x_k^\top y_k - \mu = \epsilon$ . Then
+
+$$
+s _ {k + 1} = 1 - h u _ {k + 1} ^ {2} - h ^ {2} x _ {k + 1} ^ {\top} y _ {k + 1} (\mu - x _ {k + 1} ^ {\top} y _ {k + 1}) = s _ {k} + h ^ {2} \epsilon \mu (3 + s _ {k}) + h ^ {2} \epsilon^ {2} (3 + s _ {k} ^ {2} - h u _ {k} ^ {2}) > s _ {k},
+$$
+
+where $s_k > -3$ in this region. Also, $x_{k + 2}^{\top}y_{k + 2} - \mu = s_{k + 1}s_{k}\epsilon$ .
+
+Then for $s_k \leq -1$ , $u_{k+1}^2 \leq \frac{2}{h}$ , and $s_{k+1} > -1$ ,
+
+$$
+\begin{array}{l} s _ {k + 2} = s _ {k} + h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} s _ {k + 1}\right) + h ^ {2} \epsilon^ {2} \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2} + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right)\right) \\ = s _ {k} + h ^ {2} \epsilon \mu \left(3 + 4 s _ {k + 1} + s _ {k + 1} ^ {2}\right) + h ^ {2} \epsilon^ {2} \left[ \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2}\right) \left(1 - 4 h ^ {2} \epsilon \mu - h ^ {2} \epsilon \mu s _ {k + 1}\right) \right. \\ \left. + s _ {k} ^ {2} \left(2 - h u _ {k + 1} ^ {2}\right) + s _ {k} ^ {2} \left(1 + s _ {k + 1} ^ {2}\right) - h ^ {2} \mu^ {2} \left(4 + s _ {k + 1}\right) \left(3 + s _ {k}\right) \right] \\ > s _ {k} + h ^ {2} \epsilon^ {2} \left(1 - 8 h ^ {2} \mu^ {2}\right) \\ \end{array}
+$$
+
+where the inequality is achieved by $s_{k + 1} > - 1,u_k^2\leq \frac{4}{h},u_{k + 1}^2\leq \frac{2}{h},8h^2\mu^2 < 1,\epsilon \leq 2\mu .$
+
+For $s_k > -1$
+
+$$
+\begin{array}{l} s _ {k + 2} = s _ {k} + h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} ^ {2}\right) + h ^ {2} \epsilon^ {2} \left[ \left(3 + s _ {k} ^ {2} - h u _ {k} ^ {2}\right) \left(1 + s _ {k} h ^ {2} \epsilon \mu\right) \right. \\ \left. + s _ {k} ^ {2} \left(3 + s _ {k + 1} ^ {2} - h u _ {k + 1} ^ {2}\right) + h ^ {2} \mu^ {2} s _ {k} \left(3 + s _ {k}\right) \right] \\ > s _ {k} + h ^ {2} \epsilon \mu (3 + 4 s _ {k} + s _ {k} ^ {2}) + h ^ {2} \epsilon^ {2} \big [ s _ {k} ^ {2} (1 + 2 s _ {k} h ^ {2} \mu^ {2}) + s _ {k} ^ {2} + h ^ {2} \mu^ {2} s _ {k} (3 + s _ {k}) \big ] \\ = s _ {k} + h ^ {2} \epsilon \mu \left(3 + 4 s _ {k} + s _ {k} ^ {2}\right) + h ^ {2} \epsilon^ {2} \left[ 2 s _ {k} ^ {2} + h ^ {2} \mu^ {2} s _ {k} \left(3 + 2 s _ {k} ^ {2} + s _ {k}\right) \right] \\ \end{array}
+$$
+
+When $s_k > -1$ , we have $s_k + h^2\epsilon \mu(3 + 4s_k + s_k^2) > -1$ and $h^2\epsilon \mu(3 + 4s_k + s_k^2) > 0$ . Since $8h^2\mu^2 < 1$ , $2s_k^2 + h^2\mu^2 s_k(3 + 2s_k^2 + s_k) \geq \frac{1}{2} - \frac{3}{2} h^2\mu^2 > 0$ for $-1 < s_k \leq -\frac{1}{2}$ . For $-\frac{1}{2} < s_k \leq 0$ , $2s_k^2 + h^2\mu^2 s_k(3 + 2s_k^2 + s_k) \geq h^2\mu^2 s_k(3 + 2s_k^2 + s_k) \geq -\frac{3}{2} h^2\mu^2 > -\frac{1}{2}$ . Hence $s_{k+2} > \min\{-1 + h^2\epsilon^2(\frac{1}{2} - \frac{3}{2} h^2\mu^2), -\frac{1}{2} - \frac{3}{2} h^4\epsilon^2\mu^2\} > -1$ .
+
+
+
+Lemma G.14. Given $u_{k}^{2} \leq \frac{2}{h}$ , when $|x_{k}^{\top}y_{k}| > \mu$ , $u_{k + 1}^{2} - u_{k}^{2} < 0$ .
+
+Proof.
+
+$$
+\begin{array}{l} u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) \left(4 x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} (\mu - x _ {k} ^ {\top} y _ {k})\right) \\ = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) 4 x _ {k} ^ {\top} y _ {k} + h ^ {2} u _ {k} ^ {2} \left(\mu - x _ {k} ^ {\top} y _ {k}\right) ^ {2} \\ \leq h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) 4 x _ {k} ^ {\top} y _ {k} + 2 h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) ^ {2} \\ = 2 h \left(\mu^ {2} - \left(x _ {k} ^ {\top} y _ {k}\right) ^ {2}\right) < 0 \\ \end{array}
+$$
+
+
+
+Lemma G.15. Given $u_{k}^{2}\leq \frac{2}{h}$ $u_{k + 1}^2 -u_k^2\leq \mu$
+
+Proof.
+
+$$
+u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) (4 x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} (\mu - x _ {k} ^ {\top} y _ {k})) \leq \frac {4 h \mu^ {2}}{4 - h u _ {k} ^ {2}},
+$$
+
+where the maximum is achieved at $x_{k}^{\top}y_{k} = \frac{2 - hu_{k}^{2}}{4 - hu_{k}^{2}}\mu$ . When $h = \frac{4}{u_0^2 + 4c\mu}$ , from the proof of Lemma G.9, $u_{k + 1} - u_k^2 \leq \mu$ . When $h = \frac{1}{(2 + c)\mu}$ and in this case $u_{k}^{2} \leq \frac{2}{h} = (1 + \frac{c}{2}\mu)$ , $u_{k + 1} - u_k^2 \leq \frac{8}{7(2 + c)}\mu < \mu$ .
+
+Lemma G.16. When $-\mu \leq x_{k}^{\top}y_{k} < \mu$ , if $s_k = 1 - hu_k^2 - h^2x_k^{\top}y_k(\mu - x_k^{\top}y_k) \leq -1$ , $u_{k+2}^2 - u_k^2 \leq -h(4 - 4h\mu)(\mu - x_k^{\top}y_k)^2 < 0$ .
+
+Proof.
+
+$$
+\begin{array}{l} u _ {k + 2} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) \left(\left((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + s \left(h u _ {k + 1} ^ {2} \mu + (4 - h u _ {k + 1} ^ {2}) \left(s \left(x _ {k} ^ {\top} y _ {k} - \mu\right) + \mu\right)\right)\right) \\ = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(- \left(4 - h u _ {k} ^ {2} + s ^ {2} \left(4 - h u _ {k + 1} ^ {2}\right)\right) \left(\mu - x _ {k} ^ {\top} y _ {k}\right) + 4 (1 + s) \mu\right) \\ \leq - h \left(8 - h \left(u _ {k} ^ {2} + u _ {k + 1} ^ {2}\right)\right) \left(\mu - x _ {k} ^ {\top} y _ {k}\right) ^ {2} \\ \leq - h (4 - 4 h \mu) (\mu - x _ {k} ^ {\top} y _ {k}) ^ {2} < 0 \\ \end{array}
+$$
+
+where the first inequality is because when $s_k = -1$ it has the maximum value; the second is from Lemma G.10.
+
+Lemma G.17. When $u_{k}^{2} \leq \frac{2}{h}$ , then $s_k < 1$ and will be away from 1 by a constant.
+
+Proof.
+
+$$
+s _ {k} = 1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k}) \leq 1 - h u _ {k} ^ {2} + h ^ {2} \frac {u _ {k} ^ {2}}{2} \left(\mu + \frac {u _ {k} ^ {2}}{2}\right)
+$$
+
+where equality is achieved when $x_{k}^{\top}y_{k} = -\frac{u_{k}^{2}}{2}$ .
+
+Since $0 < u_{k}^{2}\leq \frac{2}{h}$
+
+$$
+s _ {k} \leq 1 - h u _ {k} ^ {2} + h ^ {2} \frac {u _ {k} ^ {2}}{2} \left(\mu + \frac {u _ {k} ^ {2}}{2}\right) \leq \max \{1, h \mu \} < 1.
+$$
+
+Actually this $s_k$ will be away from 1 by a constant. This is because when $u_k^2$ are close to 0, $s_k$ will be close to 1; however, $u_k^2$ will be increasing because of the decrease of $|\mu - x_k^\top y_k|$ and thus $s_k$ will decrease accordingly.
+
+Lemma G.18. When $u_{k}^{2} > \frac{1}{h} + 2h\mu^{2}$ and $-\mu \leq x_{k}^{\top}y_{k} \leq 3\mu$ , $(x_{k+1}^{\top}y_{k+1} - \mu)(x_{k}^{\top}y_{k} - \mu) < 0$ , meaning it oscillates around $x^{\top}y = \mu$ .
+
+Proof.
+
+$$
+1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right) < 1 - h \left(\frac {1}{h} + 2 h \mu^ {2}\right) + 2 h ^ {2} \mu^ {2} = 0
+$$
+
+□
+
+Lemma G.19. When $-\mu \leq x_k^\top y_k < \mu$ and $h\mu \leq \frac{1}{3}$ , we have $|x_{k + 1} - y_{k + 1}| < |x_k - y_k|$ .
+
+Proof.
+
+$$
+\left| x _ {k + 1} - y _ {k + 1} \right| = \left| x _ {k} - y _ {k} \right| \left| 1 - h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \right|.
+$$
+
+Since $h\mu < 1$ , then
+
+$$
+- 1 < 1 - 2 h \mu \leq 1 - h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) < 1.
+$$
+
+□
+
+Lemma G.20. When $u_{k}^{2} \leq \frac{1}{h} + 2h\mu^{2}$ and $h\mu \leq \frac{1}{3}$ , $s_{k} \geq -\frac{1}{4}$ .
+
+Proof. By $h\mu \leq \frac{1}{3}$ ,
+
+$$
+1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \geq - 2 h ^ {2} \mu^ {2} - \frac {h ^ {2} \mu^ {2}}{4} \geq - \frac {9 h ^ {2} \mu^ {2}}{4} \geq - \frac {1}{4}.
+$$
+
+□
+
+# H PROOF OF THEOREM 4.1, THEOREM 4.2, AND THEOREM 4.3
+
+The proof in this section mainly follows the strategy of the scalar case. More precisely, all the expressions, e.g., $u_{k+1}^2$ and $x_{k+1}^\top y_{k+1} - \mu$ , in this rank-1 approximation case contains two parts: the one that can be handled using the technique in scalar case, and the other one measuring the extent of alignment between $x_k$ and $y_k$ . Again, let $u_k^2 = \|x_k\|^2 + \|y_k\|^2$ .
+
+Theorem H.1 (Main 1). Let $h = \frac{4}{u_0^2 + 4c\mu}$ . Assume $c \geq \sqrt{7}$ and $u_0^2 > 4\sqrt{7}\mu$ . Then $GD$ converges to a point in $\{(x,y) : \| x\|^2 + \| y\|^2 \leq \frac{2}{h}, x^\top y = \mu \}$ except for a Lebesgue measure-0 set of $(x_0, y_0)$ .
+
+Proof. The proof follows from Lemma H.3 and Lemma H.8. $\square$
+
+Theorem H.2 (Main 2). Let $h = \frac{4}{4\sqrt{7}\mu + 4c\mu} = \frac{1}{(\sqrt{7} + c)\mu}$ . Assume $c \geq \sqrt{7}$ and $u_0^2 \leq 4\sqrt{7}\mu$ . Then $GD$ converges to a point in $\{(x,y) : \| x\|^2 + \| y\|^2 \leq \frac{2}{h}, x^\top y = \mu\}$ except for a Lebesgue measure-0 set of $(x_0, y_0)$ .
+
+Proof. Since $c \geq \sqrt{7}$ , in this case we have $u_0^2 \leq 4\sqrt{7}\mu \leq 2(\sqrt{7} + c)\mu = \frac{2}{h}$ . Therefore, the convergence follows from Lemma H.8.
+
+Hence we can show the proof of the theorems in Section 4.
+
+Proof of Theorem 4.1. By Lemma H.3 and H.7, the proof follows from Lemma H.9. $\square$
+
+
+
+Proof of Theorem 4.2 and 4.3. Similar to scalar case, $h = \frac{4}{u_0^2 + 4c\mu}$ for $c \geq \sqrt{7}$ implies $h \leq \frac{4}{u_0^2 + 4\sqrt{7}\mu}$ and $h = \frac{1}{(\sqrt{7} + c)\mu}$ implies $h \leq \frac{1}{2\sqrt{7}}$ . Therefore, the convergence and balancing of GD follow from Theorem H.1 and H.2. The second inequality of Theorem 4.3 follows from $x^\top y = \mu$ at the global minimum because of diagonal and non-negative $A$ and the best rank-1 approximation in SVD.
+
+# H.1 PHASE 1
+
+The main theorem in phase 1 is the following.
+
+Lemma H.3. Given $h = \frac{4}{u_0^2 + 4c\mu}$ for $c \geq \sqrt{7}$ , $GD$ will enter $\{\| x\|^2 + \| y\|^2 \leq \frac{2}{h}\}$ except for a measure-0 set of initial conditions.
+
+Proof. Since the expressions, $u_{k+2}^2 - u_k^2$ and $u_{k+2}^2 - u_k^2$ , of the rank-1 version have an additional term upper bounded by $c_0((x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k)$ for some constant $c_0 > 0$ which is non-positive, we have $u_k^2$ decreases by a constant for either one- or two-step if $(x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k < -c_1$ for some constant $c_1 > 0$ when $\frac{2}{h} < u_k^2 < \frac{4}{h}$ . Therefore, we can pick a $K > 0$ s.t. $(x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k < -c_1$ for $k \leq K$ . If GD enters $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ within $K$ steps, then we are done. Otherwise, we can just assume that for all the $k > K$ , $-c_1 \leq (x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k \leq 0$ . Then again, like the scalar case, we only need to consider when $x_k, y_k$ are close to $x_k^\top y_k = \mu$ and $x_k^\top y_k = -\frac{h\mu u_k^2}{4 - h u_k^2}$ . For the region near $x_k^\top y_k = -\frac{h\mu u_k^2}{4 - h u_k^2}$ , we can always choose a $c_1$ s.t. there exists a $\delta > 0$ , when $-\delta \leq x_k^\top y_k + \frac{h\mu u_k^2}{4 - h u_k^2} < 0$ , we have both $x_{k+1}^\top y_{k+1} > \mu$ and $s_k < 0$ . Then all the discussion just follows the scalar case. For the region near $x_k^\top y_k = \mu$ , i.e., $|x_k^\top y_k - \mu| < \epsilon$ for some $0 < \epsilon < \mu$ , consider
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) s _ {k} + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}).
+$$
+
+Similar to scalar decomposition, we only need to consider the case when $s_k \leq -1$ because if $s_k > -1$ which can only happen when $x_k^\top y_k > \mu$ , we have $u_k^2 \leq \frac{2}{h} + \epsilon_k h(\mu + \epsilon)$ and then $u_{k+1}^2 \leq \frac{2}{h}$ . If $s_k \geq -1$ for all the following iterations, together with the bounded second term in $x_{k+1}^\top y_{k+1} - \mu$ , i.e., $-2h^2 \mu c_1 \leq h^2 (2\mu - x_k^\top y_k)((x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k) \leq 0$ , we have that there exists $K > 0$ s.t. $|x_K^\top y_K - \mu| \geq \epsilon_1$ for some $\epsilon_1 > 0$ unless it leaves this region $|x_k^\top y_k - \mu| < \epsilon$ . Therefore, by the same discussion in scalar case, $u_k^2$ will decrease either in one step or two steps by at least a constant.
+
+Moreover, by Lemma H.4, GD will not terminate inside $\left\{\frac{2}{h} < \| x\|^2 + \| y\|^2 < \frac{4}{h}\right\}$ in finite step. Thus, GD is guaranteed to enter $\left\{\| x\|^2 + \| y\|^2 \leq \frac{2}{h}\right\}$ in finite steps.
+
+Lemma H.4. $GD$ will not converge to any fixed points in $\{\| x\|^2 + \| y\|^2 > \frac{2}{h}\}$ except for a measure-0 set.
+
+Proof. Similar to the discussion in scalar case, the set of points converging to $x^{\top}y = \mu$ in finite step is measure-0.
+
+Also, since $\mu x^{\top}y = x^{\top}xy^{\top}y = \mu^{2}$ , the fixed points of GD map requires $x^{\top}xy^{\top}y = (x^{\top}y)^{2}$ . This can be seen in the following expression
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) (1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k})) + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}),
+$$
+
+where the convergence of $x_{k}^{\top}y_{k} - \mu$ requires the convergence of $x_{k}^{\top}x_{k}y_{k}^{\top}y_{k} - (x_{k}^{\top}y_{k})^{2}$ .
+
+Hence if $x_{k}^{\top}x_{k}y_{k}^{\top}y_{k} - (x_{k}^{\top}y_{k})^{2}$ does not converge, then GD will not converge. If $x_{k}^{\top}x_{k}y_{k}^{\top}y_{k} - (x_{k}^{\top}y_{k})^{2}$ converges, then $c\geq x_k^\top x_k y_k^\top y_k - (x_k^\top y_k)^2\geq 0$ for all the rest of the iterations with some $c > 0$ , and we further assume $|x_{k}^{\top}y_{k} - \mu | < \epsilon$ for any $0 < \epsilon < \mu$ . As is shown in scalar case, when $u_{k}^{2}\geq \frac{2}{h} +\epsilon h(\mu +\epsilon)$ , we have $s_k = 1 - hu_k^2 -h^2 x_k^\top y_k(\mu -x_k^\top y_k)\geq -1$ . Then
+
+$$
+x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) s _ {k} + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k})
+$$
+
+will never converge (because $s_k \leq -1$ and the second term is bounded).
+
+Lemma H.5. When $x_{k}^{\top}y_{k} > \mu$ or $x_{k}^{\top}y_{k} < -\frac{h\mu u_{k}^{2}}{4 - h u_{k}^{2}}$ , we have $u_{k + 1}^{2} - u_{k}^{2} < 0$ .
+
+Proof.
+
+$$
+\begin{array}{l} u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + h \left(4 - h u _ {k} ^ {2}\right) \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ \leq h (\mu - x _ {k} ^ {\top} y _ {k}) ((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu). \\ \end{array}
+$$
+
+Hence the proof follows 1D case.
+
+
+
+Lemma H.6. When $-\frac{h\mu u_k^2}{4 - h u_k^2} \leq x_k^\top y_k < \mu$ , we have $u_{k+2}^2 - u_k^2 < 0$ .
+
+Proof. Let $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ , the same as 1D.
+
+$$
+\begin{array}{l} x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = (x _ {k} ^ {\top} y _ {k} - \mu) (1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} (\mu - x _ {k} ^ {\top} y _ {k})) + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}) \\ \triangleq (x _ {k} ^ {\top} y _ {k} - \mu) s _ {k} + M. \\ \end{array}
+$$
+
+$$
+u _ {k + 2} ^ {2} - u _ {k} ^ {2} = u _ {k + 1} ^ {2} - u _ {k} ^ {2} + u _ {k + 2} ^ {2} - u _ {k + 1} ^ {2}
+$$
+
+$$
+\begin{array}{l} = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + h (4 - h u _ {k} ^ {2}) \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ + h \left(\mu - x _ {k + 1} ^ {\top} y _ {k + 1}\right) \left(\left(4 - h u _ {k + 1} ^ {2}\right) x _ {k + 1} ^ {\top} y _ {k + 1} + h u _ {k + 1} ^ {2} \mu\right) \\ + h (4 - h u _ {k + 1} ^ {2}) ((x _ {k + 1} ^ {\top} y _ {k + 1}) ^ {2} - x _ {k + 1} ^ {\top} x _ {k + 1} y _ {k + 1} ^ {\top} y _ {k + 1}) \\ = \left[ h (\mu - x _ {k} ^ {\top} y _ {k}) \left(\left((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + s _ {k} \left(h u _ {k + 1} ^ {2} \mu + (4 - h u _ {k + 1} ^ {2}) \left(s _ {k} \left(x _ {k} ^ {\top} y _ {k} - \mu\right) + \mu\right)\right)\right) \right] \\ + \left[ h (4 - h u _ {k} ^ {2}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}) + h M ^ {2} (- 4 + h u _ {k + 1} ^ {2}) \right. \\ + h M (- h u _ {k + 1} ^ {2} \mu + (- 4 + h u _ {k + 1} ^ {2}) \mu + 2 (4 - h u _ {k + 1} ^ {2}) (\mu - x _ {k} ^ {\top} y _ {k}) s _ {k}) \Bigg ] \\ \end{array}
+$$
+
+$$
+\triangleq \mathrm {I} + \Pi .
+$$
+
+I is the same as 1D $u_{k+2}^2 - u_k^2$ and hence (1) < 0. For II,
+
+$$
+\begin{array}{l} \mathrm {I I} = h M ^ {2} \left(- 4 + h u _ {k + 1} ^ {2}\right) + h \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ \times \underbrace {(4 - h u ^ {2} + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) (- h u _ {k + 1} ^ {2} \mu + (- 4 + h u _ {k + 1} ^ {2}) \mu + 2 (4 - h u _ {k + 1} ^ {2}) (\mu - x _ {k} ^ {\top} y _ {k}) s _ {k}))} _ {\text {I I I}}. \\ \end{array}
+$$
+
+From 1D results, $s_k < 0$ . Then, III achieves its lower bound at $x_k^\top y_k = \mu$ or $x_k^\top y_k = -\frac{h\mu u_k^2}{4 - h u_k^2}$ . For $x_k^\top y_k = \mu$ ,
+
+$$
+\mathrm {I I I} = 4 - h u _ {k} ^ {2} - 4 h ^ {2} \mu^ {2} \geq 4 h \mu (c - h \mu) > 0,
+$$
+
+where the inequality is from $u_{k}^{2} \leq u_{0}^{2} = \frac{4}{h} - 4c\mu$ and $c > h\mu$ .
+
+For $x_{k}^{\top}y_{k} = -\frac{h\mu u_{k}^{2}}{4 - h u_{k}^{2}}$
+
+$$
+\begin{array}{l} \mathrm {I I I} = 4 - h u _ {k} ^ {2} - \frac {4 h ^ {2} (8 - h u _ {k} ^ {2}) (4 - h u _ {k} ^ {2} - 2 s _ {k} (4 - h u _ {k + 1} ^ {2})) \mu^ {2}}{(4 - h u _ {k} ^ {2}) ^ {2}} \\ \geq 4 - h u _ {k} ^ {2} - \frac {4 h ^ {2} (8 - h u _ {k} ^ {2}) (4 - h u _ {k} ^ {2} - 2 s _ {k} (4 - h u _ {k} ^ {2})) \mu^ {2}}{(4 - h u _ {k} ^ {2}) ^ {2}} \\ = 4 - h u _ {k} ^ {2} - \frac {4 h ^ {2} (8 - h u _ {k} ^ {2}) (1 - 2 s _ {k}) \mu^ {2}}{4 - h u _ {k} ^ {2}} \\ \stackrel {u _ {k} ^ {2} \leq u _ {0} ^ {2}} {\geq} 4 - h u _ {k} ^ {2} - \frac {4 h ^ {2} (4 + 4 c h \mu) (1 - 2 s _ {k}) \mu^ {2}}{4 c h \mu} \\ \sum^ {u _ {k} ^ {2} \leq u _ {0} ^ {2}} \frac {4 h \mu}{c} (- 1 + c ^ {2} + 2 s _ {k} + c h (- 1 + 2 s _ {k}) \mu) \\ \stackrel {*} {\geq} c ^ {2} (1 + 8 h ^ {2} \mu^ {2}) + c (h \mu - \frac {h ^ {3} \mu^ {3}}{2}) - 7 - \frac {h ^ {2} \mu^ {2}}{2} \\ \begin{array}{l} \stackrel {{*}} {{\geq}} 0, \end{array} \\ \end{array}
+$$
+
+where $\ast$ follows from
+
+$$
+s _ {k} = 1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)
+$$
+
+$$
+\begin{array}{c} x _ {k} ^ {\top} y _ {k} = \mu / 2 \\ \geq 1 - h u _ {k} ^ {2} - \frac {h ^ {2} \mu^ {2}}{4} \end{array}
+$$
+
+$$
+\stackrel {u _ {k} ^ {2} \leq u _ {0} ^ {2}} {\geq} - 3 + 4 c h \mu - \frac {h ^ {2} \mu^ {2}}{4},
+$$
+
+and $\ast \ast$ follows from $c\geq \sqrt{7}$
+
+From 1D discussion, $-4 + h u_{k+1}^2 < 0$ . Also, $(x_k^\top y_k)^2 - x_k^\top x_k y_k^\top y_k < 0$ . Hence we have $(3) \geq 0$ . Overall, $(2) \leq 0$ and therefore the whole discussion of (1) is the same as 1D.
+
+# H.2 PHASE 2
+
+The proof in phase 2 is partly different from the scalar case due to the alignment. Before presenting the main convergence lemma, we first state the boundedness of GD in the following lemma.
+
+Lemma H.7. Once $GD$ enters $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ , it will stay bounded inside $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h} + 2h\mu^2(1 + \frac{1}{1 - h^2\mu^2})\}$ and re-enter $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ within finite steps where the number of such steps do not depend on the number of iteration.
+
+Proof. Assume $u_{k}^{2} \leq \frac{2}{h}$ . Then
+
+$$
+\begin{array}{l} u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) ((4 - h u _ {k} ^ {2}) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu) + h (4 - h u _ {k} ^ {2}) ((x _ {k} ^ {\top} y _ {k}) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}) \\ \leq 2 h \left(\mu^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \leq 2 h \mu^ {2}, \\ \end{array}
+$$
+
+where the first inequality follows from $u_{k}^{2} \leq \frac{2}{h}$ . If further $u_{k+1}^{2} \leq \frac{2}{h} + 2h\mu^{2}$ , then by $x_{k+1}^{\top}y_{k+1} \geq -\sqrt{x_{k+1}^{\top}x_{k+1}y_{k+1}^{\top}y_{k+1}}$ and $-1 + h^{2}\mu^{2} < 0$ , we have
+
+$$
+\begin{array}{l} u _ {k + 2} ^ {2} - u _ {k + 1} ^ {2} = h (\mu - x _ {k + 1} ^ {\top} y _ {k + 1}) ((4 - h u _ {k + 1} ^ {2}) x _ {k + 1} ^ {\top} y _ {k + 1} + h u _ {k + 1} ^ {2} \mu) \\ + h (4 - h u _ {k + 1} ^ {2}) ((x _ {k + 1} ^ {\top} y _ {k + 1}) ^ {2} - x _ {k + 1} ^ {\top} x _ {k + 1} y _ {k + 1} ^ {\top} y _ {k + 1}) \\ \leq 2 h (x _ {k + 1} ^ {\top} x _ {k + 1} y _ {k + 1} ^ {\top} y _ {k + 1} (- 1 + h ^ {2} \mu^ {2}) + \mu^ {2} (1 - 2 x _ {k + 1} ^ {\top} y _ {k + 1} h ^ {2} \mu + h ^ {2} \mu^ {2})) \\ \leq 2 h (x _ {k + 1} ^ {\top} x _ {k + 1} y _ {k + 1} ^ {\top} y _ {k + 1} (- 1 + h ^ {2} \mu^ {2}) + \mu^ {2} (1 + 2 \sqrt {x _ {k + 1} ^ {\top} x _ {k + 1} y _ {k + 1} ^ {\top} y _ {k + 1}} h ^ {2} \mu + h ^ {2} \mu^ {2})) \\ \leq \frac {2 h \mu^ {2}}{1 - h ^ {2} \mu^ {2}}. \\ \end{array}
+$$
+
+The first inequality is from $u_{k+1}^2 \leq \frac{2}{h} + 2h\mu^2$ ; the second inequality follows from the two conditions mentioned above; the third inequality follows from choosing $\sqrt{x_{k+1}^\top x_{k+1}y_{k+1}^\top y_{k+1}} = \frac{h^2\mu^3}{1 - h^2\mu^2}$ .
+
+From previous proof, we know when $u_k^2 > \frac{2}{h}$ , by Lemma H.3, we have GD will enter $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ in finite steps with the decrease of $u_k^2$ in either one step or two steps. Then, $u_i^2 \leq \frac{2}{h} + 2h\mu^2(1 + \frac{1}{1 - h^2\mu^2})$ for all $i \geq k$ .
+
+Let $U_{k} = x_{k}^{\top}y_{k}$ , $V_{k} = x_{k}^{\top}x_{k}$ , $W_{k} = y_{k}^{\top}y_{k}$ . Then we can rewrite the iteration for the three variables
+
+$$
+\left\{ \begin{array}{l} U _ {k + 1} = h \left(1 - h V _ {k}\right) \mu W _ {k} + h \mu V _ {k} \left(1 - h W _ {k}\right) + U _ {k} \left(1 + h ^ {2} V _ {k} W _ {k} - h \left(V _ {k} + W _ {k}\right) + h ^ {2} \mu^ {2}\right) \\ V _ {k + 1} = 2 h \mu U _ {k} + V _ {k} - 2 h V _ {k} W _ {k} + h ^ {2} \left(\mu^ {2} W _ {k} - 2 \mu U _ {k} W _ {k} + V _ {k} W _ {k} ^ {2}\right) \\ W _ {k + 1} = 2 h \mu U _ {k} + W _ {k} - 2 h V _ {k} W _ {k} + h ^ {2} \left(\mu^ {2} V _ {k} - 2 \mu U _ {k} V _ {k} + V _ {k} ^ {2} W _ {k}\right) \end{array} . \right. \tag {10}
+$$
+
+When $h = \frac{4}{u_0^2 + 4c\mu}$ or $h = \frac{1}{2\sqrt{7}\mu}$ , we have $h\mu \leq \frac{1}{2\sqrt{7}}$ . The following is the main lemma in phase 2.
+
+Lemma H.8. Given $h\mu \leq \frac{1}{2\sqrt{7}}$ , if $GD$ enters $\{\|x\|^2 + \|y\|^2 \leq \frac{2}{h}\}$ , it converges to $x^\top y = \|x\| \|y\| = \mu$ , i.e., the global minimum, inside this region except for a measure-0 set of initial conditions.
+
+Proof. This proof follows the same method as the scalar decomposition. We need to prove that all the conclusions in scalar case also hold in this rank one decomposition.
+
+Consider $u_{k + 1}^2 - u_k^2$ when $x_k^\top y_k < -\mu$ or $x_k^\top y_k > \mu$ ,
+
+$$
+\begin{array}{l} u _ {k + 1} ^ {2} - u _ {k} ^ {2} = h (\mu - x _ {k} ^ {\top} y _ {k}) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + h \left(4 - h u _ {k} ^ {2}\right) \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ = h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right) + h \left(4 - h u _ {k} ^ {2}\right) \left(U _ {k} ^ {2} - V _ {k} W _ {k}\right) \\ \leq h \left(\mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(4 - h u _ {k} ^ {2}\right) x _ {k} ^ {\top} y _ {k} + h u _ {k} ^ {2} \mu\right), \\ \end{array}
+$$
+
+where the last expression is the same as scalar case and therefore under the conditions such that $u_{k + 1}^2 - u_k^2 < 0$ in scalar case, we also have $u_{k + 1}^2 - u_k^2 < 0$ in rank-one approximation.
+
+As in scalar case, we also denote $s_k = 1 - h u_k^2 - h^2 x_k^\top y_k (\mu - x_k^\top y_k)$ . First consider $\frac{1}{h} + 2h\mu^2 < u_k^2 \leq \frac{2}{h}$ . If $-\mu \leq x_k^\top y_k < \mu$ , $u_{k+1}^2 \geq u_k^2$ , and $s_k \leq -1$ , consider $u_{k+2}^2 - u_k^2$ . From Lemma H.6, the extra terms of $u_{k+2}^2 - u_k^2$ compared to scalar case is
+
+$$
+\begin{array}{l} h M ^ {2} \left(- 4 + h u _ {k + 1} ^ {2}\right) + h \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ \times \underbrace {(4 - h u ^ {2} + h ^ {2} (2 \mu - x _ {k} ^ {\top} y _ {k}) (- h u _ {k + 1} ^ {2} \mu + (- 4 + h u _ {k + 1} ^ {2}) \mu + 2 (4 - h u _ {k + 1} ^ {2}) (\mu - x _ {k} ^ {\top} y _ {k}) s _ {k}))} _ {\text {I I I}} \\ \end{array}
+$$
+
+where $M = h^{2}(2\mu - x_{k}^{\top}y_{k})((x_{k}^{\top}y_{k})^{2} - x_{k}^{\top}x_{k}y_{k}^{\top}y_{k})$ . Then we will prove that III is positive and then all the extra terms will be less than 0. By rewriting III in terms of $x_{k}^{\top}y_{k}$ , we get
+
+$$
+\begin{array}{l} \mathrm {I I I} = 2 (x _ {k} ^ {\top} y _ {k}) ^ {2} h ^ {2} s _ {k} (4 - h u _ {k + 1} ^ {2}) + x _ {k} ^ {\top} y _ {k} (h ^ {3} u _ {k + 1} ^ {2} \mu - 6 h ^ {2} s _ {k} (4 - h u _ {k + 1} ^ {2}) \mu - h ^ {2} (- 4 + h u _ {k + 1} ^ {2}) \mu) \\ - 2 h ^ {3} u _ {k + 1} ^ {2} \mu^ {2} + 4 h ^ {2} s _ {k} (4 - h u _ {k + 1} ^ {2}) \mu^ {2} + 2 h ^ {2} (- 4 + h u _ {k + 1} ^ {2}) \mu^ {2} + 4 - h u _ {k} ^ {2} \\ \geq 4 - h u _ {k} ^ {2} + 1 2 h ^ {2} (- 1 + 4 s _ {k}) \mu^ {2} - 1 2 h ^ {3} s _ {k} u _ {k + 1} ^ {2} \mu^ {2} \\ \geq 4 - h u _ {k} ^ {2} + 1 2 h ^ {2} (- 1 + 4 s _ {k}) \mu^ {2} - 1 2 h ^ {3} s _ {k} u _ {k} ^ {2} \mu^ {2} \\ = 4 - h u _ {k} ^ {2} + 1 2 h ^ {2} \left(- 1 + s _ {k} \left(4 - h u _ {k} ^ {2}\right)\right) \mu^ {2} > 0, \\ \end{array}
+$$
+
+where the first inequality is because it obtains the minimum at $x_{k}^{\top}y_{k} = -\mu$ ; the second inequality follows from $u_{k + 1}^{2}\geq u_{k}^{2}$ ; the last inequality is from the range of $u_{k}^{2}$ and $s_k$ . Therefore the extra terms of $u_{k + 2}^{2} - u_{k}^{2}$ is always negative and then we have the same conclusion as scalar case, i.e., $u_{k + 2}^{2} - u_{k}^{2} < - C(\mu -x_{k}^{\top}y_{k})^{2}$ for some constant $C > 0$ .
+
+Next, consider $s_{k+1}$ when $-\mu \leq x_k^\top y_k \leq 3\mu$ and $\frac{1}{h} + 2h\mu^2 < u_k^2 \leq \frac{2}{h}$ which implies $-1 - \frac{h^2\mu^2}{4} \leq s_k < 0$ . The extra terms of $s_{k+1}$ compared to scalar case is
+
+$$
+h ^ {2} (U _ {k} ^ {2} - V _ {k} W _ {k}) \underbrace {\Big (- (4 - h u _ {k} ^ {2}) + (- x _ {k} ^ {\top} y _ {k} + 2 \mu) (2 h ^ {2} s _ {k} (x _ {k} ^ {\top} y _ {k} - \mu) + h ^ {2} \mu) + h ^ {4} x (- x _ {k} ^ {\top} y _ {k} + 2 \mu) ^ {2} \Big)} _ {\mathrm {I V}},
+$$
+
+where $U_{k}^{2} - V_{k}W_{k}\leq 0$ . Then consider the upper bound of IV
+
+$$
+\begin{array}{l} \mathrm {I V} = - 4 - 2 \left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} h ^ {2} s _ {k} + x _ {k} ^ {\top} y _ {k} \left(- h ^ {2} \mu + 6 h ^ {2} s \mu\right) + h u _ {k} ^ {2} + 2 h ^ {2} \mu^ {2} - 4 h ^ {2} s _ {k} \mu^ {2} \\ \leq - 4 + h u _ {k} ^ {2} + \left(- h ^ {2} - 4 h ^ {2} s _ {k}\right) \mu^ {2} < 0, \\ \end{array}
+$$
+
+where the first inequality follows from $x_{k}^{\top}y_{k}\leq 3\mu$ . Therefore the extra terms is non-negative, namely all the lower bound for $s_{k + 1}$ in the scalar case also holds for rank-one approximation.
+
+Also we need to consider $s_{k+2}$ when $s_k > -1, -\mu \leq x_k^\top y_k \leq 3\mu$ , and $\frac{1}{h} + 2h\mu^2 < u_k^2 \leq \frac{2}{h}$ . For scalar case, from Lemma G.13 with $\epsilon = x_{k+1}^\top y_{k+1} - \mu$ , we have
+
+$$
+\begin{array}{l} s _ {k + 2} = s _ {k + 1} + \left(h ^ {2} \left(3 + s _ {k + 1} ^ {2}\right) - h ^ {3} u _ {k} ^ {2}\right) \epsilon^ {2} + h ^ {2} \epsilon \left(- 3 \mu - s _ {k + 1} \mu\right) \\ = 3 h ^ {2} \epsilon^ {2} + h ^ {2} s _ {k + 1} ^ {2} \epsilon^ {2} - h ^ {3} u _ {k} ^ {2} \epsilon^ {2} - 3 h ^ {2} \epsilon \mu + s _ {k + 1} (1 - h ^ {2} \epsilon \mu). \\ \end{array}
+$$
+
+Since the minimum point w.r.t. $s_{k + 1}$ is $\frac{-(1 - h^2\epsilon\mu)}{2h^2\epsilon^2} < -1 - \frac{h^2\mu^2}{4}$ , we have if $s_{k + 1}$ is larger, then $s_{k + 2}$ is also larger. Given the same value for $s_k$ for both scalar and rank-one cases, $s_{k + 1}$ is larger from the above discussion and thus $s_{k + 2}$ is also larger, namely, the lower bound for $s_{k + 2}$ also holds in rank-one cases.
+
+Next consider $u_{k}^{2} \leq \frac{1}{h} + 2h\mu^{2}$ where $|s_k| < 1$ and we need the iteration to have certain restrictions such that it will be bounded in a region. If $s_k < 0$ , then it follows the same from the above discussion. If $s_k > 0$ and $x_{k}^{\top}y_{k} > \mu$ or $x_{k}^{\top}y_{k} < -\mu$ , then by $u_{k+1}^{2} - u_{k}^{2} < 0$ , it will stay in $\{x_{k}^{\top}y_{k} > \mu, u_{k}^{2} \leq \frac{1}{h} + 2h\mu^{2}\}$ until convergence. If $s_k > 0$ and $-\mu \leq x_{k}^{\top}y_{k} < \mu$ , similar to scalar case, we consider $|x_{k}^{\top}x_{k} - y_{k}^{\top}y_{k}| = |V_{k} - W_{k}|$ and
+
+$$
+\left| V _ {k + 1} - W _ {k + 1} \right| = \left| V _ {k} - W _ {k} \right| \cdot \left| 1 - h ^ {2} V _ {k} W _ {k} + 2 h ^ {2} U _ {k} \mu - h ^ {2} \mu^ {2} \right|,
+$$
+
+where $U_{k} = x_{k}^{\top}y_{k}$ and $U_{k}^{2}\leq V_{k}W_{k}$ . Then
+
+$$
+1 - h ^ {2} V _ {k} W _ {k} + 2 h ^ {2} U _ {k} \mu - h ^ {2} \mu^ {2} \leq 1 - h ^ {2} U _ {k} ^ {2} + 2 h ^ {2} U _ {k} \mu - h ^ {2} \mu^ {2} < 1,
+$$
+
+$$
+1 - h ^ {2} V _ {k} W _ {k} + 2 h ^ {2} U _ {k} \mu - h ^ {2} \mu^ {2} \geq 1 - h ^ {2} \frac {u _ {k} ^ {4}}{4} - 2 h ^ {2} \mu - h ^ {2} \mu^ {2} \geq 1 - \frac {1}{4} (1 + 2 h ^ {2} \mu^ {2}) ^ {2} - 3 h ^ {2} \mu^ {2} > 0.
+$$
+
+Therefore if $-\mu \leq x_{k}^{\top}y_{k} < \mu$ and $u_{k}^{2} \leq \frac{1}{h} + 2h\mu^{2}$ , we have $|V_{k+1} - W_{k+1}| < |V_{k} - W_{k}|$ , meaning together with $0 \leq \mu - x_{k+1}^{\top}y_{k+1} < \mu - x_{k}^{\top}y_{k}$ , $x_{k+1}$ and $y_{k+1}$ is bounded in the monotone convergence region.
+
+So far we retrieve all the conditions for convergence. Therefore, from the proof of the convergence in scalar case, we have that there exists a constant $K > 0$ , s.t., $|s_k| < 1$ and $0 < 2\mu - x_k^\top y_k < 2\mu$ for all $k > K$ . Then let $S_k = h^2 (2\mu - x_k^\top y_k)$ and we have
+
+$$
+\begin{array}{l} x _ {k + 1} ^ {\top} y _ {k + 1} - \mu = \left(x _ {k} ^ {\top} y _ {k} - \mu\right) \left(1 - h u _ {k} ^ {2} - h ^ {2} x _ {k} ^ {\top} y _ {k} \left(\mu - x _ {k} ^ {\top} y _ {k}\right)\right) \\ + h ^ {2} \left(2 \mu - x _ {k} ^ {\top} y _ {k}\right) \left(\left(x _ {k} ^ {\top} y _ {k}\right) ^ {2} - x _ {k} ^ {\top} x _ {k} y _ {k} ^ {\top} y _ {k}\right) \\ = \left(x _ {k} ^ {\top} y _ {k} - \mu\right) s _ {k} + S _ {k} \left(U _ {k} ^ {2} - V _ {k} W _ {k}\right) \\ \end{array}
+$$
+
+In fact $x_{k}^{\top}y_{k} - \mu \to 0$ as $k \to 0$ . First, since $S_{k}(U_{k}^{2} - V_{k}W_{k}) \to 0$ as $k \to 0$ by Lemma H.9 and $|s_k| < 1$ , we have $x_{k}^{\top}y_{k} - \mu$ is bounded. Also, from previous discussion, $|s_k| \leq \max \{C_2, 1 - C_3(x_k^\top y_k - \mu)^2\}$ for some constant $C_2, C_3 > 0$ . For any $\epsilon_0 > 0$ , there exists $K_1 > 0$ and $\epsilon_1 \ll \epsilon_0$ such that $|S_{k}(U_{k}^{2} - V_{k}W_{k})| < \epsilon_{1}$ for all $k > K_1$ and $C_2 \leq 1 - C_3\epsilon_1^2$ . Therefore $x_{k}^{\top}y_{k} - \mu$ will
+
+decreases to $\mathcal{O}(\epsilon_1)$ . This is because
+
+$$
+\begin{array}{l} \left| x _ {k + 1} ^ {\top} y _ {k + 1} - \mu \right| \leq \left(1 - C _ {3} \epsilon_ {1} ^ {2}\right) \left| x _ {k} ^ {\top} y _ {k} - \mu \right| + 2 \mu \left| U _ {K _ {1}} ^ {2} - V _ {K _ {1}} W _ {K _ {1}} \right| C _ {0} ^ {2 (k - K _ {1})} \\ \leq \left| \left(x _ {K _ {1}} ^ {\top} y _ {K _ {1}} - \mu\right) \right| \left(1 - C _ {3} \epsilon_ {1} ^ {2}\right) ^ {k - K _ {1}} \\ + 2 h ^ {2} \mu \left(V _ {K _ {1}} W _ {K _ {1}} - U _ {K _ {1}} ^ {2}\right) \sum_ {i = K _ {1}} ^ {k} C _ {0} ^ {2 (i - K _ {1})} \left(1 - C _ {3} \epsilon_ {1} ^ {2}\right) ^ {k - i} \\ \leq \left| \left(x _ {K _ {1}} ^ {\top} y _ {K _ {1}} - \mu\right) \right| \left(1 - C _ {3} \epsilon_ {1} ^ {2}\right) ^ {k - K _ {1}} + 2 h ^ {2} \mu \left(V _ {K _ {1}} W _ {K _ {1}} - U _ {K _ {1}} ^ {2}\right) \left(k - K _ {1}\right) C _ {4} ^ {k - K _ {1}} \\ \end{array}
+$$
+
+where $C_4 = \max \{C_0, 1 - C_3\epsilon_1^2\} < 1$ and we have $kC_4^k \to 0$ as $k \to \infty$ . Therefore there exists $K_2 \geq K_1$ s.t. $x_{K_2}^\top y_{K_2} - \mu = \mathcal{O}(\epsilon_1)$ . Then we will show for all $k > K_2$ , $|x_k^\top y_k - \mu| < \epsilon_0$ . As is shown before there exists $K_3 > K_2$ and $\epsilon_2 \ll \epsilon_1$ s.t. $|S_k(U_k^2 - V_kW_k)| < \epsilon_2$ . Since $|s_k| < 1$ , the increase of $|x_k^\top y_k - \mu|$ is also $\mathcal{O}(\epsilon_1)$ and thus $|x_k^\top y_k - \mu| = \mathcal{O}(\epsilon_1) < \epsilon_0$ for $k > K_2$ . Then we have the convergence of $|x_k^\top y_k - \mu| \to 0$ .
+
+In general, we have $x_{k}^{\top}y_{k}\to \mu$ and $|\cos (\angle (x_k,y_k))|\to 0$ , which implies GD converges to the global minimum $x^{\top}y = \| x\| \| y\| = \mu$ .
+
+For the proof of alignment, we only need to consider when $\| x_{k}\|^{2} + \| y_{k}\|^{2}\leq \frac{2}{h} +2h\mu^{2}(1 + \frac{1}{1 - h^{2}\mu^{2}})$ . Also, we have $V_{k}W_{k} - U_{k}^{2}\geq 0$ and
+
+$$
+V _ {k + 1} W _ {k + 1} - U _ {k + 1} ^ {2} = (V _ {k} W _ {k} - U _ {k} ^ {2}) (1 - h (V _ {k} + W _ {k}) + h ^ {2} (V _ {k} W _ {k} - \mu^ {2})) ^ {2}.
+$$
+
+Thus we denote $l_{k} = 1 - h(V_{k} + W_{k}) + h^{2}(V_{k}W_{k} - \mu^{2})$ which characterizes the change of $V_{k}W_{k} - U_{k}^{2}$ .
+
+Lemma H.9. If $\| x_k\|^2 + \| y_k\|^2 \leq \frac{2}{h} + 2h\mu^2 (1 + \frac{1}{1 - h^2\mu^2})$ , then $V_{k}W_{k} - U_{k}^{2}$ converges to 0 and also $|\cos (\angle (x_k,y_k))|$ converges to 1.
+
+Proof. By $0 \leq V_k W_k \leq \left(\frac{V_k + W_k}{2}\right)^2$ and the boundedness theorem, we have
+
+$$
+V _ {k} + W _ {k} \leq \frac {2}{h} + 2 h \mu^ {2} \left(1 + \frac {1}{1 - h ^ {2} \mu^ {2}}\right),
+$$
+
+and
+
+$$
+l _ {k} = 1 - h \left(V _ {k} + W _ {k}\right) + h ^ {2} \left(V _ {k} W _ {k} - \mu^ {2}\right) \geq - 1 - h ^ {2} \mu^ {2} \left(3 + \frac {2}{1 - h ^ {2} \mu^ {2}}\right), \tag {11}
+$$
+
+$$
+\begin{array}{l} l _ {k} = 1 - h (V _ {k} + W _ {k}) + h ^ {2} (V _ {k} W _ {k} - \mu^ {2}) \leq \frac {h ^ {2}}{4} (V _ {k} + W _ {k}) ^ {2} - h (V _ {k} + W _ {k}) + 1 - h ^ {2} \mu^ {2} \\ \leq 1 - h ^ {2} \mu^ {2} < 1. \\ \end{array}
+$$
+
+We will show that there exists $K > 0$ and a constant $C > 0$ only depending on $h\mu$ , s.t. when $k > K$ , $|l_k| < 1 - C$ .
+
+If $V_{k} + W_{k} < \frac{2}{h} - h\mu^{2}$ , then
+
+$$
+l _ {k} = 1 - h \left(V _ {k} + W _ {k}\right) + h ^ {2} \left(V _ {k} W _ {k} - \mu^ {2}\right) > - 1 + h ^ {2} V _ {k} W _ {k} > - 1.
+$$
+
+(If $V_{k}W_{k} = 0$ , then $V_{k}W_{k} - U_{k}^{2} = 0$ meaning it just converge.)
+
+Therefore when $V_{k} + W_{k} < \frac{2}{h} - h\mu^{2}$ , we have $|l_{k}| < 1$ . We only need to consider $l_{k+1}$ when $\frac{2}{h} - h\mu^{2} \leq V_{k} + W_{k} \leq \frac{2}{h} + 2h\mu^{2}\left(1 + \frac{1}{1 - h^{2}\mu^{2}}\right)$ . Next we replace $l_{k}, V_{k}, W_{k}, U_{k}$ by $l, V, W, U$ for
+
+simplicity.
+
+$$
+\begin{array}{l} l _ {k + 1} = 1 - h \left(V _ {k + 1} + W _ {k + 1}\right) + h ^ {2} \left(V _ {k + 1} W _ {k + 1} - \mu^ {2}\right) \\ = 1 - h \left(V _ {k + 1} + W _ {k + 1}\right) + h ^ {2} \left(V _ {k + 1} W _ {k + 1} - U _ {k + 1} ^ {2}\right) + h ^ {2} \left(U _ {k + 1} ^ {2} - \mu^ {2}\right) \\ = 1 - h \left(V _ {k + 1} + W _ {k + 1}\right) + h ^ {2} l ^ {2} \left(V W - U ^ {2}\right) + h ^ {2} \left(U _ {k + 1} ^ {2} - \mu^ {2}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \stackrel {(1 0)} {=} l + h ^ {2} \left(3 + l ^ {2} - h \left(1 + 4 h ^ {2} \mu^ {2}\right) (V + W)\right) \left(V W - U ^ {2}\right) \\ + h ^ {2} U ^ {2} \left(3 + (l + 2 h ^ {2} \mu^ {2}) ^ {2} - h \left(1 + 4 h ^ {2} \mu^ {2}\right) (V + W)\right) \\ + h ^ {2} \mu^ {2} \left(h ^ {2} (W + V) ^ {2} - h (W + V) + 4 h ^ {4} V ^ {2} W ^ {2}\right) \\ + 2 h ^ {2} U \mu \left(\left(1 - \left(l + 2 h ^ {2} \mu^ {2}\right)\right) h (W + V) - 2 + 2 \left(l + 2 h ^ {2} \mu^ {2}\right) \left(1 - l - h ^ {2} \mu^ {2}\right)\right) \tag {12} \\ \end{array}
+$$
+
+If $l \geq -4h^2\mu^2$ , we have
+
+$$
+\begin{array}{l} l _ {k + 1} = l + h ^ {2} \left(3 + l ^ {2} - h \left(1 + 4 h ^ {2} \mu^ {2}\right) (V + W)\right) \left(V W - U ^ {2}\right) \\ + h ^ {2} U ^ {2} \left(3 + (l + 2 h ^ {2} \mu^ {2}) ^ {2} - h \left(1 + 4 h ^ {2} \mu^ {2}\right) (V + W)\right) \\ + h ^ {2} \mu^ {2} \left(h ^ {2} (W + V) ^ {2} - h (W + V) + 4 h ^ {4} V ^ {2} W ^ {2}\right) \\ + 2 h ^ {2} U \mu ((1 - (l + 2 h ^ {2} \mu^ {2})) h (W + V) - 2 + 2 (l + 2 h ^ {2} \mu^ {2}) (1 - l - h ^ {2} \mu^ {2})) \\ \geq l + 2 h ^ {2} U \mu ((1 - (l + 2 h ^ {2} \mu^ {2})) h (W + V) - 2 + 2 (l + 2 h ^ {2} \mu^ {2}) (1 - l - h ^ {2} \mu^ {2})) \\ \geq l - h ^ {2} \mu (V + W) \left(5 h ^ {2} \mu^ {2} + \left(9 h ^ {4} \mu^ {4}\right) / 8\right) \\ \geq - 4 h ^ {2} \mu^ {2} - h \mu (2 + 2 h ^ {2} \mu^ {2} \left(1 + \frac {1}{1 - h ^ {2} \mu^ {2}}\right)) \left(5 h ^ {2} \mu^ {2} + \left(9 h ^ {4} \mu^ {4}\right) / 8\right) \\ > - 1, \\ \end{array}
+$$
+
+where the first inequality is because all the removed terms are positive when $\frac{2}{h} - h\mu^2 \leq V + W \leq \frac{2}{h} + 2h\mu^2 (1 + \frac{1}{1 - h^2\mu^2})$ ; the second inequality follows from recollecting $l$ and take $l$ from quadratic formula with the $h(V + W)$ taken at the bound, and $U > -\frac{V + W}{2}$ ; the third inequality follows from the bounds of $h(V + W)$ and $l$ ; the last inequality is from $h\mu \leq \frac{1}{2\sqrt{7}}$ .
+
+If $l < -4h^2\mu^2 \Rightarrow l + h^2\mu^2 < 0$ . By rewriting $l_{k+1}$ in the following way
+
+$$
+\begin{array}{l} l _ {k + 1} = l + h ^ {2} \left(4 h ^ {4} V ^ {2} W ^ {2} - h (V + W) + h ^ {2} (V + W) ^ {2}\right) \mu^ {2} + 4 h ^ {4} U ^ {2} \mu^ {2} \left(l + h ^ {2} \mu^ {2}\right) \\ + 2 h ^ {2} U \mu (- 2 - h (V + W) (- 1 + l + 2 h ^ {2} \mu^ {2}) - 2 (- 1 + l + h ^ {2} \mu^ {2}) (l + 2 h ^ {2} \mu^ {2})) \\ + h ^ {2} V W \left(3 + l ^ {2} - h (V + W) \left(1 + 4 h ^ {2} \mu^ {2}\right)\right), \\ \end{array}
+$$
+
+we have that the minimum of $l_{k+1}$ is achieved when $U = \pm \sqrt{VW}$ . Thus we will consider two cases: $U \geq 0$ and $U < 0$ . Note we always have $U^2 < VW$ (otherwise $VW - U^2 = 0$ just converges) and hence $l_{k+1}$ is larger than the corresponding value at $U = \pm \sqrt{VW}$ . Let $q = h|U|, v = h\mu, q = cv$ for $c \geq 0$ . Then we have
+
+$$
+q ^ {2} = c ^ {2} v ^ {2} \leq h ^ {2} V W = h (V + W) - 1 + l - v ^ {2} < 1, \quad i. e., \quad c < \frac {1}{v}. \tag {13}
+$$
+
+Next, let
+
+$$
+l _ {k + 1} ^ {\prime} = l _ {k + 1} - h ^ {2} (3 + l ^ {2} - h (1 + 4 h ^ {2} \mu^ {2}) (V + W)) (V W - U ^ {2}) < l _ {k + 1} - h ^ {2} (\frac {1}{2} + l ^ {2}) (V W - U ^ {2}).
+$$
+
+First let $U \geq 0$ and $q = hU < h\sqrt{VW}$ . Choose $q = hU = h\sqrt{VW}$ . Then by
+
+$$
+h (V + W) = 1 - l + h ^ {2} \left(V W - \mu^ {2}\right) = 1 - l + c ^ {2} v ^ {2} - v ^ {2},
+$$
+
+we have the minimum value of $l_{k + 1}$ when $U\geq 0$
+
+$$
+\begin{array}{l} l _ {k + 1} \geq l _ {k + 1} ^ {\prime} = l + (- 1 + c) \left(- \left(\left(- 1 + l\right) l\right) + c \left(2 + l + l ^ {2}\right)\right) v ^ {2} \tag {14} \\ - (- 1 + c) ^ {2} (1 + c ^ {2} - 2 l + 2 c l) v ^ {4} + (- 1 + c) ^ {4} v ^ {6}. \\ \end{array}
+$$
+
+1) When $-1 < l < -4h^2\mu^2$ and $c = 1$ , we have $l_{k + 1} = l_{k + 1}' = l = l_k$ .
+
+2) When $-1 < l < -4h^2\mu^2$ and $c > 1$ , the derivative of (14) with respect to $c$ is
+
+$$
+\begin{array}{l} \frac {d}{d c} l _ {k + 1} ^ {\prime} = (1 - l) l v ^ {2} + (- 2 - l - l ^ {2}) v ^ {2} + 2 v ^ {4} - 6 l v ^ {4} - 4 v ^ {6} + 3 c ^ {2} (2 v ^ {4} - 2 l v ^ {4} - 4 v ^ {6}) \\ + 4 c ^ {3} \left(- v ^ {4} + v ^ {6}\right) + 2 c \left(\left(2 + l + l ^ {2}\right) v ^ {2} - 2 v ^ {4} + 6 l v ^ {4} + 6 v ^ {6}\right), \\ \end{array}
+$$
+
+which is a third order polynomial with negative coefficient of the highest degree term and has a root in $[0,1]$ . Also, when $c = 1$ , $\frac{d}{dc} l_{k+1}' = 2v^2(1 + l) > 0$ . Therefore, when $1 < c < \frac{1}{v}$ , $l_{k+1}'$ either increases or first increases then decreases, namely, the minimum of $l_{k+1}'$ is achieved at $c = 1$ or $c = \frac{1}{v}$ . If $c = 1$ , by the previous discussion, $l_{k+1}' = l$ . If $c = \frac{1}{v}$ ,
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} = 1 + l ^ {2} (- 1 + v) ^ {2} - v ^ {2} - 2 v ^ {3} + 5 v ^ {4} - 4 v ^ {5} + v ^ {6} + l (2 - 2 v + 5 v ^ {2} - 6 v ^ {3} + 2 v ^ {4}) \\ \geq \frac {v ^ {2} (- 2 4 + 4 4 v - 2 5 v ^ {2} + 4 v ^ {3})}{4 (- 1 + v) ^ {2}} > - 1, \\ \end{array}
+$$
+
+where the first inequality follows from the property of quadratic function by taking $l = -\frac{(2 - 2v + 5v^2 - 6v^3 + 2v^4)}{2(-1 + v)^2}$ . Therefore when $-1 < l < -4h^2\mu^2$ and $c > 1$ , $l_{k+1} > -1$ .
+
+3) When $-1 < l < -4h^2\mu^2$ and $c < 1$ , rewrite $l_{k+1}^{\prime}$ with respect to $l$ and we have
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} = 2 (- 1 + c) c v ^ {2} - (- 1 + c) ^ {2} v ^ {4} - (- 1 + c) ^ {2} c ^ {2} v ^ {4} + (- 1 + c) ^ {4} v ^ {6} + l ^ {2} ((1 - c) v ^ {2} \\ + (- 1 + c) c v ^ {2}) + l (1 + (- 1 + c) v ^ {2} + (- 1 + c) c v ^ {2} + 2 (- 1 + c) ^ {2} v ^ {4} - 2 (- 1 + c) ^ {2} c v ^ {4}), \\ \end{array}
+$$
+
+where the minimum point is
+
+$$
+l = - \frac {1}{2 (- 1 + c) ^ {2} v ^ {2}} - \frac {1}{2} - (1 - c) v ^ {2} < - \frac {1}{2 v ^ {2}} - \frac {1}{2} < - 1.
+$$
+
+Therefore the minimum of $l_{k + 1}^{\prime}$ is obtained at $l = -1$ , i.e.,
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} \geq - 1 + (- 1 + c) ^ {2} v ^ {2} (2 - (3 - 2 c + c ^ {2}) v ^ {2} + (- 1 + c) ^ {2} v ^ {4}) \\ \geq - 1 + (- 1 + c) ^ {2} v ^ {2} (2 - 3 v ^ {2} + (- 1 + c) ^ {2} v ^ {4}) > - 1, \\ \end{array}
+$$
+
+where the inequality is from $0 \leq c < 1$ . Therefore when $-1 < l < -4h^2\mu^2$ and $c < 1$ , $l_{k+1} > -1$ .
+
+4) When $l \leq -1$ and $c \geq \frac{5}{4}$ , consider $l_{k+1}' - l$ (15) and take the derivative $\frac{d}{dc} (l_{k+1}' - l) = \frac{d}{dc} l_{k+1}'$ . From previous discussion, consider $\frac{d}{dc} l_{k+1}'$ at $c = \frac{5}{4}$ , i.e.,
+
+$$
+\frac {d}{d c} l _ {k + 1} ^ {\prime} = 1 / 1 6 v ^ {2} (4 8 + 8 l ^ {2} - 2 3 v ^ {2} + v ^ {4} + l (4 0 - 6 v ^ {2})) > v ^ {2} - (1 6 1 v ^ {4}) / 1 6 + (3 2 5 v ^ {6}) / 1 6 > 0,
+$$
+
+where the first inequality follows from $l > -1 - 6v^2$ by (11). Therefore the minimum of $l_{k+1}' - l$ is at $c = \frac{5}{4}$ or $c = \frac{1}{v}$ . If $c = \frac{5}{4}$ ,
+
+$$
+l _ {k + 1} ^ {\prime} - l = \frac {v ^ {2}}{2 5 6} (1 6 0 + 1 6 l ^ {2} - 4 1 v ^ {2} + v ^ {4} - 8 l (- 1 8 + v ^ {2})) > \frac {v ^ {2}}{2 5 6} (3 2 - 7 0 5 v ^ {2} + 6 2 5 v ^ {4}) > 0
+$$
+
+where the first inequality is from $l > -1 - 6v^2$ by (11). If $c = \frac{1}{v}$ ,
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} - l = l ^ {2} (- 1 + v) ^ {2} + l (- 1 + v) (- 1 + v - 4 v ^ {2} + 2 v ^ {3}) + (- 1 + v) (- 1 - v + 2 v ^ {3} - 3 v ^ {4} + v ^ {5}) \\ \geq (1 - v) ^ {3} \left(1 + 3 v + v ^ {2} - v ^ {3}\right) > 0 \\ \end{array}
+$$
+
+where the first inequality is from $l \leq -1$ . Therefore when $l \leq -1$ and $c \geq \frac{5}{4}$ , $l_{k+1} - l_k > \min \left\{ \frac{v^2}{256} (32 - 705v^2 + 625v^4), (1 - v)^3 (1 + 3v + v^2 - v^3) \right\} > 0$ .
+
+In the next two cases $c \leq 1$ and $1 < c < \frac{5}{4}$ , we no longer assume $q = h\sqrt{VW}$ but want the same lower bound of $l_{k+1}'$ . Since $q = hU < h\sqrt{VW}$ , we have $h(V + W) > 1 - l + c^2 v^2 - v^2 > 0$ . By rewriting $l_{k+1}'$ to be
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} = l - 4 c v ^ {2} + 3 c ^ {2} v ^ {2} + 4 c ^ {4} v ^ {6} + 4 c v ^ {2} (1 - l - v ^ {2}) (l + 2 v ^ {2}) + v ^ {2} h ^ {2} (V + W) ^ {2} \\ + c ^ {2} v ^ {2} (l + 2 v ^ {2}) ^ {2} + (- v ^ {2} + 2 c v ^ {2} (1 - l - 2 v ^ {2}) - c ^ {2} v ^ {2} (1 + 4 v ^ {2})) h (V + W), \\ \end{array}
+$$
+
+it can be seen from the minimum point w.r.t. $h(V + W)$ that when $h(V + W) > 0$ and $0 \leq c < \frac{5}{4}$ , $l_{k+1}'$ decreases as $h(V + W)$ decreases. Therefore by $h(V + W) > 1 - l + c^2 v^2 - v^2$ , we have the same expression for the lower bound of $l_{k+1}'$ but with $U^2 < VW$ , i.e.,
+
+$$
+l _ {k + 1} - l _ {k + 1} ^ {\prime} = h ^ {2} (3 + l ^ {2} - h (1 + 4 h ^ {2} \mu^ {2}) (V + W)) (V W - U ^ {2}) > h ^ {2} (\frac {1}{2} + l ^ {2}) (V W - U ^ {2}),
+$$
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} > l + (- 1 + c) \left(- \left(\left(- 1 + l\right) l\right) + c \left(2 + l + l ^ {2}\right)\right) v ^ {2} \\ - (- 1 + c) ^ {2} (1 + c ^ {2} - 2 l + 2 c l) v ^ {4} + (- 1 + c) ^ {4} v ^ {6}. \\ \end{array}
+$$
+
+5) When $l \leq -1$ and $c \leq 1$ , consider $l_{k+1}' - l$
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} - l > (- 1 + c) \left(- \left((- 1 + l) l\right) + c \left(2 + l + l ^ {2}\right)\right) v ^ {2} \tag {15} \\ - (- 1 + c) ^ {2} (1 + c ^ {2} - 2 l + 2 c l) v ^ {4} + (- 1 + c) ^ {4} v ^ {6} \\ = (- 1 + c) ^ {2} l ^ {2} v ^ {2} + (- 1 + c) l v ^ {2} (1 + c - 2 (1 - c) v ^ {2} + 2 (1 - c) c v ^ {2}) \\ + (- 1 + c) v ^ {2} (2 c + (1 - c) v ^ {2} + (1 - c) c ^ {2} v ^ {2} + (- 1 + c) ^ {3} v ^ {4}) \\ \end{array}
+$$
+
+where the minimum point is $l = -\frac{1}{2} + \frac{1 - (1 - c)v^2 + (1 - c)cv^2}{1 - c} > -1$ . By $l \leq -1$ we have
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} - l > v ^ {2} (2 (- 1 + c) ^ {2} - (- 1 + c) ^ {2} (3 - 2 c + c ^ {2}) v ^ {2} + (- 1 + c) ^ {4} v ^ {4}) \\ = v ^ {2} \left(\left(- 1 + c\right) ^ {2} \left(2 - \left(3 - 2 c + c ^ {2}\right) v ^ {2}\right) + \left(- 1 + c\right) ^ {4} v ^ {4}\right) \\ \geq v ^ {2} \left((- 1 + c) ^ {2} (2 - 3 v ^ {2}) + (- 1 + c) ^ {4} v ^ {4}\right) \geq 0. \\ \end{array}
+$$
+
+Therefore when $l \leq -1$ and $c \leq 1$ , $l_{k+1} - l_k > h^2\left(\frac{1}{2} + l^2\right)(VW - U^2) \geq \frac{3}{2}h^2(VW - U^2)$ .
+
+6) When $l \leq -1$ and $1 < c < \frac{5}{4}$ , consider $U_{k + 1}$ . By $h(V + W) - h^2 VW = 1 - l - v^2$ , we have
+
+$$
+\begin{array}{l} U _ {k + 1} = h (1 - h V) \mu W + h \mu V (1 - h W) + U \left(1 + h ^ {2} V W - h (V + W) + h ^ {2} \mu^ {2}\right) \\ = \mu ((c - 1) (l + v ^ {2}) + 1 + c v ^ {2} - h ^ {2} V W). \\ \end{array}
+$$
+
+Thus denote $hU_{k + 1} = c_{k + 1}h\mu = c_{k + 1}v$ and we have
+
+$$
+\begin{array}{l} c _ {k + 1} = (c - 1) (l + v ^ {2}) + 1 + c v ^ {2} - h ^ {2} V W \\ < (c - 1) (l + v ^ {2}) + 1 + c v ^ {2} - c ^ {2} v ^ {2} < 1. \\ \end{array}
+$$
+
+Then if $l_{k+1} - l \geq 0$ , then $l_{k+2} - l = l_{k+2} - l_{k+1} + l_{k+1} - l > l_{k+2} - l_{k+1} > \frac{3}{2} h^2 (VW - U^2)$ . Otherwise, we have $l_{k+1} < l$ and consider $l_{k+2}$ . Also, the distance between 1 and $c_{k+1}$ is larger than that of 1 and $c$ , i.e.,
+
+$$
+\begin{array}{l} 1 - c _ {k + 1} - (c - 1) > (1 - (c - 1) (l + v ^ {2}) + 1 + c v ^ {2} - c ^ {2} v ^ {2}) - (c - 1) \tag {16} \\ = 1 + l + v ^ {2} + c ^ {2} v ^ {2} + c (- 1 - l - 2 v ^ {2}) > 0. \\ \end{array}
+$$
+
+From previous discussion, $l_{k+1}' - l$ increases as $l$ decreases. Also $\frac{d}{dc} l_{k+1}' < 0$ when $0 \leq c < 1$ , so $l_{k+1}' - l$ increases as $c$ decreases. By (16), we have $c_{k+1} < 2 - c$ . Then
+
+$$
+\begin{array}{l} l _ {k + 2} ^ {\prime} - l = l _ {k + 2} ^ {\prime} - l _ {k + 1} + l _ {k + 1} - l > l _ {k + 2} ^ {\prime} - l _ {k + 1} + l _ {k + 1} ^ {\prime} - l \\ > (- 1 + c) \left(- \left((- 1 + l) l\right) + c (2 + l + l ^ {2})\right) v ^ {2} \\ - (- 1 + c) ^ {2} (1 + c ^ {2} - 2 l + 2 c l) v ^ {4} + (- 1 + c) ^ {4} v ^ {6} \\ + (1 - c) v ^ {2} \left(- \left((- 1 + l) l\right) - (- 2 + c) (2 + l + l ^ {2}) \right. \\ + (- 1 + c) \left(5 + c ^ {2} + 2 l - 2 c (2 + l)\right) v ^ {2} - (- 1 + c) ^ {3} v ^ {4}) \\ = 2 v ^ {2} (- 1 + c) ^ {2} \left((2 + l + l ^ {2}) + (- 2 - (- 1 + c) ^ {2}) v ^ {2} + (- 1 + c) ^ {2} v ^ {4}\right) \\ > 2 v ^ {2} (- 1 + c) ^ {2} \left(\left(2 - 3 v ^ {2}\right) + (- 1 + c) ^ {2} v ^ {4}\right) > 0, \\ \end{array}
+$$
+
+where the second inequality follows from $c_{k+1} < 2 - c$ and $l_{k+1} < l$ ; the last inequality is by $l \leq -1$ and $1 < c < \frac{5}{4}$ . Therefore when $l \leq -1$ and $1 < c < \frac{5}{4}$ , $l_{k+2} - l_k > \frac{3}{2} h^2 (VW - U^2)$ or $2v^2 (-1 + c)^2 ((2 - 3v^2) + (-1 + c)^2 v^4)$ .
+
+Second, let $U < 0$ and $q = -hU < h\sqrt{VW}$ . Choose $q = -hU = h\sqrt{VW}$ . Then similarly we have the minimum value of $l_{k + 1}$ when $U < 0$
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} = l + (1 + c) \left(\left(- 1 + l\right) l + c \left(2 + l + l ^ {2}\right)\right) v ^ {2} - (1 + c) ^ {2} \left(1 + c ^ {2} \right. (17) \\ - 2 l - 2 c l) v ^ {4} + (1 + c) ^ {4} v ^ {6} \\ = (1 + c) ^ {2} l ^ {2} v ^ {2} + l \left(1 + (- 1 + c ^ {2}) v ^ {2} + 2 (1 + c) ^ {3} v ^ {4}\right) \\ + (1 + c) v ^ {2} \left(v ^ {2} (- 1 + v ^ {2}) + c ^ {3} v ^ {2} (- 1 + v ^ {2}) + c ^ {2} v ^ {2} (- 1 + 3 v ^ {2}) + c (2 - v ^ {2} + 3 v ^ {4})\right) \\ \geq - 1 + (- 4 + 4 c + 3 c ^ {2}) v ^ {2} + (1 5 + 1 6 c - 5 c ^ {2} - 8 c ^ {3} - 2 c ^ {4}) v ^ {4} (18) \\ + (- 5 - 4 c + 2 c ^ {2} + c ^ {3}) ^ {2} v ^ {6}, \\ \end{array}
+$$
+
+where the inequality is because when $l > -1 - 6v^2 + c^2 v^2$ (from (11)), $l_{k+1}'$ increases as $l$ increases.
+
+1) When $c \geq 1$ , since $(-5 - 4c + 2c^2 + c^3)^2 v^6 \geq 0$ , we consider $(-4 + 4c + 3c^2)v^2 + (15 + 16c - 5c^2 - 8c^3 - 2c^4)v^4$ denoted to be $l_{k+1}^{part}$ .
+
+$$
+\frac {d}{d c} l _ {k + 1} ^ {p a r t} = (4 + 6 c) v ^ {2} + (1 6 - 1 0 c - 2 4 c ^ {2} - 8 c ^ {3}) v ^ {4}.
+$$
+
+It has a root between -2 and 0. Also when $c = 1$ , $\frac{d}{dc} l_{k+1}^{part} > 0$ ; when $c = \frac{1}{v}$ , $\frac{d}{dc} l_{k+1}^{part} < 0$ . Thus, the minimum of $l_{k+1}^{part}$ is achieved at $c = 1$ or $c = \frac{1}{v}$ , i.e., $l_{k+1}^{part} \geq v^2 (3 + 16v^2)$ . Then
+
+$$
+l _ {k + 1} ^ {\prime} \geq - 1 + v ^ {2} (3 + 1 6 v ^ {2}) + (- 5 - 4 c + 2 c ^ {2} + c ^ {3}) ^ {2} v ^ {6} > 0.
+$$
+
+Therefore when $c \geq 1$ , $l_{k+1} > -1$ .
+
+2) When $0 \leq c < 1$ and $l > -1$ , from previous discussion of $l_{k+1}^{\prime}$ we have
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} \geq - 1 + 2 (1 + c) ^ {2} v ^ {2} - (1 + c) ^ {2} (3 + 2 c + c ^ {2}) v ^ {4} + (1 + c) ^ {4} v ^ {6} \\ \geq - 1 + (1 + c) ^ {2} v ^ {2} (2 - 6 v ^ {2}) + (1 + c) ^ {4} v ^ {6} \\ \geq - 1 + v ^ {2} (2 - 6 v ^ {2}) + v ^ {6} > - 1. \\ \end{array}
+$$
+
+Therefore when $0 \leq c < 1$ and $l > -1$ , $l_{k+1} > -1$ .
+
+3) When $0 \leq c < 1$ and $l \leq -1$ , consider $l_{k+1}' - l$ . By (17),
+
+$$
+\begin{array}{l} l _ {k + 1} ^ {\prime} - l = (1 + c) ^ {2} l ^ {2} v ^ {2} + l \left(\left(- 1 + c ^ {2}\right) v ^ {2} + 2 \left(1 + c\right) ^ {3} v ^ {4}\right) \\ + (1 + c) v ^ {2} \left(v ^ {2} (- 1 + v ^ {2}) + c ^ {3} v ^ {2} (- 1 + v ^ {2}) + c ^ {2} v ^ {2} (- 1 + 3 v ^ {2}) + c (2 - v ^ {2} + 3 v ^ {4})\right) \\ \geq 2 (1 + c) ^ {2} v ^ {2} - (1 + c) ^ {2} \left(3 + 2 c + c ^ {2}\right) v ^ {4} + (1 + c) ^ {4} v ^ {6} \\ \geq v ^ {2} (2 - 6 v ^ {2}) + v ^ {6}, \\ \end{array}
+$$
+
+where the first inequality is because the minimum point of $l$ is greater than -1. Therefore when $0 \leq c < 1$ and $l \leq -1$ , $l_{k+1} - l_k > v^2(2 - 6v^2) + v^6$ .
+
+Actually all the proofs of $l_{k} > -1 \Rightarrow l_{k + 1} > -1 + C$ for some $C > 0$ are valid for all $0 < V_{k} + W_{k} \leq \frac{2}{h} + 2h\mu^{2}\left(1 + \frac{1}{1 - h^{2}\mu^{2}}\right)$ .
+
+In general, if $l_{k} > -1$ , then there exists a constant $C > 0$ only depending on $h\mu$ s.t. $l_{i} > -1 + C$ for all $i > k$ . If $l_{k} \leq -1$ , then either (1) $l_{k+1}$ increases at least by a fixed value only depending on $h\mu$ , or (2) $l_{k+2}$ or $l_{k+1}$ increases by $\frac{3}{2} h^{2}(V_{k}W_{k} - U_{k}^{2})$ . If it keeps staying in case (2), then since $l_{k} \leq -1$ , $V_{k}W_{k} - U_{k}^{2}$ will be larger and larger until $l_{i} > -1$ for some $i$ . Therefore, there exists a $K > 0$ , s.t. when $k > K$ , $l_{k} > -1 + C$ . Then because $l_{k} \leq 1 - h^{2}\mu^{2}$ , let $0 < C_{0} = \max\{1 - C, 1 - h^{2}\mu^{2}\} < 1$ and we have $|l_{k}| \leq C_{0} < 1$ for all $k > K$ . Further,
+
+$$
+V _ {k} W _ {k} - U _ {k} ^ {2} \leq C _ {0} ^ {2 (k - K)} (V _ {K} W _ {K} - U _ {K} ^ {2}) \rightarrow 0 \quad \mathrm {a s} k \rightarrow \infty ,
+$$
+
+i.e., $1 - \frac{U_k^2}{V_kW_k} \to 0 \Rightarrow |\cos(\angle(x_k, y_k))| \to 1$ .
+
+Otherwise, there exists a $K > 0$ , s.t., $V_{K}W_{K} - U_{K}^{2} = 0$ , then $V_{k}W_{k} - U_{k}^{2} = 0$ for all $k \geq K$ . There are two cases. (i) $x_{K}$ and $y_{K}$ are already aligned. (ii) one of $V_{K}$ and $W_{K}$ is 0, WOLG assume
+
+$V_{K} = 0$ . Then from the GD update,
+
+$$
+\left\{ \begin{array}{l l} & x _ {k + 1} = x _ {k} + h (\mu I - x _ {k} y _ {k} ^ {\top}) y _ {k} \\ & y _ {k + 1} = y _ {k} + h (\mu I - y _ {k} x _ {k} ^ {\top}) x _ {k} \end{array} \right.,
+$$
+
+$x_{K + 1}$ and $y_{K + 1}$ will be aligned for both cases. Then for all $k\geq K + 1$ $x_{k}$ and $y_{k}$ is aligned, i.e., $\left|\cos (\angle (x_k,y_k))\right| = 1.$
+
+# I PROOF OF THEOREM 5.1
+
+# I.1 GENERAL RANK 1 APPROXIMATION FOR NON-NEGATIVE DIAGONAL MATRIX
+
+We first discuss an easy case where $A$ is a non-negative diagonal matrix (later on we will see this is actually the canonical case) and consider
+
+$$
+\min _ {x, y \in \mathbb {R} ^ {n}} \| A - x y ^ {\top} \| _ {F} ^ {2} / 2. \tag {19}
+$$
+
+Assume $A = \left( \begin{array}{ccc}\mu_1I_{n_1} & & \\ & \ddots & \\ & & \mu_mI_{n_m} \end{array} \right)$ , where $I_{n_i}$ is an identity matrix of dimension $n_i\times n_i$ ,
+
+$\sum_{i=1}^{m} n_i = n, \mu_i \geq 0, \mu_i \neq \mu_j$ for $i \neq j$ . Let $S_i = \{1,2,\dots,n_i\} + \sum_{j=1}^{i-1} n_j$ , i.e., an index set describing the positional indices of $I_{n_i}$ . Let $\mu_{max} = \max \{\mu_1,\dots,\mu_m\}$ and $S_{max}$ be the corresponding index set. Let $[x_\infty, y_\infty]$ be a fixed point of the GD map. Let $x_{s,\infty}$ and $y_{s,\infty}$ be the $s$ th element of $x_\infty$ and $y_\infty$ .
+
+The following theorem characterizes the fixed points of the GD map.
+
+Theorem I.1. The fixed points of $GD$ map satisfy $\sum_{s\in S_i}x_{s,\infty}^2\cdot \sum_{s\in S_i}y_{s,\infty}^2 = \mu_i^2$ , $x_{s,\infty} = y_{s,\infty} = 0$ for $s\notin S_i$ , $\forall i = 1,\dots ,n$ . Thus $\| x_{\infty}\| \| y_{\infty}\| = \mu_i$ , $\forall i = 1,\dots ,n$ .
+
+Proof. To solve the fixed points, we have $\forall i = 1,\dots ,n$ and $x\in S_i$
+
+$$
+\left\{ \begin{array}{l l} & (A - x _ {\infty} y _ {\infty} ^ {\top}) y _ {\infty} = A y _ {\infty} - (y _ {\infty} ^ {\top} y _ {\infty}) x _ {\infty} = 0 \\ & (A - x _ {\infty} y _ {\infty} ^ {\top}) ^ {\top} x _ {\infty} = A ^ {\top} x _ {\infty} - (x _ {\infty} ^ {\top} x _ {\infty}) y _ {\infty} = 0 \end{array} \right.
+$$
+
+i.e.,
+
+$$
+\left\{ \begin{array}{l l} & {\mu_ {i} y _ {s, \infty} = (y _ {\infty} ^ {\top} y _ {\infty}) x _ {s, \infty}} \\ & {\mu_ {i} x _ {s, \infty} = (x _ {\infty} ^ {\top} x _ {\infty}) y _ {s, \infty}} \end{array} \Rightarrow \mu_ {i} ^ {2} x _ {s, \infty} y _ {s, \infty} = (x _ {\infty} ^ {\top} x _ {\infty}) (y _ {\infty} ^ {\top} y _ {\infty}) x _ {s, \infty} y _ {s, \infty}} \right.
+$$
+
+Obviously, $x_{\infty} = y_{\infty} = 0$ is a fixed point. If $x_{s,\infty}\neq 0$ , then $y_{s,\infty}\neq 0$ and we have $\mu_i^2 = (x_\infty^\top x_\infty)(y_\infty^\top y_\infty)$ . Since $\mu_{i}\neq \mu_{j}$ for $i\neq j$ , there exists at most one $i$ , s.t. $\mu_i^2 = (x_\infty^\top x_\infty)(y_\infty^\top y_\infty)$ and all the $x_{s,\infty},y_{s,\infty}$ s.t. $s\in S_j$ , $j\neq i$ is zero.
+
+This theorem identifies that each of these fixed points is concentrated in one of the positions of the eigenvalue blocks. Note the fixed points contain both stable and unstable ones, i.e., all the global minima and saddles are of the above form. Moreover, the global minima are the points obeying $\sum_{s\in S_{max}}x_{s,\infty}^2\cdot \sum_{s\in S_{max}}y_{s,\infty}^2 = \mu_{max}^2$ , $x_{s,\infty} = y_{s,\infty} = 0$ for $s\notin S_{max}$ and also $\| x_{\infty}\| \| y_{\infty}\| = \mu_{max}$ . The saddles are the ones with $\mu_i\neq \mu_{max},\forall i = 1,\dots ,n$ .
+
+Remark I.2 (The alignment of $x_{\infty}$ and $y_{\infty}$ at the global minimum). At the global minimum of the objective (19) with diagonal and non-negative $A$ defined above, $x_{\infty}y_{\infty}^{\top}$ is the rank-1 approximation of $A$ with the largest eigenvalue, i.e., we have $\mu_{max} = \mathrm{tr}(x_{\infty}y_{\infty}^{\top}) = x_{\infty}^{\top}y_{\infty}$ . Also, from the above theorem, $\| x_{\infty}\| \| y_{\infty}\| = \mu_{max}$ . Therefore for each global minimum, there exists a scalar $l > 0$ , s.t., $x_{\infty} = ly_{\infty}$ , i.e., $x_{\infty}$ and $y_{\infty}$ are aligned at the global minimum.
+
+Based on the analytical form of eigenvalues of the Jacobian of GD map (19) in Theorem I.1, we can establish the following relation between $x_{\infty}$ and $y_{\infty}$ at the global minimum via stability analysis.
+
+Theorem I.3. For almost all initial conditions, if $GD$ converges to a minimum, then $x_{\infty}^{\top}y_{\infty} = \mu_{max}$ and
+
+$$
+\left\| x _ {\infty} \right\| ^ {2} + \left\| y _ {\infty} \right\| ^ {2} < \frac {2}{h}; \tag {20}
+$$
+
+the extent of balancing is quantified by
+
+$$
+\left\| x _ {\infty} - y _ {\infty} \right\| ^ {2} < \frac {2}{h} - 2 \mu_ {\max } \tag {21}
+$$
+
+Proof. Since each unstable fixed point has its stable set with negligible size when compared to the stable set of stable fixed point, then for almost all initial conditions, if GD converges to a global minimum, this minimum is a stable fixed point of the GD map.
+
+From the above theorem, we know the fixed points are $\mu_i^2 = (x_\infty^\top x_\infty)(y_\infty^\top y_\infty)$ . Assume $\mu^2 = (x_\infty^\top x_\infty)(y_\infty^\top y_\infty)$ .
+
+For the Jacobian $J = I_{2n} + \left( \begin{array}{cc} - h(y_{\infty}^{\top}y_{\infty})I_{n} & hA - 2hx_{\infty}y_{\infty}^{\top}\\ hA^{\top} - 2hy_{\infty}x_{\infty}^{\top} & -h(x_{\infty}^{\top}x_{\infty})I_{n} \end{array} \right) = I_{2n} + \tilde{A},$ since the lower two blocks commute, we have
+
+$$
+\begin{array}{l} \det (\lambda I - \tilde {A}) = \det (\lambda^ {2} I _ {n} + \lambda h (x _ {\infty} ^ {\top} x _ {\infty} + y _ {\infty} ^ {\top} y _ {\infty}) I _ {n} + h ^ {2} \mu^ {2} I _ {n} - h ^ {2} A ^ {2} \\ + h ^ {2} \left(2 A y _ {\infty} x _ {\infty} ^ {\top} + 2 x _ {\infty} y _ {\infty} ^ {\top} A - 4 x _ {\infty} y _ {\infty} ^ {\top} y _ {\infty} x _ {\infty} ^ {\top}\right)) \\ = \det (\lambda^ {2} I _ {n} + \lambda h (x _ {\infty} ^ {\top} x _ {\infty} + y _ {\infty} ^ {\top} y _ {\infty}) I _ {n} + h ^ {2} \mu^ {2} I _ {n} - h ^ {2} A ^ {2} \\ + h ^ {2} \left(2 \left(A - x _ {\infty} y _ {\infty} ^ {\top}\right) y _ {\infty} x _ {\infty} ^ {\top} + 2 x _ {\infty} y _ {\infty} ^ {\top} \left(A - y _ {\infty} x _ {\infty} ^ {\top}\right)\right)) \\ = \det (\lambda^ {2} I _ {n} + \lambda h (x _ {\infty} ^ {\top} x _ {\infty} + y _ {\infty} ^ {\top} y _ {\infty}) I _ {n} + h ^ {2} \mu^ {2} I _ {n} - h ^ {2} A ^ {2}) \\ = \prod_ {i = 1} ^ {n} \left(\lambda^ {2} + h \left(x _ {\infty} ^ {\top} x _ {\infty} + y _ {\infty} ^ {\top} y _ {\infty}\right) \lambda + h ^ {2} \left(\mu^ {2} - \mu_ {i} ^ {2}\right)\right). \\ \end{array}
+$$
+
+Hence the two values, 1 and $1 - h(x_{\infty}^{\top}x_{\infty} + y_{\infty}^{\top}y_{\infty})$ , are eigenvalues of $J$ at each nonzero fixed point.
+
+If $\mu = \max \{\mu_i\}$ , then $|1 - h(x_{\infty}^{\top}x_{\infty} + y_{\infty}^{\top}y_{\infty})| < 1 \Rightarrow$ all the eigenvalues are bounded by 1. Hence $x_{\infty}^{\top}x_{\infty} + y_{\infty}^{\top}y_{\infty} < \frac{2}{h}$ .
+
+If $\mu \neq \max \{\mu_i\}$ , then $1 + \frac{1}{2} (-h(x_{\infty}^{\top}x_{\infty} + y_{\infty}^{\top}y_{\infty}) + \sqrt{h^{2}(x_{\infty}^{\top}x_{\infty} + y_{\infty}^{\top}y_{\infty})^{2} + 4h^{2}((\mu_{i}^{2} - \mu^{2}))}) > 1$ for $\mu_i \geq \mu$ . It has at least one unstable direction. It's stable set is measure 0.
+
+The second inequality of the theorem follows from $x_{\infty}^{\top}y_{\infty} = \mu$ at the global minimum because of diagonal and non-negative $A$ and SVD.
+
+# I.2 GENERAL MATRIX FACTORIZATION FOR NON-NEGATIVE DIAGONAL MATRIX
+
+In this section, we consider problem (5) via GD iteration but with $A \in \mathbb{R}^{n \times n}$ to be an arbitrary non-negative diagonal matrix.
+
+Let $\mu_1 \geq \mu_2 \geq \dots \geq \mu_n \geq 0$ be the diagonal elements of $A$ . Let $r = \mathrm{rank}(A)$ which of course satisfies $r \leq n$ . Also assume that $\|A\|_{\mathsf{F}}$ does not scale with $n$ or $d$ (without loss of generality we can assume $\|A\|_{\mathsf{F}} = \mathcal{O}(1)$ ). Then we will have our balancing result in the following.
+
+Theorem I.4. For almost all initial conditions, if $GD$ for (5) converges to a global minimum, then there exists $c = c(n,d) > c_0$ with constant $c_0 > 0$ independent of $n,d$ , and learning rate $h$ , such that, $(X,Y)$ satisfies
+
+$$
+c (\| X _ {\infty} \| _ {\mathsf {F}} ^ {2} + \| Y _ {\infty} \| _ {\mathsf {F}} ^ {2}) < \frac {2}{h},
+$$
+
+and the extent of balancing is quantified by
+
+$$
+\left\| X _ {\infty} - Y _ {\infty} \right\| _ {\mathsf {F}} ^ {2} < \frac {2}{c h} - 2 \sum_ {i = 1} ^ {\min \{d, r \}} \mu_ {i}.
+$$
+
+Proof. Let $r = \mathrm{rank}(A) \leq n$ . Since each unstable fixed point has its stable set with size negligible when compared to the stable set of stable fixed point, then for almost all initial conditions, if GD converges to a global minimum, this minimum is a stable fixed point of the GD map.
+
+For matrix $X = (x_{1} x_{2} \cdots x_{d}) \in \mathbb{R}^{n \times d}$ , where $x_{i} \in \mathbb{R}^{n}$ is the $i$ th column vector, we vectorize the
+
+variable and get $vec(X) = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_d \end{pmatrix}$ . Then we can rewrite the GD iteration,
+
+$$
+\begin{array}{l} \left\{ \begin{array}{l l} & X _ {k + 1} = X _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) Y _ {k} \\ & Y _ {k + 1} = Y _ {k} + h (A ^ {\top} - Y _ {k} X _ {k} ^ {\top}) X _ {k} \end{array} \right. \\ \Rightarrow \left\{ \begin{array}{l l} & v e c (X _ {k + 1}) = v e c (X _ {k}) + h (I \otimes A - T (v e c (Y _ {k}) v e c (X _ {k}) ^ {\top})) v e c (Y _ {k}) \\ & v e c (Y _ {k + 1}) = v e c (Y _ {k}) + h (I \otimes A - T (v e c (X _ {k}) v e c (Y _ {k}) ^ {\top})) v e c (X _ {k}) \end{array} \right., \\ \end{array}
+$$
+
+where $\otimes$ is the Kronecker product, and $T:\mathbb{R}^{nd\times nd}\to \mathbb{R}^{nd\times nd}$ is a linear operator, s.t.
+
+$$
+\begin{array}{l} T \left(\left( \begin{array}{c c c} M _ {1 1} & \dots & M _ {1 d} \\ \vdots & & \vdots \\ M _ {d 1} & \dots & M _ {d d} \end{array} \right)\right) = \left( \begin{array}{c c c} M _ {1 1} ^ {\top} & \dots & M _ {1 d} ^ {\top} \\ \vdots & & \vdots \\ M _ {d 1} ^ {\top} & \dots & M _ {d d} ^ {\top} \end{array} \right), \\ \text {t h e n} \qquad T (v e c (Y) v e c (X) ^ {\top}) = \left( \begin{array}{c c c c} x _ {1} y _ {1} ^ {\top} & x _ {2} y _ {1} ^ {\top} & \dots & x _ {d} y _ {1} ^ {\top} \\ x _ {1} y _ {2} ^ {\top} & x _ {2} y _ {2} ^ {\top} & \dots & x _ {d} y _ {2} ^ {\top} \\ \vdots & \vdots & & \vdots \\ x _ {1} y _ {d} ^ {\top} & x _ {2} y _ {d} ^ {\top} & \dots & x _ {d} y _ {d} ^ {\top} \end{array} \right). \\ \end{array}
+$$
+
+The Jacobian of the vectorized GD map is (replace $X_{k}$ and $Y_{k}$ by $X$ and $Y$ ) $I_{2nd} - hM$ , where
+
+$$
+M = \left( \begin{array}{c c} Y ^ {\top} Y \otimes I _ {n} & T (v e c (Y) v e c (X) ^ {\top}) + I \otimes (X Y ^ {\top} - A) \\ T (v e c (X) v e c (Y) ^ {\top}) + I \otimes (Y X ^ {\top} - A) & X ^ {\top} X \otimes I _ {n} \end{array} \right).
+$$
+
+We would like to obtain an estimation of the eigenvalues of $I - hM$ for stability analysis. Since $M$ is the Hessian of the objective at the global minimum defined, all the eigenvalues are non-negative. Also, since $\| A \|_{\mathsf{F}}$ is independent of $h, n$ and $d$ , we can just assume without loss of generality $\| A \|_{\mathsf{F}} = \mathcal{O}(1)$ and then take $\| X \|_{\mathsf{F}}$ and $\| Y \|_{\mathsf{F}}$ to be $\mathcal{O}(1)$ at each global minimum. Then
+
+$$
+\operatorname {t r} (M) = n \left(\| X \| _ {\mathsf {F}} ^ {2} + \| Y \| _ {\mathsf {F}} ^ {2}\right) = \mathcal {O} (n).
+$$
+
+Next consider $\operatorname{tr}(M^2)$ . We only need the diagonal blocks of $M^2$ . The two diagonal blocks are the following
+
+$$
+\begin{array}{l} M _ {1} = (Y ^ {\top} Y \otimes I _ {n}) ^ {2} \\ + \left[ T \left(\operatorname {v e c} (Y) \operatorname {v e c} (X) ^ {\top}\right) + I \otimes \left(X Y ^ {\top} - A\right) \right] \left[ T \left(\operatorname {v e c} (X) \operatorname {v e c} (Y) ^ {\top}\right) + I \otimes \left(Y X ^ {\top} - A\right) \right], \\ \end{array}
+$$
+
+$$
+\begin{array}{l} M _ {2} = \left(X ^ {\top} X \otimes I _ {n}\right) ^ {2} \\ + \left[ T \left(\operatorname {v e c} (X) \operatorname {v e c} (Y) ^ {\top}\right) + I \otimes \left(Y X ^ {\top} - A\right) \right] \left[ T \left(\operatorname {v e c} (Y) \operatorname {v e c} (X) ^ {\top}\right) + I \otimes \left(X Y ^ {\top} - A\right) \right]. \\ \end{array}
+$$
+
+Since we evaluate this matrix at the minimum, we have the gradient equals 0, i.e.,
+
+$$
+(A - X Y ^ {\top}) Y = 0, (A - Y X ^ {\top}) X = 0.
+$$
+
+By the mixed-product property of Kronecker product, we have
+
+$$
+\begin{array}{l} M _ {1} = \left(Y ^ {\top} Y\right) ^ {2} \otimes I _ {n} + T (v e c (Y) v e c (X) ^ {\top}) T (v e c (X) v e c (Y) ^ {\top}) \\ + I _ {d} \otimes [ (A - X Y ^ {\top}) (A - Y X ^ {\top}) ], \\ \end{array}
+$$
+
+$$
+\begin{array}{l} M _ {2} = \left(X ^ {\top} X\right) ^ {2} \otimes I _ {n} + T (v e c (X) v e c (Y) ^ {\top}) T (v e c (Y) v e c (X) ^ {\top}) \\ + I _ {d} \otimes [ (A - Y X ^ {\top}) (A - X Y ^ {\top}) ]. \\ \end{array}
+$$
+
+Then
+
+$$
+\operatorname {t r} \left(M ^ {2}\right) = 2 \left\| X \right\| _ {\mathsf {F}} ^ {2} \left\| Y \right\| _ {\mathsf {F}} ^ {2} + n \left(\left\| X ^ {\top} X \right\| _ {\mathsf {F}} ^ {2} + \left\| Y ^ {\top} Y \right\| _ {\mathsf {F}} ^ {2}\right) + d \left\| A - X Y ^ {\top} \right\| _ {\mathsf {F}} ^ {2}.
+$$
+
+Also, this is the global minimum, meaning
+
+$$
+\left\| A - X Y ^ {\top} \right\| _ {\mathsf {F}} ^ {2} = \operatorname {t r} ((A - X Y ^ {\top}) (A - Y X ^ {\top})) = \left\{ \begin{array}{l l} \sum_ {i = d + 1} ^ {r} \mu_ {i} ^ {2}, & d < r \\ 0, & d \geq r \end{array} \right.
+$$
+
+Therefore, when $d \geq r$ , we have
+
+$$
+\mathrm {t r} (M ^ {2}) = 2 \left\| X \right\| _ {\mathsf {F}} ^ {2} \left\| Y \right\| _ {\mathsf {F}} ^ {2} + n (\left\| X ^ {\top} X \right\| _ {\mathsf {F}} ^ {2} + \left\| Y ^ {\top} Y \right\| _ {\mathsf {F}} ^ {2}) = \mathcal {O} (n).
+$$
+
+When $d < r$ , we have
+
+$$
+\begin{array}{l} \operatorname {t r} \left(M ^ {2}\right) = 2 \left\| X \right\| _ {\mathsf {F}} ^ {2} \left\| Y \right\| _ {\mathsf {F}} ^ {2} + n \left(\left\| X ^ {\top} X \right\| _ {\mathsf {F}} ^ {2} + \left\| Y ^ {\top} Y \right\| _ {\mathsf {F}} ^ {2}\right) + d \left\| A - X Y ^ {\top} \right\| _ {\mathsf {F}} ^ {2} \\ < 2 \left\| X \right\| _ {\mathsf {F}} ^ {2} \left\| Y \right\| _ {\mathsf {F}} ^ {2} + n \left(\left\| X ^ {\top} X \right\| _ {\mathsf {F}} ^ {2} + \left\| Y ^ {\top} Y \right\| _ {\mathsf {F}} ^ {2}\right) + n \left\| A - X Y ^ {\top} \right\| _ {\mathsf {F}} ^ {2} = \mathcal {O} (n). \\ \end{array}
+$$
+
+Therefore, the number of non-zero eigenvalues is $N = \mathcal{O}(n)$ . Let $\lambda_{max}$ be the largest eigenvalue of $M$ . Then there exist a constant $c_0 > 0$
+
+$$
+\lambda_ {m a x} \geq \operatorname {t r} (M) / N \geq c _ {0} \left(\| X \| _ {\mathsf {F}} ^ {2} + \| Y \| _ {\mathsf {F}} ^ {2}\right).
+$$
+
+From stability analysis, we need the absolute values of the eigenvalues of $I - hM$ to be bounded by 1, i.e.,
+
+$$
+1 - h c _ {0} (\| X \| _ {\mathsf {F}} ^ {2} + \| Y \| _ {\mathsf {F}} ^ {2}) \geq 1 - h \lambda_ {m a x} \geq - 1 \Rightarrow c _ {0} (\| X \| _ {\mathsf {F}} ^ {2} + \| Y \| _ {\mathsf {F}} ^ {2}) \leq \frac {2}{h}.
+$$
+
+Obviously, if we pick a constant $c = c(n,d)$ for each $n$ and $d$ instead of $c_{0}$ , the above inequality also holds with $c(n,d) > c_{0}$ .
+
+For the derivation of the second inequality, since at the global minimum $\mathrm{tr}(X_{\infty}Y_{\infty}^{\top}) = \sum_{i=1}^{\min\{d,r\}} \mu_i = \sum_{i=1}^{\min\{d,n\}} \mu_i$ because for non-negative diagonal $A$ , its SVD of the non-zero part satisfies $U_{non-zero} = V_{non-zero}$ , we have
+
+$$
+\| X _ {\infty} - Y _ {\infty} \| _ {\mathsf {F}} ^ {2} = \| X _ {\infty} \| _ {\mathsf {F}} ^ {2} + \| Y _ {\infty} \| _ {\mathsf {F}} ^ {2} - 2 \operatorname {t r} (X _ {\infty} Y _ {\infty} ^ {\top}) \leq \frac {2}{c h} - 2 \sum_ {i = 1} ^ {\min \{d, n \}} \mu_ {i}.
+$$
+
+
+
+# I.3 FROM DIAGONAL MATRICES TO GENERAL MATRICES
+
+Proof of Theorem 5.1. First all the minima of this problem are global minima and all the saddles are unstable fixed points. Since each unstable fixed point has its stable set with size negligible when compared to the stable set of stable fixed point, then for almost all initial conditions, if GD converges to a point, for almost all situations, this point is a stable fixed point of the GD map.
+
+By singular value decomposition (SVD), $A = UDV^{\top}$ , where $U, D, V \in \mathbb{R}^{n \times n}$ , $U$ and $V$ are orthogonal matrices, and $D$ is a non-negative diagonal matrix. Let $X_{k} = UR_{k}$ , $Y_{k} = VS_{k}$ . Then
+
+$$
+\begin{array}{l} \left\{ \begin{array}{r l} & X _ {k + 1} = X _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) Y _ {k} \\ & Y _ {k + 1} = Y _ {k} + h (A - X _ {k} Y _ {k} ^ {\top}) ^ {\top} X _ {k} \end{array} \right. \\ \Leftrightarrow \left\{ \begin{array}{l l} & U R _ {k + 1} = U R _ {k} + h (U D V ^ {\top} - U R _ {k} S _ {k} ^ {\top} V ^ {\top}) V S _ {k} \\ & V S _ {k + 1} = V S _ {k} + h (U D V ^ {\top} - U R _ {k} S _ {k} ^ {\top} V ^ {\top}) ^ {\top} U R _ {k} \end{array} \right. \\ \Leftrightarrow \left\{ \begin{array}{r l} & R _ {k + 1} = R _ {k} + h (D - R _ {k} S _ {k} ^ {\top}) S _ {k} \\ & S _ {k + 1} = S _ {k} + h (D - R _ {k} S _ {k} ^ {\top}) ^ {\top} R _ {k}. \end{array} \right. \\ \end{array}
+$$
+
+Therefore, problem (5) is equivalent to the following problem solved by GD
+
+$$
+\min _ {R, S \in \mathbb {R} ^ {n \times d}} \| D - R S ^ {\top} \| _ {\mathsf {F}} ^ {2} / 2. \tag {22}
+$$
+
+From Theorem I.3 and I.4, we obtain: if GD for (22) converges to a global minimum $(R,S)$ , then there exists a constant $c > 0$ independent of $n$ , $r$ , $d$ , and $h$ , s.t., the limiting minimum satisfies
+
+$$
+c (\| R \| _ {\mathsf {F}} ^ {2} + \| S \| _ {\mathsf {F}} ^ {2}) \leq \frac {2}{h},
+$$
+
+and the extent of balancing is quantified by
+
+$$
+\| R - S \| _ {\mathsf {F}} ^ {2} \leq \frac {2}{c h} - 2 \sum_ {i = 1} ^ {\min \{d, r \}} \mu_ {i}.
+$$
+
+Especially, when $d = 1$ , $n \in \mathbb{N}^+$ , $c = 1$ .
+
+Since $X = UR$ , $Y = VS \Rightarrow R = U^{\top}X$ , $S = V^{\top}Y$ , we have $\| R \|_{\mathsf{F}} = \| X \|_{\mathsf{F}}$ , $\| S \|_{\mathsf{F}} = \| Y \|_{\mathsf{F}}$ and $\| R - S \|_{\mathsf{F}} = \| U^{\top}X - V^{\top}Y \|_{\mathsf{F}} = \| X - (UV^{\top})Y \|_{\mathsf{F}}$ . The we obtain the first and second inequalities in Theorem 5.1. Also, by SVD, $\| XY^{\top} \|_{\mathsf{F}}^{2} = \sum_{i=1}^{\min\{d,n\}} \mu_{i}^{2} \leq \| X \|_{\mathsf{F}}^{2} \| Y \|_{\mathsf{F}}^{2}$ , we obtain the third inequality.
\ No newline at end of file
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/images.zip b/largelearningratetameshomogeneityconvergenceandbalancingeffect/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6ad64dbd15782a2fe4dc862ee0e9fa6f58e47919
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a595445044c9b0caa7488ced41e9ad3f9eea95465d43469789273f03fe074b00
+size 2786385
diff --git a/largelearningratetameshomogeneityconvergenceandbalancingeffect/layout.json b/largelearningratetameshomogeneityconvergenceandbalancingeffect/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..006c7abc02286f37fbb98b1c288e0864503f36b4
--- /dev/null
+++ b/largelearningratetameshomogeneityconvergenceandbalancingeffect/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3d2bc75f8737bb19f6485a33f6c3964c12a7b8ab2afee122a211b4fa63c79316
+size 2583670
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_content_list.json b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..875742343a93d320516c8c0a4a7684521def67c4
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:494ec2c886467b81af05ddc538d4e722436a5fbb59d302869dc67bcd2816297e
+size 121719
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_model.json b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4682b0abea7370ecb2ee0e15348ce68458df14bf
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:679101d0703df51f7cd705d00707d49cd58ea2ac24e67cb029db5198b8926b5f
+size 146330
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_origin.pdf b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f4bf172ea8986828170594990735d5f4c1609a6c
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/3d9854a7-3f35-4264-8fb9-869744ca837b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1f3fc1607272ba9d669c83688d0f3ee669fa8df361f677d9b6bca6b921201c57
+size 4991803
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/full.md b/largescalerepresentationlearningongraphsviabootstrapping/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..ea1d4a5b39b31a6b0fabe667629c6ff6292346f1
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/full.md
@@ -0,0 +1,443 @@
+# LARGE-SCALE REPRESENTATION LEARNING ON GRAPHS VIA BOOTSTRAPPING
+
+Shantanu Thakoor*
+
+DeepMind
+
+Coretin Tallec
+
+DeepMind
+
+Mohammad Gheshlaghi Azar
+
+DeepMind
+
+Mehdi Azabou
+
+Georgia Institute of Technology
+
+Eva Dyer
+
+Georgia Institute of Technology
+
+Rémi Munos
+
+DeepMind
+
+Petar Velicković
+
+DeepMind
+
+Michal Valko
+
+DeepMind
+
+# ABSTRACT
+
+Self-supervised learning provides a promising path towards eliminating the need for costly label information in representation learning on graphs. However, to achieve state-of-the-art performance, methods often need large numbers of negative examples and rely on complex augmentations. This can be prohibitively expensive, especially for large graphs. To address these challenges, we introduce Bootstrapped Graph Latents (BGRL) - a graph representation learning method that learns by predicting alternative augmentations of the input. BGRL uses only simple augmentations and alleviates the need for contrasting with negative examples, and is thus scalable by design. BGRL outperforms or matches prior methods on several established benchmarks, while achieving a 2-10x reduction in memory costs. Furthermore, we show that BGRL can be scaled up to extremely large graphs with hundreds of millions of nodes in the semi-supervised regime - achieving state-of-the-art performance and improving over supervised baselines where representations are shaped only through label information. In particular, our solution centered on BGRL constituted one of the winning entries to the Open Graph Benchmark - Large Scale Challenge at KDD Cup 2021, on a graph orders of magnitudes larger than all previously available benchmarks, thus demonstrating the scalability and effectiveness of our approach.
+
+# 1 INTRODUCTION
+
+Graphs provide a powerful abstraction for complex datasets that arise in a variety of applications such as social networks, transportation networks, and biological sciences (Hamilton et al., 2017; Derrow-Pinion et al., 2021; Zitnik & Leskovec, 2017; Chanussot et al., 2021). Despite recent advances in graph neural networks (GNNs), when trained with supervised data alone, these networks can easily overfit and may fail to generalize (Rong et al., 2019). Thus, finding ways to form simplified representations of graph-structured data without labels is an important yet unsolved challenge.
+
+Current state-of-the-art methods for unsupervised representation learning on graphs (Velicković et al., 2019; Peng et al., 2020; Hassani & Khasahmadi, 2020; Zhu et al., 2020b;a; You et al., 2020) are contrastive. These methods work by pulling together representations of related objects and pushing apart representations of unrelated ones. For example, current best methods Zhu et al. (2020b) and Zhu et al. (2020a) learn node representations by creating two augmented versions of a graph, pulling together the representation of the same node in the two graphs, while pushing apart every other node pair. As such, they inherently rely on the ability to compare each object to a large number of negatives. In the absence of a principled way of choosing these negatives, this can require computation and memory quadratic in the number of nodes. In many cases, the generation of a large number of negatives poses a prohibitive cost, especially for large graphs.
+
+
+Figure 1: Overview of our proposed BGRL method. The original graph is first used to derive two different semantically similar views using augmentations $\mathcal{T}_{1,2}$ . From these, we use encoders $\mathcal{E}_{\theta,\phi}$ to form online and target node embeddings. The predictor $p_{\theta}$ uses the online embedding $\widetilde{\mathbf{H}}_1$ to form a prediction $\widetilde{\mathbf{Z}}_1$ of the target embedding $\widetilde{\mathbf{H}}_2$ . The final objective is then computed as the cosine similarity between $\widetilde{\mathbf{Z}}_1$ and $\widetilde{\mathbf{H}}_2$ , flowing gradients only through $\widetilde{\mathbf{Z}}_1$ . The target parameters $\phi$ are updated as an exponentially moving average of $\theta$ .
+
+In this paper, we introduce a scalable approach for self-supervised representation learning on graphs called Bootstrapped Graph Latents (BGRL). Inspired by recent advances in self-supervised learning in vision (Grill et al., 2020), BGRL learns node representations by encoding two augmented versions of a graph using two distinct graph encoders: an online encoder, and a target encoder. The online encoder is trained through predicting the representation of the target encoder, while the target encoder is updated as an exponential moving average of the online network. Critically, BGRL does not require contrasting negative examples, and thus can scale easily to very large graphs.
+
+# Our main contributions are:
+
+- We introduce Bootstrapped Graph Latents (BGRL), a graph self-supervised learning method that effectively scales to extremely large graphs and outperforms existing methods, while using only simple graph augmentations and not requiring negative examples (Section 2).
+- We show that contrastive methods face a trade-off between peak performance and memory constraints, due to their reliance on negative examples (Section 4.2). Due to having time and space complexity scaling only linearly in the size of the input, BGRL avoids the performance-memory trade-off inherent to contrastive methods altogether. BGRL provides performance competitive with the best contrastive methods, while using 2-10x less memory on standard benchmarks (Section 3).
+- We show that leveraging the scalability of BGRL allows making full use of the vast amounts of unlabeled data present in large graphs via semi-supervised learning. In particular, we find that efficient use of unlabeled data for representation learning prevents representations from overfitting to the classification task, and achieves significantly higher, state-of-the-art performance. This was critical to the success of our solution at KDD Cup 2021 in which our BGRL-based solution was awarded one of the winners, on the largest publicly available graph dataset, of size 360GB consisting of 240 million nodes and 1.7 billion edges (Section 4.3).
+
+# 2 BOOTSTRAPPED GRAPH LATENTS
+
+# 2.1 BGRL COMPONENTS
+
+BGRL builds representations through the use of two graph encoders, an online encoder $\mathcal{E}_{\theta}$ and a target encoder $\mathcal{E}_{\phi}$ , where $\theta$ and $\phi$ denote two distinct sets of parameters. We consider a graph $\mathbf{G} = (\mathbf{X},\mathbf{A})$ with node features $\mathbf{X}\in \mathbb{R}^{N\times F}$ and adjacency matrix $\mathbf{A}\in \mathbb{R}^{N\times N}$ . BGRL first produces two alternate views of $\mathbf{G}$ : $\mathbf{G}_1 = (\widetilde{\mathbf{X}}_1,\widetilde{\mathbf{A}}_1)$ and $\mathbf{G}_2 = (\widetilde{\mathbf{X}}_2,\widetilde{\mathbf{A}}_2)$ , by applying stochastic graph augmentation functions $\mathcal{T}_1$ and $\mathcal{T}_2$ respectively. The online encoder produces an online representation from the first augmented graph, $\widetilde{\mathbf{H}}_1\coloneqq \mathcal{E}_{\theta}(\widetilde{\mathbf{X}}_1,\widetilde{\mathbf{A}}_1)$ ; similarly the target encoder produces a target representation of the second augmented graph, $\widetilde{\mathbf{H}}_2\coloneqq \mathcal{E}_{\phi}(\widetilde{\mathbf{X}}_2,\widetilde{\mathbf{A}}_2)$ . The online representation is fed into a node-level predictor $p_{\theta}$ that outputs a prediction of the target representation, $\widetilde{\mathbf{Z}}_1\coloneqq p_{\theta}(\widetilde{\mathbf{H}}_1)$ .
+
+BGRL differs from prior bootstrapping approaches such as BY0L (Grill et al., 2020) in that it does not use a projector network. Unlike vision tasks, in which a projection step is used by BY0L for
+
+dimensionality reduction, common embedding sizes are quite small for graph tasks and so this is not a concern in our case. In fact, we observe that this step can be eliminated altogether without loss in performance (Appendix B).
+
+The augmentation functions $\mathcal{T}_1$ and $\mathcal{T}_2$ used are simple, standard graph perturbations previously explored (You et al., 2020; Zhu et al., 2020b). We use a combination of random node feature masking and edge masking with fixed masking probabilities $p_f$ and $p_e$ respectively. More details and background on graph augmentations is provided in Appendix D.
+
+# 2.2 BGRL UPDATE STEP
+
+Updating the online encoder $\mathcal{E}_{\theta}$ : The online parameters $\theta$ (and not $\phi$ ), are updated to make the predicted target representations $\widetilde{\mathbf{Z}}_1$ closer to the true target representations $\widetilde{\mathbf{H}}_2$ for each node, by following the gradient of the cosine similarity w.r.t. $\theta$ , i.e.,
+
+$$
+\ell (\theta , \phi) = - \frac {2}{N} \sum_ {i = 0} ^ {N - 1} \frac {\widetilde {\mathbf {Z}} _ {(1 , i)} \widetilde {\mathbf {H}} _ {(2 , i)} ^ {\top}}{\| \widetilde {\mathbf {Z}} _ {(1 , i)} \| \| \widetilde {\mathbf {H}} _ {(2 , i)} \|} \tag {1}
+$$
+
+$$
+\theta \leftarrow \operatorname {o p t i m i z e} (\theta , \eta , \partial_ {\theta} \ell (\theta , \phi)), \tag {2}
+$$
+
+where $\eta$ is the learning rate and the final updates are computed from the gradients of the objective with respect to $\theta$ only, using an optimization method such as SGD or Adam (Kingma & Ba, 2015). In practice, we symmetrize this loss, by also predicting the target representation of the first view using the online representation of the second.
+
+Updating the target encoder $\mathcal{E}_{\phi}$ : The target parameters $\phi$ are updated as an exponential moving average of the online parameters $\theta$ , using a decay rate $\tau$ , i.e.,
+
+$$
+\phi \leftarrow \tau \phi + (1 - \tau) \theta , \tag {3}
+$$
+
+Figure 1 visually summarizes BGRL's architecture.
+
+Note that although the objective $\ell(\theta, \phi)$ has undesirable or trivial solutions, BGRL does not actually optimize this loss. Only the online parameters $\theta$ are updated to reduce this loss, while the target parameters $\phi$ follow a different objective. This non-collapsing behavior even without relying on negatives has been studied further (Tian et al., 2021). We provide an empirical analysis of this behavior in Appendix A, showing that in practice BGRL does not collapse to trivial solutions and $\ell(\theta, \phi)$ does not converge to 0.
+
+Scalable non-contrastive objective: Here we note that a contrastive approach would instead encourage $\widetilde{\mathbf{Z}}_{(1,i)}$ and $\widetilde{\mathbf{H}}_{(2,j)}$ to be far apart for node pairs $(i,j)$ that are dissimilar. In the absence of a principled way of choosing such dissimilar pairs, the naive approach of simply contrasting all pairs $\{(i,j) \mid i \neq j\}$ , scales quadratically in the size of the input. As BGRL does not rely on this contrastive step, BGRL scales linearly in the size of the graph, and thus is scalable by design.
+
+# 3 COMPUTATIONAL COMPLEXITY ANALYSIS
+
+We provide a brief description of the time and space complexities of the BGRL update step, and illustrate its advantages compared to previous strong contrastive methods such as GRACE (Zhu et al., 2020b), which perform a quadratic all-pairs contrastive computation at each update step. The same analysis applies to variations of the GRACE method such as GCA (Zhu et al., 2020a).
+
+Consider a graph with $N$ nodes and $M$ edges, and simple encoders $\mathcal{E}$ that compute embeddings in time and space $\mathcal{O}(N + M)$ . This property is satisfied by most popular GNN architectures such as convolutional (Kipf & Welling, 2017), attentional (Velicković et al., 2018), or message-passing (Gilmer et al., 2017) networks. BGRL performs four encoder computations per update step (twice for the target and online encoders, and twice for each augmentation) plus a node-level prediction step; GRACE performs two encoder computations (once for each augmentation), plus a node-level projection step. Both methods backpropagate the learning signal twice (once for each augmentation),
+
+and we assume the backward pass to be approximately as costly as a forward pass. We ignore the cost for computation of the augmentations in this analysis. Thus the total time and space complexity per update step for BGRL is $6C_{\mathrm{encoder}}(M + N) + 4C_{\mathrm{prediction}}N + C_{\mathrm{BGRL}}N$ , compared to $4C_{\mathrm{encoder}}(M + N) + 4C_{\mathrm{projection}}N + C_{\mathrm{GRACE}}N^2$ for GRACE, where $C$ are constants depending on architecture of the different components. Table 1 shows an empirical comparison of BGRL and GRACE's computational requirements on a set of benchmark tasks, with further details in Appendix I.
+
+| Dataset | Amazon Photos | WikiCS | Amazon Computers | Coauthor CS | Coauthor Phy |
| #Nodes | 7,650 | 11,701 | 13,752 | 18,333 | 34,493 |
| #Edges | 119,081 | 216,123 | 245,861 | 81,894 | 247,962 |
| BGRL Memory | 0.47 GB | 0.63 GB | 0.58 GB | 2.86 GB | 5.50 GB |
| GRACE Memory | 1.81 GB | 3.82 GB | 5.14 GB | 11.78 GB | OOM |
+
+Table 1: Comparison of computational requirements on a set of standard benchmark graphs. OOM indicates ruining out of memory on a 16GB V100 GPU.
+
+# 4 EXPERIMENTAL ANALYSIS
+
+We present an extensive empirical study of performance and scalability, showing that BGRL is effective across a wide range of settings from frozen linear evaluation to semi-supervised learning, and both when performing full-graph training and training on subsampled node neighborhoods. We give results across a range of dataset scales and encoder architectures including convolutional, attentional, and message-passing neural networks.
+
+We analyze the performance of BGRL on a set of 7 standard transductive and inductive benchmark tasks, as well as in the very high-data regime by evaluating on the MAG240M dataset (Hu et al., 2021). We present results on medium-sized datasets where contrastive objectives can be computed on the entire graph (Section 4.1), on larger datasets where this objective must be approximated (Section 4.2), and finally on the much larger MAG240M dataset designed to test scalability limits (Section 4.3), showing that BGRL improves performance across all scales of datasets. In Appendix C, we show that BGRL achieves state-of-the-art performance even in the low-data regime on a set of 4 small-scale datasets. Dataset sizes are summarized in Table 2 and described further in Appendix E.
+
+Evaluation protocol: In most tasks, we follow the standard linear-evaluation protocol on graphs (Velicković et al., 2019). This involves first training each graph encoder in a fully unsupervised manner and computing embeddings for each node; a simple linear model is then trained on top of these frozen embeddings through a logistic regression loss with $\ell_2$ regularization, without flowing any gradients back to the graph encoder network. In the more challenging MAG240M task, we extend BGRL to the semi-supervised setting by combining our self-supervised representation learning loss together with a supervised loss. We show that BGRL's bootstrapping objective obtains state-of-the-art performance in this hybrid setting, and even improves further with the added use of unlabeled data for representation learning - properties which have not been previously demonstrated by prior works on self-supervised representation learning on graphs.
+
+Implementation details including model architectures and hyperparameters are provided in Appendix F. Algorithm implementation and experiment code for most tasks can be found at https://github.com/nerdslab/bgrl while code for our solution on MAG240M has been open-sourced as part of the KDD Cup 2021 (Addanki et al., 2021) at https://github.com/deepmind/deepmindresearch/tree/master/ogb_lsc/mag.
+
+# 4.1 PERFORMANCE AND EFFICIENCY GAINS WHEN SCALABILITY IS NOT A BOTTLENECK
+
+We first evaluate our method on a set of 5 recent real-world datasets — WikiCS, Amazon-Computers, Amazon-Photos, Coauthor-CS, Coauthor-Physics — in the transductive setting. Note that these are challenging medium-scale datasets specifically proposed for rigorous evaluation of semi-supervised node classification methods (Mernyei & Cangea, 2020; Shchur et al., 2018), but are almost all small enough that constractive approaches such as GRACE (Zhu et al., 2020b) can compute their quadratic objective exactly. Thus, these experiments present a comparison of BGRL with prior methods in the
+
+ | Task | Nodes | Edges | Features | Classes |
| WikiCS | Transductive | 11,701 | 216,123 | 300 | 10 |
| Amazon Computers | Transductive | 13,752 | 245,861 | 767 | 10 |
| Amazon Photos | Transductive | 7,650 | 119,081 | 745 | 8 |
| Coauthor CS | Transductive | 18,333 | 81,894 | 6,805 | 15 |
| Coauthor Physics | Transductive | 34,493 | 247,962 | 8,415 | 5 |
| ogbn-arxiv | Transductive | 169,343 | 1,166,243 | 128 | 40 |
| PPI (24 graphs) | Inductive | 56,944 | 818,716 | 50 | 121 (multilabel) |
| MAG240M | Transductive | 244,160,499 | 1,728,364,232 | 768 | 153 |
+
+idealized case where scalability is not a bottleneck. We show that even in this steelmanned setting, our method outperforms or matches prior methods while requiring a fraction of the memory costs.
+
+We primarily compare BGRL against GRACE, a recent strong contrastive representation learning method on graphs. We also report performances for other commonly used self-supervised graph methods from previously published results (Perozzi et al., 2014; Velicković et al., 2019; Peng et al., 2020; Hassani & Khasahmadi, 2020; Zhu et al., 2020a), as well as Random-Init (Velicković et al., 2019), a baseline using embeddings from a randomly initialized encoder, thus measuring the quality of the inductive biases present in the encoder model. We use a 2-layer GCN model (Kipf & Welling, 2017) as our graph encoder $\mathcal{E}$ , and closely follow models, architectures, and graph-augmentation settings used in prior works (Zhu et al., 2020a; Velicković et al., 2019; Zhu et al., 2020b).
+
+Table 2: Statistics of datasets used in our experiments.
+
+ | WikiCS | Am. Comp. | Am. Photos | Co.CS | Co.Phy |
| Raw features | 71.98 ± 0.00 | 73.81 ± 0.00 | 78.53 ± 0.00 | 90.37 ± 0.00 | 93.58 ± 0.00 |
| DeepWalk | 74.35 ± 0.06 | 85.68 ± 0.06 | 89.44 ± 0.11 | 84.61 ± 0.22 | 91.77 ± 0.15 |
| DeepWalk + feat. | 77.21 ± 0.03 | 86.28 ± 0.07 | 90.05 ± 0.08 | 87.70 ± 0.04 | 94.90 ± 0.09 |
| DGI | 75.35 ± 0.14 | 83.95 ± 0.47 | 91.61 ± 0.22 | 92.15 ± 0.63 | 94.51 ± 0.52 |
| GMI | 74.85 ± 0.08 | 82.21 ± 0.31 | 90.68 ± 0.17 | OOM | OOM |
| MVGRL | 77.52 ± 0.08 | 87.52 ± 0.11 | 91.74 ± 0.07 | 92.11 ± 0.12 | 95.33 ± 0.03 |
| Random-Init* | 78.95 ± 0.58 | 86.46 ± 0.38 | 92.08 ± 0.48 | 91.64 ± 0.29 | 93.71 ± 0.29 |
| GRACE* | 80.14 ± 0.48 | 89.53 ± 0.35 | 92.78 ± 0.45 | 91.12 ± 0.20 | OOM |
| BGRL* | 79.98 ± 0.10 | 90.34 ± 0.19 | 93.17 ± 0.30 | 93.31 ± 0.13 | 95.73 ± 0.05 |
| GCA | 78.35 ± 0.05 | 88.94 ± 0.15 | 92.53 ± 0.16 | 93.10 ± 0.01 | 95.73 ± 0.03 |
| Supervised GCN | 77.19 ± 0.12 | 86.51 ± 0.54 | 92.42 ± 0.22 | 93.03 ± 0.31 | 95.65 ± 0.16 |
+
+Table 3: Performance measured in terms of classification accuracy along with standard deviations. Our experiments, marked as $\star$ , are over 20 random dataset splits and model initializations. The other results are taken from previously published reports. OOM indicates running out of memory on a 16GB V100 GPU. We report the best result for GCA out of the proposed GCA-DE, GCA-PR, and GCA-EV models.
+
+In Table 3, we report results of our experiments on these standard benchmark tasks. We see that even when scalability does not prevent the use of contrastive objectives, BGRL performs competitively both with our unsupervised and fully supervised baselines, achieving state-of-the-art performance in 4 of the 5 datasets. Further, as noted in Table 1, BGRL achieves this despite using 2-10x less memory. BGRL provides this improvement in memory-efficiency at no cost in performance, demonstrating a useful practical advantage over prior methods such as GRACE.
+
+Effect of more complex augmentations: In addition to the original GRACE method, we also highlight GCA, a variant of it that has the same learning objective but trades off more expressive but expensive graph augmentations for better performance. However, these augmentations often take time cubic in the size of the graph, or are otherwise cumbersome to implement on large graphs. As we focus on scalability to the high-data regime, we primarily restrict our comparisons to the base method GRACE, which uses the same simple, easily scalable augmentations as BGRL. Nevertheless, for the sake of completeness, in Table 4 we investigate the effect of these complex augmentations with BGRL. We see that BGRL obtains equivalent performance with both simple and complex augmentations, while GCA requires more expensive augmentations for peak performance. This indicates that BGRL can safely rely on simple augmentations when scaling to larger graphs without sacrificing performance.
+
+| Method | Augmentation | Co.CS | Co.Phy | Am. Comp. | Am. Photos |
| BGRL | Standard | 93.31 ± 0.13 | 95.73 ± 0.05 | 90.34 ± 0.19 | 93.17 ± 0.30 |
| Degree centrality | 93.34 ± 0.13 | 95.62 ± 0.09 | 90.39 ± 0.22 | 93.15 ± 0.37 |
| Pagerank centrality | 93.34 ± 0.11 | 95.59 ± 0.09 | 90.45 ± 0.25 | 93.13 ± 0.34 |
| Eigenvector centrality | 93.32 ± 0.15 | 95.62 ± 0.06 | 90.20 ± 0.27 | 93.03 ± 0.39 |
| GCA | Standard | 92.93 ± 0.01 | 95.26 ± 0.02 | 86.25 ± 0.25 | 92.15 ± 0.24 |
| Degree centrality | 93.10 ± 0.01 | 95.68 ± 0.05 | 87.85 ± 0.31 | 92.49 ± 0.09 |
| Pagerank centrality | 93.06 ± 0.03 | 95.72 ± 0.03 | 87.80 ± 0.23 | 92.53 ± 0.16 |
| Eigenvector centrality | 92.95 ± 0.13 | 95.73 ± 0.03 | 87.54 ± 0.49 | 92.24 ± 0.21 |
+
+Table 4: Comparison of BGRL and GCA for simple versus complex augmentation heuristics on four benchmark graphs. For GCA, we report the numbers provided in their original paper.
+
+ | Validation | Test |
| MLP | 57.65±0.12 | 55.50±0.23 |
| node2vec | 71.29±0.13 | 70.07±0.13 |
| Random-Init* | 69.90±0.11 | 68.94±0.15 |
| DGI* | 71.26±0.11 | 70.34±0.16 |
| GRACE full-graph* | OOM | OOM |
| GRACE-SUBSAMPLING (k=2)* | 60.49±3.72 | 60.24±4.06 |
| GRACE-SUBSAMPLING (k=8)* | 71.30±0.17 | 70.33±0.18 |
| GRACE-SUBSAMPLING (k=32)* | 72.18±0.16 | 71.18±0.16 |
| GRACE-SUBSAMPLING (k=2048)* | 72.61±0.15 | 71.51±0.11 |
| BGRL* | 72.53±0.09 | 71.64±0.12 |
| Supervised GCN | 73.00±0.17 | 71.74±0.29 |
+
+Table 5: Performance on the ogbn-arXiv task measured in terms of classification accuracy along with standard deviations. Our experiments, marked as $\star$ , are averaged over 20 random model initializations. Other results are taken from previously published reports. OOM indicates running out of memory on a 16GB V100 GPU.
+
+# 4.2 SCALABILITY-PERFORMANCE TRADE-OFFS FOR LARGE GRAPHS
+
+When scaling up to large graphs, it may not be possible to compare each node's representation to all others. In this case, a natural way to reduce memory is to compare each node with only a subset of nodes in the rest of the graph. To study how the number of negatives impacts performance in this case, we propose an approximation of GRACE's objective called GRACE-SUBSAMPLING, where instead of contrasting every pair of nodes in the graph, we subsample $k$ nodes randomly across the graph to use as negative examples for each node at every gradient step. Note that $k = 2$ is the asymptotic equivalent of BGRL in terms of memory costs, as BGRL always only compares each node with itself across both views, i.e., BGRL faces no such computational difficulty or design choice in scaling up.
+
+# EVALUATING ON OGBN-ARXIV DATASET
+
+To study the tradeoff between performance and complexity we consider a node classification task on a much larger dataset, from the OGB benchmark (Hu et al., 2020a), ogbn-arXiv. In this case, GRACE cannot run without subsampling (on a GPU with 16GB of memory). Considering the increased difficulty of this task, we slightly expand our model to use 3 GCN layers, following the baseline model provided by Hu et al. (2020a). As there has not been prior work on applying GNN-based unsupervised approaches to the ogbn-arXiv task, we implement and compare against two representative contrastive-learning approaches, DGI and GRACE. In addition, we report results from Hu et al. (2020a) for node2vec (Grover & Leskovec, 2016) and a supervised-learning baseline. We report results on both validation and test sets, as is convention for this task since the dataset is split based on a chronological ordering.
+
+Our results, summarized in Table 5, show that BGRL is competitive with the supervised learning baseline. Further, we note that the performance of GRACE-SUBSAMPLING is very sensitive to the parameter $k$ -requiring a large number of negatives to match the performance of BGRL. Note that BGRL far exceeds the performance of GRACE-SUBSAMPLING with $k = 2$ , its asymptotic equivalent in terms of memory; and that larger values of $k$ lead to out-of-memory errors on a 16GB GPU. These results suggest that the performance of contrastive methods such as GRACE may suffer due to approximations to their objectives that must be made when scaling up.
+
+ | PPI |
| Raw features | 42.20 |
| DGI | 63.80 ± 0.20 |
| GMI | 65.00 ± 0.02 |
| Random-Init | 62.60 ± 0.20 |
| GRACE MeanPooling encoder* | 69.66 ± 0.15 |
| BGRL MeanPooling encoder* | 69.41 ± 0.15 |
| GRACE GAT encoder* | 69.71 ± 0.17 |
| BGRL GAT encoder* | 70.49 ± 0.05 |
| Supervised MeanPooling | 96.90 ± 0.20 |
| Supervised GAT | 97.30 ± 0.20 |
+
+Table 6: Performance on the PPI task measured in terms of Micro- $\mathbf{F}_1$ across the 121 labels along with standard deviations. Our experiments, marked as $\star$ , are averaged over 20 random model initializations. Other results are taken from previously published reports.
+
+# EVALUATING ON PROTEIN-PROTEIN INTERACTION DATASET
+
+Next, we consider the Protein-Protein Interaction (PPI) task—a more challenging inductive task on multiple graphs where the gap between the best self-supervised methods and fully supervised methods is (still) significantly large, due to $40\%$ of the nodes missing feature information. In addition to simple mean-pooling propagation rules from GraphSage-GCN (Hamilton et al., 2017), we also consider Graph Attention Networks (GAT, Velicković et al., 2018) where each node aggregates features from its neighbors non-uniformly using a learned attention weight. It has been shown (Velicković et al., 2018) that GAT improves over non-attentional models on this dataset when trained in supervised settings, but these models have thus far not been able to be trained to a higher performance than non-attentional models through contrastive techniques.
+
+We report our results in Table 6, showing that BGRL is competitive with GRACE when using the simpler MeanPooling networks. Applying BGRL to a GAT model, results in a new state-of-the-art performance, improving over the MeanPooling network. On the other hand, the GRACE contrastive loss is unable to improve performance of a GAT model over the non-attentional MeanPooling encoder. We observe that the approximation of the contrastive objective results not only in lower accuracies
+
+
+Figure 2: PPI task performance, averaged over 20 seeds. Figure 3: Histogram of GAT attention entropies.
+
+
+
+(Figure 2), but also qualitatively different behaviors in the GAT models being trained. In Figure 3, we examine the internals of GAT models trained through both BGRL and GRACE by analyzing the entropy of the attention weights learned. For each training node, we compute the average entropy of its attention weights across all GAT layers and attention heads, minus the entropy of a uniform attention distribution as a baseline. We see that GAT models learned using GRACE, particularly when subsampling few negative examples, tend to have very low attention entropies and perform poorly. On the other hand, BGRL is able to train the model to have meaningful attention weights, striking a balance between the low-entropy models learned through GRACE and the maximum-entropy
+
+uniform-attention distribution. This aligns with recent observations (Kim & Oh, 2021; Wang et al., 2019) that auxiliary losses must be chosen carefully for the stability of GAT attention weights.
+
+# 4.3 SCALING TO EXTREMELY LARGE GRAPHS
+
+To further test the scalability and evaluate the performance of BGRL in the very high-data regime, we consider the MAG240M node classification task (Hu et al., 2021). As a single connected graph of 360GB with over 240 million nodes (of which 1.4 million are labeled) and 1.7 billion edges, this dataset is orders of magnitude larger than previously available public datasets, and poses a significant scaling challenge. Since the test labels for this dataset are (still) hidden, we report performance based on validation accuracies in our experiments. Implementation and experiment details are in Appendix G.
+
+To account for the increased scale and difficulty of the classification task on this dataset, we make a number of changes to our learning setup. First, since we can no longer perform full-graph training due to the sheer size of the graph, we thus adopt the Neighborhood Sampling strategy proposed by Hamilton et al. (2017) to sample a small number of central nodes at which our loss is to be applied, and sampling a fixed size neighborhood around them. Second, we use more expressive Message Passing Neural Networks (Gilmer et al., 2017) as our graph encoders. Finally, as we are interested in pushing performance on this competition dataset, we make use of the available labels for representation learning and shift from evaluating on top of a frozen representation, to semi-supervised training by combining both supervised and self-supervised signals at each update step. We emphasize that these are significant changes from the standard small-scale evaluation setup for graph representation learning methods studied previously, and more closely resemble real-world conditions in which these algorithms would be employed.
+
+
+Figure 4: Performance on MAG240M using BGRL or GRACE-SUBSAMPLING as an auxiliary signal, averaged over 5 seeds and run for 50k steps.
+
+
+Figure 5: Mixing varying amounts of unlabeled data for representation learning with BGRL, averaged over 5 seeds and run for 500k steps.
+
+In Figure 4, we see that BGRL used as an auxiliary signal is able to learn faster and significantly improve final performance over fully supervised learning on this challenging task. Considering the difficulty of this task and the small gap in final performance between winning entries in the KDD Cup 2021 contest, this is a significant improvement. On the other hand, GRACE-SUBSAMPLING provides much lower benefits over fully supervised learning, possibly due to no longer being able to sample sufficiently many negatives over the whole graph. Here we used $k = 256$ negatives, the largest value we were able to run without running out of memory.
+
+We further show that we can leverage the high scalability of BGRL to make use of the vast amounts of unlabeled data present in the dataset. Since labeled nodes form only $0.5\%$ of the graph, unlabeled data offers a rich self-supervised signal for learning better representations and ultimately improving performance on the supervised task. In Figure 5, we consider adding some number of unlabeled nodes to each minibatch of data, and examine the effect on performance as this ratio of unlabeled to labeled data in each batch increases. Thus at each step, we apply the supervised loss on only the labeled nodes in the batch, and BGRL on all nodes. Note that a ratio of 0 corresponds to the case where we apply BGRL as an auxiliary loss only to the training nodes, already examined in Figure 4. We observe a dramatic increase in both stability and peak performance as we increase this ratio, showing that BGRL can utilize the unlabeled nodes effectively to shape higher quality representations and prevent
+
+early overfitting to the supervised signal. This effect shows steady improvement as we increase this ratio from 1x to 10x unlabeled data, where we stop due to resource constraints on running ablations on this large-scale graph - however, this trend may continue to even higher ratios, as the true ratio of unlabeled to labeled nodes present in the graph is $99\mathrm{x}$ .
+
+This result of $73.89\%$ is state-of-the-art for this dataset for the highest single-model performance (i.e., without ensembling) - the OGB baselines report a score of $70.02\%$ (Hu et al., 2021) while the KDD Cup 2021 contest first place solution reported a score of $73.71\%$ before ensembling.
+
+KDD Cup 2021: Our solution using BGRL to shape representations, utilizing unlabeled data in conjunction with a supervised signal for semi-supervised learning, was awarded as one of the winners of the MAG240M track at OGB-LSC(Addanki et al., 2021). It achieved a final position of second overall, achieving $75.19\%$ accuracy on the test set. The first and third place solutions achieved $75.49\%$ and $74.60\%$ respectively. Although differences in many other factors such as model architectures, feature engineering, ensembling strategies, etc. prevent a direct comparison between these solutions, these results serve as a strong empirical evidence for the effectiveness of BGRL for learning representations on extremely large scale datasets.
+
+# 5 RELATED WORK
+
+Early methods in the area relied on random-walk objectives such as DeepWalk (Perozzi et al., 2014) and node2vec (Grover & Leskovec, 2016). Even though the graph neural networks (GNNs) inductive bias aligns with these objectives (Wu et al., 2019; Velicković et al., 2019; Kipf & Welling, 2017), composing GNNs and random-walks does not work very well and can even degrade performance (Hamilton et al., 2017). Earlier combinations of GNNs and self-supervised learning involve Embedding Propagation (García-Durán & Niepert, 2017), Variational Graph Autoencoders (Kipf & Welling, 2016) and Graph2Gauss (Bojchevski & Gunnemann, 2018). Hu et al. (2020b) leverages BERT (Devlin et al., 2019) for representation learning in graph-structured inputs. Hu et al. (2020b) assumes specific graph structures and uses feature masking objectives to shape representations.
+
+Recently, contrastive methods effective on images have also been adapted to graphs using GNNs. This includes DGI (Veličković et al., 2019), inspired by Deep InfoMax Hjelm et al. (2019), which contrasts node-local patches against global graph representations. Next, InfoGraph (Sun et al., 2020) modified DGI's pipeline for graph classification tasks. GMI Peng et al. (2020) maximizes a notion of graphical mutual information inspired by MINE (Belghazi et al., 2018), allowing for a more fine-grained contrastive loss than DGI's. The SimCLR method of Chen et al. (2020a;b) has been specialized for graphs by GRACE and variants such as GCA (Zhu et al., 2020b;a) that rely on more complex data-adaptive augmentations. GraphCL (You et al., 2020) adapts SimCLR to learn graph-level embeddings using a contrastive objective. MVGRL (Hassani & Khasahmadi, 2020) generalizes CMC (Tian et al., 2020) to graphs. Graph Barlow Twins (Bielak et al., 2021) presents a method to learn representations by minimizing correlation between different representation dimensions. Concurrent works DGB (Che et al., 2020) and SelfGNN (Kefato & Girdzijauskas, 2021), like BGRL, adapt BYOL (Grill et al., 2020) for graph representation learning. However, BGRL differs from these works in the following ways:
+
+- We show that BGRL scales to and attains state-of-the-art results on the very high-data regime on the MAG240M dataset. These results are unprecedented in the graph self-supervised learning literature and demonstrate a high degree of scalability.
+- We show that BGRL is effective even when trained on sampled subgraphs and not full graph.
+- We provide an extensive analysis of the performance-computation trade-off of BGRL versus contrastive methods, showing that BGRL can be more efficient in terms of computation and memory usage as it requires no negative examples.
+- We show that BGRL is effective when performing semi-supervised training, providing further gains when leveraging both labeled data and unlabeled data. This is a significant result that has not been demonstrated in graph representation learning methods using neural networks prior to our work.
+
+# ICLR ETHICS STATEMENT
+
+Our contributions are in developing and evaluating a general method for self-supervised representation learning in graphs. As such, they may be helpful in applications where obtaining labels can be challenging or expensive, thus enabling newer applications potentially in the direction of positive social good.
+
+On the other hand, as an unsupervised pretraining method, there is a risk of practitioners using it for downstream tasks without carefully considering how these embeddings were originally trained, potentially leading to stereotyping or unfair biases. Further, since the bootstrapping dynamics of BGRL are not yet fully understood, there is a higher chance of it being used as a blackbox machine learning method and harmful downstream effects being difficult to diagnose and resolve.
+
+# ICLR REPRODUCIBILITY STATEMENT
+
+We believe that the results we report in this paper are reproducible and strengthen our empirical contributions.
+
+We have submitted our algorithm implementation and experimental setup, config, and code for almost all of our experiments as supplementary material. Most experiments finish within 30 minutes on a single V100 GPU, and thus are easy to verify with few resources. In addition, we are providing trained model weights/checkpoints for directly loading and verifying performance without training. Experiments for which code has not been provided are described in detail in the appendices (Appendix E and Appendix F) and should allow for reproduction.
+
+Besides this, code for our large-scale MAG240M solution has been open-sourced as part of the KDD Cup 2021 and has been verified independently by the OGB-LSC contest organizers.
+
+# REFERENCES
+
+Ravichandra Addanki, Peter W. Battaglia, David Budden, Andreae Deac, Jonathan Godwin, Thomas Keck, Wai Lok Sibon Li, Alvaro Sanchez-Gonzalez, Jacklynn Stott, Shantanu Thakoor, and Petar Velickovic. Large-scale graph representation learning with very deep gnns and self-supervision. CoRR, abs/2107.09422, 2021. URL https://arxiv.org/abs/2107.09422.
+Jimmy Ba, J. Kiros, and Geoffrey E. Hinton. Layer normalization. *ArXiv*, abs/1607.06450, 2016.
+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, 2018. URL http://proceedings.mlr.press/v80/belghazi18a.html.
+Piotr Bielak, Tomasz Kajdanowicz, and Nitesh V. Chawla. Graph barlow twins: A self-supervised representation learning framework for graphs. CoRR, abs/2106.02466, 2021. URL https://arxiv.org/abs/2106.02466.
+Aleksandar Bojchevski and Stephan Gunnemann. Deep gaussian embedding of graphs: Unsupervised inductive learning via ranking. arXiv preprint arXiv:1707.03815, 2017.
+Aleksandar Bojchevski and Stephan Gunnemann. Deep gaussian embedding of graphs: Unsupervised inductive learning via ranking. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=r1ZdKJ-OW.
+Lowik Chanussot, Abhishek Das, Siddharth Goyal, Thibaut Lavril, Muhammed Shuaibi, Morgane Riviere, Kevin Tran, Javier Heras-Domingo, Caleb Ho, Weihua Hu, and et al. Open catalyst 2020 (oc20) dataset and community challenges. ACS Catalysis, 11(10):6059-6072, May 2021. ISSN 2155-5435. doi: 10.1021/acscatal.0c04525. URL http://dx.doi.org/10.1021/acscatal.0c04525.
+Feihu Che, Guohua Yang, Dawei Zhang, Jianhua Tao, Pengpeng Shao, and Tong Liu. Self-supervised graph representation learning via bootstrapping. arXiv preprint arXiv:2011.05126, 2020.
+
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning, 2020a. URL http://proceedings.mlr.press/v119/chen20j.html.
+Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E. Hinton. Big self-supervised models are strong semi-supervised learners. In Neural Information Processing Systems, 2020b. URL https://proceedings.neurips.cc/paper/2020/bit/ fcbc95ccdd551da181207c0c1400c655-Abstract.html.
+Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). In International Conference on Learning Representations, 2016. URL http://arxiv.org/abs/1511.07289.
+J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
+Austin Derrow-Pinion, Jennifer She, David Wong, Oliver Lange, Todd Hester, Luis Perez, Marc Nunkesser, Seongjae Lee, Xueying Guo, Brett Wiltshire, Peter W. Battaglia, Vishal Gupta, Ang Li, Zhongwen Xu, Alvaro Sanchez-Gonzalez, Yujia Li, and Petar Velickovic. ETA prediction with graph neural networks in google maps. CoRR, abs/2108.11482, 2021. URL https://arxiv.org/abs/2108.11482.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Conference of the North American Chapter of the Association for Computational Linguistics, 2019. doi: 10.18653/v1/N19-1423. URL https://www.aclweb.org/anthology/N19-1423.
+Alberto García-Durán and Mathias Niepert. Learning graph representations with embedding propagation. In Neural Information Processing Systems, 2017. ISBN 9781510860964.
+Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML'17, 2017.
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Conference on Artificial Intelligence and Statistics, 2010.
+Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to self-supervised learning. In Neural Information Processing Systems, 2020.
+Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In ACM SIGKDD International Conference on Knowledge discovery and Data Mining, 2016.
+Sylvain Gugger and Jeremy Howard. Adamw and super-convergence is now the fastest way to train neural nets. https://www.fast.ai/2018/07/02/adam-weight-decay/, 2018.
+William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Neural Information Processing Systems, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/5dd9db5e033da9c6fb5ba83c7a7ebea9-Abstract.html.
+Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, 2020. URL http://proceedings.mlr.press/v119/hassani20a.html.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In International Conference on Computer Vision, USA, 2015. ISBN 9781467383912. doi: 10.1109/ICCV.2015.123. URL https://doi.org/10.1109/ICCV.2015.123.
+
+R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bklr3j0cKX.
+Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In Neural Information Processing Systems, 2020a. URL https://proceedings.neurips.cc/paper/2020/bitical/17968453678678678678678678678678678678678678678678678678678678678678678678678678678678678678678678678678678678
+- 2020/bitical/17968453678678678678678678678678678678678678678678678678678678678678678678678678678678678678
+- 2020/bitical/179685535b535b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5
+Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In International Conference on Learning Representations, 2020b. URL https://openreview.net/forum?id=HJ1WWJSFDH.
+Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. Ogb-lsc: A large-scale challenge for machine learning on graphs, 2021.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, 2015. URL http://proceedings.mlr.press/v37/ioffe15.html.
+Zekarias T. Kefato and Sarunas Girdzijauskas. Self-supervised graph neural networks without explicit negative sampling. CoRR, abs/2103.14958, 2021. URL https://arxiv.org/abs/2103.14958.
+Dongkwan Kim and Alice Oh. How to find your friendly neighborhood: Graph attention design with self-supervision. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=Wi5KUNlqWty.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. URL http://arxiv.org/abs/1412.6980.
+Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016.
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=SJU4ayYgl.
+Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton van den Hengel. Image-based recommendations on styles and substitutes. In ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '15, 2015. ISBN 9781450336215. doi: 10.1145/2766462.2767755. URL https://doi.org/10.1145/2766462.2767755.
+Péter Mernyei and Cătălina Cangea. Wiki-cs: A wikipedia-based benchmark for graph neural networks, 2020.
+Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. In International Conference on Learning Representations, 2013. URL http://arxiv.org/abs/1301.3781.
+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.
+Zhen Peng, Wenbing Huang, Minnan Luo, Qinghua Zheng, Yu Rong, Tingyang Xu, and Junzhou Huang. Graph Representation Learning via Graphical Mutual Information Maximization, pp. 259-270. Association for Computing Machinery, New York, NY, USA, 2020. ISBN 9781450370233. URL https://doi.org/10.1145/3366423.3380112.
+Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Conference on Empirical Methods in Natural Language Processing, 2014. doi: 10.3115/v1/D14-1162. URL https://www.aclweb.org/anthology/D14-1162.
+
+Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk. ACM SIGKDD International Conference on Knowledge discovery and Data Mining, 2014. doi: 10.1145/2623330.2623732. URL http://dx.doi.org/10.1145/2623330.2623732.
+Siyuan Qiao, Huiyu Wang, Chenxi Liu, Wei Shen, and Alan L. Yuille. Weight standardization. CoRR, abs/1903.10520, 2019. URL http://arxiv.org/abs/1903.10520.
+Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Droppedge: Towards deep graph convolutional networks on node classification. In International Conference on Learning Representations, 2019.
+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.
+Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls of graph neural network evaluation. Relational Representation Learning Workshop, NeurIPS 2018, 2018.
+Arnab Sinha, Zhihong Shen, Yang Song, Hao Ma, Darrin Eide, Bo-June (Paul) Hsu, and Kuansan Wang. An overview of microsoft academic service (mas) and applications. In International Conference on World Wide Web, 2015. ISBN 9781450334730. doi: 10.1145/2740908.2742839. URL https://doi.org/10.1145/2740908.2742839.
+Fan-Yun Sun, Jordan Hoffmann, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=r1lfF2NYvH.
+Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, 2020. doi: 10.1007/978-3-030-58621-8\45. URL https://doi.org/10.1007/978-3-030-58621-8_45.
+Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. CoRR, abs/2102.06810, 2021. URL https://arxiv.org/abs/2102.06810.
+Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJXMpikCZ.
+Petar Velicković, William Fedus, William L. Hamilton, Pietro Lio, Yoshua Bengio, and R. Devon Hjelm. Deep graph infomax. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rklz9iAcKQ.
+Guangtao Wang, Rex Ying, Jing Huang, and J. Leskovec. Improving graph attention networks with large margin-based constraints. ArXiv, abs/1910.11945, 2019.
+Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In International Conference on Machine Learning, 2019.
+Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In Neural Information Processing Systems, 2020. URL https://proceedings.neurips.cc/paper/2020/bit/3fe230348e9a12c13120749e3f9fa4cd-Abstract.html.
+Xiaojin Zhu and Zoubin Ghahramani. Learning from labeled and unlabeled data with label propagation. 2002.
+Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, S. Wu, and Liang Wang. Graph contrastive learning with adaptive augmentation. ArXiv, abs/2010.14945, 2020a.
+Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, and Liang Wang. Deep graph contrastive representation learning. ArXiv, abs/2006.04131, 2020b.
+
+Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. Bioinformatics, 33(14):i190-i198, Jul 2017. ISSN 1460-2059. doi: 10.1093/bioinformatics/btx252. URL http://dx.doi.org/10.1093/bioinformatics/btx252.
+
+# A BGRL DOES NOT CONVERGE TO TRIVIAL SOLUTIONS
+
+In Figure 6 we show the BGRL loss curve throughout training for all the datasets considered. As we see, the loss does not converge to zero, indicating that the training does not result in a trivial solution.
+
+In Figure 7 we plot the spread of the node embeddings, i.e., the standard deviation of the representations learned across all nodes, divided by the average norm. As we see, the embeddings learned across all datasets have a standard deviation that is a similar order of magnitude as the norms of the embeddings themselves, further indicating that the training dynamics do not converge to a constant solution.
+
+Further, Figure 8 shows that the embeddings do not collapse to zero or blow up as training progresses.
+
+
+Figure 6: BGRL Loss
+
+
+Figure 7: Embedding spread
+
+
+Figure 8: Average embedding norm
+
+# B ABLATIONS ON PROJECTOR NETWORK
+
+As noted in Section 2, BGRL does not use a projector network, unlike both BYOL and GRACE. Prior works such as GRACE use a projector network to prevent the embeddings from becoming completely invariant to the augmentations used - however in BGRL, the predictor network can serve the same purpose. On the other hand, BYOL relies on this for dimensionality reduction, to simplify the task of the predictor $p_{\theta}$ , as it is challenging to directly predict very high-dimensional embeddings. required for large-scale vision tasks like ImageNet (Deng et al., 2009). Here we empirically verify that even in our most challenging, large-scale task of MAG240M, the projector network is not needed and only slows down learning. In Figure 9 we can see that adding the projector network leads to both slower learning and a lower final performance.
+
+
+Figure 9: Performance on OGB-LSC MAG240M task, averaged over 5 seeds, testing effect of using projector network.
+
+# C COMPARISON ON SMALL DATASETS
+
+We perform additional experiments on 4 commonly used small datasets, (Cora, CiteSeer, PubMed, and DBLP) (Sen et al., 2008; Bojchevski & Gunnemann, 2017) and show that BGRL's bootstrapping mechanism still performs well in the low-data regime, even attaining a new state of the art performance on two of the datasets.
+
+Note that Table 7 reports results averaged over 20 random dataset splits, as has been followed in Zhu et al. (2020b), instead of using the standard fixed splits for these datasets which are known to be easy to unreliable for evaluating GNN methods (Shchur et al., 2018).
+
+ | Cora | CiteSeer | PubMed | DBLP |
| GRACE | 83.02 ± 0.89 | 71.63 ± 0.64 | 86.06 ± 0.26 | 84.08 ± 0.29 |
| BGRL | 83.83 ± 1.61 | 72.32 ± 0.89 | 86.03 ± 0.33 | 84.07 ± 0.23 |
| Supervised | 82.8 | 72.0 | 84.9 | 82.7 |
+
+Table 7: Evaluation on small datasets. Results averaged over 20 dataset splits and model initializations.
+
+# D GRAPH AUGMENTATION FUNCTIONS
+
+Generating meaningful augmentations is a much less explored problem in graphs than in other domains such as vision. Further, since we work over entire graphs, complex augmentations can be very expensive to compute and will impact all nodes at once. Our contributions are orthogonal to this problem, and we primarily consider only the standard graph augmentation pipeline that has been used in previous works on representation learning (You et al., 2020; Zhu et al., 2020b).
+
+In particular, we consider two simple graph augmentation functions — node feature masking and edge masking. These augmentations are graph-wise: they do not operate on each node independently, and instead leverage graph topology information through edge masking. This contrasts with transformations used in BYOL, which operate on each image independently. First, we generate a single random binary mask of size $F$ , each element of which follows a Bernoulli distribution $\mathcal{B}(1 - p_f)$ , and use it to mask features of all nodes in the graph (i.e., all nodes have the same features masked). Empirically, we found that performance is similar for using different random masks per node or sharing them, and so we use a single mask for simplicity. In addition to this node-level attribute transformation, we also compute a binary mask of size $E$ (where $E$ is the number of edges in the original graph), each element of which follows a Bernoulli distribution $\mathcal{B}(1 - p_e)$ , and use it to mask edges in the augmented graph. To compute our final augmented graphs, we make use of both augmentation functions with different hyperparameters for each graph, i.e. $p_{f_1}$ and $p_{e_1}$ for the first view, and $p_{f_2}$ and $p_{e_2}$ for the second view.
+
+Beyond these standard augmentations, in Section 4.1 we also consider more complex adaptive augmentations proposed by prior works (Zhu et al., 2020a) which use various heuristics to mask different features or edges with different probabilities.
+
+# E DATASET DETAILS
+
+WikiCS3 This graph is constructed from Wikipedia references, with nodes representing articles about Computer Science and edges representing links between them. Articles are classified into 10 classes based on their subfield, and node features are the average of GloVE (Pennington et al., 2014) embeddings of all words in the article. This dataset comes with 20 canonical train/valid/test splits, which we use directly.
+
+Amazon Computers, Amazon Photos These graphs are from the Amazon co-purchase graph (McAuley et al., 2015) with nodes representing products and edges being between pairs of goods frequently purchased together. Products are classified into 10 (for Computers) and 8 (for Photos)
+
+classes based on product category, and node features are a bag-of-words representation of a product's reviews. We use a random split of the nodes into $(10 / 10 / 80\%)$ train/validation/test nodes respectively as these datasets do not come with a standard dataset split.
+
+Coauthor CS, Coauthor Physics These graphs are from the Microsoft Academic Graph (Sinha et al., 2015), with nodes representing authors and edges between authors who have co-authored a paper. Authors are classified into 15 (for CS) and 5 (for Physics) classes based on the author's research field, and node features are a bag-of-words representation of the keywords of an author's papers. We again use a random $(10 / 10 / 80\%)$ split for these datasets.
+
+ogbn-arXiv: This is another citation network, where nodes represent CS papers on arXiv indexed by the Microsoft Academic Graph (Sinha et al., 2015). In our experiments, we symmetrize this graph and thus there is an edge between any pair of nodes if one paper has cited the other. Papers are classified into 40 classes based on arXiv subject area. The node features are computed as the average word-embedding of all words in the paper, where the embeddings are computed using a skip-gram model (Mikolov et al., 2013) over the entire corpus.
+
+$\mathbf{PPI}^{6}$ is a protein-protein interaction network (Zitnik & Leskovec, 2017; Hamilton et al., 2017), comprised of multiple (24) graphs each corresponding to different human tissues. We use the standard dataset split as 20 graphs for training, 2 for validation, and 2 for testing. Each node has 50 features computed from various biological properties. This is a multilabel classification task, where each node can possess up to 121 labels.
+
+# F IMPLEMENTATION DETAILS
+
+In all our experiments, we use the AdamW optimizer (Kingma & Ba, 2015; Gugger & Howard, 2018) with weight decay set to $10^{-5}$ , and all models initialized using Glorot initialization (Glorot & Bengio, 2010). The BGRL predictor $p_{\theta}$ used to predict the embedding of nodes across views is fixed to be a Multilayer Perceptron (MLP) with a single hidden layer. The decay rate $\tau$ controlling the rate of updates of the BGRL target parameters $\phi$ is initialized to 0.99 and gradually increased to 1.0 over the course of training following a cosine schedule. Other model architecture and training details vary per dataset and are described further below. The augmentation hyperparameters $p_{f_{1,2}}$ and $p_{e_{1,2}}$ are reported below.
+
+Graph Convolutional Networks Formally, the GCN propagation rule (Kipf & Welling, 2017) for a single layer is as follows,
+
+$$
+\operatorname {G C N} _ {i} (\mathbf {X}, \mathbf {A}) = \sigma \left(\widehat {\mathbf {D}} ^ {- \frac {1}{2}} \widehat {\mathbf {A}} \widehat {\mathbf {D}} ^ {- \frac {1}{2}} \mathbf {X} \mathbf {W} _ {i}\right), \tag {4}
+$$
+
+where $\widehat{\mathbf{A}} = \mathbf{A} + \mathbf{I}$ is the adjacency matrix with self-loops, $\widehat{\mathbf{D}}$ is the degree matrix, $\sigma$ is a non-linearity such as ReLU, and $\mathbf{W}_i$ is a learned weight matrix for the $i$ 'th layer.
+
+Mean Pooling Rule Formally, the Mean Pooling (Hamilton et al., 2017) rule for a single layer is given by:
+
+$$
+\mathrm {M P} _ {i} (\mathbf {X}, \mathbf {A}) = \sigma \left(\widehat {\mathbf {D}} ^ {- 1} \widehat {\mathbf {A}} \mathbf {X} \mathbf {W} _ {i}\right) \tag {5}
+$$
+
+As proposed by Velicković et al. (2019), our exact encoder in inductive experiments $\mathcal{E}$ is a 3-layer mean-pooling network with skip connections. We use a layer size of 512 and PReLU (He et al., 2015) activation. Thus, we compute:
+
+$$
+\mathbf {H} _ {1} = \sigma \left(\mathrm {M P} _ {1} (\mathbf {X}, \mathbf {A})\right) \tag {6}
+$$
+
+$$
+\mathbf {H} _ {2} = \sigma \left(\mathrm {M P} _ {2} \left(\mathbf {H} _ {1} + \mathbf {X W} _ {\text {s k i p}}, \mathbf {A}\right)\right) \tag {7}
+$$
+
+$$
+\mathcal {E} (\mathbf {X}, \mathbf {A}) = \sigma \left(\mathrm {M P} _ {3} \left(\mathbf {H} _ {2} + \mathbf {H} _ {1} + \mathbf {X W} _ {\text {s k i p}}, \mathbf {A}\right)\right) \tag {8}
+$$
+
+Graph Attention Networks The GAT layer (Velicković et al., 2018) consists of a learned matrix $\mathbf{W}$ that transforms each node features. We then use self-attention to compute attention coefficient for a pair of nodes $i$ and $j$ as $e_{ij} = a(\mathbf{h}_i,\mathbf{h}_j)$ . The attention function $a$ is computed as LeakyReLU(a[Wh_i||Wh_j]), where $\mathbf{a}$ is a learned matrix transforming a pair of concatenated attention queries into a single scalar attention logit. The weight of the edge between nodes $i$ and $j$ is computed as $\alpha_{ij} = \mathrm{softmax}_{j}(e_{ij})$ . We follow the architecture proposed by Velicković et al. (2018), including a 3-layer GAT model (with the first 2 layers consisting of 4 heads of size 256 each and the final layer size 512 with 6 output heads), ELU activation (Clevert et al., 2016), and skip-connections in intermediate layers.
+
+Model architectures As described in Section 4, we use GCN (Kipf & Welling, 2017) encoders in our experiments on the smaller transductive tasks, while on the inductive task of PPI we use MeanPooling encoders with residual connections. The BGRL predictor $p_{\theta}$ is implemented as a multilayer perceptron (MLP). We also used stabilization techniques like batch normalization (Ioffe & Szegedy, 2015), layer normalization (Ba et al., 2016), and weight standardization (Qiao et al., 2019). The decay rate use for statistics in the batch normalization is fixed to 0.99. We use PReLU activation (He et al., 2015) in all experiments except those using a GAT encoder, where we use the ELU activation (Clevert et al., 2016). In all our models, at each layer including the final layer, we apply first the batch/layer normalization as applicable, and then the activation function. Table 8 describes hyperparameter and architectural details for most of our experimental setups with BGRL. In addition to these standard settings, we perform additional experiments on the PPI dataset using a GAT (Veličković et al., 2018) model as the encoder. When using the GAT encoder on PPI, we use 3 attention layers — the first two with 4 attention heads of size 256 each, and the final with 6 attention heads of size 512, following a very similar model proposed by Veličković et al. (2018). We concatenate the attention head outputs for the first 2 layers, and use the mean for the final output. We also use the ELU activation (Clevert et al., 2016), and skip connections in the intermediate attention layers, as suggested by Veličković et al. (2018).
+
+| Dataset | WikiCS | Am. Computers | Am. Photos | Co. CS | Co. Physics | ogbn-arXiv | PPI |
| pf,1 | 0.2 | 0.2 | 0.1 | 0.3 | 0.1 | 0.0 | 0.25 |
| pf,2 | 0.1 | 0.1 | 0.2 | 0.4 | 0.4 | 0.0 | 0.00 |
| pe,1 | 0.2 | 0.5 | 0.4 | 0.3 | 0.4 | 0.6 | 0.30 |
| pe,2 | 0.3 | 0.4 | 0.1 | 0.2 | 0.1 | 0.6 | 0.25 |
| ηbase | 5·10-4 | 5·10-4 | 10-4 | 10-5 | 10-5 | 10-2 | 5·10-3 |
| embedding size | 256 | 128 | 256 | 256 | 128 | 256 | 512 |
| ε hidden sizes | 512 | 256 | 512 | 512 | 256 | 256, 256 | 512, 512 |
| ρθ hidden sizes | 512 | 512 | 512 | 512 | 512 | 256 | 512 |
| batch norm | Y | Y | Y | Y | Y | N | N |
| layer norm | N | N | N | N | N | Y | Y |
| weight standard. | N | N | N | N | N | Y | N |
+
+Table 8: Hyperparameter settings for unsupervised BGRL learning.
+
+Augmentation parameters The hyperparameter settings for graph augmentations, as well as the sizes of the embeddings and hidden layers, very closely follow previous work (Zhu et al., 2020b;a) on all datasets with the exception of ogbn-arXiv. On this dataset, since there has not been prior work on applying self-supervised graph learning methods, we provide the hyperparameters we found through a small grid search.
+
+Optimization settings We perform full-graph training at each gradient step on all small-scale experiments, with the exception of experiments using GAT encoders on the PPI dataset. Here, due to memory constraints, we perform training with a batch size of 1 graph. Since the PPI dataset consists of multiple smaller, disjoint subgraphs, we do not have to perform any node subsampling at training time.
+
+We use Glorot initialization (Glorot & Bengio, 2010) the AdamW optimizer (Kingma & Ba, 2015; Gugger & Howard, 2018) with a base learning rate $\eta_{\mathrm{base}}$ and weight decay set to $10^{-5}$ . The learning rate is annealed using a cosine schedule over the course of learning of $n_{\mathrm{total}}$ total steps with an initial warmup period of $n_{\mathrm{warmup}}$ steps. Hence, the learning rate at step $i$ is computed as
+
+$$
+\eta_ {i} \triangleq \left\{ \begin{array}{l l} \frac {i \times \eta_ {\text {b a s e}}}{n _ {\text {w a r m u p}}} & \text {i f} i \leq n _ {\text {w a r m u p}}, \\ \eta_ {\text {b a s e}} \times \left(1 + \cos \frac {(i - n _ {\text {w a r m u p}}) \times \pi}{n _ {\text {t o t a l}} - n _ {\text {w a r m u p}}}\right) \times 0. 5 & \text {i f} n _ {\text {w a r m u p}} \leq i \leq n _ {\text {t o t a l}}. \end{array} \right.
+$$
+
+We fix $n_{\mathrm{total}}$ to be 10,000 total steps and $n_{\mathrm{warmup}}$ to 1,000 warmup steps, with the exception of experiments on the GAT encoder that requires using a batch size of 1 graph on the PPI dataset. In this case, we increase the number of total steps to 20,000 and warmup to 2,000 steps.
+
+The target network parameters $\phi$ are initialized randomly from the same distribution of the online parameters $\theta$ but with a different random seed. The decay parameter $\tau$ is also updated using a cosine schedule starting from an initial value of $\tau_{\mathrm{base}} = 0.99$ and is computed as
+
+$$
+\tau_ {i} \triangleq 1 - \frac {(1 - \tau_ {\mathrm {b a s e}})}{2} \times \left(\cos \left(\frac {i \times \pi}{n _ {\mathrm {t o t a l}}}\right) + 1\right).
+$$
+
+These annealing schedules for both $\eta$ and $\tau$ follow the procedure used by Grill et al. (2020).
+
+Frozen linear evaluation of embeddings In the linear evaluation protocol, the final evaluation is done by fitting a linear classifier on top of the frozen learned embeddings without flowing any gradients back to the encoder. For the smaller datasets of WikiCS, Amazon Computers/Photos, and Coauthor CS/Physics, we use an $\ell_2$ -regularized LogisticRegression classifier from Scikit-Learn (Pedregosa et al., 2011) using the 'liblinear' solver. We do a hyperparameter search over the regularization strength to be between $\{2^{-10}, 2^{-9}, \ldots, 2^9, 2^{10}\}$ .
+
+For larger PPI and ogbn-arXiv datasets, where the liblinear solver takes too long to converge, we instead perform 100 steps of gradient descent using AdamW with learning rate 0.01, with a smaller hyperparameter search on the weight decay between $\{2^{-10}, 2^{-8}, 2^{-6}, \ldots, 2^6, 2^8, 2^{10}\}$ .
+
+In all cases, we $\ell_2$ -normalize the frozen learned embeddings over the entire graph before fitting the classifier on top.
+
+# G MAG240M EXPERIMENT DETAILS
+
+Full implementation and experiment code has been open-sourced as part of the KDD Cup 2021. Key implementation details and hyperparameter descriptions are reproduced below.
+
+OGB-LSC MAG240M Dataset: This is a heterogeneous graph introduced for the KDD Cup 2021 (Hu et al., 2021), comprised of 121 million academic papers, 122 million authors, and 26 thousand institutions. Papers are represented by 768-dimensional BERT embeddings (Devlin et al., 2019), and the task is to classify arXiv papers into one of 153 categories, where $1\%$ of the paper nodes are from arXiv.
+
+Message Passing Neural Networks encoders: We use a bi-directional version of the standard MPNN (Gilmer et al., 2017) architectures with 4 message passing steps, a hidden size of 256 at each layer, with node and edge update functions represented by Multilayer Perceptrons (MLPs) with 2 hidden layers of size 512 each.
+
+Node Neighborhood Sampling: Since we can no longer perform full-graph training, we sample a batch size of 1024 central nodes split across 8 devices, and subsample a fixed-size neighborhood for each. Specifically, we sample a depth-2 neighborhood with different numbers of neighbors sampled per layer depending on the type (paper, author, institution) of each neighbor. We sample up to 80 papers and 20 authors for each paper; and 40 papers and 10 institutions per author.
+
+Other hyperparameters: We use edge masking probability $p_e$ of 0.2 and feature masking probability $p_f$ of 0.4 for each augmentation. We use a higher decay rate $\tau$ , starting at 0.999 and decayed to 1.0 with a cosine schedule. We use AdamW optimizer with a weight decay of $10^{-5}$ , and a learning rate starting at 0.01 and annealed to 0 over the course of learning with a warmup step equal to $10\%$ the period of learning.
+
+# H MODEL ABLATIONS ON MAG240M EXPERIMENTS
+
+In our main experiments on the OGB-LSC MAG240M dataset, we focus on MPNN encoders to $(i)$ achieve high accuracy on this challenging dataset, and $(ii)$ to evaluate the stability of training these more complex models with the BGRL approach. In this section, we further experiment with simpler GCN encoders and evaluate the benefits of applying BGRL even on top of these weaker encoders.
+
+We use a 2-layer GCN encoder, with an embedding size of 128. All other settings such as learning rate schedules, augmentation parameters, etc. are unchanged.
+
+In Figure 10, we see that both BGRL and GRACE improve over the performance of a fully supervised approach, with BGRL learning faster and more stably. Thus the effectiveness of BGRL even with weaker encoder architectures makes it more applicable in practice.
+
+
+Figure 10: Performance on OGB-LSC MAG240M task, averaged over 3 seeds, using GCN encoders.
+
+# I VISUALIZATION OF SCALING BEHAVIOR
+
+
+Figure 11: Memory usage of BGRL and GRACE across 5 standard datasets.
+
+In this section, we provide the information contained in Table 1 as a scatterplot, to more easily visualize the different scaling properties of BGRL and GRACE. We see in Figure 11 that the empirical scaling behavior matches the theoretical predictions in Section 3. Note that we do not show the memory usage of GRACE for the largest dataset, as it runs out of memory here, and we only visualize as a function of the number of nodes in the graph and ignore the number of edges for the purposes of this visualization.
+
+# J FROZEN LINEAR EVALUATION ON MAG240M
+
+We briefly run experiments evaluating BGRL and GRACE under the frozen evaluation protocol using an MLP classification layer on the MAG240M dataset. We see that although GRACE outperforms BGRL in this setting, both methods perform poorly. In particular, they underperform LabelProp (Zhu & Ghahramani, 2002; Hu et al., 2021) a simple parameterless, graph-agnostic baseline. This, combined with our goal of pushing performance on the competition dataset, motivates our consideration of the semi-supervised learning setting.
+
+
+Figure 12: Performance on OGB-LSC MAG240M task, averaged over 5 seeds, under frozen evaluation protocol.
\ No newline at end of file
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/images.zip b/largescalerepresentationlearningongraphsviabootstrapping/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..15d7c98e22dd2045dda84483883ed6bb44f3417a
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9401d4935ee34c4b758ec9f2fb5dd390ff7d6a873ab168231dde3252de002335
+size 736158
diff --git a/largescalerepresentationlearningongraphsviabootstrapping/layout.json b/largescalerepresentationlearningongraphsviabootstrapping/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..89dec71dd87df27fb71025566fa697728749596e
--- /dev/null
+++ b/largescalerepresentationlearningongraphsviabootstrapping/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:28a6717c736b5021eb5f4f0d046edd0f32e896998a8773cb2487bffbc68386ad
+size 575067
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_content_list.json b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..987c602617cfcf5d48ad0e1790b3ea16a3928e60
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b3891b475f6f962f6565e3d1396b92a4d14002ed33642c4fc7ec2cbdf043596a
+size 111703
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_model.json b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..02aca1a557fef16f57efe36d44cf8365f52a0b6a
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb908696e720b1deb61da2b84eef9ff09662dff5b66a49b9f6ef0cb3c5146a85
+size 136598
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_origin.pdf b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..34de52e8603e995ff3b03850e147712f0496dcbe
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/1b5aac74-c791-4567-8004-d5b0376bae3a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:38656edd14f6ed749d5705474418b2c5bf7bad89c1fd279766a9ccfd8f9b443e
+size 16628120
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/full.md b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3d8e68c25564a2a6f0e5974115e36321dfd95822
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/full.md
@@ -0,0 +1,513 @@
+# LATENT IMAGE ANIMATOR: LEARNING TO ANIMATE IMAGES VIA LATENT SPACE NAVIGATION
+
+Yaohui Wang, Di Yang, Francois Bremond & Antitza Dantcheva
+
+Inria, Université Côte d'Azur
+
+{yaohui.wang,di.yang,francois.bremond,antitza.dantcheva}@inria.fr
+
+# ABSTRACT
+
+Due to the remarkable progress of deep generative models, animating images has become increasingly efficient, whereas associated results have become increasingly realistic. Current animation-approaches commonly exploit structure representation extracted from driving videos. Such structure representation is instrumental in transferring motion from driving videos to still images. However, such approaches fail in case the source image and driving video encompass large appearance variation. Moreover, the extraction of structure information requires additional modules that endow the animation-model with increased complexity. Deviating from such models, we here introduce the Latent Image Animator (LIA), a self-supervised autoencoder that evades need for structure representation. LIA is streamlined to animate images by linear navigation in the latent space. Specifically, motion in generated video is constructed by linear displacement of codes in the latent space. Towards this, we learn a set of orthogonal motion directions simultaneously, and use their linear combination, in order to represent any displacement in the latent space. Extensive quantitative and qualitative analysis suggests that our model systematically and significantly outperforms state-of-art methods on VoxCeleb, Taichi and TED-talk datasets w.r.t. generated quality. Source code and pre-trained models are publicly available1.
+
+
+Figure 1: LIA animation examples. The two images of Marilyn Monroe and Emmanuel Macron are animated by LIA, which transfers motion of a driving video (smaller images on the top) from VoxCeleb dataset (Chung et al., 2018) onto the still images. LIA is able to successfully animate these two images without relying on any explicit structure representations, such as landmarks and region representations.
+
+# 1 INTRODUCTION
+
+In the series of science fiction books Harry Potter (Rowling et al., 2016; Rowling, 2019), wizards and witches were able to magically enchant portraits, bringing them to life. Remarkable progress of deep generative models has recently turned this vision into reality. This work examines the scenario where a framework animates a source image by motion representations learned from a driving video. Existing approaches for image animation are classically related to computer graphics (Cao et al., 2014; Thies et al., 2016; 2019; Zhao et al., 2018) or exploit motion labels (Wang et al., 2020b) and structure representations such as semantic maps (Pan et al., 2019; Wang et al., 2018; 2019), human keypoints (Jang et al., 2018; Yang et al., 2018; Walker et al., 2017; Chan et al., 2019; Zakharov et al., 2019; Wang et al., 2019; Siarohin et al., 2019), 3D meshes (Liu et al., 2019; Chen et al., 2021), and optical flows (Li et al., 2018; Ohnishi et al., 2018). We note that the ground truth of such structure representations has been computed a-priori for the purpose of supervised training, which poses constraints on applications, where such representations of unseen testing images might be fragmentary or difficult to access.
+
+Self-supervised motion transfer approaches (Wiles et al., 2018; Siarohin et al., 2019; 2021) accept raw videos as input and learn to reconstruct driving images by warping source image with predicted dense optical flow fields. While the need for domain knowledge or labeled ground truth data has been obviated, which improves performance on in-the-wild testing images, such methods entail necessity of explicit structure representations as motion guidance. Prior information such as keypoints (Siarohin et al., 2019; Wang et al., 2021a) or regions (Siarohin et al., 2021) are learned in an end-to-end training manner by additional networks as intermediate features, in order to predict target flow fields. Although online prediction of such representations is less tedious than the acquisition of ground truth labels, it still strains the complexity of networks.
+
+Deviating from such approaches, we here aim to fully eliminate the need of explicit structure representations by directly manipulating the latent space of a deep generative model. To the best of our knowledge, this constitutes a new direction in the context of image animation. Our work is motivated by interpretation of GANs (Shen et al., 2020; Goetschalckx et al., 2019; Jahanian et al., 2020; Voynov & Babenko, 2020), showcasing that latent spaces of StyleGAN (Karras et al., 2019; 2020b) and BigGAN (Brock et al., 2019) contain rich semantically meaningful directions. Given that walking along such directions, basic visual transformations such as zooming and rotation can be induced in generated results. As in image animation, we have that motion between source and driving images can be considered as higher-level transformation, a natural question here arises: can we discover a set of directions in the latent space that induces high-level motion transformations collaboratively?
+
+Towards answering this question, we introduce LIA, a novel Latent Image Animator constituting of an autoencoder for animating still images via latent space navigation. LIA seeks to animate a source image via linearly navigating associated source latent code along a learned path to reach a target latent code, which represents the high-level transformation for animating the source image. We introduce a Linear Motion Decomposition (LMD) approach aiming to represent a latent path via a linear combination of a set of learned motion directions and associated magnitudes. Specifically, we constrain the set as an orthogonal basis, where each vector indicates a basic visual transformation. By describing the whole motion space using such learned basis, LIA eliminates the requirement of explicit structure representations.
+
+In addition, we design LIA to disentangle motion and appearance within a single encoder-generator architecture. Deviating from existing methods using separate networks to learn disentangled features, LIA integrates both, latent motion code, as well as appearance features in a single encoder, which highly reduces the model complexity and simplifies training.
+
+We provide evaluation on multiple datasets including VoxCeleb (Chung et al., 2018), TaichiHD (Siarohin et al., 2019) and TED-talk (Siarohin et al., 2021). In addition, we show that LIA outperforms the state-of-the-art in preserving the facial structure in generated videos in the setting of one-shot image animation on unseen datasets such as FFHQ (Karras et al., 2019) and GermanPublicTV (Thies et al., 2020).
+
+# 2 RELATED WORK
+
+Video generation GAN-based video generation is aimed at mapping Gaussian noise to video, directly and in the absence of prior information (Vondrick et al., 2016; Saito et al., 2017; Tulyakov et al., 2018; Wang et al., 2020a; Wang, 2021). Approaches based on deep probabilistic models (Den-
+
+
+Figure 2: General pipeline. Our objective is to transfer motion via latent space navigation. The entire training pipeline consists of two steps. Firstly, we encode a source image $x_{s}$ into a latent code $z_{s\rightarrow r}$ . By linearly navigating $z_{s\rightarrow r}$ along a path $w_{r\rightarrow d}$ , we reach a target latent code $z_{s\rightarrow d}$ . The latent paths are represented by a linear combination between a set of learned motion directions (e.g., $d_{1}$ and $d_{2}$ ), which is an orthogonal basis, and associated magnitudes. In the second step, we decode $z_{s\rightarrow d}$ to a target dense optical flow field $\phi_{s\rightarrow d}$ , which is used to warp $x_{s}$ into the driving image $x_{d}$ . While we train our model using images from the same video sequence, in the testing phase, $x_{s}$ and $x_{d}$ generally pertain to different identities.
+
+ton & Birodkar, 2017; Li & Mandt, 2018; Bhagat et al., 2020; Xie et al., 2020) were also proposed to tackle this problem, however only show results on toy datasets with low resolution. Recently, with the progress of GANs in photo-realistic image generation (Brock et al., 2019; Karras et al., 2019; 2020a), a series of works (Clark et al., 2019; Wang et al., 2021c) explored production of high-resolution videos by incorporating the architecture of an image generator into video GANs, trained jointly with RNNs. Tian et al. (2021) directly leveraged the knowledge of a pre-trained StyleGAN to produce videos of resolution up to $1024 \times 1024$ . Unlike these approaches, which generate random videos based on noise vectors in an unconditional manner, in this paper, we focus on conditionally creating novel videos by transferring motion from driving videos to input images.
+
+Latent space editing In an effort to control generated images, recent works explored the discovery of semantically meaningful directions in the latent space of pre-trained GANs, where linear navigation corresponds to desired image manipulation. Supervised (Shen et al., 2020; Jahanian et al., 2020; Goetschalckx et al., 2019) and unsupervised (Voynov & Babenko, 2020; Peebles et al., 2020; Shen & Zhou, 2021) approaches were proposed to edit semantics such as facial attributes, colors and basic visual transformations (e.g., rotation and zooming) in generated or inverted real images (Zhu et al., 2020; Abdal et al., 2020). In this work, as opposed to finding directions corresponding to individual visual transformations, we seek to learn a set of directions that cooperatively allows for high-level visual transformations that can be beneficial in image animation.
+
+Image animation Related approaches (Chan et al., 2019; Wang et al., 2018; Zakharov et al., 2019; Wang et al., 2019; Yang et al., 2020) in image animation required strong prior structure labels as motion guidance. In particular, Chan et al. (2019), Yang et al. (2020) and Wang et al. (2018) proposed to map representations such as human keypoints and facial landmarks to videos in the setting of image-to-image translation proposed by Isola et al. (2017). However, such approaches were only able to learn an individual model for a single identity. Transferring motion on new appearances requires retraining the entire model from scratch by using videos of target identities. Several recent works (Zakharov et al., 2019; Wang et al., 2019) explored meta learning in fine-tuning models on target identities. While only few images of target identities were required during inference time, it was still compulsory to input pre-computed structure representations in those approaches, which usually are hard to access in many real-world scenarios. Towards addressing this issue, very recent works (Siarohin et al., 2019; 2021; Wang et al., 2021b; Wiles et al., 2018) proposed to learn image animation in self-supervised manner, only relying on RGB videos for both, training and testing without any priors. They firstly predicted dense flow fields from input images, which were then utilized to warp source images, in order to obtain final generated results. Inference only required one image of a target identity without any fine-tuning step on pre-trained models. While no priors were required, state-of-the-art methods still followed the idea of using explicit structure representations. FOMM (Siarohin et al., 2019) proposed a first order motion approach to predict keypoints and local transformations online to generate flow fields. Siarohin et al. (2021) developed this idea to model articulated objects by replacing a keypoints predictor by a PCA-based region prediction module. Wang et al. (2021b) extended FOMM by predicting 3D keypoints for view-free generation. We
+
+
+Figure 3: Overview of LIA. LIA is an autoencoder consisting of two networks, an encoder $E$ and a generator $G$ . In the latent space, we apply Linear Motion Decomposition (LMD) towards learning a motion dictionary $D_{m}$ , which is an orthogonal basis where each vector represents a basic visual transformation. LIA takes two frames sampled from the same video sequence as source image $x_{s}$ and driving image $x_{d}$ respectively during training. Firstly, it encodes $x_{s}$ into a source latent code $z_{s\rightarrow r}$ and $x_{d}$ into a magnitude vector $A_{r\rightarrow d}$ . Then, it linearly combines $A_{r\rightarrow d}$ and a trainable $D_{m}$ using LMD to obtain a latent path $w_{r\rightarrow d}$ , which is used to navigate $z_{s\rightarrow r}$ to a target code $z_{s\rightarrow d}$ . Finally, $G$ decodes $z_{s\rightarrow d}$ into a target dense flow field and warps $x_{s}$ to an output image $x_{s\rightarrow d}$ . The training objective is to reconstruct $x_{d}$ using $x_{s\rightarrow d}$ .
+
+note though that in all approaches, given that keypoints or regions are inadequately predicted, the quality of generated images drastically decreases. In contrast to such approaches, our method does not require any explicit structure representations. We dive into the latent space of the generator and self-learn to navigate motion codes in certain directions with the goal to reach target codes, which are then decoded to flow fields for warping.
+
+# 3 METHOD
+
+Self-supervised image animation aims at learning to transfer motion from a subject of a driving video to a subject in a source image based on training with a large video dataset. In this work, we propose to model such motion transformation via latent space navigation. The general pipeline is illustrated in Fig. 2. Specifically, for training, our model takes in a pair of source and driving images, randomly sampled from one video sequence. These two images are encoded into a latent code which is used to represent motion transformation in the image space. The training objective is to reconstruct the driving image by combining source image with learned motion transformation. For testing, frames of a driving video are sequentially processed with the source image to animate the source subject.
+
+We provide an overview of the proposed model in Fig. 3. Our model is an autoencoder, consisting of two main networks, an encoder $E$ and a generator $G$ . In general, our model requires two steps to transfer motion. In the first step, $E$ encodes source and driving images $x_{s}, x_{d} \sim \mathcal{X} \in \mathbb{R}^{3 \times H \times W}$ into latent codes in the latent space. The source code is then navigated into a target code, which is used to represent target motion transformation, along a learned latent path. Based on proposed Linear Motion Decomposition (LMD), we represent such a path as a linear combination of a set of learned motion directions and associated magnitudes, which are learned from $x_{d}$ . In the second step, once the target latent code is obtained, $G$ decodes it as a dense flow field $\phi_{s \to d} \sim \Phi \in \mathbb{R}^{2 \times H \times W}$ and uses $\phi_{s \to d}$ to warp $x_{s}$ and then to obtain the output image. In the following, we proceed to discuss the two steps in detail.
+
+# 3.1 LATENT MOTION REPRESENTATION
+
+Given a source image $x_{s}$ and a driving image $x_{d}$ , our first step constitutes of learning a latent code $z_{s\rightarrow d}\sim \mathcal{Z}\in \mathbb{R}^{N}$ to represent the motion transformation from $x_{s}$ to $x_{d}$ . Due to the uncertainty of two images, directly learning $z_{s\rightarrow d}$ puts forward a high requirement on the model to capture a complex distribution of motion. Mathematically, it requires modeling directions and norms of the vector $z_{s\rightarrow d}$ simultaneously, which is challenging. Therefore, instead of modeling motion transformation $x_{s}\to x_{d}$ , we assume there exists a reference image $x_{r}$ and motion transfer can be modeled
+
+as $x_{s} \to x_{r} \to x_{d}$ , where $z_{s \to d}$ is learned in an indirect manner. We model $z_{s \to d}$ as a target point in the latent space, which can be reached by taking linear walks from a starting point $z_{s \to r}$ along a linear path $w_{r \to d}$ (see Fig. 2), given by
+
+$$
+z _ {s \rightarrow d} = z _ {s \rightarrow r} + w _ {r \rightarrow d}, \tag {1}
+$$
+
+where $z_{s \to r}$ and $w_{r \to d}$ indicate the transformation $x_s \to x_r$ and $x_r \to x_d$ respectively. Both $z_{s \to r}$ and $w_{r \to d}$ are learned independently and $z_{s \to r}$ is obtained by passing $x_s$ through $E$ .
+
+We learn $w_{r\rightarrow d}$ via Linear Motion Decomposition (LMD). Our idea is to learn a set of motion directions $D_{m} = \{\mathbf{d}_{1},\dots,\mathbf{d}_{\mathbf{M}}\}$ to represent any path in the latent space. We constrain $D_{m}$ as an orthogonal basis, where each vector indicates a motion direction $\mathbf{d_i}$ . We then combine each vector in the basis with a vector $A_{r\rightarrow d} = \{a_1,\dots,a_M\}$ , where $a_{i}$ represents the magnitude of $\mathbf{d_i}$ . Hence, any linear path in the latent space can be represented using a linear combination
+
+$$
+w _ {r \rightarrow d} = \sum_ {i = 1} ^ {M} a _ {i} \mathbf {d} _ {\mathbf {i}}, \tag {2}
+$$
+
+where $\mathbf{d_i} \in \mathbb{R}^N$ and $a_i \in \mathbb{R}$ for all $i \in \{1, \dots, M\}$ . Semantically, each $\mathbf{d_i}$ should represent a basic visual transformation and $a_i$ indicates the required steps to walk in $\mathbf{d_i}$ towards achieving $w_{r \to d}$ . Due to $D_m$ entailing an orthogonal basis, any two directions $\mathbf{d_i}, \mathbf{d_j}$ follow the constrain
+
+$$
+< \mathbf {d} _ {\mathrm {i}}, \mathbf {d} _ {\mathrm {j}} > = \left\{ \begin{array}{l l} 0 & i \neq j \\ 1 & i = j. \end{array} \right. \tag {3}
+$$
+
+We implement $D_{m}$ as a learnable matrix and apply the Gram-Schmidt process during each forward pass, in order to meet the requirement of orthogonality. $A_{r\rightarrow d}$ is obtained by mapping $z_{d\rightarrow r}$ , which is the output of $x_{d}$ after $E$ , through a 5-layer MLP. The final formulation of latent motion representation for each $x_{s}$ and $x_{d}$ is thus given as
+
+$$
+z _ {s \rightarrow d} = z _ {s \rightarrow r} + \sum_ {i = 1} ^ {M} a _ {i} \mathbf {d} _ {\mathbf {i}}. \tag {4}
+$$
+
+# 3.2 LATENT CODE DRIVEN IMAGE ANIMATION
+
+Once we obtain $z_{s \to d}$ , in our second step, we use $G$ to decode a flow field $\phi_{s \to d}$ and warp $x_s$ . Our $G$ consists of two components, a flow field generator $G_f$ and a refinement network $G_r$ (we provide details in App. A).
+
+Towards learning multi-scale features, $G$ is designed as a residual network containing $N$ models to produce a pyramid of flow fields $\phi_{s\rightarrow d} = \{\phi_i\}_{1}^N$ in different layers of $G_{f}$ . Multi-scale source features $x_{s}^{enc} = \{x_{i}^{enc}\}_{1}^{N}$ are obtained from $E$ and are warped in $G_{f}$ .
+
+However, as pointed out by Siarohin et al. (2019), only relying on $\phi_{s\rightarrow d}$ to warp source features is insufficient to precisely reconstruct driving images due to the existing occlusions in some positions of $x_{s}$ . In order to predict pixels in those positions, the network is required to inpaint the warped feature maps. Therefore, we predict multi-scale masks $\{m_i\}_{1}^N$ along with $\{\phi_i\}_{1}^N$ in $G_{f}$ to mask out the regions required to be inpainted. In each residual module, we have
+
+$$
+x _ {i} ^ {\prime} = \mathcal {T} \left(\phi_ {i}, x _ {i} ^ {e n c}\right) \odot m _ {i}, \tag {5}
+$$
+
+where $\odot$ denotes the Hadamard product and $\mathcal{T}$ denotes warping operation, whereas $x_{i}^{\prime}$ signifies the masked features. We generate both dense flow fields, as well as masks by letting each residual module output a 3-channel feature map in which the first two channels represent $\phi_{i}$ and the last channel $m_{i}$ . Based on an inpainted feature map $f(x_{i}^{\prime})$ , as well as an upsampled image $g(x_{i - 1})$ provided by the previous module in $G_{r}$ , the RGB image from each module is given by
+
+$$
+o _ {i} = f \left(x _ {i} ^ {\prime}\right) + g \left(o _ {i - 1}\right), \tag {6}
+$$
+
+where $f$ and $g$ denote the inpainting and upsampling layers, respectively. The output image $o_N$ from the last module constitutes the final generated image $x_{s\rightarrow d} = o_N$ .
+
+# 3.3 LEARNING
+
+We train LIA in a self-supervised manner to reconstruct $x_{d}$ using three losses, i.e., a reconstruction loss $\mathcal{L}_{recon}$ , a perceptual loss $\mathcal{L}_{vgg}$ (Johnson et al., 2016) and an adversarial loss $\mathcal{L}_{adv}$ . We use $\mathcal{L}_{recon}$ to minimize the pixel-wise $L_{1}$ distance between $x_{d}$ and $x_{s\rightarrow d}$ , calculated as
+
+$$
+\mathcal {L} _ {\text {r e c o n}} \left(x _ {s \rightarrow d}, x _ {d}\right) = \mathbb {E} \left[ \| x _ {d} - x _ {s \rightarrow d} \| _ {1} \right]. \tag {7}
+$$
+
+Towards minimizing the perceptual distance, we apply a VGG19-based $\mathcal{L}_{vgg}$ on multi-scale feature maps between real and generated images, written as
+
+$$
+\mathcal {L} _ {v g g} \left(x _ {s \rightarrow d}, x _ {d}\right) = \mathbb {E} \left[ \sum_ {n} ^ {N} \| F _ {n} \left(x _ {d}\right) - F _ {n} \left(x _ {s \rightarrow d}\right) \| _ {1} \right], \tag {8}
+$$
+
+where $F_{n}$ denotes the $n^{th}$ layer in a pre-trained VGG19 (Simonyan & Zisserman, 2015). In practice, towards penalizing real and generated images in multi-scale images, we use a pyramid of four resolutions, namely $256 \times 256$ , $128 \times 128$ , $64 \times 64$ and $32 \times 32$ as inputs of VGG19. The final perceptual loss is the addition of perceptual losses in four resolutions.
+
+Further, towards generating photo-realistic results, we incorporate a non-saturating adversarial loss $\mathcal{L}_{adv}$ on $x_{s\rightarrow d}$ , which is calculated as
+
+$$
+\mathcal {L} _ {a d v} \left(x _ {s \rightarrow d}\right) = \mathbb {E} _ {x _ {s \rightarrow d} \sim p _ {r e c}} \left[ \right. - l o g \left( \right.D \left(x _ {s \rightarrow d}\right)\left. \right], \left. \right. \tag {9}
+$$
+
+where $D$ is a discriminator, aimed at distinguishing reconstructed images from the original ones. Our full loss function is the combination of three losses with $\lambda$ as a balanced hyperparameter
+
+$$
+\mathcal {L} \left(x _ {s \rightarrow d}, x _ {d}\right) = \mathcal {L} _ {\text {r e c o n}} \left(x _ {s \rightarrow d}, x _ {d}\right) + \lambda \mathcal {L} _ {\text {v g g}} \left(x _ {s \rightarrow d}, x _ {d}\right) + \mathcal {L} _ {\text {a d v}} \left(x _ {s \rightarrow d}\right). \tag {10}
+$$
+
+# 3.4 INFERENCE
+
+In inference stage, given a driving video sequence $V_{d} = \{x_{t}\}_{1}^{T}$ , we aim to transfer motion from $V_{d}$ to $x_{s}$ , in order to generate a novel video $V_{d\rightarrow s} = \{x_{t\rightarrow s}\}_{1}^{T}$ . If $V_{d}$ and $x_{s}$ stem from the same video sequence, i.e., $x_{s} = x_{1}$ , our task comprises of reconstructing the entire original video sequence. Therefore, we construct the latent motion representation of each frame using absolute transfer, which follows the training process, given as
+
+$$
+z _ {s \rightarrow t} = z _ {s \rightarrow r} + w _ {r \rightarrow t}, t \in \{1, \dots , T \}. \tag {11}
+$$
+
+However, in real world applications, interest is rather placed on the scenario, where motion transfer between $x_{s}$ and $V_{d}$ , the latter stemming from different identities, i.e., $x_{s} \neq x_{1}$ . Taking a talking head video as an example, in this setting, beyond identity, $x_{1}$ and $x_{s}$ might also differ in pose and expression. Therefore, we propose relative transfer to eliminate the motion impact of $w_{r\rightarrow 1}$ and involve motion of $w_{r\rightarrow s}$ in the full generated video sequence. Owing to a linear representation of the latent path, we can easily represent $z_{s\rightarrow t}$ for each frame as
+
+$$
+\begin{array}{l} z _ {s \rightarrow t} = \left(z _ {s \rightarrow r} + w _ {r \rightarrow s}\right) + \left(w _ {r \rightarrow t} - w _ {r \rightarrow 1}\right) \tag {12} \\ = z _ {s \rightarrow s} + (w _ {r \rightarrow t} - w _ {r \rightarrow 1}), t \in \{1, \dots , T \}. \\ \end{array}
+$$
+
+The first term in Eq. (12), $z_{s \to s}$ indicates the reconstruction of $x_{s}$ , while the second term $(w_{r \to t} - w_{r \to 1})$ represents the motion from $x_{1}$ to $x_{t}$ . This equation indicates that the original pose is preserved in $x_{s}$ , at the same time motion is transferred from $V_{d}$ . We note that in order to completely replicate the position and pose in $V_{d}$ , it requires $x_{s}$ and $x_{1}$ to contain similar poses in relative motion transfer.
+
+# 4 EXPERIMENTS
+
+In this section, we firstly describe our experimental setup including implementation details and datasets. Secondly, we qualitatively demonstrate generated results based on testing datasets. Then, we provide quantitative evaluation w.r.t. image quality on (a) same-identity reconstruction, (b) cross-video motion transfer, presenting (c) a user study. Next, we conduct an ablation study that demonstrates (d) the effectiveness of our proposed motion dictionary, as well as (e) associated size. Finally, we provide an in-depth analysis of our (f) latent codes and (g) motion dictionary to interpret their semantic meanings.
+
+Datasets Our model is trained on the datasets VoxCeleb, TaichiHD and TED-talk. We follow the pre-processing method in (Siarohin et al., 2019) to crop frames into $256 \times 256$ resolution for quantitative evaluation.
+
+Implementation details Our model is implemented in PyTorch (Paszke et al., 2019). All models are trained on four 16G NVIDIA V100 GPUs. The total batch size is 32 with 8 images per GPU. We use a learning rate of 0.002 to train our model with the Adam optimizer (Kingma & Ba, 2014). The dimension of all latent codes, as well as directions in $D_{m}$ is set to be 512. In our loss function, we use $\lambda = 10$ in order to penalize more on the perceptual loss. It takes around 150 hours to fully train our framework.
+
+
+
+
+
+
+
+
+Source $(\mathbf{x}_s)$
+Figure 4: Qualitative results. Examples for same-dataset absolute motion transfer on TaichiHD (top-right) and TED-talk (bottom-right). On VoxCeleb (left), we demonstrate cross-dataset relative motion transfer. We successfully transfer motion between $x_{1}$ and $x_{t}$ from videos in VoxCeleb to $x_{s}$ from FFHQ, the latter not being used for training.
+
+
+
+
+
+
+
+
+FOMM
+
+
+
+
+
+
+
+
+MRAA
+
+
+
+
+
+
+
+
+Ours
+
+
+
+
+
+
+
+
+Starting $(\mathbf{x}_1)$
+
+
+
+
+
+
+
+
+Driving $(\mathbf{x}_c)$
+
+
+
+
+Ours
+
+
+
+
+
+MRAA
+
+
+MRAA
+AA
+Driving $(\mathbf{x}_i)$
+FOMM
+
+Source $(\mathbf{x}_s)$
+
+
+
+
+
+Source $(\mathbf{x}_s)$
+
+
+
+Driving $(\mathbf{x}_i)$
+
+
+FOMM
+
+Evaluation metrics We evaluate our model w.r.t. (i) reconstruction faithfulness using $\mathcal{L}_1$ , LPIPS, (ii) generated video quality using video FID, as well as (iii) semantic consistency using average keypoint distance (AKD), missing keypoint rate (MKR) and average euclidean distance (AED). Details are available in App. B.2.
+
+# 4.1 QUALITATIVE RESULTS
+
+Firstly, we evaluate the ability of LIA to generate realistic videos and compare related results with four state-of-the-art methods. For TaichiHD and TED-talk datasets, we conduct an experiment related to cross-video generation. Corresponding results (see Fig. 4) confirm that our method is able to correctly transfer motion on articulated human bodies, in the absence of explicit structure representations. For the VoxCeleb dataset, we conduct a cross-dataset generation-experiment, where we transfer motion from VoxCeleb to images of the FFHQ dataset. We observe that our method outperforms FOMM and MRAA w.r.t. image quality, as both approaches visibly deform the shape of the original faces. This is specifically notable in the case that source and driving images entail large pose variations. At the same time, LIA is able to successfully tackle this challenge and no similar deformations are visible.
+
+# 4.2 COMPARISON WITH STATE-OF-THE-ART METHODS
+
+We quantitatively compare our method with the state-of-the-art approaches X2Face, Monkey-Net, FOMM and MRAA on two tasks, namely (a) same-identity reconstruction and (b) cross-video motion transfer. Additionally, we conduct a (c) user study.
+
+(a) Same-identity reconstruction We here evaluate the reconstruction ability of our method. Specifically, we reconstruct each testing video by using the first frame as $x_{s}$ and the remaining frames as $x_{d}$ . Results on three datasets are reported in Table 1. Focusing on foreground-reconstruction, our method outperforms the other approaches w.r.t. all metrics. More results are presented in App. B.3, discussing background-reconstruction.
+(b) Cross-video motion transfer Next, we conduct experiments, where source images and driving videos stem from different video sequences. In this context, we mainly focus on evaluating talking head videos and explore two different cases. In the first case, we generate videos using the VoxCeleb testing set to conduct motion transfer. In the second case, source images are from an unseen dataset, namely the GermanPublicTV dataset, as we conduct cross-dataset motion transfer. In both experiments, we randomly construct source and driving pairs and transfer motion from driving videos to source images to generate a novel manipulated dataset. Since ground truth data for our generated videos is not available, we use video FID (as initialized by Wang et al. (2020a)) to
+
+Table 1: Same-identity reconstruction. Comparison with state-of-the-art methods on three datasets for same-identity reconstruction.
+
+| Method | VoxCeleb | TaichiHD | TED-talks |
| \( \mathcal{L}_1 \) | AKD | AED | LPIPS | \( \mathcal{L}_1 \) | (AKD, MKR) | AED | LPIPS | \( \mathcal{L}_1 \) | (AKD, MKR) | AED | LPIPS |
| X2Face | 0.078 | 7.687 | 0.405 | - | 0.080 | (17.654, 0.109) | - | - | - | - | - | - |
| Monkey-Net | 0.049 | 1.878 | 0.199 | - | 0.077 | (10.798, 0.059) | - | - | - | - | - | - |
| FOMM | 0.046 | 1.395 | 0.141 | 0.136 | 0.063 | (6.472, 0.032) | 0.495 | 0.191 | 0.030 | (3.759, 0.0090) | 0.428 | 0.13 |
| MRAA w/o bg | 0.043 | 1.307 | 0.140 | 0.127 | 0.063 | (5.626, 0.025) | 0.460 | 0.189 | 0.029 | (3.126, 0.0092) | 0.396 | 0.12 |
| Ours | 0.041 | 1.353 | 0.138 | 0.123 | 0.057 | (4.823, 0.020) | 0.431 | 0.180 | 0.027 | (3.141, 0.0095) | 0.399 | 0.11 |
+
+Table 2: Cross-video generation. We report video FID for both inner- and cross-dataset tasks on VoxCeleb and GermanPublicTV.
+
+ | VoxCeleb | GermanPublicTV |
| FOMM | 0.323 | 0.456 |
| MRAA | 0.308 | 0.454 |
| Ours | 0.161 | 0.406 |
+
+Table 3: User study. We ask 20 human raters to conduct a subjective video quality evaluation.
+
+ | VoxCeleb(%) | TaichiHD(%) | TED-talk(%) |
| Ours/FOMM | 92.9/7.1 | 64.5/35.5 | 71.4/28.6 |
| Ours/MRAA | 89.7/10.3 | 60.7/39.9 | 54.8/45.2 |
+
+compute the distance between generated and real data distributions. As shown in Tab. 2, our method outperforms all other approaches w.r.t. video FID, indicating the best generated video quality.
+
+(c) User study We conduct a user study to evaluate video quality. Towards this, we displayed paired videos and asked 20 human raters 'which clip is more realistic?' Each video-pair contains a generated video from our method, as well as a video generated from FOMM or MRAA. Results suggest that our results are more realistic in comparison to FOMM and MRAA across all three datasets (see Tab. 3). Hence, the obtained human preference is in accordance with our quantitative evaluation.
+
+Table 4: Ablation study on motion dictionary. We conduct experiments on three datasets with and without $D_{m}$ and show reconstruction results.
+
+| Method | VoxCeleb | TaichiHD | TED-talks |
| L1 | LPIPS | L1 | LPIPS | L1 | LPIPS |
| w/o Dm | 0.049 | 0.165 | 0.062 | 0.186 | 0.031 | 0.12 |
| Full | 0.041 | 0.123 | 0.057 | 0.180 | 0.028 | 0.11 |
+
+Table 5: Ablation study on $D_{m}$ size. We conduct experiments on three datasets with 5 different $D_{m}$ size and show reconstruction results.
+
+| M | VoxCeleb | TaichiHD | TED-talks |
| L1 | LPIPS | L1 | LPIPS | L1 | LPIPS |
| 5 | 0.051 | 0.15 | 0.070 | 0.22 | 0.037 | 0.15 |
| 10 | 0.043 | 0.13 | 0.065 | 0.20 | 0.036 | 0.13 |
| 20 | 0.041 | 0.12 | 0.057 | 0.18 | 0.028 | 0.11 |
| 40 | 0.042 | 0.12 | 0.060 | 0.19 | 0.030 | 0.12 |
| 100 | 0.041 | 0.12 | 0.058 | 0.18 | 0.028 | 0.11 |
+
+# 4.3 ABLATION STUDY
+
+We here analyze our proposed motion dictionary and focus on answering following two questions.
+
+(d) Is the motion dictionary $D_{m}$ beneficial? We here explore the impact of proposed $D_{m}$ , by training our model without $D_{m}$ . Specifically, we output $w_{r\rightarrow d}$ directly from MLP, without using LMD to learn an orthogonal basis. From the evaluation results reported in Tab. 4 and qualitative results in App. B.5, we observe that in the absence of $D_{m}$ , model fails to generate high-quality images, which proves the effectiveness of $D_{m}$ , consistently on all datasets.
+(e) How many directions are required in $D_{m}$ ? Towards finding an effective size of $D_{m}$ , we empirically test three different $M$ , viz. 5, 10, 20, 40 and 100. Quantitative results in Tab. 5 show that when using 20 directions, the model achieves the best reconstruction results.
+
+# 4.4 FURTHER ANALYSIS
+
+(f) Latent code analysis. While our method successfully transfers motion via latent space navigation, we here aim at answering the question — what does $x_r$ represent? Towards answering this question, we proceed to visualize $x_r$ . We firstly decode $z_{s \to r}$ into a dense flow field $\phi_{s \to r}$ , which is then used to warp $x_s$ (we show details in App. B.4). Fig. 5 shows examples of $x_s$ and $x_r$ . Interestingly, we observe that $x_r$ represents the canonical pose of $x_s$ , regardless of original poses of the subjects. And for all datasets, reference images resemble each other w.r.t. pose and scale. As such
+
+
+Figure 5: Visualization of reference images. Example source (top) and reference images (down) from VoxCeleb, TaichiHD and TED-talk datasets. Our network learns reference images of a consistently frontal pose, systematically for all input images of each dataset.
+
+
+Figure 6: Linear manipulation of four motion directions on the painting of Mona Lisa. Manipulated results indicate that $d_{6}$ represents eye movement, $d_{8}$ represents head nodding, whereas $d_{19}$ and $d_{7}$ represent facial expressions.
+
+reference images can be considered as a normalized form of $x_{s}$ , learning transformations between $x_{s}$ and $x_{d}$ using $x_{s} \to x_{r} \to x_{d}$ is considerably more efficient than $x_{s} \to x_{d}$ , once $x_{r}$ is fixed.
+
+Noteworthy, we found the similar idea of learning a 'reference image' has also been explored by Siarohin et al. (2019) (FOMM) and Wiles et al. (2018) (X2Face). However, deviating from our visualized 'reference image', the 'reference image' in FOMM refers to a non-visualized and abstract concept. In addition, LIA only requires a latent code $z_{s \rightarrow r}$ , rather than the 'reference image' for both, training and testing, which is contrast to X2Face.
+
+(g) Motion dictionary interpretation. Towards further interpretation of directions in $D_{m}$ , we conduct linear manipulations on each $d_{i}$ . Images pertained to manipulating four motion directions are depicted in Fig. 6. The results suggest that the directions in $D_{m}$ are semantically meaningful, as they represent basic visual transformations such as head nodding ( $d_{8}$ ), eye movement ( $d_{6}$ ) and facial expressions ( $d_{19}$ and $d_{7}$ ). More results can be found on our project webpage2.
+
+# 5 CONCLUSIONS
+
+In this paper, we presented a novel self-supervised autoencoder LIA, aimed at animating images via latent space navigation. By the proposed Linear Motion Decomposition (LMD), we were able to formulate the task of transferring motion from driving videos to source images as learning linear transformations in the latent space. We evaluated proposed method on real-world videos and demonstrated that our approach is able to successfully animate still images, while eliminating the necessity of explicit structure representations. In addition, we showed that the incorporated motion dictionary is interpretable and contains directions pertaining to basic visual transformations. Both quantitative and qualitative evaluations showed that LIA outperforms state-of-art algorithms on all benchmarks. We postulate that LIA opens a new door in design of interpretable generative models for video generation.
+
+# ETHIC STATEMENT
+
+In this work, we aim to synthesize high-quality videos by transferring motion on still images. Our approach can be used for movie production, making video games, online education, generating synthetic data for other computer vision tasks, etc. We note that our framework mainly focuses on learning how to model motion distribution rather than directly model appearance, therefore it is not biased towards any specific gender, race, region, or social class. It works equally well irrespective of the difference in subjects.
+
+# REPRODUCIBILITY STATEMENT
+
+We assure that all the results shown in the paper and supplemental materials can be reproduced. We intend to open-source our code, as well as trained models.
+
+# ACKNOWLEDGEMENTS
+
+This work was granted access to the HPC resources of IDRIS under the allocation AD011011627R1. It was supported by the French Government, by the National Research Agency (ANR) under Grant ANR-18-CE92-0024, project RESPECT and through the 3IA Côte d'Azur Investments in the Future project managed by the National Research Agency (ANR) with the reference number ANR-19-P3IA-0002.
+
+# REFERENCES
+
+Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan++: How to edit the embedded images? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
+Brandon Amos, Bartosz Ludwiczuk, and Mahadev Satyanarayanan. Openface: A general-purpose face recognition library with mobile applications. Technical report, CMU-CS-16-118, CMU School of Computer Science, 2016.
+Sarthak Bhagat, Shagun Uppal, Zhuyun Yin, and Nengli Lim. Disentangling multiple features in video sequences using gaussian processes in variational autoencoders. In ECCV, 2020.
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In ICLR, 2019.
+Adrian Bulat and Georgios Tzimiropoulos. How far are we from solving the 2d & 3d face alignment problem? (and a dataset of 230,000 3d facial landmarks). In ICCV, 2017.
+Chen Cao, Qiming Hou, and Kun Zhou. Displaced dynamic expression regression for real-time facial tracking and animation. ACM Transactions on graphics (TOG), 33(4):1-10, 2014.
+Z. Cao, G. Hidalgo Martinez, T. Simon, S. Wei, and Y. A. Sheikh. Openpose: Realtime multi-person 2d pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019.
+Caroline Chan, Shiry Ginosar, Tinghui Zhou, and Alexei A Efros. Everybody dance now. In ICCV, 2019.
+Hao Chen, Yaohui Wang, Benoit Lagadec, Antitza Dantcheva, and Francois Bremond. Joint generative and contrastive learning for unsupervised person re-identification. In CVPR, 2021.
+J. S. Chung, A. Nagrani, and A. Zisserman. Voxceleb2: Deep speaker recognition. In INTER-SPEECH, 2018.
+Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019.
+
+Emily L Denton and vighnesh Birodkar. Unsupervised learning of disentangled representations from video. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), NeurIPS, 2017.
+Lore Goetschalckx, Alex Andonian, Aude Oliva, and Phillip Isola. Ganalyze: Toward visual definitions of cognitive image properties. In ICCV, pp. 5744-5753, 2019.
+Kensho Hara, Hirokatsu Kataoka, and Yutaka Satoh. Can spatiotemporal 3d cnns retrace the history of 2d cnns and imagenet? In CVPR, 2018.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In NIPS, 2017.
+Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-Image Translation with Conditional Adversarial Networks. In CVPR, 2017.
+Ali Jahanian, Lucy Chai, and Phillip Isola. On the "steerability" of generative adversarial networks. In ICLR, 2020.
+Yunseok Jang, Gunhee Kim, and Yale Song. Video Prediction with Appearance and Motion Conditions. In ICML, 2018.
+Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision, pp. 694-711. Springer, 2016.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019.
+Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In CVPR, 2020a.
+Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In CVPR, 2020b.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems, 2012.
+Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang. Flow-grounded spatial-temporal video prediction from still images. In ECCV, 2018.
+Yingzhen Li and Stephan Mandt. Disentangled sequential autoencoder. ICML, 2018.
+Wen Liu, Zhixin Piao, Jie Min, Wenhan Luo, Lin Ma, and Shenghua Gao. Liquid warping gan: A unified framework for human motion imitation, appearance transfer and novel view synthesis. In CVPR, 2019.
+Arsha Nagrani, Joon Son Chung, Weidi Xie, and Andrew Zisserman. Voxceleb: Large-scale speaker verification in the wild. Computer Science and Language, 2019.
+Katsunori Ohnishi, Shohei Yamamoto, Yoshitaka Ushiku, and Tatsuya Harada. Hierarchical video generation from orthogonal information: Optical flow and texture. In AAAI, 2018.
+Junting Pan, Chengyu Wang, Xu Jia, Jing Shao, Lu Sheng, Junjie Yan, and Xiaogang Wang. Video generation from single semantic label map. arXiv preprint arXiv:1903.04480, 2019.
+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. 2019.
+William Peebles, John Peebles, Jun-Yan Zhu, Alexei A. Efros, and Antonio Torralba. The hessian penalty: A weak prior for unsupervised disentanglement. In Proceedings of European Conference on Computer Vision (ECCV), 2020.
+
+JK Rowling. Harry potter. The 100 Greatest Literary Characters, pp. 183, 2019.
+Joanne Kathleen Rowling, John Tiffany, and Jack Thorne. Harry Potter and the Cursed Child-Parts One and Two (Special Rehearsal Edition). Pottermore Publishing, 2016.
+Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In ICCV, 2017.
+Yujun Shen and Bolei Zhou. Closed-form factorization of latent semantics in gans. In CVPR, 2021.
+Yujun Shen, Jinjin Gu, Xiaou Tang, and Bolei Zhou. Interpreting the latent space of gans for semantic face editing. In CVPR, 2020.
+Aliaksandr Siarohin, Stéphane Lathuilière, Sergey Tulyakov, Elisa Ricci, and Nicu Sebe. First order motion model for image animation. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), NeurIPS. Curran Associates, Inc., 2019.
+Aliaksandr Siarohin, Oliver Woodford, Jian Ren, Mengei Chai, and Sergey Tulyakov. Motion representations for articulated animation. In CVPR, 2021.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015.
+Justus Thies, Michael Zollhofer, Marc Stamminger, Christian Theobalt, and Matthias Nießner. Face2face: Real-time face capture and reenactment of RGB videos. In CVPR, 2016.
+Justus Thies, Michael Zollhöfer, and Matthias Nießner. Deferred neural rendering: Image synthesis using neural textures. ACM Transactions on Graphics (TOG), 38(4):1-12, 2019.
+Justus Thies, Mohamed Elgharib, Ayush Tewari, Christian Theobalt, and Matthias Nießner. Neural voice puppetry: Audio-driven facial reenactment. ECCV, 2020.
+Yu Tian, Jian Ren, Mengei Chai, Kyle Olszewski, Xi Peng, Dimitris N. Metaxas, and Sergey Tulyakov. A good image generator is what you need for high-resolution video synthesis. In *ICLR*, 2021.
+Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. MoCoGAN: Decomposing motion and content for video generation. In CVPR, 2018.
+Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In NIPS, 2016.
+Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the gan latent space. arXiv preprint arXiv:2002.03754, 2020.
+Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In ICCV, 2017.
+Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In NeurIPS, 2018.
+Ting-Chun Wang, Ming-Yu Liu, Andrew Tao, Guilin Liu, Jan Kautz, and Bryan Catanzaro. Few-shot video-to-video synthesis. In NeurIPS, 2019.
+Ting-Chun Wang, Arun Mallya, and Ming-Yu Liu. One-shot free-view neural talking-head synthesis for video conferencing. In CVPR, 2021a.
+Ting-Chun Wang, Arun Mallya, and Ming-Yu Liu. One-shot free-view neural talking-head synthesis for video conferencing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021b.
+Yaohui Wang. Learning to Generate Human Videos. Theses, Inria - Sophia Antipolis; Université Cote d'Azur, September 2021.
+Yaohui Wang, Piotr Bilinski, Francois Bremond, and Antitza Dantcheva. G3AN: Disentangling appearance and motion for video generation. In CVPR, 2020a.
+Yaohui Wang, Piotr Bilinski, Francois F Bremond, and Antitza Dantcheva. ImaGINator: Conditional Spatio-Temporal GAN for Video Generation. In WACV, 2020b.
+
+Yaohui Wang, Francois Bremond, and Antitza Dantcheva. Inmodegan: Interpretable motion decomposition generative adversarial network for video generation. arXiv preprint arXiv:2101.03049, 2021c.
+Olivia Wiles, A Koepke, and Andrew Zisserman. X2face: A network for controlling face generation using images, audio, and pose codes. In Proceedings of the European conference on computer vision (ECCV), pp. 670-686, 2018.
+Jianwen Xie, Ruiqi Gao, Zilong Zheng, Song-Chun Zhu, and Ying Nian Wu. Motion-based generator model: Unsupervised disentanglement of appearance, trackable and intractable motions in dynamic patterns. In AAAI, 2020.
+Ceyuan Yang, Zhe Wang, Xinge Zhu, Chen Huang, Jianping Shi, and Dahua Lin. Pose guided human video generation. In ECCV, 2018.
+Zhuoqian Yang, Wentao Zhu, Wayne Wu, Chen Qian, Qiang Zhou, Bolei Zhou, and Chen Change Loy. Transmomo: Invariance-driven unsupervised video motion retargeting. In CVPR, 2020.
+Egor Zakharov, Aliaksandra Shysheya, Egor Burkov, and Victor Lempitsky. Few-shot adversarial learning of realistic neural talking head models. In ICCV, 2019.
+Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
+Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris Metaxas. Learning to forecast and refine residual motion for image-to-video generation. In ECCV, 2018.
+Zhedong Zheng, Tao Ruan, Yunchao Wei, Yi Yang, and Tao Mei. Vehiclenet: Learning robust visual representation for vehicle re-identification. IEEE Transaction on Multimedia (TMM), 2020.
+Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. In Proceedings of European Conference on Computer Vision (ECCV), 2020.
+
+# A DETAILS OF MODEL ARCHITECTURE
+
+We proceed to describe the model architecture in this section. Fig. 7 shows details of our $E$ . In each ResBlock in $E$ , spatial size of input feature maps are downsampled. We take feature maps of spatial sizes from $8 \times 8$ to $256 \times 256$ as our appearance features $x_{i}^{enc}$ . We use a 5-layer MLP to predict a magnitude vector $A_{d \to r}$ from $z_{d \to r}$ . Fig. 8 (a) shows the general architecture of our $G$ , which consists of two components, a flow field generator $G_{f}$ and a refinement network $G_{r}$ . We apply StyleConv (Upsample + Conv3 × 3), which is proposed by StyleGAN2, in $G_{f}$ . StyleConv takes latent representation $z_{s \to t}$ as style code and generates flow field $\phi_{i}$ and corresponding mask $m_{i}$ . $G_{r}$ uses UpConv (Conv1 × 1 + Upsample) to upsample and refine inpainted feature maps to target resolution. We show details pertaining to $G$ block in Fig. 8 (b). Each $G$ block is used to upsample ×2 the previous resolution. We stack 6 blocks towards producing 256 resolution images.
+
+
+(a) Encoder
+
+
+(b) ResBlock
+Figure 7: Encoder architecture. We show details of architecture of $E$ in (a) and ResBlock in (b).
+
+# B EXPERIMENTS
+
+We proceed to introduce details of datasets and evaluation metrics used in our experiments.
+
+# B.1 DATASETS
+
+VoxCeleb (Nagrani et al., 2019) consists of a large amount of interview videos of different celebrities. Following the process of FOMM (Siarohin et al., 2019), we extract frames and crop them into $256 \times 256$ resolution. In total, VoxCeleb contains a training set of 17928 videos and a test set of 495 videos.
+
+
+(a) Generator architecture
+
+
+(b) G Block
+Figure 8: Generator architecture. We show details about architecture of $G$ in (a) and $G$ block in (b).
+
+TaiChiHD (Siarohin et al., 2019) consists of videos of full human bodies performing Tai Chi actions. We follow the original pre-processing of FOMM (Siarohin et al., 2019) and utilize its $256 \times 256$ version. TaiChiHD contains 1096 training videos and 115 testing videos.
+
+TED-talk is a new dataset proposed in MRAA (Siarohin et al., 2021). It comprises a number of TED-talk videos, where the main subjects have been cropped out. We resize the original version into $256 \times 256$ resolution to train our model. This dataset includes 1124 training videos and 130 testing videos.
+
+# B.2 EVALUATION METRICS
+
+We use five different metrics to evaluate our experimental results, namely $\mathcal{L}_1$ , LPIPS, AKD, MKR and AED that quantify the reconstructed results. In addition, we compute video FID to evaluate video quality in motion transferring tasks.
+
+$\mathcal{L}_1$ represents the mean absolute pixel difference between reconstructed and real videos.
+
+LPIPS (Zhang et al., 2018) aims at measuring the perceptual similarity between reconstructed and real images by leveraging the deep features from AlexNet (Krizhevsky et al., 2012).
+
+Video FID is a modified version of the original FID (Heusel et al., 2017). We here follow the same implementation as Wang et al. (2020a) and utilize a pre-trained ResNext101 (Hara et al., 2018) to extract spatio-temporal features to compute the distance between real and generated videos distributions. We take the first 100 frames of each video as input of the feature-extractor to compute the final scores.
+
+Average keypoint distance (AKD) and missing keypoint rate (MKR) evaluate the difference between keypoints of reconstructed and ground truth videos. We extract landmarks using the face alignment approach of (Bulat & Tzimiropoulos, 2017) and extract body poses for both TaiChiHD and TED-talks using OpenPose (Cao et al., 2019). AKD is computed as the average distance between corresponding keypoints, whereas MKR is the proportion of keypoints present in the ground-truth that are missing in a reconstructed video.
+
+Average Euclidean distance (AED) measures the ability of preserving identity in reconstructed video. We use a person re-identification pretrained model (Zheng et al., 2020) for measuring human bodies (TaichiHD and TED-talk) and OpenFace (Amos et al., 2016) for faces to extract identity embeddings from reconstructed and ground truth frame pairs, then we compute MSE of their difference for all pairs.
+
+# B.3 COMPARISON WITH FULL MRAA
+
+We show quantitative evaluation results with the full MRAA model in Tab. 6. We observe that our method achieves competitive results in reconstruction and keypoint evaluation. While we do not explicitly predict keypoints, w.r.t. the TaichiHD dataset, interestingly we outperform MRAA in both, AKD and MKR. Such results showcase the effectiveness of our proposed method on modeling articulated human structures. However, reconstruction evaluation cannot provide a completely fair comparison on how well the main subjects (e.g., faces and human bodies) are generated in videos. This is in particular the case for TaichiHD and TED-talk, where backgrounds have large contributions to the final scores.
+
+Table 6: Comparison with full MRAA.
+
+| Method | VoxCeleb | TaichiHD | TED-talks |
| \( \mathcal{L}_1 \) | AKD | AED | LPIPS | \( \mathcal{L}_1 \) | (AKD, MKR) | AED | LPIPS | \( \mathcal{L}_1 \) | (AKD, MKR) | AED | LPIPS |
| MRAA | 0.041 | 1.303 | 0.135 | 0.124 | 0.045 | (5.551, 0.025) | 0.431 | 0.178 | 0.027 | (3.107, 0.0093) | 0.379 | 0.11 |
| Ours | 0.041 | 1.353 | 0.138 | 0.123 | 0.057 | (4.823, 0.020) | 0.431 | 0.180 | 0.027 | (3.141, 0.0095) | 0.399 | 0.11 |
+
+# B.4 REFERENCE IMAGE GENERATION.
+
+To produce $x_{r}$ , we use $G$ to decode $z_{s\rightarrow r}$ into the flow field $\phi_{s\rightarrow r}$ . Reference image $x_{r}$ is obtained by warping $x_{s}$ using $\phi_{s\rightarrow r}$ . The entire process is shown in Fig. 9.
+
+
+Figure 9: Reference image generation.
+
+# B.5 QUALITATIVE RESULTS ON EFFECTIVENESS OF USING MOTION DICTIONARY
+
+Fig. 10 illustrates the generated results on transferring motion from VoxCeleb to GermanPublicTV with and without motion dictionary. We observe that without the motion dictionary, appearance information is undesirably transferred from driving videos to generated videos.
+
+# B.6 LIMITATIONS
+
+For human body, one limitation of our method is dealing with body occlusion. We observe in Fig. 11 that in taichi videos, in case of occlusion cause by legs and arms, motion is not transferred successfully. In addition, in TED-talks, transferring hand motion is challenging, as hands are of small size, articulated and sometimes occluded by human bodies.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Xd
+
+
+w/o dictionary
+
+
+with dictionary
+
+
+Xs
+Figure 10: Generated results with and without $D_{m}$ . We observe that the disentanglement of appearance and motion is much better by using $D_{m}$ .
+
+
+
+
+TaichiHD
+
+
+Driving
+
+
+
+
+TED-talks
+
+
+
+
+Figure 11: Failure cases. We observed that it is still challenging for LIA to handle arm-leg occlusion (Taichi) and hand motion (TED-talk).
+
+
+
+
+Generated results
+
+
+
+
+
+
\ No newline at end of file
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/images.zip b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..975eef5c811748a9fdc388d5f7fc8600df4e1ed2
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:122f5a0873bf444df3136e87ed8a8b55bec383a46d000738195bcf73ca22d06d
+size 897707
diff --git a/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/layout.json b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0851d3fd8267f7b30efd12cc62085dcc297d3ac5
--- /dev/null
+++ b/latentimageanimatorlearningtoanimateimagesvialatentspacenavigation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e22bdd35b2889130d571ea19aa8a6de1d8a89ae737853719544975cba910955
+size 746363
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_content_list.json b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..0b8b56f0651f891de7c2a0a6ca1864e8da496f27
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4eceff62427efb1624993384f231a4cf906bdae7249c7a284b1ddfd653d9b666
+size 111519
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_model.json b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4d2535f4eb1f6cce8310af1a475a1a5ff7dbcc98
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c1063e9f4cc1379ddb3a7186528f8cdb82f78d94b4a628a167763a5253ee915
+size 134187
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_origin.pdf b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ca368423afe11b3ced7e15bc8a391a7dd4d62c27
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/23299844-bdbd-4e2c-9ae4-a4c75f21c1d6_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:df01ab9560f4b369e371898e4138a518cb4902ad129588c53666101ceb7792b3
+size 963103
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/full.md b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..bc879ef229ba22e679489da508d1f06330ab4aec
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/full.md
@@ -0,0 +1,424 @@
+# LEARNABILITY LOCK: AUTHORIZED LEARNABILITY CONTROL THROUGH ADVERSARIAL INVERTIBLE TRANSFORMATIONS
+
+Weiqi Peng
+
+Yale University
+
+weiqi.peng@yale.edu
+
+Jinghui Chen
+
+Pennsylvania State University
+
+jzc5917@psu.edu
+
+# ABSTRACT
+
+Owing much to the revolution of information technology, the recent progress of deep learning benefits incredibly from the vastly enhanced access to data available in various digital formats. However, in certain scenarios, people may not want their data being used for training commercial models and thus studied how to attack the learnability of deep learning models. Previous works on learnability attack only consider the goal of preventing unauthorized exploitation on the specific dataset but not the process of restoring the learnability for authorized cases. To tackle this issue, this paper introduces and investigates a new concept called "learnability lock" for controlling the model's learnability on a specific dataset with a special key. In particular, we propose adversarial invertible transformation, that can be viewed as a mapping from image to image, to slightly modify data samples so that they become "unlearnable" by machine learning models with negligible loss of visual features. Meanwhile, one can unlock the learnability of the dataset and train models normally using the corresponding key. The proposed learnability lock leverages class-wise perturbation that applies a universal transformation function on data samples of the same label. This ensures that the learnability can be easily restored with a simple inverse transformation while remaining difficult to be detected or reverse-engineered. We empirically demonstrate the success and practicability of our method on visual classification tasks.
+
+# 1 INTRODUCTION
+
+Recent progress in deep learning empowers the application of artificial intelligence in various domains such as computer vision (He et al., 2016), speech recognition (Hinton et al., 2012), natural language processing (Devlin et al., 2018) and etc. While the massive amounts of publicly available data lead to the successful AI systems in practice, one major concern is that some of them may be illegally exploited without authorization. In fact, many commercial models nowadays are trained with unconsciously collected personal data from the Internet, which raises people's awareness on the unauthorized data exploitation for commercial or even illegal purposes.
+
+For people who share their data online (e.g., upload selfie photos to social networks), there is not much they can do to prevent their data from being illegally collected for commercial use (e.g. training commercial machine learning models). To address such concern, recent works propose Learnability Attack (Fowl et al., 2021a; Huang et al., 2021; Fowl et al., 2021b), which adds invisible perturbations to the original data to make it "unlearnable" such that the model trained on the perturbed dataset has awfully low prediction accuracy. Specifically, these methods generate either sample-wise or class-wise adversarial perturbations to prevent machine learning models from learning meaningful information from the data. This task is similar to traditional data poisoning attack, except that there is an additional requirement that the perturbation noise should be invisible and hard-to-notice by human eyes. And when the model trained on the perturbed dataset is bad enough, it won't even be considered as a realistic inference model by the unauthorized user for any purposes.
+
+However, the previous works on learnability attack only consider the goal of making the perturbed dataset "unlearnable" to unauthorized users, while in certain scenarios, we also want the authorized
+
+users to access and retrieve the clean data from the unlearnable counterparts. For example, photographers or artists may want to add unlearnable noise to their work before sharing it online to protect it from being illegally collected to train commercial models. Yet they also want authorized users (e.g., people who paid for the copyrights) to obtain access to their original work. In this regard, the existing methods (Fowl et al., 2021a; Huang et al., 2021; Fowl et al., 2021b) have the following major drawbacks: (1) sample-wise perturbation does not allow authorized clients to recover to original data for regular use, i.e., restore the learnability; (2) class-wise perturbation can be easily detected or reverse engineered since it applies the same perturbation for all data in one class; (3) the unlearnable performances are significantly worse for adversarial training based learning algorithms, making the perturbed data, to a certain extent, "learnable" again.
+
+To tackle these issues, we introduce the novel concept of Learnability Lock, a learnability control technique to perturb the original data with adversarial invertible transformations. To meet our goal, a DNN model trained on the perturbed dataset should have a reasonably bad performance for various training schedules such that none of the trained models can be effectively deployed for an AI system. The perturbation noises should also be both invisible and diverse against visual inspections. In addition, the authorized users should be able to use the correct key to retrieve the original data and restore their learnability.
+
+In particular, we creatively adopt a class-wise invertible functional perturbation where one transformation is applied to each class as a mapping from images to images. In this sense, the key for the learnability control process is defined as the parameters of the transformation function. For an authorized user, the inverse transformation function can be easily computed with the given key, and thus retrieving the original clean dataset. We focus our method on class-wise noise rather than sample-wise noise because we want the key, i.e., parameters of the transformation function, to be lightweight and easily transferable. Note that different from traditional additive noises (Fowl et al., 2021a; Huang et al., 2021; Fowl et al., 2021b), even the same transformation function would produce different perturbations on varying samples. Therefore, it is still difficult for an attacker to reverse-engineer the perturbation patterns as a counter-measure.
+
+We summarize our contributions as follows:
+
+- We introduce a novel concept Learnability Lock, that can be applied to the scenario of learnability control, where only the authorized clients can access the key in order to train their models on the retrieved clean dataset while unauthorized clients cannot learn meaningful information from the released data that appears normal visually.
+- We creatively apply invertible functional perturbation for crafting unlearnable examples, and propose two efficient functional perturbation algorithms. The functional perturbation is more suited to crafting class-wise noises while allowing different noise patterns across samples to avoid being detected or reverse engineered.
+- We empirically demonstrate that our pipeline works on common image datasets and is more robust to defensive techniques such as adversarial training than prior additive perturbation methods (Fowl et al., 2021a; Huang et al., 2021; Fowl et al., 2021b).
+
+# 2 RELATED WORK
+
+Adversarial Attack One closely related topic is adversarial attack (Goodfellow et al., 2015; Papernot et al., 2017). Earlier studies have shown that deep neural networks can be deceived by small adversarially designed perturbations (Szegedy et al., 2013; Madry et al., 2017). Later on, various attacks (Carlini & Wagner, 2017; Chen et al., 2017; Ilyas et al., 2018; Athalye et al., 2018; Chen et al., 2020; Moon et al., 2019; Croce & Hein, 2020; Tashiro et al., 2020; Andriushchenko et al., 2020; Chen & Gu, 2020) were also proposed for different settings or stronger performances. Laidlaw & Feizi (2019) proposes a functional adversarial attack that applies a unique color mapping function for crafting functional perturbation patterns. It is proved in Laidlaw & Feizi (2019) that even a simple linear transformation can introduce more complex features than additive noises. On the defensive side, adversarial training has been shown as the most efficient technique for learning robust features minimally affected by the adversarial noises (Madry et al., 2018; Zhang et al., 2019a).
+
+Data Poisoning Different from adversarial evasion attacks which directly evade a model's predictions, data poisoning focuses on manipulating samples at training time. Under this setting, the
+
+attacker injects bad data samples into the training pipeline so that whatever pattern the model learns becomes useless. Previous works have shown that DNNs (Muñoz-González et al., 2017) as well as traditional machine learning algorithms, such as SVM (Biggio et al., 2012), are vulnerable to poisoning attacks (Shafahi et al., 2018; Koh et al., 2018). Recent progress involves using gradient matching and meta-learning inspired methods to solve the noise crafting problem (Geiping et al., 2020; Huang et al., 2020). One special type of data poisoning is backdoor attacks, which aim to inject falsely labeled training samples with a stealthy trigger pattern (Gu et al., 2017; Qiao et al., 2019). During the inference process, inputs with the same trigger pattern shall cause the model to predict incorrect labels. While poisoning methods can potentially be used to prevent malicious data exploitation, the practicability is limited as the poisoned samples appear distinguishable to clean samples (Yang et al., 2017).
+
+Learnability Attack Learnability attack methods emerge recently in the ML community with a similar purpose as data poisoning attacks (to reduce model's prediction accuracy) but with an extra requirement to preserve the visual features of the original data. Huang et al. (2021) firstly present a form of error-minimizing noise, effective both sample-wise and class-wise, that forces a deep learning model to learn useless features and thus behave badly on clean samples. Specifically, the noise crafting process involves solving a bi-level objective through projected gradient descent (Madry et al., 2018). Fowl et al. (2021b) resolves a similar problem using gradient matching technique. In another work, they note that adversarial attacks can also be used for data poisoning (Fowl et al., 2021a). In comparison, our method concerns a novel target as "learnability control", where authorized user is granted access to retrieve the clean data and train their model on it.
+
+# 3 METHOD
+
+# 3.1 PROBLEM DEFINITION
+
+We focus on the scenario where the data for releasing is intentionally poisoned by the data holder to lock its learnability. In particular, a model trained on the learnability locked dataset by unauthorized users should have awfully low performances on the standard test cases. On the other hand, authorized clients with the correct keys can unlock the learnability of the dataset and train useful models. In designing a secure learnability control approach for our needs, we assume the data holder has full access to the clean data, but cannot interfere with the training procedure after the dataset is released. We also assume that the dataset to be released is fully labeled. Let's denote the original clean dataset with $n$ samples as $D_{c} = \{(\mathbf{x}_{i},y_{i})\}_{i = 1}^{n}$ . Our goal is to develop a method that succeeds in the following tasks:
+
+A. Given $D_{c}$ , craft the learnability-locked dataset $D_{p} = \{(\mathbf{x}_{i}^{\prime},y_{i})\}_{i = 1}^{n}$ with a special key $\psi$
+B. Given $D_p$ and the corresponding key $\psi$ , recover the clean dataset as $D_{\widetilde{c}}$ , which restores the learnability of $D_c$ .
+
+
+Figure 1: Authorized learnability control pipeline, with $g_{\psi}$ being a perturbation function where $\psi$ serves as the key for the learnability lock. (a) demonstrates the case of an illegal exploitation attempt where the unauthorized client trains a model on the learnability-locked dataset; In (b) an authorized user can unlock the protected dataset with the inverse transformations and train a normal model.
+
+Now we design a novel method that introduces functional perturbations to generate learnability locked data samples. For simplicity, let's consider the common supervised image classification
+
+task with the goal of training a K-class classifier $f_{\theta} : \mathcal{X} \to \mathcal{Y}$ with a labeled dataset. With a little abuse of notations, we define a set of $K$ perturbation functions $\{g^{(1)}, \dots, g^{(K)}\}$ for each class $y \in \{1, \dots, K\}$ . Each perturbation function $g^{(y)} : \mathcal{X} \to \mathcal{X}$ maps the original data $\mathbf{x}$ to a new one $\mathbf{x}'$ through an invertible transformation while the changes remain unnoticeable, i.e., $\mathbf{x}'^{(y)} = g^{(y)}(\mathbf{x})$ and $\| \mathbf{x}' - \mathbf{x} \|_{\infty} \leq \epsilon$ . Let's use $\psi$ to denote the parameters of the transformation function, which also served as the key for unlocking the learnability of the dataset. To solve for the most effective transformation function for locking the learnability, we formulate the problem as a min-min bi-level optimization problem for each class $y$ :
+
+$$
+\underset {\boldsymbol {\theta}} {\operatorname {a r g m i n}} \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {c}} \left[ \underset {\psi} {\min } \mathcal {L} \left(f _ {\boldsymbol {\theta}} \left(g _ {\psi} ^ {(y)} (\mathbf {x})\right), y\right) \right] \quad \text {s . t .} \| g _ {\psi} ^ {(y)} (\mathbf {x}) - \mathbf {x} \| _ {\infty} \leq \epsilon , \tag {3.1}
+$$
+
+where $\theta$ , the model for noise generation, is trained from scratch and $\psi$ , the parameters of the perturbation function, is also initialized as identical mapping.
+
+Intuitively, the inner minimization will generate a perturbation such that the perturbed data is well fit the current model. Thus in the outer minimization task, the model is tricked into believing that the current parameters are perfect and there is little left to be learned. Therefore, such perturbations can make the model fail in learning useful features from data. Finally, training on such perturbed dataset will lead to a model that heavily relies on the perturbation noise. And when testing the model on clean samples, it cannot judge based on the noise pattern and thus makes wrong predictions. (3.1) can be solved via an alternating strategy: first solving the inner minimization problem to obtain the best $\psi$ that minimizes the training loss, then solving the outer minimization for better $\theta$ . Ideally, if (3.1) can be well optimized, the perturbations generated by $g_{\psi}^{(y)}(\cdot)$ should fulfill task A of crafting unlearnable samples.
+
+Compared with Huang et al. (2021), the main difference is that we define the inner optimization as solving the transformation function parameters $\psi$ instead of a set of fixed perturbation vectors. This brings us unique challenges in designing the form of the perturbation functions $g_{\psi}^{(y)}(\cdot)$ . Specifically, to fulfill task B, the perturbation function $g$ is required to be invertible (i.e. $g^{-1}$ exists), which means it maps every input to a unique output and vice versa. Moreover, the magnitude of perturbation should be bounded so that it will not affect normal use, i.e., $\| g_{\psi}^{(y)}(\mathbf{x}) - \mathbf{x}\|_{\infty} \leq \epsilon$ . This constraint may seem easy for generating adversarial examples but not quite obvious for building invertible transformations. Finally, it requires a careful balance between the transformation's parameter size and its expressive power: it should be complicated enough to provide various perturbations for solving (3.1) and also be relatively lightweight for efficiently transferring to the authorized clients.
+
+In the following section, we present two plausible perturbation functions that could satisfy the aforementioned properties. One is based on linear transformation and the other one is convolution-based nonlinear transformation.
+
+# 3.1.1 LINEAR FUNCTIONAL PERTURBATION
+
+We start by considering a linear transformation function where $g_{\psi}^{(y)}(\cdot)$ consists of simple elementwise linear mappings over input data $\mathbf{x}_i \in \mathbb{R}^d$ drawn from $D_c$ . We define the linear weights $\mathbf{W} = \{\mathbf{w}^{(1)}, \dots, \mathbf{w}^{(K)}\}$ , with each $\mathbf{w}^{(y)} \in \mathbb{R}^d$ , and biases $\mathbf{B} = \{\mathbf{b}^{(1)}, \dots, \mathbf{b}^{(K)}\}$ , with each $\mathbf{b}^{(y)} \in \mathbb{R}^d$ . We denote the overall parameters $\boldsymbol{\psi} = \{\mathbf{W}, \mathbf{B}\}$ . For each $(\mathbf{x}_i, y_i) \in D_c$ , we leverage an invertible transformation as:
+
+$$
+\mathbf {x} _ {i} ^ {\prime} = g _ {\boldsymbol {\psi}} ^ {(y _ {i})} \left(\mathbf {x} _ {i}\right) = \mathbf {w} ^ {(y _ {i})} \odot \mathbf {x} _ {i} + \mathbf {b} ^ {(y _ {i})}, \tag {3.2}
+$$
+
+where $\odot$ denotes element-wise multiplication. Note that the above transformation is class-wise, where weights $\mathbf{w}$ and $\mathbf{b}$ are universal for each class label. Furthermore, for each index $j\in [d]$ we restrict $[\mathbf{w}^{(y)}]_j\in [1 - \epsilon /2,1 + \epsilon /2]$ , and $[\mathbf{b}^{(y)}]_j\in [-\epsilon /2,\epsilon /2]$ . This ensures that the perturbation on each sample shall be bounded by:
+
+$$
+\| \mathbf {x} _ {i} ^ {\prime} - \mathbf {x} _ {i} \| _ {\infty} = \max _ {j \in [ d ]} \left| [ \mathbf {w} ^ {(y)} ] _ {j} [ \mathbf {x} _ {i} ] _ {j} + [ \mathbf {b} ^ {(y)} ] _ {j} - [ \mathbf {x} _ {i} ] _ {j} \right| \leq \frac {\epsilon}{2} \max _ {j \in [ d ]} | [ \mathbf {x} _ {i} ] _ {j} | + \frac {\epsilon}{2} \leq \epsilon ,
+$$
+
+where the last inequality is due to $0 \leq [\mathbf{x}_i]_j \leq 1$ in the image classification task. Therefore, the linear function implicitly enforces the perturbation to satisfy the $\epsilon$ limit in $L_{\infty}$ distance. The whole crafting process is summarized in Algorithm 1.
+
+Algorithm 1 Learnability Locking (Linear)
+1: Inputs: Clean dataset $D_{c} = \{(\mathbf{x}_{i},y_{i})\}_{i = 1}^{n}$ , crafting model $f$ with parameters $\theta$ , all $\mathbf{w}_0 = 1$ and $\mathbf{b}_0 = \mathbf{0}$ perturbation bound $\epsilon$ , outer optimization step $I$ , inner optimization step $J$ , error rate $\lambda$ , loss function $L$
+2: while error rate $< \lambda$ do
+3: $D_{p}\gets$ empty dataset
+4: for $(\mathbf{x}_i,y_i)$ in $D_{c}$ do
+5: $\mathbf{x}_i^{\prime} = \mathbf{w}^{(y_i)}\odot \mathbf{x}_i + \mathbf{b}^{(y_i)}$
+6: Add $(\mathbf{x}_i^{\prime},y_i)$ to $D_{p}$
+7: end for
+8: repeat I steps: ▷outer optimization over $\theta$
+9: $(\mathbf{x}_k',y_k)\gets$ Sample a new batch from $D_{p}$
+10: Optimize $\theta$ over $\mathcal{L}(f_{\theta}(\mathbf{w}_t^{(y_k)}\odot \mathbf{x}_k' + \mathbf{b}_t^{(y_k)}),y_k)$ by SGD
+11: repeat J steps: ▷inner optimization over $\psi$
+12: for $(\mathbf{x}_i',y_i)$ in $D_{p}$ do
+13: Optimize W and B by (3.3) and (3.4)
+14: W $\leftarrow$ Clip(W, $1 - \epsilon /2,1 + \epsilon /2)$ , and B $\leftarrow$ Clip(B, $-\epsilon /2, + \epsilon /2)$
+15: end for
+16: error rate $\leftarrow$ Evaluate $f_{\theta}$ over $D_{p}$
+17: end while
+18: Output Poisoned dataset $D_{p}$ ,key $\psi = (\mathbf{W},\mathbf{B})$
+
+Algorithm 2 Learnability Unlocking (Linear)
+1: Inputs: Poisoned dataset $D_{p} = \{(\mathbf{x}_{i}^{\prime},y_{i})\}_{i = 1}^{n}$ , CNN parameters $\theta$ , W and B, perturbation bound $\epsilon$
+2: $D_{\widetilde{c}} \gets$ empty list
+3: for each $\mathbf{x}_i^\prime, y_i$ in $D_p$ do
+4: $\mathbf{x}_i = (\mathbf{x}_i - \mathbf{b}^{(y_i)}) \odot \frac{1}{\mathbf{w}^{(y_i)}}$
+5: Append $(\mathbf{x}_i, y_i)$ to $D_{\widetilde{c}}$
+6: end for
+7: Output Recovered dataset $D_{\widetilde{c}}$ .
+
+Optimization We solve (3.1) by adopting projected gradient descent (Madry et al., 2018) to iteratively update the two parameter sets $\mathbf{W}$ and $\mathbf{B}$ . Specifically, we first optimize over $\theta$ for $I$ batches on the perturbed data via stochastic gradient descent. Then $\psi$ , namely $\mathbf{W}$ and $\mathbf{B}$ , is updated through optimizing the inner minimization for $J$ steps. In particular, $\mathbf{W}$ and $\mathbf{B}$ are iteratively updated by:
+
+$$
+\mathbf {w} _ {t + 1} ^ {(y _ {i})} = \mathbf {w} _ {t} ^ {(y _ {i})} - \eta_ {1} \nabla_ {\mathbf {w}} \mathcal {L} \left(f _ {\theta} \left(\mathbf {w} _ {t} ^ {(y _ {i})} \odot \mathbf {x} _ {i} ^ {\prime} + \mathbf {b} _ {t} ^ {(y _ {i})}\right), y _ {i}\right), \tag {3.3}
+$$
+
+$$
+\boldsymbol {b} _ {t + 1} ^ {(y _ {i})} = \boldsymbol {b} _ {t} ^ {(y _ {i})} - \eta_ {2} \nabla_ {\boldsymbol {b}} \mathcal {L} \left(f _ {\theta} \left(\mathbf {w} _ {t} ^ {(y _ {i})} \odot \mathbf {x} _ {i} ^ {\prime} + \boldsymbol {b} _ {t} ^ {(y _ {i})}, y _ {i}\right), \right. \tag {3.4}
+$$
+
+at step $t + 1$ with learning rates $\eta_{1}$ and $\eta_{2}$ . In practice, the iterations on $J$ will traverse one pass (epoch) through the whole dataset. This typically allows $\mathbf{W}$ and $\mathbf{B}$ to better capture the strong (false) correlation between the perturbations and the model. After each update, each entry of $\mathbf{W}$ is clipped into the range $[1 - \epsilon / 2, 1 + \epsilon / 2]$ , and each entry of $\mathbf{B}$ is constrained to $[-\epsilon / 2, \epsilon / 2]$ . Moreover, $D_{p}$ is updated at each iteration according to (3.2). The iteration stops when $f_{\theta}$ obtains a low training error, controlled by $\lambda$ , on the perturbed dataset.
+
+To unlock the dataset, we simply do an inverse of the linear transformation given the corresponding $\mathbf{W}$ and $\mathbf{B}$ from Algorithm 1. Contrary to the locking process, we first apply an inverse shifting and then apply an inverse scaling operation. Detailed process is presented in Algorithm 2. We note that the whole learnability control process based on a linear transformation is nearly lossless in terms of information1.
+
+# 3.1.2 CONVOLUTIONAL FUNCTIONAL PERTURBATION
+
+Next, we present another way of applying convolutional function to craft adversarial perturbations. To begin with, we quickly review the idea of invertible ResNet (i-ResNet) (Behrmann et al., 2019).
+
+i-ResNet Residual networks consist of residual transformations such as $\mathbf{y} = \mathbf{x} + h_{\psi}(\mathbf{x})$ . Behrmann et al. (2019) note that this transformation is invertible as long as the Lipschitz-constant of $h_{\psi}(\cdot)$ satisfies $Lip(h_{\psi}) \leq 1$ . Behrmann et al. (2019) proposed the invertible residual network that uses spectral normalization to limit the Lipschitz-constant of $h_{\psi}(\cdot)$ and obtain invertible ResNet. In particular, the inverse operation can be done by performing an fix-point iteration starting from $\mathbf{x}_0 = \mathbf{y}$ , and then iteratively compute $\mathbf{x}_{t+1} = \mathbf{x}_t - h_{\psi}(\mathbf{x}_t)$ . We refer the reader to the original paper for more detailed illustrations.
+
+The invertible residual block is a perfect match for our purposes: we need an invertible and parameter-efficient transformation for data encryption/decryption, while the invertible residual block only requires a few convolutional layers (shared convolution filters). Specifically, let's denote the class- $y$ 's invertible residual transformation function $^2$ as $g^{(y)}$ . For each $\mathbf{x}_i$ with label $y_{i}\in \{1,\dots,K\}$ , we design the following the transformation function:
+
+$$
+\mathbf {x} _ {i} ^ {\prime} = g ^ {(y _ {i})} (\mathbf {x} _ {i}) = \mathbf {x} _ {i} + \epsilon \cdot \tanh (h _ {\boldsymbol {\psi}} ^ {(y _ {i})} (\mathbf {x} _ {i})), \tag {3.5}
+$$
+
+where each $h_{\psi}^{(y)}$ is composed of multiple spectrally normalized convolution layers with same-sized output, and ReLU activations, in order to make the transformation invertible. The output of $h_{\psi}^{(y)}(\cdot)$ can be viewed as the perturbation noise added to the original image. To limit the $L_{\infty}$ norm of the perturbation to satisfy the $\epsilon$ constraint, we add an extra tanh function outside $h_{\psi}^{(y)}(\cdot)$ and then multiplied by $\epsilon$ . Note that this does not change the invertible nature of the whole transformation, as the tanh function is also 1-Lipschitz.
+
+The crafting process is similar to the linear transformation case, as summarized in Algorithm 3 in appendix. Specifically, we adopt stochastic gradient descent for updating $\theta$ and $\psi$ alternatively. To unlock a perturbed data sample in this setting, we start from $\mathbf{x}_i = \mathbf{x}_i'$ and perform fixed point iterations by updating $\mathbf{x}_i = \mathbf{x}_i - \epsilon \cdot \tanh(h_{\psi}^{(y_i)}(\mathbf{x}_i))$ , as shown in Algorithm 4 in the appendix. Note that although this iterative unlocking process cannot exactly recover the original dataset, as shown in Appendix B.4, the actual reconstruction loss is minimal.
+
+# 4 EXPERIMENTS
+
+In this section, we empirically verify the effectiveness of our methods for learnability control. Following Huang et al. (2021), we then examine the strength and robustness of the generated perturbations in multiple settings and against potential counter-measures. Tasks are evaluated on three publicly available datasets: CIFAR-10, CIFAR-100 (Krizhevsky et al., 2009), and IMAGENET (Deng et al., 2009). Specifically, for IMAGENET experiments, we picked a subset of 10 classes, each with 700 training and 300 testing samples, denoted by IMAGENET-10. Detailed experimental setups can be found at Appendix B.1.
+
+# 4.1 LEARNABILITY CONTROL
+
+Our main experiments aim to answer the following two key questions related to the learnability control task: (1) are the proposed transformations effective for controlling (locking and unlocking) the learnability of the dataset? (2) is this learnability control strategy universal (agnostic to network structures or datasets)? We test the strength of our methods on standard image classification tasks for CIFAR-10, CIFAR-100, and IMAGENET-10 datasets on four state-of-art CNN models: ResNet-18, ResNet-50 (He et al., 2016), VGG-11 (Simonyan & Zisserman, 2014), and DenseNet-121 (Huang et al., 2017). We train each model on CIFAR-10 for 60 epochs, CIFAR-100 for 100 epochs, and IMAGENET-10 for 60 epochs.
+
+As shown in Table 1, both of the proposed adversarial transformations (linear or convolutional) can reliably lock and restore the dataset learnability. Specifically, compared to clean models trained on
+
+$D_{c}$ , models trained on perturbed dataset $D_{p}$ have significantly worse validation accuracy. This effect is equally powerful across network structures with different model depths. On the other hand, the learnability is ideally recovered through the authorization process as the model trained on recovered dataset $D_{\widetilde{c}}$ achieves comparable performance as the corresponding clean models. This is also true on IMAGENET-10 dataset, suggesting that the information loss through the learnability control process is negligible for training commercial models. We can also observe that the linear transformation function seems more powerful than the convolutional one in terms of the validation accuracy on the learnability locked dataset $D_{p}$ . However, the convolutional lock is advantageous in that the structure of $h_{\psi}$ can be flexibly adjusted to control the number of parameters in the key3, while the linear one has the key size strictly proportional to the data dimension. Also note that while we use ResNet-18 model for $f_{\theta}$ in the learnability locking process, other model architectures could also be effective for our task, which is further discussed in Appendix C.4.
+
+Table 1: Test accuracy for models trained on clean dataset $(D_{c})$ , perturbed dataset $(D_{p})$ , and recovered clean dataset $(D_{\overline{c}})$ . The first row summarizes result for linear perturbation function; the second row lists the result for convolutional perturbation function.
+
+| Transform | Network | CIFAR-10 | CIFAR-100 | IMAGENET-10 |
| Dc | Dp | D\(\tilde{c}\) | Dc | Dp | D\(\tilde{c}\) | Dc | Dp | D\(\tilde{c}\) |
| Linear | ResNet-18 | 91.60 | 12.38 | 90.66 | 68.46 | 8.58 | 67.16 | 81.57 | 9.97 | 81.90 |
| ResNet-50 | 94.28 | 15.62 | 95.59 | 70.12 | 6.98 | 69.09 | 84.20 | 10.30 | 83.53 |
| VGG-11 | 90.76 | 15.07 | 91.37 | 67.25 | 6.62 | 67.49 | 81.07 | 11.80 | 81.33 |
| DenseNet-121 | 94.36 | 14.75 | 93.33 | 70.81 | 7.48 | 71.32 | 83.17 | 8.53 | 83.37 |
| Conv | ResNet-18 | 91.02 | 16.60 | 91.95 | 69.27 | 8.92 | 68.93 | 82.83 | 12.20 | 81.70 |
| ResNet-50 | 95.68 | 19.39 | 94.79 | 69.58 | 8.70 | 67.29 | 84.93 | 10.37 | 84.63 |
| VGG-11 | 91.07 | 19.61 | 90.88 | 67.32 | 7.45 | 67.98 | 81.30 | 13.20 | 81.90 |
| DenseNet-121 | 93.22 | 20.23 | 93.48 | 71.14 | 5.62 | 71.54 | 84.37 | 12.47 | 84.43 |
+
+Control over Single Class: In practice, the data controller may not has access to the entire dataset, rather, the access may be restricted to single or several classes of the whole dataset. We test our learnability control process with only one single class being manipulated. Specifically, we choose to perturb the class "bird" in the CIFAR-10 dataset and observe the corresponding learnability performance. In Figure 2, we show the heatmap of the prediction confusion matrices on our single-class controlled CIFAR10 dataset via both linear and convolutional transformations. It can be observed that our proposed method reliably fools the network into misclassifying "bird" as other class labels. This demonstrates the effectiveness of our proposed method even with single class data being perturbed. On the other hand, the model trained on the unlocked "bird"-class data can achieve $93\%$ and $91\%$ test accuracies respectively for linear and convolutional perturbation functions. This confirms that our learnability lock can be flexibly adapted to different protection tasks. Due to the space limit, we refer the readers to Section B.2 in the appendix for experiments with learnability control on multiple classes.
+
+Effect of Perturbation Limit $\epsilon$ : We also test the effectiveness of our learnability control with different $\epsilon$ limitations. We conduct two sets of experiments on the CIFAR10 dataset using linear transformation with $\epsilon = 8$ and $\epsilon = 16$ respectively. As shown in Figure 3, the learning curves demonstrate that larger perturbation provides apparently better protection to the data learnability. While it is true that larger $\epsilon$ gives better learnability control on the dataset, we point out that the too large noise will make the perturbation visible to human eyes.
+
+# 4.2 ROBUSTNESS ANALYSIS
+
+In this section, we evaluate the robustness of the functional perturbations against proactive mitigation strategies. It is worth noting that there is no existing strategy specifically targeted to compromise the learnability control process. So we consider two types of general defenses that may affect the effectiveness of our learnability lock: 1) data augmentations or filtering strategies that preprocess the
+
+
+(a) Linear
+
+
+(b) Conv
+Figure 2: Heatmap of the classification confusion matrix for learnability control on the single class "bird" of CIFAR-10 for (a) linear transformation, and (b) convolutional transformation.
+
+
+(a) Linear
+Figure 3: Test accuracy against training epochs for model training on the perturbed dataset $D_{p}$ using different $\epsilon$ for (a) linear transformation, and (b) convolutional transformation.
+
+
+(b) Conv
+
+input data which may mitigate the effect of our perturbations; 2) adversarial training based defensive techniques that target to learn the robust features in the input which still exist in the perturbed data.
+
+# 4.2.1 DATA AUGMENTATION AND FILTERING TECHNIQUES
+
+It is possible that data augmentation can be used to mitigate the effect of small adversarial perturbations. In addition to standard augmentation methods such as rotation, shifting, and flipping, we test our method against several more advanced ones, including Mixup (Zhang et al., 2018), Cutmix (Yun et al., 2019), and Cutout (Cubuk et al., 2018). We also evaluate our method on some basic filtering techniques such as random $L_{\infty}$ noises and Gaussian smoothing restricting the perturbation strength $\epsilon = 8$ . Experimental results in Table 2 indicate that none of these techniques defeat our learnability control method as the model trained on the augmented samples still behaves poorly. Standard augmentations such as rotation, shifting and flipping can only recover an extra $1\%$ of the validation accuracy. Mixup (Zhang et al., 2018) achieved the best learnability recovery result of $43.88\%$ for linear lock and $36.97\%$ for convolutional lock, yet it is still far from satisfactory for practical use cases. Note that although convolutional based perturbations achieve worse learnability locking performance compared with linear perturbations, they are actually more robust to such data augmentation or filtering techniques. It is also worth noting that in our experiment, we assume that the data provider doesn't know the potential augmentations used for generating the learnability locked dataset. We believe our method can be further improved by crafting the learnability lock on an augmented dataset so that the lock can generalize better to various augmentations.
+
+Table 2: Summary of applying data augmentation and filtering techniques on the learnability locked dataset.
+
+| Defenses | Acc (Linear) | Acc (Conv) |
| None | 14.79 | 17.61 |
| Random Noise | 19.83 | 17.32 |
| Gaussian Blurring | 15.59 | 21.28 |
| rotate & flip & crop | 15.25 | 18.81 |
| Cutmix | 20.72 | 18.60 |
| Cutout | 26.28 | 23.04 |
| Mixup | 43.88 | 36.97 |
+
+Table 3: Summary on the effectiveness of applying adversarial training on several learnability attack methods and our proposed learnability lock.
+
+| Method ↓ | Val Acc |
| Unlearnable Examples | 85.89 |
| Gradient Alignment | 83.56 |
| Adversarial Poisoning | 86.09 |
| Learnability Lock (linear) | 65.53 |
| Learnability Lock (conv) | 71.78 |
+
+# 4.2.2 ADVERSARIAL TRAINING
+
+Adversarial training (Madry et al., 2018) can also be viewed as a strong data augmentation technique against data perturbations. It is originally designed to help the model learn robust features to defend against the adversarial examples, which are generated by solving a min-max problem. Note that this min-max optimization is the exact counterpart of the min-min formulation in Huang et al. (2021). Huang et al. (2021) reported that adversially trained models can still effectively learn the useful information from the dataset perturbed by the error-minimizing noise (gaining around $85\%$ validation accuracy). We test our methods by adversially training a ResNet-50 model on the perturbed
+
+CIFAR-10 dataset created from functional perturbations. We compare the result with three existing learnability attack methods including unlearnable examples (Huang et al., 2021), gradient alignment (Fowl et al., 2021b), and adversarial poisoning (Fowl et al., 2021a). The attack used for adversarial training is the traditional PGD approach with 10 iteration steps, and the maximum $L_{\infty}$ perturbation is limited to 8/255.
+
+Experimental results in Table 3 indicate that the learnability lock outperforms existing methods based on additive noises in terms of adversarially trained models. We suspect this is because simple transformations, such as scaling and shifting, are able to generate much more complicated perturbation patterns than pure additive noises (Laidlaw & Feizi, 2019). A similar finding is noted by Zhang et al. (2019b) that simple transformations can move images out of the manifold of the data samples and thus expose the adversarially trained models under threats of "blind spots". While adversarial training proves to be much more effective than other data augmentations techniques, it also fails to recover the validation accuracy back to a natural level and is, on the other hand, extremely computationally expensive. In Appendix B.3, we further discuss a hypothetical case where attacker realizes the transformation function used for learnability control and thus perform an adaptive adversarial training, which is shown to be even less effective than standard adversarial training.
+
+# 4.3 PRACTICAL GUIDELINES
+
+In this section we study some unique properties of our learnability control framework. Since our proposed learnability control framework allows us to restore its learnability with the correct secret key, one may wonder whether this learnability key is unique and reliable for practical use. In other words, if we generate two sets of keys for two clients based on one common data source, would the two keys mutually
+
+Table 4: Summary of uniqueness experiment results with a ResNet-18 trained on CIFAR-10
+
+| Keys ↓ | Linear (A) | Conv (A) |
| Linear (B) | 14.79 | 11.35 |
| Conv (B) | 19.83 | 17.81 |
+
+unlock the other "learnability locked" dataset? This is crucial since if it is the case, then as long as one set of key (transformation function) is exposed to an attacker, we lost the learnability locks for all the perturbed datasets based on the same source data. In our experiment, we train two learnability locks for each transformation separately on the CIFAR-10 dataset and generate learnability locked datasets $D_p^1$ and $D_p^2$ with corresponding keys $\psi_1$ and $\psi_2$ . Then we use $\psi_1$ to unlock $D_p^2$ and train a model on the retrieved dataset. As shown in Table 4, each row represents the transformation method we used as the key and each column stands for a learnability locked dataset we intend to unlock. The result suggests that learnability lock is strongly tied with a key that cannot be used to mutually unlock other locks, which introduces the desired property that prevents any unwanted data usage caused by partial leakage of secret keys.
+
+We also conduct various ablation studies on the practicality of learnability lock including the effect of different perturbation percentages in $D_{p}$ , different model architectures of $f_{\theta}$ , the possibility of using global transformation functions or a mixture of transformation functions, for which we refer the reader to Appendix C.
+
+# 5 CONCLUSION
+
+We introduce a novel concept Learnability Lock that leverages adversarial transformations to achieve learnability control on specific dataset. One significant advantage of our method is that not only we can attack the learnability of a specific dataset with little visual compromises through an adversarial transformation, but also can easily restore its learnability with a special key, which is light-weighted and easy-to-transfer, through the inverse transformations. While we demonstrate the effectiveness of our method on visual classification tasks, it is possible to adapt our method to other data formats, which we leave as future work directions.
+
+# REFERENCES
+
+Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search. In European Conference
+
+on Computer Vision, pp. 484-501. Springer, 2020.
+Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018.
+Jens Behrmann, Will Grathwohl, Ricky TQ Chen, David Duvenaud, and Jorn-Henrik Jacobsen. Invertible residual networks. In International Conference on Machine Learning, pp. 573-582. PMLR, 2019.
+Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. arXiv preprint arXiv:1206.6389, 2012.
+Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In SP, pp. 39-57. IEEE, 2017.
+Jinghui Chen and Quanquan Gu. Rays: A ray searching method for hard-label adversarial attack. In SIGKDD, 2020.
+Jinghui Chen, Dongruo Zhou, Jinfeng Yi, and Quanquan Gu. A frank-wolfe framework for efficient and effective adversarial attacks. In AAAI, 2020.
+Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In AISC, pp. 15-26. ACM, 2017.
+F. Croce and M. Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. In ICML, 2020.
+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.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
+Liam Fowl, Micah Goldblum, Ping yeh Chiang, Jonas Geiping, Wojtek Czaja, and Tom Goldstein. Adversarial examples make strong poisons, 2021a.
+Liam Fowl, Ping yeh Chiang, Micah Goldblum, Jonas Geiping, Arpit Bansal, Wojtek Czaja, and Tom Goldstein. Preventing unauthorized use of proprietary data: Poisoning for secure dataset release, 2021b.
+Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches' brew: Industrial scale data poisoning via gradient matching. arXiv preprint arXiv:2009.02276, 2020.
+Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples, 2015.
+Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 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, Li Deng, Dong Yu, George Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Brian Kingsbury, et al. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal processing magazine, 29, 2012.
+
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700-4708, 2017.
+Hanxun Huang, Xingjun Ma, Sarah Monazam Erfani, James Bailey, and Yisen Wang. Unlearnable examples: Making personal data unexploitable. arXiv preprint arXiv:2101.04898, 2021.
+W Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. arXiv preprint arXiv:2004.00225, 2020.
+Andrew Ilyas, Logan Engstrom, Anish Athalye, Jessy Lin, Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Black-box adversarial attacks with limited queries and information. In ICML, 2018.
+Pang Wei Koh, Jacob Steinhardt, and Percy Liang. Stronger data poisoning attacks break data sanitization defenses. arXiv preprint arXiv:1811.00741, 2018.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
+Cassidy Laidlaw and Soheil Feizi. Functional adversarial attacks. arXiv preprint arXiv:1906.00001, 2019.
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
+Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
+Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. ICML, 2018.
+Seungyong Moon, Gaon An, and Hyun Oh Song. Parsimonious black-box adversarial attacks via efficient combinatorial optimization. In ICML, pp. 4636-4645, 2019.
+Luis Muñoz-González, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 27-38, 2017.
+Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pp. 506-519, 2017.
+Ximing Qiao, Yukun Yang, and Hai Li. Defending neural backdoors via generative distribution modeling. arXiv preprint arXiv:1910.04749, 2019.
+Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. arXiv preprint arXiv:1804.00792, 2018.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
+Yusuke Tashiro, Yang Song, and Stefano Ermon. Diversity can be transferred: Output diversification for white-and black-box attacks. Advances in Neural Information Processing Systems, 33, 2020.
+
+Boxi Wu, Jinghui Chen, Deng Cai, Xiaofei He, and Quanquan Gu. Do wider neural networks really help adversarial robustness? arXiv preprint arXiv:2010.01279, 2020.
+Chaofei Yang, Qing Wu, Hai Li, and Yiran Chen. Generative poisoning attack method against neural networks. arXiv preprint arXiv:1703.01340, 2017.
+Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In International Conference on Computer Vision (ICCV), 2019.
+Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning, pp. 7472-7482. PMLR, 2019a.
+Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
+Huan Zhang, Hongge Chen, Zhao Song, Duane Boning, Inderjit S Dhillon, and Cho-Jui Hsieh. The limitations of adversarial training and the blind-spot attack. arXiv preprint arXiv:1901.04684, 2019b.
+
+# A ALGORITHMS FOR CONVOLUTIONAL LEARNABILITY LOCKING AND UNLOCKING
+
+In this section, we attach the complete algorithms for the convolutional learnability locking and unlocking process. Specifically, the convolutional learnability locking process is summarized in Algorithm 3. The general procedure is similar to Algorithm 1: we update the perturbed dataset $D_{p}$ with the current convolutional function and then alternatively update $\theta$ and $\psi$ using the perturbed data via stochastic gradient descent.
+
+The unlocking steps are summarized in Algorithm 4. Specifically, the inverse mapping of the residual network can be approximated by a fixed-point iteration. Note that while this fixed-point iteration may not perfectly reconstruct the original data, we show that this information loss is essentially negligible (in terms of both reconstruction error and learnability) in Section B.4.
+
+Algorithm 3 Learnability Locking (convolutional)
+1: Inputs: Clean dataset $D_{c} = \{(\mathbf{x}_{i},y_{i})\}_{i = 1}^{n}$ , crafting model $f$ with parameters $\theta$ , transformation $h$ with randomly initialized parameters $\psi_0$ , perturbation bound $\epsilon$ , outer optimization step $I$ inner optimization step $J$ , error rate $\lambda$ , loss function $\mathcal{L}$
+2: while error rate $< \lambda$ do
+3: $D_{p}\gets$ empty dataset
+4: for $(\mathbf{x}_i,y_i)$ in $D_{c}$ do
+5: $\mathbf{x}_i^{\prime} = \mathbf{x}_i + \epsilon \cdot \tanh (h_{\psi}^{(y_i)}(\mathbf{x}_i))$
+6: Add $(\mathbf{x}_i^{\prime},y_i)$ to $D_{p}$
+7: end for
+8: repeat I steps: ▷outer optimization over $\theta$
+9: $(\mathbf{x}_k',\mathbf{y}_k)\gets$ Sample a new batch from $D_{p}$
+10: Optimize $\theta$ over $\mathcal{L}(f_{\theta}(\mathbf{x}_k^{\prime} + \epsilon \cdot \tanh (h_{\psi}^{(\mathbf{y}_k)}(\mathbf{x}_k^{\prime}))),\mathbf{y}_k)$ by SGD
+11: repeat J steps: ▷inner optimization over $\psi$
+12: for $(\mathbf{x}_i',y_i)$ in $D_{p}$ do
+13: Optimize $\psi$ over $\mathcal{L}(f_{\theta}(\mathbf{x}_i^{\prime} + \epsilon \cdot \tanh (h_{\psi}^{(y_i)}(\mathbf{x}_i^{\prime}))),y_i)$ by SGD
+14: end for
+15: error rate $\leftarrow$ Evaluate $f_{\theta}$ over $D_{p}$
+16: end while
+17: Output Poisoned dataset $D_{p}$ ,key $\psi$
+
+Algorithm 4 Learnability Unlocking (convolutional)
+1: Inputs: Poisoned dataset $D_{p} = \{(\mathbf{x}_{i}^{\prime},y_{i})\}_{i = 1}^{n}$ , transform function (i-ResNet) $h_\psi$ , number of fixed-point iterations m, perturbation bound $\epsilon$
+2: $D_{\widetilde{c}}\gets$ empty list
+3: for each $\mathbf{x}_i^\prime ,y_i$ in $D_{p}$ do
+4: for i = 1,..., m do
+5: $\mathbf{x}_i = \mathbf{x}_i' - \epsilon \cdot \tanh (h_{\psi}^{(y_i)}(\mathbf{x}_i))$
+6: end for
+7: Append $(\mathbf{x}_i,y_i)$ to $D_{\widetilde{c}}$
+8: end for
+9: Output Recovered dataset $D_{\widetilde{c}}$
+
+# B ADDITIONAL EXPERIMENT DETAILS
+
+# B.1 EXPERIMENTAL SETUP
+
+For all experiments, we use ResNet-18 (He et al., 2016) as the base model for generating the learnability lock unless specified. Performance of the learnability locking process is evaluated by the
+
+Table 5: Structure of transformation model $h$ for convolutional learnability lock on CIFAR
+
+| Layer Type | # channels | Filter Size | Stride | Padding | Activation |
| Conv | 8 | 3 × 3 | 1 | 1 | ReLU |
| Conv | 16 | 3 × 3 | 1 | 1 | ReLU |
| Conv | 16 | 1 × 1 | 1 | 0 | ReLU |
| Conv | 8 | 3 × 3 | 1 | 1 | ReLU |
| Conv | 3 | 3 × 3 | 1 | 1 | ReLU |
+
+testing accuracy of the model train from scratch on the controlled dataset $D_{p}$ . Similarly, effectiveness of the unlocking process is examined by the testing accuracy of the model trained on the learnability restored dataset $D_{\widetilde{c}}$ . To ensure the stealthiness of the perturbation, we restrict $\epsilon = 8 / 255$ for CIFAR-10 and CIFAR-100, and $\epsilon = 16 / 255$ for IMAGENET. To evaluate the effectiveness of the learnability control, the evaluation models are trained using Stochastic Gradient Descent (SGD) (LeCun et al., 1998) with initial learning rate of 0.01, momentum of 0.9, and a cosine annealing scheduler (Loshchilov & Hutter, 2016). For model training during the learnability locking process (updating $f_{\theta}$ ), we set initial learning rate of SGD as 0.1 with momentum as 0.9 and cosine annealing scheduler without restart. Cross-entropy is always used as the loss function if not mentioned otherwise. The batch size is set as 256 for CIFAR-10 and CIFAR-100, 128 for the IMAGENET due to memory limitation.
+
+Setup for Linear Learnability Lock For learnability locking using linear transformations, we use the following hyper-parameters in Algorithm 1: for CIFAR-10, we set $I = 20$ and $J = 1$ with a learning rate over $\psi$ of 0.1 according to (3.3) and (3.4); for CIFAR-100, we let $I = 25$ and $J = 3$ with learning rate 0.1; for IMAGENET-10 dataset, we set $I = 30$ and $J = 5$ with learning rate 0.1. In addition, the functional parameters $\psi = \{\mathbf{W},\mathbf{B}\}$ are initialized with all ones to $\mathbf{W}$ and all zeros to $\mathbf{B}$ . For the exit condition, $\lambda$ is set to 0.1.
+
+Setup for Convolutional Learnability Lock The convolutional model $h_{\psi}$ we used for generating perturbations is demonstrated in Table 5. For experiment on IMAGENET, we use the same $h$ structure but modify the number of channels in order to 64, 128, 128, 64, 3. The hyper-parameters are set as follows in Algorithm 3: for CIFAR-10, we use $I = 25$ and $J = 3$ with a learning rate of 0.1 with SGD over $\psi$ ; for CIFAR-100, we set $I = 30$ and $J = 5$ with an initial learning rate 0.05, which shrinks by half for every 5 iterations of Algorithm 3. On IMAGENET, we instead use $I = 40$ and $J = 5$ with learning rate 0.01. For the unlocking process, we set the number of fixed-point iterations $m = 5$ . For exit condition, we set $\lambda = 0.2$ and also applied early stopping to avoid overfitting.
+
+# B.2 LEARNABILITY CONTROL ON MULTIPLE CLASSES
+
+We follow the experimental setup in Section 4.1 and consider the case where multiple, but not all, classes need to be protected. For linear transformation, we select 4 classes ("automobile", "cat", "dog", "horse") from the CIFAR-10 dataset to conduct learnability control. For convolutional transformation, we do the same on another 4 classes ("bird", "deer", "frog", "ship") for demonstration. Note that the controlled classes are selected by random and our method also generalizes to other settings. Figure 5 shows the prediction results of a ResNet-50 trained on the partially controlled dataset. We can observe that model falsely predict almost all the samples that belong to classes under learnability control, while remaining unaffected on other classes. The learnability can also be reliably restored by unlocking the controlled classes. Models trained on the restored datasets achieve testing accuracies of $94\%$ and $93\%$ , respectively.
+
+# B.3 MORE DETAILS ON ADVERSARIAL TRAINING
+
+Generally speaking, adversarial training fails to serve as an ideal counter-measure to our proposed learnability control. Aside from the extra computational cost to craft adversarial examples in each training step, it has been shown that adversially trained models suffer from a compromised natural accuracy (Zhang et al., 2019a; Wu et al., 2020). Our experiments indicate that with the same training pipeline, the adversially trained model on a CIFAR-10 dataset can achieve at best $87\%$ validation accuracy, while the normally trained model can easily attain a $93\%$ . The degradation is even more apparent on a industry-level dataset with high resolution (Fowl et al., 2021a). In addition,
+
+
+(a) Linear
+
+
+(b) Convolutional
+
+
+(a) Linear
+Figure 5: Prediction results of a ResNet-50 model trained on partially learnability-controlled CIFAR-10. The classes under control are circled in red. It is easy to see that the model has fairly bad performance on learnability-controlled classes, while nearly unaffected on other classes.
+
+
+Figure 4: Annotated version of Fig. 2 - classification confusion matrix for learnability control on the single class "bird" of CIFAR-10 for (a) linear transformation, and (b) convolutional transformation.
+(b) Convolutional
+
+the adversarial training could be less effective without knowing the exact method an adversary used for the attack. This is also true in our learnability control setting as the adversary is unaware of the transformations used within the learnability lock.
+
+To further explore the stability of our learnability control strategy, we envision a hypothetical scenario that the adversary actually knows what type of transformation is used for our learnability lock. Therefore, the adversary may choose to adversarially train the model using the exact same type of transformations for solving the min-max problem. Specifically, if the learnability lock is crafted based on a linear transformation, then the adversary can also first solve the maximizer for $\mathbf{W}$ and $\mathbf{B}$ that mostly degrades the model performance at each training step and then solve the minimizer on the outer model training problem. We test out this concern for both the linear and convolutional learnability control processes. Specifically, we adversarially train a ResNet-50 on the CIFAR-10 dataset based on class-wise noises with linear and convolutional transformations respectively. In addition, we also use the sample-wise linear transformation (which is much computationally intensive) to craft the noise for adversarial training. We are not able to leverage the sample-wise convolutional transformation for the full adversarial training process due to the high computational burden. Instead, we craft the sample-wise noises based on convolutional transformation on a well-trained model on $D_{p}$ , and include the perturbed samples as data augmentation to $D_{p}$ . We then continue training the model for 20 iterations. The result is summarized in Figure 6, suggesting that none of the adversarial training techniques can reliably defeat our method. From Figure 6 we also observe
+
+that when the adversary is unaware of the type of transformation used, the best strategy is probably to apply the standard adversarial training, even though its learnability recovery ability is also limited (as previously shown in Section 4.2.2).
+
+
+Figure 6: Performance on the learnability locked dataset trained by adapted adversarial training with respect to the transformation functions. Specifically, "c" stands for adversarial training with class-wise perturbations, "s" means sample-wise, and "st" means the standard adversarial training using PGD.
+
+# B.4 RECONSTRUCTION LOSS
+
+Normally the encryption and decryption process is accompanied by a certain degree of information loss. This is also true for the linear and convolutional learnability lock. On the one hand, the samples transformed by the lock may be further clipped into range [0, 1] in image classification tasks. This introduces slight information loss when we reconstruct the samples with inverse transformation. Additionally, for the convolutional lock, the inverse transformation is approximated by fixed-point iterations, bringing a certain degree of information loss. While we already show in Table 1 that this loss is negligible for restoring the learnability, here we explore the ability to reconstruct the original dataset with the two proposed transformations. The experiment is conducted on CIFAR-10 with two pre-trained learnability locks. The information loss is measured by the average $L_{2}$ loss between retrieved images from $D_{\widetilde{c}}$ and original images from $D_{c}$ , calculated on 500 randomly selected images. Results are included in Table 6. It shows that the information loss is trivial compared with the distance from perturbed images, and thus the learnability control process is rarely affected.
+
+Table 6: Reconstruction losses for learnability locks with both linear and convolutional transformations measured in $L_{2}$ distance.
+
+| Average L2 loss compared to Dc | Dp | Dc |
| Linear | 0.81 ± 0.07 | 2.58e-7 ± 9.78e-8 |
| Conv | 1.67 ± 0.06 | 4.91e-4 ± 1.21e-3 |
+
+# C ABLATION STUDY
+
+In this section, we present some important ablation studies to our proposed learnability lock framework.
+
+# C.1 PERTURBATION PERCENTAGES
+
+In case when the entire training data collection is not available for the data controller to leverage learnability control, we examine the potency of our method when we perturb merely a portion of the training data. This is different from the aforementioned single-class experiments, which constrain the perturbation to only one single class. In this section, we study the effect if only part of the randomly selected samples from a full dataset has been controlled for learnability. Figure 7 shows that the effectiveness of both transformation functions is compromised when the training samples are not all under learnability control. The result suggests that the data provider should possess at
+
+
+Figure 7: Test accuracy against perturbation percentage for models trained on learnability controlled dataset with different percentage of perturbed samples.
+
+least $60\%$ of the training data in order to activate the learnability control effect. This vulnerability is also noted in previous work (Huang et al., 2021). Compared with Huang et al. $(2021)^{4}$ , we observed that both our linear and convolutional transformations achieve much better learnability locking performances especially when the perturbation percentage lies in the middle range ( $40\% \sim 80\%$ ).
+
+# C.2 GLOBAL TRANSFORMATION FUNCTION
+
+Our method focuses on class-wise transformation functions. Of particular interest is whether one global transformation function can be applied over the whole dataset and still lock the learnability. One advantage of applying a universal transformation is a smaller amount of parameters (size of the keys) needed. This makes transferring the keys between the data owner and clients more convenient. We test with both proposed perturbation functions on the CIFAR-10 dataset. Specifically, for the convolutional transformation, we use a deep network with 20 convolution layers (to ensure enough expressiveness for perturbing the entire dataset). As shown in Figure 8, while the potency of our method is decreased, the learnability lock is still effective in degrading the model performance by 20-30 percent. We believe that the performance can be further improved by either designing more effective perturbation functions or advanced optimization steps. We leave it for future study.
+
+
+Figure 8: Experimental result for global transformation functions on CIFAR-10 dataset.
+
+# C.3 MIXTURE OF PERTURBATION FUNCTIONS
+
+Another way to improve the complexity of learnability control process against potential countermeasures is to apply a mixture of perturbation functions. In this sense, we can apply different transformation functions to each class in a random order so that the order itself could serve as another secret key. We show that this is possible by applying the linear transformation (Algorithm 1) on classes with odd labels and convolutional transformation (Algorithm 3) on classes with even labels from CIFAR-10. The result is listed in Table 7, generated on a ResNet-50 model. It is
+
+Table 7: Performance comparison when using a mixture of perturbation functions.
+
+| Perturbation ↓ | Val Acc |
| None | 93.89 |
| Linear | 13.93 |
| Conv | 17.06 |
| Mixture | 21.29 |
+
+observed that using a combination of different locks has little impact on the potency of learnability control. Yet without knowing the exact transformation functions and the orders applied, it is harder for attackers to mitigate or reverse-engineer the perturbation patterns in order to compromise the protection.
+
+# C.4 EFFECT ON CRAFTING MODEL ARCHITECTURES
+
+While ResNet-18 is used as the default model architecture for crafting the learnability locked dataset in our experiments, we verify that other model architectures could serve the same purpose equivalently. Specifically, we use VGG-11 and DenseNet-121 as crafting models and evaluate the performance of the trained adversarial transformations on CIFAR-10 with ResNet-50. The results are listed in Table 8. For both linear and convolutional transformations, the learnability control process is still effective under different model architectures, suggesting that the learnability lock has the desired property that it is agnostic to network structures. In addition, we observe that a more powerful crafting model always generates a stronger learnability lock. For example, the validation accuracy of model trained on CIFAR-10 controlled by a lock crafted with DenseNet-121 is always lower than that crafted with VGG-11.
+
+Table 8: Learnability locking performances with different model architectures of $f_{\theta}$ .
+
+| gψ | fθ | Test Acc (locked) | Test Acc (unlocked) |
| Linear | VGG-11 | 17.53 | 91.35 |
| Densenet-121 | 12.01 | 90.34 |
| Conv | VGG-11 | 19.21 | 91.67 |
| Densenet-121 | 14.56 | 92.75 |
+
+# C.5 COMPARISON TO ADDITIVE PERTURBATION
+
+Additive noise is widely adopted in the literature of adversarial machine learning. It usually has the form $\mathbf{x}' = \mathbf{x} + \delta$ where $\delta$ stands for the noise pattern being mapped onto a clean sample. Several recent works leverage additive perturbation to prevent models from learning useful features on a poisoned dataset (Fowl et al., 2021a; Huang et al., 2021; Fowl et al., 2021b). Existing additive noises can be summarized into two categories: sample-wise and class-wise. However, we argue that both kinds of them are not suitable for a task of learnability control due to several major drawbacks.
+
+Sample-wise perturbation falls short of recovering the learnability for the whole dataset because of the extremely high cost to pass all the noise patterns to an authorized user. Obviously, the potential cost of transferring the "secret key" grows with the number of samples contained in the dataset, which tends to be large in a practical commercial setting. On the other hand, additive perturbations injected class-wise has much lower transferring cost. In specific, the secret key would involve a unique noise pattern for each class so that the cost is merely $O(d \times k)$ , where $d$ stands for the sample dimension and $k$ represents the number of classes. However, the downside of class-wise additive perturbation is that it applies the same perturbation for all data in one class, and thus can be easily detected or reverse-engineered.
+
+A transformation-based perturbation resolves both concerns raised above. First, the inversion cost is much lower than that of sample-wise additive noises. The proposed linear learnability lock involves
+
+$O(d \times k)$ parameters to do the inverse transformation. This is merely 61440 parameter values in the case of CIFAR-10. The cost Sof convolutional learnability lock is also low, with around 30000 parameters on CIFAR-10 (based on $h$ provided in Table 5). On the other hand, the transformation based perturbation, though performed class-wise, can generate different noise patterns for each sample. This improves the stealthiness and stability of the learnability control process. Furthermore, it is shown that the transformation-based perturbation is more robust to standard adversarial training as counter-measure. Table 9 compares the maximum achievable accuracy of our method with Huang et al. (2021) that is based on additive noise. It shows that while the validation accuracy on the unlearnable data produced by our method is comparable to that of Huang et al. (2021), our method can ensure a much lower maximum achievable accuracy taking into account adversarial training. Table 10 summarizes the comparisons between our method and additive noises in terms of several significant properties for learnability control. Specifically, the "stealthiness" is reflected through diversity of functional perturbations rather than the value $^5$ of $\epsilon$ . The diversity of functionally perturbations make it harder to reverse-engineer the noise patterns from the unlearnable dataset and thus break our protection. For example, suppose a key-lock pair (one noisy image and the original clean sample) is disclosed, then for the additive noise, it is easy for the attacker to detect or reverse-engineer the noise pattern and remove all of them. This is not true for our method as the functional parameters (e.g. an invertible resnet) are essentially impossible to recover with one key-lock pair.
+
+Table 9: Comparison of maximum achievable accuracy with unlearnable examples (Huang et al., 2021). Here we focus on the maximum achievable validation accuracy of a ResNet-50 trained on the CIFAR-10 dataset using any training schemes.
+
+ | Normal Training | Adv Training | Max Achievable Accuracy |
| Unlearnable | 13.45 | 85.89 | 85.89 |
| Ours (linear) | 15.62 | 65.53 | 65.53 |
| Ours (conv) | 19.39 | 71.78 | 71.78 |
+
+Table 10: Comparison of different strategies under the setting of learnability control. The "stealthiness" evaluates based on if the noise is easily detectable or can be reverse-engineered. (✓ denotes "yes", X denotes "no").
+
+| Perturbation ↓ | Inverse | Transfer Cost | Adv. Train | Stealthiness |
| Additive (sample-wise) | X | high | X | ✓ |
| Additive (class-wise) | ✓ | low | X | X |
| Linear (ours) | ✓ | low | ✓ | ✓ |
| Convolutional (ours) | ✓ | low | ✓ | ✓ |
\ No newline at end of file
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/images.zip b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b9bae4cc449e548cc431d0c4b33c41205658cf7b
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a4bfb110122e0dcab1fbc63ff5b1126de6515402eaaf2178972c4a429df4b7a5
+size 524835
diff --git a/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/layout.json b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..26128f787f3b3b5d29f8e31dcca5fc0f4747ced0
--- /dev/null
+++ b/learnabilitylockauthorizedlearnabilitycontrolthroughadversarialinvertibletransformations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:974d11ba9b642c40c50ff730b10b0e3f66a4323414e095d156c138f73d291c2c
+size 662508
diff --git a/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_content_list.json b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e8a68764d855da8f55934c1b55fba1a14ee064ac
--- /dev/null
+++ b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4fc34721d7226b35973382d98007b17330e9247d71880820b3234e9a9ce98472
+size 130389
diff --git a/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_model.json b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..add22094d8e6248ac4ef626b42cde47701b3b00a
--- /dev/null
+++ b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b4441543f48beee94befcd09b9bc97b4dca6a23030f54afb19b9a0c4bab81fc5
+size 151245
diff --git a/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_origin.pdf b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..cc9b5cf9c9a2de1ce95654baea032b89e9ec6586
--- /dev/null
+++ b/learnedsimulatorsforturbulence/2b432e56-5ab8-4725-b3cc-35bb83b249f8_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:57f081160bd06469b1833fde2a513996db6a3f967d76805f331cb7d1b99e8610
+size 11835926
diff --git a/learnedsimulatorsforturbulence/full.md b/learnedsimulatorsforturbulence/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2935ceb5fc5e8ffaa2682e554ce215829773f358
--- /dev/null
+++ b/learnedsimulatorsforturbulence/full.md
@@ -0,0 +1,402 @@
+# LEARNED COARSE MODELS FOR EFFICIENT TURBULENCE SIMULATION
+
+Kimberly Stachenfeld, $^{1}$ Drummond B. Fielding, $^{2}$ Dmitrii Kochkov, $^{3}$ Miles Cranmer, $^{4}$ Tobias Pfaff, $^{1}$ Jonathan Godwin, $^{1}$ Can Cui, $^{2}$ Shirley Ho, $^{2}$ Peter Battaglia, $^{1}$ Alvaro Sanchez-Gonzalez $^{1}$
+
+$^{1}$ DeepMind, London, UK $^{2}$ Center for Computational Astrophysics, Flatiron Institute, New York, NY $^{3}$ Google Research, Cambridge, MA $^{4}$ Princeton University, Princeton, NJ alvarosg@google.com, stachenfeld@google.com
+
+# ABSTRACT
+
+Turbulence simulation with classical numerical solvers requires high-resolution grids to accurately resolve dynamics. Here we train learned simulators at low spatial and temporal resolutions to capture turbulent dynamics generated at high resolution. We show that our proposed model can simulate turbulent dynamics more accurately than classical numerical solvers at the comparably low resolutions across various scientifically relevant metrics. Our model is trained end-to-end from data and is capable of learning a range of challenging chaotic and turbulent dynamics at low resolution, including trajectories generated by the state-of-the-art Athena++ engine. We show that our simpler, general-purpose architecture outperforms various more specialized, turbulence-specific architectures from the learned turbulence simulation literature. In general, we see that learned simulators yield unstable trajectories; however, we show that tuning training noise and temporal downsampling solves this problem. We also find that while generalization beyond the training distribution is a challenge for learned models, training noise, added loss constraints, and dataset augmentation can help. Broadly, we conclude that our learned simulator outperforms traditional solvers run on coarser grids, and emphasize that simple design choices can offer stability and robust generalization.
+
+# 1 INTRODUCTION
+
+Turbulent fluid dynamics are ubiquitous throughout the natural world, and many scientific and engineering disciplines depend on high quality turbulence simulations. Examples range from design problems in aeronautics (Rhie, 1983) and medicine (Sallam & Hwang, 1984) to scientific problems of understanding molecular dynamics (Smith, 2015), weather (Beljaars, 2003), and vast galactic systems (Canuto & Christensen-Dalsgaard, 1998). Predicting turbulent dynamics is challenging, and finding a general solution to the governing equations of fluid dynamics, the Navier-Stokes Equation, is a famously open problem in Mathematical Physics (Jaffe, 2006). The challenge is due in large part to the fact that turbulence is chaotic: small-scale changes in the initial conditions can lead to a large difference in the outcome. Nonetheless, over the past several decades, high-quality numerical solvers have been engineered that integrate the governing partial differential equations (PDEs) and can maintain accuracy over long integration periods even for complex dynamics. These solvers often must operate over high-resolution grids and therefore require substantial computational resources. Otherwise, high-frequency information is lost due to hard-to-model "numerical viscosity", and the simulated dynamics can further diverge from the underlying equations due to the chaotic dynamics.
+
+Learned simulation represents a promising avenue for efficient fluid simulation because learned models can potentially adapt to capture the large-scale dynamics on coarse grids. Learned simulators vary in the extent to which they incorporate components from classical solvers, like those that learn closures and subgrid discretization (Duraisamy et al., 2019; Freund et al., 2019; Pathak et al., 2020; Um et al., 2021; Kochkov et al., 2021), versus adopting a pure Machine Learning (ML) approach (Kim et al., 2018; Lusch et al., 2018; Sanchez-Gonzalez et al., 2020; Wang et al., 2020; Li et al., 2020c;a; Pfaff et al., 2021). Advantages of the pure ML route are that the same model can be used
+
+without specialized knowledge of the domain and that they do not involve the challenge of interfacing with PDE solvers. However, fully learned simulators often work well only when conditions are similar to the training distribution, which can limit their stability over time and their generalization capabilities.
+
+Our primary contribution is to demonstrate that fully learned simulators can learn to predict turbulent dynamics on coarse grids more accurately than classical solvers. This is true over a range of performance metrics, but the learned simulators particularly excel in their ability to preserve high frequency information. While learned simulators can be prohibitively unstable, we show that the simple practice of tuning training noise and the temporal downsampling factor can reliably produce stable rollouts. We introduce a simple model that combines neural networks architectures for grids (Dilated CNNs (Yu & Koltun, 2016), ResNets (He et al., 2015)) with recent advancements on general purpose learned simulation on graphs (encode-process-decode models (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021) trained with noise (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021)). We implement this as well as a set of learned models from the literature that have been proposed for modeling turbulence, and show that Dilated ResNet (Dil-ResNet) outperforms the often more complicated, more heavily parameterized models. Rather than looking at a single problem, we evaluate our models over a variety of challenging turbulent and chaotic domains, showing that Dil-ResNet is generally able to capture a variety of turbulent dynamics out-of-the-box. This includes two environments generated by the new Athena++ solver(Stone et al., 2020), a state of the art (magneto-)hydrodynamics simulator used for astrophysics, where extremely high-resolution and large-scale simulations are often required. Finally, we evaluate the ability of the learned models to generalize to initial conditions, rollout durations, and environment sizes outside of the training distribution. Generalizing out of distribution is a known challenge for learned models, and we document where our models fail and what model and training choices can improve generalization.
+
+# 2 RELATED WORK
+
+Turbulence simulation is a crucial step in problems across disciplines. These include forecasting problems, like predicting the spread of a wildfire (Leonardi et al., 2019) or the evolution of a hurricane (Zhang et al., 2020), engineering challenges, like designing more aerodynamic machinery (Rhie, 1983), and scientific questions, like understanding the physics of insect flight (Dickinson et al., 1999) or dynamics of celestial objects (Fielding et al., 2018). Across applications, a variety of statistical measures are relevant for quantifying physical variables under turbulence (Velocity Autocorrelation, variable histograms, Cooling, Energy spectra). The primary challenge for simulating turbulence is accurately capturing small- and large-scale flow dynamics, and their interplay, simultaneously.
+
+Traditional approaches to computational fluid dynamics integrate the governing PDEs describing the fluid flow, given initial and boundary conditions. State-of-the-art turbulence simulators, such as Athena++, are built upon efficient algorithms that prioritize the preservation of high-order statistics. Such simulators are used frequently in scientific applications to numerically compare model predictions with experimental observations, but can be extremely-often prohibitively-expensive to run. Thus, there is significant practical interest in developing more efficient simulators.
+
+Deep learning models for predicting physical dynamics have traditionally been used for modeling low-dimensional dynamical systems with graph-like (Battaglia et al., 2016; Sanchez-Gonzalez et al., 2018) and grid-like specifications (Raissi et al., 2017; Chen et al., 2018), but there is a growing body of work for fine-grained modeling of complex dynamics, as in particle-based liquids and soft-body physics (Li et al., 2019; Ummenhofer et al., 2020; Sanchez-Gonzalez et al., 2020). Learned models are often used in computer graphics to speed up (Wiewel et al., 2019; Um et al., 2018; Ladicky et al., 2015; Holden et al., 2019) or super-resolve (Xie et al., 2018) simulations. A number of papers predict the steady-state flow around 2D airfoil wings, using CNN (Thuerey et al., 2020; Bhatnagar et al., 2019) or GCN (Belbute-Peres et al., 2020) architectures, or the transient dynamics of various low Reynolds number flows using mesh representations (Pfaff et al., 2021).
+
+In recent years, a number of models have been introduced specifically for learning turbulent dynamics. Many of these use neural networks to model some part of an otherwise classical, theoretically motivated numerical integration setup (Duraisamy et al., 2019; Freund et al., 2019; Pathak et al., 2020; Um et al., 2021; Kochkov et al., 2021; Tompson et al., 2016), PDE formulation (Raissi et al., 2017; Champion et al., 2019), or embedding space (Lusch et al., 2018). Other models incorporate
+
+
+
+
+Figure 1: (a) Learned simulator framework. The model is trained to predict the difference between the current and next state. Gaussian noise can be added to the inputs during training to produce models that are robust to small perturbations. Shown below is the schematic for the Dilated ResNet model (Dil-ResNet). (b-e) Frames predicted by rollouts from the learned simulator model compared to ground truth frames. (b) KS-1D: The model follows the ground truth closely for the first 150 steps $(t < 75)$ and remains plausible thereafter. (c) INCOMP-2D: The model remains accurate after 119 model steps (91,392 solver steps). (d) COMPDECAY-3D: The model remains accurate after 31 model steps (1984 solver steps). (e) COOLMIXLAYER-3D. The model remains qualitatively accurate after 59 model steps (59,000 solver steps) of a box size of $(L = 0.75)$ . Videos available at sites.google.com/view/learned-turbulence-simulators.
+
+
+
+
+
+some information about turbulence simulation into the architecture, but like ours, are learned end-to-end in a supervised way. Wang et al. (Wang et al., 2020) implemented a fully learned, neural network "Turbulent Flow Network" (TF-Net) that applies physically inspired decomposition with learned parameters and processes the components with U-Nets for fluid simulation. Li and colleagues introduced "Fourier Neural Operators" for turbulence simulation (Li et al., 2020a), which apply neural networks that convolution parameters in the Fourier domain. This model is part of a broader family of work (Portwood et al., 2019; Li et al., 2020b) which combines basis transforms (Fourier, Multipole, etc) with neural operators that process the transformed input. We implement models from these papers as baselines to compare to our learned simulator.
+
+# 3 MODEL
+
+# 3.1 LEARNED SIMULATION FRAMEWORK ON GRIDS
+
+We train a simulation model $s: \mathcal{X} \to \mathcal{X}$ that maps $X_{t}$ to $X_{t + \Delta t}$ , where $\mathcal{X}$ is a space of $n + 1$ dimensional tensors which represent the state variables for each point on a grid with $n$ spatial dimensions and one feature dimension at time $t$ . The true physical dynamics applied over $K$ time steps yields a trajectory of states which we denote $(X_{t_0}, \dots, X_{t_K})$ . The "rollout" trajectory produced by iteratively applying $s$ for $K$ steps is denoted $(\hat{X}_{t_0}, \hat{X}_{t_1}, \dots, \hat{X}_{t_K})$ , where $\hat{X}_{t_0} = X_{t_0}$ represents initial conditions given as input. Our learnable simulators (Fig. 1a) implement $s$ using neural networks denoted NN (with weights $\theta$ ), and predict the next state as the difference from the current state, $\tilde{X}_{t + \Delta t} = s(\tilde{X}_t; \theta) = \tilde{X}_t + \mathrm{NN}(\tilde{X}_t; \theta)$ .
+
+# 3.2 MODELS
+
+In this work we study "fully learned" models, which learn the physical dynamics end-to-end without any hard-coded solver components. We implemented a novel Dilated ResNet model, as well as several baseline models. Detailed model parameters can be found in the Appendix.
+
+Dilated ResNet Encode-Process-Decode (Dil-ResNet) We designed this architecture to combine the encode-process-decode paradigm (Sanchez-Gonzalez et al., 2018; 2020) with dilated convolutional networks (Fig. 1a). The encoder and decoder each consist of single linear convolutional layer. The processor consists of $N = 4$ dilated CNN blocks $(\mathrm{dCNN}_n)$ connected in series with residual connections (Yu & Koltun, 2016; He et al., 2015). Each block consists of 7 dilated CNN layers with dilation rates of (1, 2, 4, 8, 4, 2, 1). A dilation rate of N, indicates each pixel is convolved with pixels that are multiples of N pixels away (N=1 reduces to regular convolution). This model is not specialized for turbulence modeling per se, and its components are general-purpose tools for improving performance in CNNs. Residual connections help avoid vanishing gradients, and dilations allow long-range communication while preserving local structure. All individual CNNs use a kernel size of 3 and have 48 output channels (except the decoder, which has an output channel for each feature). Each individual CNN layer in the processor is immediately followed by a rectified linear unit (ReLU) activation function. The Encoder CNN and the Decoder CNNs do not use activations.
+
+Encode-U-Net-Decode (U-Net) We designed this architecture as a simplification of the TF-Net baseline explained below. It uses a simple linear CNN encoder and decoder (same as Dil-ResNet) and a standard U-Net block (Ronneberger et al., 2015). As in (Ronneberger et al., 2015), each CNN stack is made of 3 CNNs, followed by activations. Other hyperparameters of the U-Net also matched those used in (Ronneberger et al., 2015).
+
+Turbulent Flow Net (TF-Net) (Wang et al., 2020) TF-Net uses a domain-specific variation of U-Nets to model turbulence, along with other architectural elements inspired by RANS-LES Hybrid Coupling in the encoder. Hyperparameters matched those used in (Ronneberger et al., 2015; Wang et al., 2020).
+
+Constrained Turbulent Flow Net (Con-TF-Net) (Wang et al., 2020) Wang et al. also explored a constraint term in the loss which penalizes the divergence, which was constrained to be zero everywhere for the PDE in their incompressible turbulence experiments. We implemented a similar model, adapting the constrained function to match constraints or preserved quantities in our datasets. For KS-1D, the mean is constrained to be 0; for INCOMP-2D, the divergence is constrained to be 0, and for COMPDECAY-3D the total energy is constrained to be the same as input's total energy.
+
+Constrained Dilated ResNet (Con-Dil-ResNet) This model is Dil-ResNet (described above) with the additional constraint terms from (Con-TF-Net) added to the loss function. This allows us to examine the effect of the loss term separately from the other aspects of the TF-Net architecture.
+
+Fourier Neural Operator (FNO) (Li et al., 2020a) This model uses the neural operator formalism introduced in earlier work (Li et al., 2020c;b), applied in the Fourier domain. We implemented FNO for 1D and 2D spatial domains as in (Li et al., 2020a) Hyperparameters are from (Li et al., 2020a).
+
+CNN padding We use periodic padding for spatial axes to implement periodic boundary conditions. For the COOLMIXLAYER-3D, which has a fixed boundary condition along the vertical axis, we mask out the value at the boundary when computing training loss and set it to the ground truth at each step of the rollout. We also augment the input state with a binary feature to distinguish boundary pixels.
+
+# 3.3 TRAINING
+
+Loss All models1 are trained to predict $\Delta X$ . We use a mean square error loss $\ell(X_{t}, X_{t + \Delta t}) = \mathrm{MSE}(\mathrm{NN}(X_{t}; \theta), \Delta X)$ to optimize parameters $\theta$ . Input $X_{t}$ and target $\Delta X = X_{t + \Delta t} - X_{t}$ features are normalized to be zero-mean and unit variance, which seemed to improve training speed. The additional mean square error loss components for constraint preservation in Con-Dil-ResNet and Con-Dil-ResNet are added to the main loss with a relative weight of 1.
+
+Training noise Optionally, we trained with Gaussian random noise with fixed standard deviation $\sigma$ added to the input $X_{t}$ and subtracted from the target $\Delta X$ , as this has been shown to improve stability of rollouts and prevent error accumulation by training the model to correct for small errors (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021). See Appendix for more details.
+
+# 4 EXPERIMENTAL TURBULENT DOMAINS
+
+We use four PDEs exhibiting chaotic or turbulent dynamics representative of a wide range of problems across science and engineering. (Fig. 1b-e). These environments range from the classic problems (KS Equations, Incompressible Turbulence) to more challenging environments that incorporate compressibility and non-uniform initial conditions. The training data is generated at high resolution Spatial and temporal downsampling factors and additional details about the environments are shown in the Appendix.
+
+1D Kuramoto-Sivashinsky Equation (KS-1D): A PDE that generates unstable, chaotic dynamics in 1D, solved using Fourier spectral method (Kuramoto, 1978; Sivashinsky, 1977). The state consists of a scalar velocity $v$ per 1D grid point. While KS-1D is not technically turbulent, it is a well-studied chaotic equation that is useful for assessing the ability of our learned models to capture dynamics that are highly unstable and nonlinear.
+
+2D Incompressible Decaying Turbulence (INCOMP-2D): Fluid flow modeled by Navier-Stokes in which small-scale eddies decay into large-scale structures due to the inverse energy cascade, solved using direct numerical simulation (Kochkov et al., 2021). The state consists of a vector velocity $v_{x}, v_{y}$ per 2D grid point. These simulations are relevant to open questions in atmospheric dynamics (Boffetta & Ecke, 2012a).
+
+3D Compressible Decaying Turbulence (COMPDECAY-3D): Decaying transonic turbulent flow under Navier-Stokes, assuming adiabatic equation of state with adiabatic index $\gamma = 5/3$ . The state consists of scalar density $\rho$ , vector velocity $v_x, v_y, v_z$ , and scalar pressure $P$ per 3D grid point. Energy at each grid point is $E = 1/2\rho v^2 + 3/2P$ . Simulations were carried out with Athena++ (Stone et al., 2020), a state-of-the-art simulator used in astrophysics. All real fluids are somewhat compressible, and this is particularly non-negligible when modeling gases (Pope, 2000). In astrophysics problems, for which the Athena++ was developed, understanding the properties of these flows plays a crucial role in regulating planet, star, black hole, and galaxy formation (Brandenburg & Nordlund, 2011).
+
+3D Compressible Turbulence with Radiative Cooling Mixing Layer (COOLMIXLAYER-3D): Turbulent mixing resulting from the Kelvin-Helmholtz instability, caused by velocity differences across the interface between fluids of different densities, solved with Athena++. The state is specified in the same way as in COMPDECAY-3D. Mixing involves strong cooling, leading to net flow from the low-density phase into the mixing layer. This environment was additionally challenging because of its open boundaries and non-uniform initial conditions. This process is common in atmospheric flows as well as many aspects of galaxy formation (Fielding et al., 2020).
+
+# 5 RESULTS
+
+We evaluate the learned simulator models in terms of stability, performance, efficiency, and generalization. Unlike numerical solvers, which are PDE specific, learned simulator models can be designed to be reusable across domains. In Figure 1, we show that the same general-purpose architecture (Dil-ResNet) and loss, trained on each of the domains, learns to capture a range of qualitatively diverse turbulent dynamics across domains (Fig. 1b-e, videos: sites.google.com/view/learned-turbulence-simulators). All results are evaluated on held-out test trajectories sampled from the same distribution used for training (except for generalization sections). All units (except time) are normalized and therefore dimensionless.
+
+Spatial coarsening Numerical solvers are known to lose information, particularly high-frequency information, when applied to coarse grids. We compared our Dil-ResNet learned simulator to Athena++ run on spatially coarsened grids (see Section 5 for comparison with learned models). We chose the energy field $E = \frac{1}{2}\rho v^2 +\frac{3}{2} P$ as the quantitative metric of 3D turbulence for the main text, as it summarizes performance on all state variables. We show results for Athena++ run at resolutions of $32^{3}$ (the same resolution as the learned models) and at $64^{3}$ (higher resolution than the learned models, lower than the ground truth). The "ground truth" data is from Athena++ run at $128^{3}$ . All grids are downsampled to $32^{3}$ for comparison. We compared models in terms of the RMSE
+
+
+Figure 2: Comparison between learned $32^{3}$ Dil-ResNet and same-resolution $32^{3}$ Athena++, intermediate resolution $64^{3}$ Athena++, and ground truth high resolution $128^{3}$ Athena++ in COMPDECAY-3D. (a) Energy Field RMSE ( $y$ -axis) for Dil-ResNet ( $32^{3}$ resolution (blue)) and Athena++ ( $64^{3}$ dark gray), and $32^{3}$ (light gray)) on a test trajectory the window of times seen during training. Dil-ResNet RMSE is lower than that of the comparably coarse Athena++ $32^{3}$ but higher than Athena++ $64^{3}$ . (b) Energy Field RMSE ( $y$ -axis) as a function of rollout duration ( $x$ -axis) over the training window (white background) and generalizing beyond (pink background) $^{3}$ . The learned simulator's error grows faster starting around 3x the training window (at $t \approx 3000$ ). Each blue line corresponds to a different seed. Ground truth (red) error is at 0 and hidden by $x$ -axis. (c) Energy Spectrum RMSE ( $y$ -axis). Dil-ResNet has lower error than both comparable and higher resolution $32^{3}$ and $64^{3}$ Athena++ models. (d) Energy Spectrum RMSE ( $y$ -axis) over rollout. Dil-ResNet's rollouts maintain lower Energy Spectrum error for up to $4 \times$ the training duration. (e) Energy Spectrum for the learned and Athena++ simulators at rollout $t \approx 1$ s (the end of the training window). The $x$ -axis represents spatial frequency, and the $y$ -axis represents spectral power. Compared to Dil-ResNet, the coarse Athena++ models lose power in the high frequency range. (f-i) Sample energy Fields at $t \approx 1$ s for Dil-ResNet and the three Athena++ resolutions. States from coarse Athena++ resolutions lose high frequency detail with respect to the ground truth, which the coarse learned model captures.
+
+of the predicted Energy Field and the Log Energy Spectrum (See Appendix for definition). We used the energy field as the main variable as it is a combination of all five state variables, but see Videos and Appendix for per-variable results.
+
+The learned simulator outperforms the comparable resolution Athena++ $32^{3}$ across a variety of metrics, despite having no built-in specializations for turbulent dynamics. In Figure 2a-b, we show RMSE for the Energy Field for $t < 1$ , which corresponds to the initial phase of the turbulence decay seen during training (white window in Fig 2b). Energy Field is given as $E = \frac{1}{2}\rho v^2 + \frac{3}{2} P$ , and it implicitly summarizes performance on all state variables (other metrics are shown in the Appendix). The learned simulator outperforms both the same- and higher-resolution Athena++ rollouts in terms of the Log Energy Spectrum (Fig. 2c,d), as the Athena++ simulators lose high frequency components that the learned simulators preserve (Figure 2e-i). Log Energy Spectrum is computed by (1) taking the 3-D Fourier transform, (2) computing the amplitude of each component, (3) taking the histogram of the 3-D Fourier transform over frequency amplitude ( $\sqrt{k_x^2 + k_y^2 + k_z^2}$ ) to get a 1-D PSD, and (4) then taking the log. We looked at a range of other physically relevant metrics and find that the learned simulator outperforms the comparably coarse $32^{3}$ Athena++ but not $64^{3}$ Athena++ on predicting feature histograms, the phase histograms (pressure v. density and entropy v. pressure), and mean squared error for each feature. The learned simulator outperformed both $32^{3}$ and $64^{3}$ Athena++ simulators on higher order velocity autocorrelations, as well as spectrum error. Since different scientific questions rely on different metrics, the tradeoffs of learned versus physics based simulators may vary across applications. These metrics are defined in the Appendix.
+
+Stability and training noise While scientific simulators are typically designed to be stable over time, a common failure mode in learned models is that small errors can accumulate over rollouts and lead to a domain shift. One reason for this is that, as the model is fed its most recent prediction back in as input for predicting future steps, its distribution of input states begins to deviate from
+
+
+Figure 3: Effects of noise and temporal downsampling on rollout stability. (a) One step errors are larger for models trained with noise. Note the error spikes are very small and are not model-related general artifacts, but specific to particular frames of this test trajectory. (b) However, models trained without noise can yield unstable rollouts, especially when using very small time steps, which is not a problem for models trained with noise. (c, e) One-step model error rises monotonically with coarser temporal downsampling. (d, f) Rollout error has a U-shaped curve over temporal downsampling factors, for a trajectory of the same time duration, with minimum error around $\Delta t = 0.032$ .
+
+
+
+that experienced at training, where it fails to generalize and can make arbitrarily poor predictions. We found that adding Gaussian noise $\sigma = 0.01$ to the inputs $X_{t}$ during training led to less accurate one-step predictions (Fig. 3a), but more stable trajectories (Fig. 3b). This is of particular importance for models that take a very large number of small steps. This is presumably because the training distribution has broader support and the model is optimized to map deviant inputs back to the training distribution.
+
+Temporal coarsening An advantage of learned simulators is that they can exploit a much larger step size than the numerical solver, as they can discover efficient updates that capture relevant dynamics on larger timescale. This allows for faster simulation. See Videos and Appendix for qualitative examples of Dil-ResNet trained on a large range of exponentially increasing coarse timesteps in KS-1D, INCOMP-2D and COMPDECAY-3D, which the model can adapt to (note that a separate model is trained for each $\Delta t$ ). Quantitatively, though the one-step error is at its lowest when using smaller time steps (Fig. 3c), the rollout error has an optimal time step at around 0.032 (Fig. 3d). This demonstrates the tradeoff between large and small time steps. Large time steps ( $>0.032$ ) cause predicting the next state to become more challenging. Small time steps ( $<0.008$ ), which require more simulator steps for the same duration, often yield unstable models because they provide more opportunities for errors to accumulate (Fig. 3d) (e.g. for some $\Delta t$ , $1s/\Delta t$ steps are required). However, they can still be stabilized to some extent with training noise (Fig. 3f).
+
+
+Figure 4: Comparison across learned models, contrasting noise and no-noise training conditions, across the three primary tasks (a) KS-1D, (b) INCOMP-2D, and (c) COMPDECAY-3D. With a few exceptions, the various learned models had comparable performance, though the Dilated ResNets (Dil-ResNet, Con-Dil-ResNet) consistently have the lowest error. In KS-1D (a), the noise harmed performance; in INCOMP-2D (b) the noise particularly benefits the FNO rollouts; in COMPDECAY-3D (c) the noise mainly stabilized rollouts.
+
+
+
+
+
+
+
+Comparison across learned models In Figure 4 we compare the learned models in terms of the performance across the different primary turbulence datasets. We find that Dilated ResNets (Dil-ResNet, Con-Dil-ResNet) are the top performing models, numerically outperforming more specialized architectures. However, we find that all learned models (ours and the baselines) produce qualitatively good rollouts compared to Athena++ $32^{3}$ , suggesting learned simulators are generally a good approach to turbulence simulation on coarse grids (see Videos). We also find training noise improves stability across learned models. All models shown in Figure 4 are evaluated such that the first predicted step is the 7th step of the ground truth trajectory. This is to allow comparison with TF-Net, which takes $C = 6$ context states as input. We show in further detail the predictions of the different models in the Appendix.
+
+Running time Learned simulators can accelerate simulations not only by coarsening in time and space, but also by running off-the-shelf on specialized GPU hardware, unlike e.g., Athena++ which is currently CPU specific. By downsampling in time ( $\Delta t = 0.0005 \rightarrow 0.032$ ) and space ( $128^3 \rightarrow 32^3$ ), the Dil-ResNet model trained on COMPDECAY-3D running on a single GPU speeds up the wall-clock simulation time by $1000x$ compared to Athena++ running on an 8-core CPU (further details in Appendix). GPU solvers can be developed for many applications and can greatly accelerate simulation; however, these can require a lot of expertise and time to develop, and will still require high spatial and temporal resolution grids.
+
+Constraint satisfaction and preserved quantities Traditional solvers often implement constraints to preserve conserved quantities. Learned simulators do not necessarily learn such constraints and may fail to capture these (see Appendix). We found that training with noise prevents this in some cases: it helps Dil-ResNet keep the mean value of the KS-1D velocity, and the INCOMP-2D divergence bounded near zero. However, in COMPDECAY-3D using noise does not seem to help preventing the model from predicting drifts in total mass, vector momentum and energy, even though they are fixed across the whole dataset. We speculate this is because these preserved quantities only account for 5 degrees of freedom out of a 3D state that is made of $163840\left(= 5 \cdot 32^{3}\right)$ output variables.
+
+Generalization to longer rollouts Dil-ResNet can stably unroll KS-1D for much longer than the trajectories seen in training. This is expected, as the distribution of states is stationary in time (see Appendix). By contrast, the distribution of states in COMPDECAY-3D is not stationary in time, as the flow decays progressively into smaller and smaller structures. We can use this to construct a more challenging generalization setting by training Dil-ResNet on early stages of the decay only $(t < 1)$ , and testing on longer durations in which the turbulence develops further than observed during training. $(1 < t < 4$ in Fig. 2b, d). We find Dil-ResNet remains competitive with $32^{3}$ Athena++ for turbulence that has decayed for up to twice longer $t < 2$ than observed during training.
+
+Generalization to different initial conditions We varied the ratio of solenoidal to compressive components in the initial velocity field in COMPDECAY-3D (Fig. 5a) in order to test the models' ability to generalize to novel initial conditions. Compared to Athena++ at $32^{3}$ and $64^{3}$ , we found that the models generalize well to more solenoidal but not to more compressive initial conditions, possibly due to faster turbulence decay under compressive conditions4. We find that Dil-ResNet (with or without noise) has particular difficulty generalizing to the more compressive components. This is somewhat ameliorated with the added constraint to the loss function (Con-Dilated-ResNet). Results for other models are similar (see Appendix).
+
+Generalization to larger boxes We tested the generalization capability of Dil-ResNet to COOLMIXLAYER-3D boxes with different size $L$ in the $x$ and $y$ direction (the length along the vertical $z$ axis perpendicular to the mixing layer remained constant). We quantified the predicted cooling velocity (small laminar flow in the low-density phase perpendicular to the interface, see Appendix for more details) which is of scientific relevance and known to depend on the box size. Specifically, for COOLMIXLAYER-3D, the dynamics undergo a transition when the box width increases relative to the cooling length, which is difficult to study because simulations for these widths essentially prohibitive. We found that unless Dil-ResNet is trained on a range of sizes, the predicted cooling velocity does not follow the right trend, and even when trained on a range of sizes, generalization beyond the training
+
+
+Figure 5: Generalization outside of the training distribution. (a) Generalization to different initial conditions. We vary the ratio of compressive and solenoidal components in the initial velocity field. Solid markers indicated the training region. We find that, compared to coarse Athena++, generalization to more compressive initial states is challenging for learned models and inconsistent across seeds, but that loss constraints (Con-Dil-ResNet) ameliorate this to some extent. (b) Cooling velocity generalization as function of the box size in the mixing layer. The black line indicates the ground truth cooling velocity averaged across time for 8 test trajectories with different box sizes, with one standard deviation represented as the shaded region. None of 3 seeds of Dil-ResNet trained on a single length of $L = 0.75$ (blue) generalize outside the training range. Dil-ResNet trained on multiple lengths (orange) shows better generalization performance. However, generalization far beyond training box sizes remains a challenge.
+
+
+
+range is not reliable across seeds (Fig. 5b). We speculate that achieving this form of generalization would require either stronger inductive biases, more sophisticated dataset engineering, or both.
+
+# 6 CONCLUSIONS
+
+Learned simulation techniques have been advancing steadily in recent years. Our results demonstrate that learned simulators can outperform comparably coarse solvers in challenging turbulence settings on a range of scientifically relevant statistical measures, suggesting that state-of-the-art learned simulators can be useful for efficient, accurate simulation even in chaotic domains. Learned simulators can perform particularly well in terms of preserving high frequency information. The Dilated ResNet model had lower log Energy Spectrum RMSE than both $32^{3}$ Athena++ and the higher resolutions $64^{3}$ Athena++, and the RMSE remained lower even beyond the duration seen during training. In our experiments, we found that using training noise and temporal downsampling improved the stability and accuracy of extended rollouts.
+
+Out-of-distribution generalization is a known challenge for learned simulation (Duraisamy et al., 2019) and for deep learning methods generally, and we find that the coarse Athena++ models outperform the learned models on more extreme generalization conditions. However, certain training choices can make learned models more robust. In particular, physically-informed regularization (e.g., Con-Dil-ResNet and Con-TF-Net) improved generalization to different initial conditions on COMPDECAY-3D, and for COOLMIXLAYER-3D, augmenting the training data with a larger range of box sizes improved generalization performance on an even larger range. Future work should explore methods from other areas of deep learning for improving adversarial robustness and domain generalization, such as feature denoising (Xie et al., 2019) and discriminative objectives (Tzeng et al., 2017; Lample et al., 2017).
+
+More broadly, we conclude that a key potential role for learned simulators in the near term is distilling expensive, high-resolution engineered simulators into low-resolution algorithms to strike better performance-versus-efficiency tradeoffs. Our approach can be applied effectively to diverse and challenging environments, which suggests that even generic CNN-based models may apply well to low-resolution simulation on a wide range of physical domains which can be represented as grids.
+
+# ACKNOWLEDGMENTS
+
+We would like to thank Meire Fortunato, Matthew Grimes, and Lyuba Chumakova for helpful discussions and comments on the manuscript.
+
+# REFERENCES
+
+Peter W Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. arXiv preprint arXiv:1612.00222, 2016.
+Filipe de Avila Belbute-Peres, Thomas D. Economon, and J. Zico Kolter. Combining differentiable PDE solvers and graph neural networks for fluid flow prediction. In Proceedings of the 37th International Conference on Machine Learning ICML 2020, 2020.
+A. Beljaars. Parameterization of physical processes | turbulence and mixing. In James R. Holton (ed.), Encyclopedia of Atmospheric Sciences, pp. 1705-1717. Academic Press, Oxford, 2003. ISBN 978-0-12-227090-1. doi: https://doi.org/10.1016/B0-12-227090-8/00310-9. URL https://www.sciencedirect.com/science/article/pii/B012270908003109.
+Saakaar Bhatnagar, Yaser Afshar, Shaowu Pan, Karthik Duraisamy, and Shailendra Kaushik. Prediction of aerodynamic flow fields using convolutional neural networks. Computational Mechanics, 64(2):525-545, 2019.
+Guido Boffetta and Robert E. Ecke. Two-dimensional turbulence. Annual Review of Fluid Mechanics, 44(1):427-451, 2012a. doi: 10.1146/annurev-fluid-120710-101240. URL https://doi.org/10.1146/annurev-fluid-120710-101240.
+Guido Boffetta and Robert E Ecke. Two-dimensional turbulence. Annual Review of Fluid Mechanics, 44:427-451, 2012b.
+Axel Brandenburg and Åke Nordlund. Astrophysical turbulence modeling. Reports on Progress in Physics, 74(4):046901, April 2011. doi: 10.1088/0034-4885/74/4/046901.
+V. M. Canuto and J. Christensen-Dalsgaard. Turbulence in astrophysics: Stars. Annual Review of Fluid Mechanics, 30(1):167-198, 1998. doi: 10.1146/annurev.fluid.30.1.167.
+Kathleen Champion, Bethany Lusch, J. Nathan Kutz, and Steven L. Brunton. Data-driven discovery of coordinates and governing equations. Proceedings of the National Academy of Sciences, 116 (45):22445-22451, 2019. ISSN 0027-8424. doi: 10.1073/pnas.1906995116. URL https://www.pnas.org/content/116/45/22445.
+Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. arXiv preprint arXiv:1806.07366, 2018.
+Michael H. Dickinson, Fritz-Olaf Lehmann, and Sanjay P. Sane. Wing rotation and the aerodynamic basis of insect flight. Science, 284(5422):1954-1960, 1999. doi: 10.1126/science.284.5422. 1954. URL https://www.science.org/doi/abs/10.1126/science.284.5422. 1954.
+Karthik Duraisamy, Gianluca Iaccarino, and Heng Xiao. Turbulence modeling in the age of data. Annual Review of Fluid Mechanics, 51(1):357-377, Jan 2019. ISSN 1545-4479. doi: 10.1146/annurev-fluid-010518-040547. URL http://dx.doi.org/10.1146/annurev-fluid-010518-040547.
+Christoph Federrath and Ralf S. Klessen. The Star Formation Rate of Turbulent Magnetized Clouds: Comparing Theory, Simulations, and Observations. *The Astrophysical Journal*, 761(2):156, December 2012. doi: 10.1088/0004-637X/761/2/156.
+Drummond Fielding, Eliot Quataert, and Davide Martizzi. Clustered supernovae drive powerful galactic winds after superbubble breakout. Monthly Notices of the Royal Astronomical Society, 481(3):3325-3347, December 2018. doi: 10.1093/mnras/sty2466.
+
+Drummond B. Fielding, Eve C. Ostriker, Greg L. Bryan, and Adam S. Jermyn. Multiphase gas and the fractal nature of radiative turbulent mixing layers. The Astrophysical Journal, 894(2):L24, May 2020. ISSN 2041-8213. doi: 10.3847/2041-8213/ab8d2c. URL http://dx.doi.org/10.3847/2041-8213/ab8d2c.
+Drummond B. Fielding, Stephanie Tonnesen, Daniel DeFelippis, Miao Li, Kung-Yi Su, Greg L. Bryan, Chang-Goo Kim, John C. Forbes, Rachel S. Somerville, Nicholas Battaglia, Evan E. Schneider, Yuan Li, Ena Choi, Christopher C. Hayward, and Lars Hernquist. First Results from SMAUG: Uncovering the Origin of the Multiphase Circumgalactic Medium with a Comparative Analysis of Idealized and Cosmological Simulations. The Astrophysical Journal, 903(1):32, November 2020. doi: 10.3847/1538-4357/abbc6d.
+Jonathan B. Freund, Jonathan F. MacArt, and Justin Sirignano. DPM: A deep learning PDE augmentation method (with application to large-eddy simulation), 2019.
+Uriel Frisch. Turbulence. The legacy of A.N. Kolmogorov. Cambridge University Press, 1995.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015.
+Daniel Holden, Bang Chi Duong, Sayantan Datta, and Derek Nowrouzezahrai. Subspace neural physics: Fast data-driven interactive simulation. In Proceedings of the 18th annual ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 1-12, 2019.
+Arthur M. Jaffe. The millennium grand challenge in mathematics. Notices of the AMS, 53(6):652-660, 2006.
+Byungsoo Kim, Vinicius C. Azevedo, Nils Thuerey, Theodore Kim, Markus H. Gross, and Barbara Solenthaler. Deep fluids: A generative network for parameterized fluid simulations. CoRR, abs/1806.02071, 2018. URL http://arxiv.org/abs/1806.02071.
+Dmitrii Kochkov, Jamie A. Smith, Ayya Alieva, Qing Wang, Michael P. Brenner, and Stephan Hoyer. Machine learning accelerated computational fluid dynamics, 2021.
+A. Kolmogorov. The Local Structure of Turbulence in Incompressible Viscous Fluid for Very Large Reynolds' Numbers. Akademiia Nauk SSSR Doklady, 30:301-305, January 1941.
+Yoshiki Kuramoto. Diffusion-Induced Chaos in Reaction Systems. Progress of Theoretical Physics Supplement, 64:346-367, 02 1978. ISSN 0375-9687. doi: 10.1143/PTPS.64.346. URL https://doi.org/10.1143/PTPS.64.346.
+L'ubor Ladický, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Data-driven fluid simulations using regression forests. ACM Trans. Graph., 34(6), 2015.
+Guillaume Lample, Neil Zeghidour, Nicolas Usunier, Antoine Bordes, Ludovic Denoyer, and Marc'Aurelio Ranzato. Fader networks: Manipulating images by sliding attributes. arXiv preprint arXiv:1706.00409, 2017.
+Stefano Leonardi, Martand Mayukh Garimella, and Umberto Ciri. Effect of turbulence on wildfire propagation. In APS Division of Fluid Dynamics Meeting Abstracts, APS Meeting Abstracts, pp. S18.006, November 2019.
+Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B. Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In International Conference on Learning Representations, 2019.
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations, 2020a.
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Multipole graph neural operator for parametric partial differential equations. arXiv preprint arXiv:2006.09535, 2020b.
+
+Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Neural operator: Graph kernel network for partial differential equations, 2020c.
+Bethany Lusch, J Nathan Kutz, and Steven L Brunton. Deep learning for universal linear embeddings of nonlinear dynamics. Nature Communications, 9(1):4950, 2018. ISSN 2041-1723. doi: 10.1038/s41467-018-07210-0. URL https://doi.org/10.1038/s41467-018-07210-0.
+Steven A. Orszag and G. S. Patterson. Numerical Simulation of Three-Dimensional Homogeneous Isotropic Turbulence. Physical Review Letters, 28(2):76-79, January 1972. doi: 10.1103/PhysRevLett.28.76.
+Jaideep Pathak, Mustafa Mustafa, Karthik Kashinath, Emmanuel Motheau, Thorsten Kurth, and Marcus Day. Using machine learning to augment coarse-grid computational fluid dynamics simulations, 2020.
+Tobias Pfaff, Meire Fortunato, Alvaro Sanchez-Gonzalez, and Peter Battaglia. Learning mesh-based simulation with graph networks. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=roNqYL0_XP.
+Stephen B. Pope. Turbulent Flows. Cambridge Univ. Press, 2000.
+Gavin D Portwood, Peetak P Mitra, Mateus Dias Ribeiro, Tan Minh Nguyen, Balasubramanya T Nadiga, Juan A Saenz, Michael Chertkov, Animesh Garg, Anima Anandkumar, Andreas Dengel, et al. Turbulence forecasting via neural ode. arXiv preprint arXiv:1911.05180, 2019.
+Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017.
+Li Rhie, C Chow. Numerical study of the turbulent flow past an airfoil with trailing edge separation. AIAA Journal, 21(11):1525-1532, 1983.
+Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015.
+Ahmed M. Sallam and Ned H. C. Hwang. Human red blood cell hemolysis in a turbulent shear flow: Contribution of reynolds shear stresses. Biorheology, 21(6):783-797, 1984.
+Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In International Conference on Machine Learning, pp. 4470-4479. PMLR, 2018.
+Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter Battaglia. Learning to simulate complex physics with graph networks. In International Conference on Machine Learning, pp. 8459-8468. PMLR, 2020.
+G.I. Sivashinsky. Nonlinear analysis of hydrodynamic instability in laminar flames—i. derivation of basic equations. Acta Astronautica, 4(11):1177-1206, 1977. ISSN 0094-5765. doi: https://doi.org/10.1016/0094-5765(77)90096-0. URL https://www.sciencedirect.com/science/article/pii/0094576577900960.
+E. R. Smith. A molecular dynamics simulation of the turbulent couette minimal flow unit. Physics of Fluids, 27(11):115105, 2015. doi: 10.1063/1.4935213.
+James M. Stone, Kengo Tomida, Christopher J. White, and Kyle G. Felker. The athena++ adaptive mesh refinement framework: Design and magnetohydrodynamic solvers. The Astrophysical Journal Supplement Series, 249(1):4, Jun 2020. ISSN 1538-4365. doi: 10.3847/1538-4365/ab929b. URL http://dx.doi.org/10.3847/1538-4365/ab929b.
+Nils Thuerey, Konstantin Weißenow, Lukas Prantl, and Xiangyu Hu. Deep learning methods for reynolds-averaged navier-stokes simulations of airfoil flows. AIAA Journal, 58(1):25-36, 2020.
+
+Jonathan Thompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating eulerian fluid simulation with convolutional networks. CoRR, abs/1607.03597, 2016. URL http:// arxiv.org/abs/1607.03597.
+Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7167-7176, 2017.
+Kiwon Um, Xiangyu Hu, and Nils Thuerey. Liquid splash modeling with neural networks. In Computer Graphics Forum, volume 37, pp. 171-182. Wiley Online Library, 2018.
+Kiwon Um, Robert Brand, Yun, Fei, Philipp Holl, and Nils Thuerey. Solver-in-the-Loop: Learning from differentiable physics to interact with iterative PDE-solvers, 2021.
+Benjamin Ummenhofer, Lukas Prantl, Nils Thürey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In International Conference on Learning Representations, 2020.
+Rui Wang, Karthik Kashinath, Mustafa Mustafa, Adrian Albert, and Rose Yu. Towards physics-informed deep learning for turbulent flow prediction, 2020.
+Steffen Wiewel, Moritz Becher, and Nils Thuerey. Latent space physics: Towards learning the temporal evolution of fluid flow. In Computer Graphics Forum, pp. 71-82. Wiley Online Library, 2019.
+Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 501-509, 2019.
+You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. Tempogan: A temporally coherent, volumetric gan for super-resolution fluid flow. ACM Trans. Graph., 37(4), July 2018.
+Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions, 2016.
+Jun A. Zhang, Evan A. Kalina, Mrinal K. Biswas, Robert F. Rogers, Ping Zhu, and Frank D. Marks. A review and evaluation of planetary boundary layer parameterizations in hurricane weather research and forecasting model using idealized simulations and observations. Atmosphere, 11 (10), 2020. ISSN 2073-4433. doi: 10.3390/atmos11101091. URL https://www.mdpi.com/2073-4433/11/10/1091.
+
+A APPENDIX
+
+| Hyperparameter | Dil-ResNet | U-Net | TF-Net | FNO |
| Kernel size | 3 | 3 | 3 | |
| Latent size | 48 | | | 48 |
| Activation | ReLU | ReLU | ReLU | ReLU |
| Loss | MSE | MSE | MSE | MSE |
| Dilated block depth | 7 | | | |
| Dilated block dilations | (1,2,4,8,4,2,1) | | | |
| # processor blocks N | 4 | | | |
| Shared processors? | No | | | |
| # U-Net layers | | 7 | 4 (x3 encoders) + 3 (single decoder) | |
| Stride | | 2 | 2 | |
| CNN stack depth | | 3 | 3 | |
| Base latent size | | 64 | 64 | |
| Spatial downsample by layer | (1,2,4,8,4,2,1) | | (1,2,4,8,4,2,1) | |
| Latent sizes | | (64,128,256,512,256,128,64) | (64x3,128x3,256x3,512x3256,128,64) | |
| Spatial filter kernel size | | | 5 | |
| Length of input sequence C 1 | 1 | 1 | 6 | 1 |
| # modes | | | | 8 or all |
| # layers | | | | 4 |
| Constraint weight | 1 | | 1 | |
+
+Table A.1: Model hyperparameters for the four basic models used. Con-Dil-ResNet and Con-TF-Net have the same architectural parameters as Dil-ResNet and TF-Net, respectively, with the added constraint weighted by the constraint weight. Note that spatial filter kernel for TF-Net is different from the kernel size in the first row: this spatial filter is applied during the decomposition in the TF-net model.
+
+# B ADDITIONAL MODEL DETAILS
+
+Encode-U-Net-Decode (U-Net) We designed this architecture as a simplification of the TF-Net baseline explained below. It uses a simple linear CNN encoder and decoder (same as Dil-ResNet) and a standard U-Net block (Ronneberger et al., 2015). The standard U-Net block consists of 7 layers. The first 3 layers each consist of a CNN stack followed by a factor-of-2 downsampling via striding the input. The fourth layer of the U-Net is another CNN stack, which at this point operates over a grid that is 8 times smaller than the input along each spatial axis. The last 3 layers each consist of a factor-of-2 upsampling using nearest neighbors, concatenation with the output of one of the first three layers (in reverse), and another CNN stack. This downsampling/upsampling process allows long-range communication similar to the Dilated ResNet, while also preserving local structure. As in (Ronneberger et al., 2015), each CNN stack is made of 3 CNNs, followed by activations. Other hyperparameters of the U-Net also matched those used in (Ronneberger et al., 2015).
+
+Turbulent Flow Net (TF-Net) (Wang et al., 2020) TF-Net uses a domain-specific variation of U-Nets to model turbulence, along with other architectural domain-specific elements inspired by RANS-LES Hybrid Coupling in the encoder. The model implements a custom encoder by taking a sequence of the most recent $C = 6$ states as inputs, and uses this to build three separate input arrays, by applying specific combinations of learned spatial filters, learned temporal filters, and differences
+
+of those. Each of these components are processed by a separate U-Net encoder (first 4 layers of the U-Net), then the latent outputs of each layer are concatenated and fed into a shared U-Net decoder (final 3 layers). Hyperparameters also matched those used in (Ronneberger et al., 2015; Wang et al., 2020).
+
+Constrained Turbulent Flow Net (Con-TF-Net) (Wang et al., 2020) Wang et al. also explored a constraint term in the loss which penalizes the divergence, which was constrained to be zero everywhere for the PDE in their incompressible turbulence experiments. We implemented a similar model, adapting the constrained function to match either constraints or preserved quantities in our datasets. For KS-1D, the mean is constrained to be 0; for INCOMP-2D, the divergence is constrained to be 0, and for COMPDECAY-3D the total energy is constrained to be the same as the total energy of the input.
+
+Constrained Dilated ResNet (Con-Dil-ResNet) This model is Dil-ResNet (described above) with the additional constraint terms from (Con-TF-Net) added to the loss function. This allows us to examine the effect of the loss term separately from the other aspects of the TF-Net architecture.
+
+Fourier Neural Operator (FNO) (Li et al., 2020a) This model uses the neural operator formalism introduced in earlier work (Li et al., 2020c;b), applied in the Fourier domain. This model applies matrix multiplications in the Fourier-transformed grid with complex weights learned independently for each component, as well as linear updates. The model combines pixel-wise learned linear embeddings in the spatial domain. The model combines learned linear layers, applied to each point of the spatial grid separately, with matrix multiplication on the Fourier-transformed grid using learned weights. A unique matrix of weights is learned for point in the Fourier grid. Low-pass filtering is optionally implemented by truncating all but $K$ modes along each dimension in the Fourier-transformed grid. The authors explored using a version of the model that takes a stack of past states as input. Since the state is fully-Markov, we opted for the version of the model that takes a single state as input as it is more comparable to the majority of the other models. Unlike previous models, which rely on spatially local convolutions and depth for long-range communication, this model applies long-range communication at every step in the Fourier domain. We implemented this model for 1D and 2D spatial domains as in (Li et al., 2020a).
+
+We found difficulties running this model on the 3D datasets due to compute and memory constraints. We speculate this is due to time and space complexity of the Fourier transform (when taking into account the backwards pass) which would probably require a custom gradient re-materialization strategy. This may be specific to TensorFlow which required us to reimplement the non-differentiable tf.signal.rfft3d as a sequence of tf.signal.rfft2d and tf.signal.fft.
+
+# B.1 ADDITIONAL DATASET DETAILS
+
+# B.1.1 1D KURAMOTO-SIVASHINSKY (KS) EQUATION
+
+This is a well-studied 1D PDE that generates unstable, chaotic dynamics in 1 dimension (Kuramoto, 1978; Sivashinsky, 1977) with periodic boundaries. The ground truth simulations are computed using the Fourier Spectral Method. Initial condition was set to $\cos (w_{1}x + \phi_{1})(1 + \sin (w_{2}x + \phi_{2}))$ , where $x$ ranges from 0 to $2\pi$ , $\phi_{i}$ are sampled uniformly from $[0,2\pi)$ , and $w_{1}$ are integers sampled uniformly from [1, 12). We perform a warmup from this initial condition for 75 simulation time units.
+
+# B.1.2 2D INCOMPRESSIBLE DECAYING TURBULENCE
+
+This models fluid flow described by the Navier-Stokes equations in which small-scale eddies decay into the large-scale structures due to the inverse energy cascade (Boffetta & Ecke, 2012b). The underlying simulations were performed by solving the incompressible Navier-Stokes equations using a direct numerical simulation (DNS) finite-volume solver. Boundaries along both dimensions are periodic, and the initial conditions consist of random velocity fields with small-scale variation. Initial conditions for different trajectories were obtained by sampling a high-resolution velocity field from a log-normal distribution of amplitude 1 and wavenumber $k = 10$ . We perform a warmup for 500 simulation time units, this is done to discard the transient flow that is heavily influenced by the underlying numerical scheme.
+
+ | KS Equation | Incompressible Decaying | Compressible Decaying | Compressible Radiative Cooling Mixing Layer |
| Numerical Solver | Fourier Method | DNS | Athena++ | Athena++ |
| # Spatial dims | 1 | 2 | 3 | 3 |
| # Features | 1 | 2 | 5 | 5 |
| Features | v | vx,vy | ρ, vx, vy, vz, P | ρ, vx, vy, vz, P |
| Box size | | | | |
| Lx | 2π | 2π | 1 | 0.25 to 2 |
| Ly | n/a | 2π | 1 | 0.25 to 2 |
| Lz | n/a | n/a | 1 | 3 |
| Grid element size | | | | |
| Solver | 2π/256 | 2π/576 | 1/128 | 1/128 |
| Learned model (relative to solver) | 2π/64 | 2π/48 | 1/32 | 1/32 |
| 4x | 12x | 4x | 4x |
| Warm-up duration | 75 | 500 | 0.05 | 2.32 |
| Trajectory duration | 181 | 400 | 1 | 7.226 |
| Time step | | | | |
| Solver | 0.5 | 0.00436 | 0.0005 | 0.00012 to 0.00014 |
| Learned model (relative to solver) | 0.5 | 3.35 | 0.032 | 0.12 |
| 1x | 768x | 64x | 1000x to 875x |
| # Trajectories | | | | |
| Training | 1000 | 190 | 27 | 20 if Lx = 0.75 |
| | | 5 if Lx ≠ 0.75 |
| Validation | 100 | 10 | 4 | 1 per Lx |
| Test | 100 | 10 | 4 | 1 per Lx |
| Training details | | | | |
| Early stopping? | No | No | No | Yes |
| Batch size | 32 | 8 | 1 | 1 (4 if multisize) |
| Noise | 1e-2 | 1e-4 | 1e-2 | 1e-3 |
| Constrained | mean v | divergence | total energy | 1e-3 |
+
+Table B.1: Dataset details. $\rho$ refers to density, $P$ to pressure, and $v_{x}, v_{y}, v_{z}$ to velocity components. Warm-up refers to the initial transient from initial conditions which is influenced by the underlying numerical scheme and discarded from evaluation and training. Figures are dimensionless.
+
+| # Parameters | 1D | 2D | 3D |
| Dil-ResNet | 195361 | 584162 | 1757477 |
| U-Net | 3916993 | 11739202 | 35072581 |
| TF-Net | 17358540 | 31239137 | 93712968 |
| FNO (K=8) | 288433 | 4159250 | 62222693 |
| FNO (K=full) | 1191601 | 42479378 | 603994469 |
+
+Table B.2: Number of parameters per model.
+
+# B.1.3 3D COMPRESSIBLE DECAYING TURBULENCE
+
+This models decaying transonic Navier-Stokes turbulent flow in a 3D cubic box with periodic boundary conditions (e.g., Orszag & Patterson, 1972). These simulations adopt an adiabatic equation of state with a constant adiabatic index $\gamma = 5/3$ . Simulations were carried out with Athena++ (Stone et al., 2020). The initial turbulence is driven on scales $\geq L$ , the size of the box. The turbulent
+
+driving pattern in the initial condition is split into its compressive and solenoidal components using a Helmholtz decomposition. The relative strength of these two components is varied from purely compressive to purely solenoidal. The initial driving pattern results in a root-mean-squared velocity of $\sqrt{2} c_{s}$ , where $c_{s}^{2} = (5 / 3)(P / \rho)$ is the sound speed of the fluid. The initial conditions are varied across trajectories by randomizing the phase of the spectral components, leading to different pattern in real space. We perform a warmup for 0.05 simulation time units. Compressible turbulence is ubiquitous across problems in science: all fluids are somewhat compressible, and this is usually nonnegligible when modeling gases (Pope, 2000). In astrophysics problems, for which the Athena++ was specifically developed, understanding the dynamics and properties of these flows on small and large scales plays a crucial role in regulating planet, star, black hole, and galaxy formation (Brandenburg & Nordlund, 2011).
+
+# B.1.4 3D COMPRESSIBLE RADIATIVE COOLING MIXING LAYER DYNAMICS
+
+These simulations model the interplay of radiative cooling and mixing that results from turbulence driven by the Kelvin-Helmholtz instability, which can arise when there is velocity difference across the interface between two fluids of different densities. The simulations are set up as a boundary problem initialized with a low-density fluid $(\rho = 0.01)$ on the top half of the domain $(z > 0)$ moving in the positive $x$ direction $(v_{x} = 2.04, v_{y} = v_{z} = 0)$ , and a high-density fluid $(\rho = 1)$ moving in the negative $x$ direction in the bottom half of the domain $(v_{x} = -2.04, v_{y} = v_{z} = 0)$ . The initial pressure is set to 1. The boundary conditions are periodic in both $x$ and $y$ , and fixed in $z$ . To break the symmetry, small perturbations to $v_{z}$ are added along the boundary. These perturbations are changed across trajectories by randomizing the phase of the spectral components, leading to different patterns in real space. We perform a warmup for 2.32 simulation time units. Simulations were carried out with Athena++ (Stone et al., 2020).
+
+This data presents a few unique challenges compared to the others. First, it was the only domain with fixed boundary conditions. Second, because turbulent dynamics are limited to the vicinity of the mixing layer, and because the behavior of the fluid above, at, and below the mixing layer is markedly different, there is less data representative of each type of fluid dynamic behavior.
+
+# B.2 ADDITIONAL MODEL DETAILS
+
+The learned simulator consisted of a CNN encoder, a dilated CNN processor with residual skip connections, and a CNN decoder. The parameters of the model are listed in Table A.1.
+
+CNN parameters All individual CNNs use a kernel size of 3 and have 48 output channels (except the decoder, which has an output channel for each feature). Each individual CNN layer in the processor is immediately followed by a rectified linear unit (ReLU) activation function. The Encoder CNN and the Decoder CNNs do not use activations.
+
+Dilated connections The dilation rate in the CNN filter introduces space between each element in the filter. Whereas a standard CNN filter with kernel 3 would operate over 3 adjacent pixels, a dilated CNN filter with kernel 3 and dilation 2 will operate over 3 pixels spaced at intervals of 2 in each dimension, spanning a field 5 pixels wide. This increases the scale of the CNN kernels while preserving the number of parameters and the resolution.
+
+CNN padding For each dimension in $\mathcal{X}$ with periodic boundary conditions, we implemented periodic padding. For dimensions with a fixed boundary condition, we forced the boundary to a value rather than letting the model predict it, and masked the loss so the model was not trained to predict boundary conditions. The tensor was padded with repetitions of the boundary value. We also augmented the input state with a feature that indicated fixed-boundary versus non-boundary states using a one-hot vector, so the model could distinguish them.
+
+# B.3 ADDITIONAL TRAINING DETAILS
+
+Training noise In some cases, we trained with Gaussian random noise with fixed variance $\sigma$ added to the input $X_{t}$ of the loss function. Note that this not only affects the input to the neural network, but
+
+also slightly modifies the target $\Delta X = X_{t + \Delta t} - X_t$ (and also impacts the variance used to normalize targets).
+
+Loss At training time we sample pairs of input-output states (separated by the model time step) from the trajectories, and perform gradient updates based on a single step of the model. We do not rollout the model during training.
+
+Optimization We optimized the loss using an Adam optimizer. We trained the models for up to 10M steps, with exponential learning rate decay annealed from $1e - 4$ to $1e - 7$ in the first 6M steps. Models usually reached convergence at around 5M steps. Training took up to a week on an NVIDIA V100 GPU.
+
+Hyper-parameter optimization We did not perform exhaustive hyper-parameter optimization, except on the scale of the noise (which we scanned for each domain) and some informal tuning of the depth of the dilated blocks and latent size (to make sure the network had enough capacity for the most challenging domain). Note that achieving optimal performance on test trajectories from the training distribution was not part of the scope of this work, and there are likely hyperparameters that would improve performance over our results.
+
+Validation All of the research was performed by looking at performance on the validation sets. The test set was completely held-out until final evaluation prior to writing the paper.
+
+Early stopping For the Mixing Layer Turbulence (COOLMIXLAYER-3D), which was more prone to overfitting, we used early stopping based on the validation performance. For all other models we simply evaluated the model as it was at the end of training.
+
+# B.4 ADDITIONAL RESULTS
+
+Three instances of each model were trained 3 times using 3 different initialization seeds. Bar plots indicate median performance and bars indicate min-max performance. We chose the energy field $E = \frac{1}{2}\rho v^2 +\frac{3}{2}\bar{P}$ as the quantitative metric of 3D turbulence for the main text, as it summarizes performance on all state variables.
+
+Figures and videos for 3D environments (COOLMIXLAYER-3D and COMPDECAY-3D) show a single slice of the 3D grid at $y = 0$ , displaying the $x$ and $z$ coordinates in the horizontal and vertical axis, respectively.
+
+Downsampling in time Fig. B.6 as well as Videos show models for KS-1D, INCOMP-2D, and COMPDECAY-3D models trained and working well on a wide range of time step sizes. Note that for a fair comparison in Fig. 3d,f performance is averaged across only time steps that are predicted for all models (e.g. multiples of the largest time step, 256).
+
+Downsampling in space All comparisons across spatial resolutions are always obtained by first downsampling the data into a common $32^{3}$ grid, using an approach that preserves mass, momentum, and energy (Same approach used by Athena++) . Fig. B.2 (top row) shows the downsampling comparisons equivalent to Fig. 2g-i for each of the state variables independently.
+
+Running time For 1 simulation time unit of COMPDECAY-3D, the CPU runtime for Athena++ with 8 CPU processors is $\sim 4\mathrm{s}$ , $\sim 60\mathrm{s}$ , and $\sim 1000\mathrm{s}$ for $32^{3}$ , $64^{3}$ , and $128^{3}$ resolutions, respectively (quartic scaling, as the time step is also scaled with the resolution to compensate for numerical viscosity). In comparison, the learned model's runtime is 1s on an NVIDIA V100 GPU, and 20-30s on a 8-core CPU. Note that the learned model runs at reduced spatial and temporal resolution, but preserves the dynamics of the high resolution $128^{3}$ Athena++ simulation. Simulations in Athena++ may be faster if implemented for GPUs. However, because scientific simulators like Athena++ are specialized, each simulator's GPU implementation requires specialized engineering effort, whereas learned models can take advantage of methods designed more generally for deep learning.
+
+Cooling velocity Having reliable models that generalize to larger boxes increases the applicability of learned models to scientific domains by enabling experiments in regions of parameter space that would otherwise be prohibitively expensive to simulate. For example, for COOLMIXLAYER-3D, the dynamics undergo a transition when the box width increases relative to the cooling length $(v_{\mathrm{turb}} t_{\mathrm{cool}})$ , which is difficult to study because simulations for these widths essentially prohibitive. Thus, we want to understand what affects the learned simulator's ability to generalize to a range of box widths (the length $L_x$ and width $L_y$ of the input tensor $X$ ) not previously seen in the training data. For COOLMIXLAYER-3D, we can look at the cooling velocity, the average inflowing velocity at the low density fluid boundary that develops as a means to resupply the energy that has been radiated away in the mixing layer. Cooling velocity is a useful metric because it is a scalar quantity that depends on the box width. Furthermore, understanding how turbulent dynamics at a mixing layer pull heat from the surroundings is scientifically relevant for questions in astrophysics (Fielding et al., 2020). We evaluate generalization to different box sizes ( $L_x = L_y \in [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]$ ) (Fig. 5b). We find that the model trained on box length $L_x = L_y = 0.75$ (orange) is not able to produce trajectories with the correct cooling velocity for other box sizes. However, we also find that augmenting the dataset with data from a range of box sizes ( $L_x = L_y \in [0.5, 0.75, 1.0, 1.25]$ ) improves accuracy of the cooling velocity estimate for the unseen box lengths, although the generalization outside the training domain remains imperfect and unreliable across seeds. We speculate that achieving this form of generalization would require stronger inductive biases and/or more sophisticated dataset engineering.
+
+Other Statistical Metrics The choice of metrics can impact the utility of learned simulators for scientific applications. Here we describe a few physically motivated metrics we use to evaluate the learned models.
+
+We use the power spectral density, which we quantify for the total energy in Figure 2, to quantify how well the different models are preserving information at different resolutions. Simulators at coarse resolution are known to lose high-frequency information, and we are specifically interested in understanding how learned and physics-based simulators compare in terms of preserving detailed, high-frequency components. To quantify the power spectral density, we $n$ -D Fourier transform, taking the magnitude at each point of the Fourier transformed signal to get the $n$ -D PSD, and convert this to a 1D spectrum by taking the mean magnitude over points in the $n$ -D frequency grid with the same frequency vector length to get a 1D power spectral density $\mathrm{PSD}(k)$ over a scalar frequency $k = \sqrt{\sum k_{xi}^2}$ for spatial dimensions $x_i$ . Frequencies with a vector of length $> 1$ (the length of the environment along 1 dimension) are cutoff, leaving only frequencies that fall within the sphere of radius 1. We plot log PSD and compute spectrum error over these frequencies. The spectra for different state variables are shown in Figure B.1 for the coarsened Athena++ models and Dil-ResNet, and in Figure B.3 for the learned models. The error over time for the spectra is shown in Figures B.2 and B.2.
+
+The probability distribution functions (PDFs) of the fluid quantities provides an important basis for understanding turbulent flows. Due to the inherently chaotic nature of turbulence, statistical measures are often the most robust measures of their properties. The shape and widths of PDFs are common metrics for characterizing turbulent flows(Federrath & Klessen, 2012). Moreover, joint PDFs of fluid quantities (e.g., velocity-temperature, or pressure-entropy) are used to understand more complex flow behavior and to characterize which flow components are responsible for observed behavior (Fielding et al., 2020). Joint distribution functions are often especially useful when certain physical processes only take place in specific region of phase space (e.g., combustion or radiative cooling). PDFs for different state variables and joint distributions (entropy v. pressure, density v. pressure) are shown in Figure B.1 for the coarsened Athena++ models and Dil-ResNet, and in Figure B.3 for the learned models. The error over time for these statistics is shown in Figures B.2 and B.2.
+
+Another measure of interest are spatial autocorrelation measures, particularly velocity autocorrelation. Like the histograms, these capture statistical structure and provide a metric that is more invariant to the chaotic behavior of turbulence. The $p^{\mathrm{th}}$ order autocorrelation is closely related to the velocity structure function, $S_{p}(\ell) = \mathbb{E}_{\mathbf{r},\mathbf{u},\| u\| = 1}[\| \mathbf{v}_{\mathbf{r} + \ell \mathbf{u}} - \mathbf{v}_{\mathbf{r}}\|^{p}]$ , for velocity $\mathbf{v}$ , defined at a position vector $\mathbf{r}$ (e.g., $\mathbf{v_r}$ ), with unit vector $\mathbf{u}$ multiplied by a scalar $\ell$ . Seminal self-similarity arguments that underpin turbulent theory lead to the prediction that $S_{p}(\ell)\propto \ell^{p / 3}$ (Kolmogorov, 1941; Frisch, 1995). Structure and autocorrelation functions, therefore, provide important measures on the ability of learned simulators to capture subtle, but scientifically essential properties of turbulent flows. First-
+
+and second-order autocorrelation functions for different state variables are shown in Figure B.1 for the coarsened Athena++ models and the Dil-ResNet model and Figure B.3 for all models trained on COMPDECAY-3D. The error for each of these functions over time are shown in Figures B.2 and B.4.
+
+Model comparison Fig. B.7 shows predicted rollouts for KS-1D of different learned models presented in Figure 4a. Fig. B.3 shows statistics of the final frame of the predicted rollouts for different learned models presented in Figure 4. The error of each of these statistics over time is shown in Fig. B.4. Videos show the rolled out predictions for different models for INCOMP-2D and COMPDECAY-3D.
+
+KS-1D generalization Figs. B.8 and B.9 show generalization to larger domains and longer trajectories. While the learned simulations do not perfectly capture the ground truth, we see that qualitative features of turbulence are preserved across the rollout.
+
+COMPDECAY-3D generalization Figs. B.8 and B.9 show quantitative generalization performance of the Dil-ResNet model to larger domains and longer trajectories on KS-1D. While the learned simulations do not perfectly capture the ground truth, we see that qualitative features of turbulence are preserved across the rollout. Figures B.2 and B.4 show different metrics for different variables across rollout (pink background indicates the region not seen during training). Videos show the predicted rollouts when generalizing to different initial conditions and to longer rollouts.
+
+
+Figure B.1: COMPDECAY-3D Comparison of learned Dil-ResNet model trained with noise=0.01 to Athena++ run at resolutions of $32^3$ , $64^3$ , and $128^3$ (ground truth) for a variety of different metrics at $t = 0.99$ (the end of a rollout that lasts the duration seen during training).
+
+
+Figure B.2: COMPDECAY-3D Model metrics over time across learned Dil-ResNet model trained with noise=0.01 and Athena++ coarsened to different levels of resolution. Except for the last row, which shows the error in the Entropy v. Pressure and Density v. Pressure 2D histograms, each column is a state variable (Energy Field, Density, Velocity Components, and Pressure) and each row is the error for a different function over the data. Note rollouts start at $t = 0.16$ , after 5 model steps would have elapsed, because TF-Net takes in 6 frames and all models should start at the same point. Same color scaling is used across each 2D histogram row. Background is pink for times not shown during training.
+
+
+Figure B.3: COMPDECAY-3D Comparison of learned models trained with noise=0.01 for a variety of different metrics at $t = 0.99$ (the end of a rollout that lasts the duration seen during training).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure B.4: COMPDECAY-3D Model metrics over time across different learned models trained with noise=0.01. Except for the last row, which shows the error in the Entropy v. Pressure and Density v. Pressure 2D histograms, each column is a state variable (Energy Field, Density, Velocity Components, and Pressure) and each row is the error for a different function over the data. Background is pink for times not shown during training. One seed shown per model (quantitative results for multiple seeds shown in Figure B.11)
+
+
+
+
+Figure B.5: (left) KS equation (KS-1D) net velocity error, and Incompressible Turbulence (INCOMP2D) divergence error as function of model step. Training with noise helps keeping the values bounded to be close to 0. (right) Preservation of the 5 conserved quantities in 3D Compressible Turbulence (COMPDECAY-3D) as a function of time. In this case, training with noise does not completely prevent drift of the conserved quantities.
+
+
+Figure B.6: (top) Sample trajectories from the model trained on the KS-1D dataset at different temporal downsampling factors. (bottom) MSE and correlation performance of ML models for different downsampling factors in time as a function of simulation steps.
+
+
+Figure B.7: KS-1D Rollouts for models trained with noise=0.01.
+
+
+Figure B.8: Dil-ResNet model generalizing to larger spatial domains on KS-1D (trained on domains $2\pi$ wide).
+
+
+
+
+
+
+
+
+Figure B.9: Dil-ResNet model generalizing to longer trajectories on KS-1D (trained on trajectories with 181 simulation time units).
+
+
+Figure B.10: Model comparison for KS-1D generalization to larger spatial domains (left) and longer rollouts (right).
+
+
+
+
+Figure B.11: Model Comparison for Generalization. (left) Generalization to different ratios of solenoidal to compressive components in the initial conditions for learned models (trained with noise=0.01). 0=more compressive, 1=more solenoidal components in initial conditions. The gray line marks the value the models were trained on (0.66). (right) Generalization to longer rollouts. Added noise during training improves stability and therefore leads to lower error on longer rollouts. Cutoff point for TF-Net with no noise has RMSE 2.99, and cutoff bar for Dil-ResNet goes to Inf (numerical error). As shown in Figure 5, we see that adding the constraint to the loss function makes the model generalize more reliably to the more compressive regime, and that training noise promotes stability for longer rollouts.. Note that these results are numerically different from Figure 5 because rollouts were started from the sixth timestep to allow comparison with TF-Net, which takes as input a sequence of length $C = 6$ .
\ No newline at end of file
diff --git a/learnedsimulatorsforturbulence/images.zip b/learnedsimulatorsforturbulence/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..114a5e3d6c0c8a0a16b8cdf2d85c8d14c19ae7ff
--- /dev/null
+++ b/learnedsimulatorsforturbulence/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5cb7bdc5db2bb85a74d8229ee6a98df8b771ae1df6337a0f6f6f2796aed13b8c
+size 1620947
diff --git a/learnedsimulatorsforturbulence/layout.json b/learnedsimulatorsforturbulence/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5fbf01c358f8d543c47ca93c9c6324be727093e1
--- /dev/null
+++ b/learnedsimulatorsforturbulence/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:00b51ecab62659b3af64c4229ea30d0fb7e031c73f5872d8c6422dde0c1e70f7
+size 650625
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_content_list.json b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..05f01aad8f3051b07176a0afa4859adf309be411
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:600553cbede417f7ddcafa729348ab882554661343dfa0d396a99ae65ccd2b54
+size 180941
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_model.json b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..aa661d6de147d447891db1674f3ba7da5b211b36
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b3b03a11e3f77f90b2ce6e36e69983cdda272930f7d268b600a84615a4db29b5
+size 215678
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_origin.pdf b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4d215c64dd4282503e409102726415491bb1e3a9
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/0016166a-ab98-40fc-bbaf-c6f2f2da9810_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d43da864646e619a803b51c8b36299f9f57e343c1576bbc2042fdb640527ffda
+size 7578561
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/full.md b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..ffba020da696559bc9bb4c6cc89ea8e9755cef81
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/full.md
@@ -0,0 +1,706 @@
+# LEARNING 3D REPRESENTATIONS OF MOLECULAR CHIRALITY WITH INVARIANCE TO BOND ROTATIONS
+
+Keir Adams1, Lagnajit Pattanaik1, Connor W. Coley1,2
+
+$^{1}$ Department of Chemical Engineering
+
+$^{2}$ Department of Electrical Engineering and Computer Science
+
+Massachusetts Institute of Technology, Cambridge, MA 02139, USA
+
+{keir,lagnajit,ccoley}@mit.edu
+
+# ABSTRACT
+
+Molecular chirality, a form of stereochemistry most often describing relative spatial arrangements of bonded neighbors around tetrahedral carbon centers, influences the set of 3D conformers accessible to the molecule without changing its 2D graph connectivity. Chirality can strongly alter (bio)chemical interactions, particularly protein-drug binding. Most 2D graph neural networks (GNNs) designed for molecular property prediction at best use atomic labels to naively treat chirality, while E(3)-invariant 3D GNNs are invariant to chirality altogether. To enable representation learning on molecules with defined stereochemistry, we design an SE(3)-invariant model that processes torsion angles of a 3D molecular conformer. We explicitly model conformational flexibility by integrating a novel type of invariance to rotations about internal molecular bonds into the architecture, mitigating the need for multi-conformer data augmentation. We test our model on four benchmarks: contrastive learning to distinguish conformers of different stereoisomers in a learned latent space, classification of chiral centers as R/S, prediction of how enantiomers rotate circularly polarized light, and ranking enantiomers by their docking scores in an enantiosensitive protein pocket. We compare our model, Chiral InterRoto-Invariant Neural Network (ChIRo), with 2D and 3D GNNs to demonstrate that our model achieves state of the art performance when learning chiral-sensitive functions from molecular structures.
+
+# 1 INTRODUCTION
+
+Advances in graph neural networks (GNNs) have revolutionized molecular representation learning for (bio)chemical applications such as high-fidelity property prediction (Huang et al., 2021; Chuang et al., 2020), accelerated conformer generation (Ganea et al., 2021; Mansimov et al., 2019; Simm & Hernandez-Lobato, 2020; Xu et al., 2021; Pattanaik et al., 2020b), and molecular optimization (Elton et al., 2019; Brown et al., 2019). Fueling recent developments have been efforts to model shape-dependent physio-chemical properties by learning directly from molecular conformers ( snapshots of 3D molecular structures) or from 4D conformer ensembles, which better capture molecular flexibility. For instance, recent state-of-the-art (SOTA) GNNs feature message updates informed by bond distances, bond angles, and torsion angles of the conformer (Schutt et al., 2017; Klicpera et al., 2020b; Liu et al., 2021; Klicpera et al., 2021). However, few studies have considered the expressivity of GNNs when tasked with learning the nuanced effects of stereochemistry, which describes how the relative arrangement of atoms in space differ for molecules with equivalent graph connectivity.
+
+Tetrahedral (point) chirality is a prevalent form of stereochemistry, and describes the spatial arrangement of chemical substituents around the vertices of a tetrahedron centered on a chiral center, typically a carbon atom with four non-equivalent bonded neighbors. Two molecules differing only in the relative arrangements around their chiral centers are called stereoisomers, or enantiomers if they can be interconverted through reflection across a plane. Enantiomers are distinguished in chemical line drawings by a dashed or bold wedge indicating whether a bond to a chiral center is directed into or out of the page (Figure 1A). Although enantiomers share many properties such as boiling points, electronic energies, and solubility in most solvents, enantiomers can display strikingly different behavior when interacting with external chiral environments. Notably, chirality is critical for
+
+
+A
+Enantiomers
+
+
+(mirror images)
+
+
+
+
+B
+2D Achiral Graph
+
+
+Separates Enantiomers? InterRoto Invariant?
+√
+
+
+E(3)-Invariance
+
+
+X
+Figure 1: Schematic of how different conformers of two enantiomers (panel A) separate in a learned latent space (panel B) under a 2D (achiral) graph model, E(3)- and SE(3)-invariant 3D models, and ChIRo, which is invariant to rotations of internal molecular bonds (InterRoto-invariance).
+
+
+SE(3)-Invariance
+
+
+X
+
+
+(SE(3) + InterRoto)-Invariance
+
+
+√
+
+drug design (Nguyen et al., 2006; Jamali et al., 1989), where protein-ligand interactions are influenced by ligand chirality, as well as for designing structure-directing agents for zeolite growth (Luis & Beatrixz, 2018) and for optimizing asymmetric catalysts (Pfaltz & Drury, 2004; Liao et al., 2018).
+
+Chiral centers are inverted upon reflection through a mirror plane. Consequently, E(3)-invariant 3D GNNs that only consider pairwise atomic distances or bond angles in their message updates, such as SchNet (Schütt et al., 2017) and DimeNet/DimeNet++ (Klicpera et al., 2020a;b), are inherently limited in their ability to distinguish enantiomers (Figure 1B). Although SE(3)-invariant 3D GNNs, such as the recently proposed SphereNet (Liu et al., 2021) and GemNet (Klicpera et al., 2021), can in theory learn chirality, their expressivity in this setting has not been explored.
+
+Alongside the development of 3D GNNs, which process individual 3D conformers, there have been efforts to better represent conformational flexibility by encoding multiple conformers in a 4D ensemble for property prediction (Zankov et al., 2021; 2019; Axelrod & Gomez-Bombarelli, 2021), identifying important conformer poses (Chuang & Keiser, 2020), and predicting solvation energies (Weinreich et al., 2021). Unless in the solid state, molecules are not rigid objects or static 2D graphs, but are flexible structures that rapidly interconvert through rotations of chemical bonds as well as through smaller perturbations such as bond stretching, bending, and wagging. Explicitly modeling this probability distribution over accessible conformer space has the potential to improve the modeling of protein-drug interactions, where the most relevant active pose of the ligand is not known a priori, as well as in the prediction of Boltzmann-averages, which depend on a distribution of conformers. One challenge with these methods is selecting which conformers to include in an ensemble: the space of accessible conformations combinatorially explodes with the number of rotatable bonds, and important poses are not known a priori. Modeling flexibility with multi-instance methods thus requires explicit conformer enumeration, increasing the cost of training/inference without guaranteeing performance gains. Apart from 2D methods, which ignore 3D information altogether, no studies have explicitly modeled conformational flexibility directly within a model architecture.
+
+To explicitly model tetrahedral chirality and conformational flexibility, we design a neural framework to augment 2D GNNs with processing of the SE(3)-invariant internal coordinates of a conformer, namely bond distances, bond angles, and torsion angles. Our specific contributions are:
+
+- We design a method for graph neural networks to learn the relative orientations of substituents around tetrahedral chiral centers directly from 3D torsion angles
+- We introduce a novel invariance to internal rotations of rotatable bonds directly into a model architecture, potentially mitigating the need for 4D ensemble methods or conformer-based data augmentation to treat conformational flexibility of molecules
+- We propose a contrastive learning framework to probe the ability of SE(3)-invariant 3D graph neural networks to differentiate stereoisomers in a learned latent space
+
+- Through our ablation study, we demonstrate that a global node aggregation scheme, adapted from Winter et al. (2021), which exploits subgraphs based on internal coordinate connectivity can provide a simple way to improve GNNs for chiral property prediction
+
+We explore multiple tasks to benchmark the ability of our model to learn the effects of chirality. We do not consider common MoleculeNet (Wu et al., 2018) benchmarks, as our focus is on tasks where the effects of chirality are more distinguishable from experimental noise. Our self-supervised contrastive learning task is the first of its kind applied to clustering multiple 3D conformers of different stereoisomers in a latent space. Following Pattanaik et al. (2020a), we also employ a toy R/S labeling task as a necessary but not sufficient test of chiral recognition. For a harder classification task, we follow Mamede et al. (2021) in predicting how enantiomers experimentally rotate circularly polarized light. Lastly, we create a dataset of simulated docking scores to rank small enantiomeric ligands by their binding affinities in a chirality-sensitive protein pocket. We make our datasets for the contrastive learning, R/S classification, and docking tasks available to the public. Comparisons with 2D baselines and the SE(3)-invariant SphereNet demonstrate that our model, Chiral InterRoto-Invariant Neural Network (ChIRo), achieves SOTA in 3D chiral molecular representation learning.
+
+# 2 RELATED WORK
+
+Message passing neural networks. Gilmer et al. (2017) introduced a framework for using GNNs to embed molecules into a continuous latent space for property prediction. In the typical 2D message passing scheme, a molecule is modeled as a discrete 2D graph $G$ with atoms as nodes and bonds as edges. Nodes and edges are initialized with features $\mathbf{x}_i$ and $\mathbf{e}_{ij}$ to embed initial node states:
+
+$$
+\mathbf {h} _ {i} ^ {0} = U _ {0} \left(\mathbf {x} _ {i}, \left\{\mathbf {e} _ {i j} \right\} _ {j \in N (i)}\right) \tag {1}
+$$
+
+where $N(i)$ denotes the neighboring atoms of node $i$ . In each layer $t$ of message passing, node states are updated with aggregated messages from neighboring nodes. After $T$ layers, graph feature vectors are constructed from some (potentially learnable) aggregation over the learned node states. A readout phase then uses this graph embedding for downstream property prediction:
+
+$$
+\mathbf {h} _ {i} ^ {t + 1} = U _ {t} \left(\mathbf {h} _ {i} ^ {t}, \mathbf {m} _ {i} ^ {t + 1}\right), \quad \mathbf {m} _ {i} ^ {t + 1} = \sum_ {j \in N (i)} M _ {t} \left(\mathbf {h} _ {i} ^ {t}, \mathbf {h} _ {j} ^ {t}, \mathbf {e} _ {i j}\right) \tag {2}
+$$
+
+$$
+\hat {y} = \operatorname {R e a d o u t} (\mathbf {g}), \quad \mathbf {g} = A g g \left(\left\{\mathbf {h} _ {i} ^ {T} \mid i \in G \right\}\right) \tag {3}
+$$
+
+There exist many variations on this basic message passing framework (Duvenaud et al., 2015; Kearnes et al., 2016). In particular, Yang et al. (2019)'s directed message passing neural network (DMPNN, or ChemProp) based on Dai et al. (2016) learns edge-based messages $\mathbf{m}_{ij}^{t}$ and updates edge embeddings $\mathbf{h}_{ij}^{t}$ rather than node embeddings. The Graph Attention Network (Veličković et al., 2018) constructs message updates $\mathbf{m}_{i}^{t}$ using attention pooling over local node states.
+
+3D Message Passing and Euclidean Invariances. 3D GNNs differ in their message passing schemes by using molecular internal coordinates (distances, angles, torsions) to pass geometry-informed messages between nodes. It is important to use 3D information that is at least SE(3)-invariant, as molecular properties are invariant to global rotations or translations of the conformer.
+
+SchNet (Schütt et al., 2017), a well-established network for learning quantum mechanical properties of 3D conformers, updates node states using messages informed by radial basis function expansions of interatomic distances between neighboring nodes. DimeNet (Klicpera et al., 2020b) and its newer variant DimeNet++ (Klicpera et al., 2020a) exploit additional molecular geometry by using spherical Bessel functions to embed angles $\phi_{ijk}$ between the edges formed between nodes $i$ and $j$ and nodes $j$ and $k \neq i$ in the directed message updates to node $i$ .
+
+SchNet and DimeNet are E(3)-invariant, as pairwise distances and angles formed between two edges are unchanged upon global rotations, translations, and reflections. Since enantiomers are mirror images, SchNet and DimeNet are therefore invariant to this form of chirality. To be SE(3)-invariant, 3D GNNs must consider torsion angles, denoted $\psi_{ixyj}$ , between the planes defined by angles $\phi_{ixy}$ and $\phi_{xyj}$ , where $i, x, y, j$ are four sequential nodes along a simple path. Torsion angles are negated upon reflection, and thus models considering all torsion angles should be implicitly sensitive to chirality. Flam-Shepherd et al. (2021), Liu et al. (2021) (SphereNet), and Klicpera et al. (2021) (GemNet) introduce 3D GNNs that all embed torsions in their message updates.
+
+Using a complete set of torsion angles provides access to the full geometric information present in the conformer but does not guarantee expressivity when learning chiral-dependent functions. Torsions are negated upon reflection, but any given torsion can also be changed via simple rotations of a rotatable bond—which changes the conformation, but not the molecular identity (i.e., chirality does not change). Reflecting a non-chiral conformer will also negate its torsions, but the reflected conformer can be reverted to its original structure via rotations about internal bonds. To model chirality, neural networks must learn how coupled torsions, the set of torsions $\{\psi_{ixyj}\}_{(i,j)}$ that share a bond between nodes $x$ and $y$ (with $x$ or $y$ being chiral), collectively differ between enantiomers.
+
+E(3)- and SE(3)-Equivariant Neural Networks. Recent work has introduced equivariant layers into graph neural network architectures to explicitly model how global rotations, translations, and (in some cases) reflections of a 3D structure transform tensor properties, such as molecular dipoles or force vectors. SE(3)-equivariant models (Fuchs et al., 2020; Thomas et al., 2018) should be sensitive to chirality, while E(3)-equivariant models (Satorras et al., 2021) will only be sensitive if the output layer is not E(3)-invariant. Since we use SE(3)-invariant internal coordinates as our 3D representation, we only compare our model to other SE(3)- or E(3)-invariant 3D GNNs.
+
+Explicit representations of chirality in machine learning models. A number of machine learning studies account for chirality through hand-crafted molecular descriptors (Schneider et al., 2018; Golbraikh et al., 2001; Kovatcheva et al., 2007; Valdés-Martínez et al., 2017; Mamede et al., 2021). A naive but common method for making 2D GNNs sensitive to chirality is through the inclusion of chiral tags as node features. Local chiral tags describe the orientation of substituents around chiral centers (CW or CCW) given an ordered list of neighbors. Global chiral tags use the Cahn-Ingold-Prelog (CIP) rules for labeling the handedness of chiral centers as R ("rectus") or S ("sinister"). It is unclear whether (and how) models can suitably learn chiral-dependent functions when exposed to these tags as the only indication of chirality. Pattanaik et al. (2020a) propose changing the symmetric message aggregation function in 2D GNNs (sum/max/mean) to an asymmetric function tailored to tetrahedral chiral centers, but this method does not learn chirality from 3D molecular geometries.
+
+Chirality in 2D Vision and 3D Pose Estimation. Outside of molecular chirality, there has been work in the deep learning community to develop neural methods that learn chiral representations for 2D image recognition (Lin et al., 2020) and 3D human pose estimation (Yeh et al., 2019). In particular, Yeh et al. (2019) consider integrating equivariance to chiral transforms directly into neural architectures including feed forward layers, LSTMs/GRUs, and convolutional layers.
+
+# 3 CHIRAL INTERROTO-INVARIANT NEURAL NETWORK (CHIRO)
+
+Our model uses a 2D GNN to embed node states based on graph connectivity, two feed-forward networks based on Winter et al. (2021) to encode 3D bond distances and bond angles, a specially designed torsion encoder inspired by Ganea et al. (2021) to explicitly encode chirality with invariance to internal bond rotations (InterRoto-invariance), and a readout phase for property prediction. Figure 2 visualizes how we encode torsion angles to achieve an InterRoto-invariant representation of chirality. The model is visualized in appendix A.4. We implement our network with Pytorch Geometric (Fey & Lenssen, 2019). Our code is available at https://github.com/keiradams/ChIRO.
+
+2D Graph Encoder. Given a molecular conformer, we initialize a 2D graph $G$ where nodes are atoms initialized with features $\mathbf{x}_i$ and edges are bonds initialized with features $\mathbf{e}_{ij}$ . We treat all hydrogens implicitly, use undirected edges, and omit chiral atom tags and bond stereochemistry tags. $\mathbf{x}_i$ include the atomic mass and one-hot encodings of atom type, formal charge, degree, number of hydrogens, and hybridization state. $\mathbf{e}_{ij}$ include one-hot encodings of the bond type, whether the bond is conjugated, and whether the bond is in a ring system. In select experiments, we include global and local chiral atom tags and bond stereochemistry tags for performance comparisons.
+
+Any 2D GNN suffices to embed node states. Following Winter et al. (2021), we use Simonovsky & Komodakis (2017)'s edge convolution (EConv) to embed the node features with the edge features:
+
+$$
+\mathbf {h} _ {i} ^ {0} = \boldsymbol {\Theta} \mathbf {x} _ {i} + \sum_ {j \in N (i)} \mathbf {x} _ {j} \cdot f _ {e} (\mathbf {e} _ {i j}) \tag {4}
+$$
+
+where $\Theta$ is a learnable weight matrix and $f_{e}$ is a multi-layer perceptron (MLP). Node states $\mathbf{h}_i^t\in \mathbb{R}^{h_t}$ are then updated through $T$ sequential Graph Attention Layers (GAT) (Veličković et al., 2018):
+
+$$
+\mathbf {h} _ {i} ^ {t} = \operatorname {G A T} ^ {(t)} \left(\mathbf {h} _ {i} ^ {t - 1}, \left\{\mathbf {h} _ {j} ^ {t - 1} \right\} _ {j \in N (i)}\right), \quad t = 1, \dots , T \tag {5}
+$$
+
+
+Figure 2: Geometric visualization of how ChIRo learns chiral representations with InterRotoinvariance. Given two enantiomers with three coupled torsions $\psi_{a},\psi_{b}$ , and $\psi_{c}$ involving a chiral carbon center, rotating the shared carbon-carbon bond by $R\in [0,2\pi)$ rotates each torsion together, forming three periodic sinusoids (solid RGB curves). Learning phase shifts $\varphi_{i}$ for each torsion produces shifted waves (dashed RGB curves) that differ between enantiomers. A weighted sum of the shifted sinusoids results in different degrees of wave interference between enantiomers, yielding different amplitudes of the net waves. These amplitudes, visualized here as the different radii $(r)$ of the circles formed by plotting the summed sines against the summed cosines, are invariant to the rotation of the internal carbon-carbon bond. See appendices A.1, A.2 for further details.
+
+Bond Distance and Bond Angle Encoders. To embed 3D bond distance and bond angle information, we follow Winter et al. (2021) by individually encoding each bond distance $d_{ij}$ (in Angstroms) and angle $\phi_{ijk}$ into learned latent vectors. We then sum-pool these vectors to get conformer-level latent embeddings $\mathbf{z}_d\in \mathbb{R}^z$ and $\mathbf{z}_{\phi}\in \mathbb{R}^{z}$ :
+
+$$
+\mathbf {z} _ {d} = \sum_ {(i, j) \in G} f _ {d} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, d _ {i j}\right) + f _ {d} \left(\mathbf {h} _ {j}, \mathbf {h} _ {i}, d _ {i j}\right) \tag {6}
+$$
+
+$$
+\mathbf {z} _ {\phi} = \sum_ {(i, j, k) \in G} f _ {\phi} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {k}, \cos \phi_ {i j k}, \sin \phi_ {i j k}\right) + f _ {\phi} \left(\mathbf {h} _ {k}, \mathbf {h} _ {j}, \mathbf {h} _ {i}, \cos \phi_ {i j k}, \sin \phi_ {i j k}\right) \tag {7}
+$$
+
+where $f_{d}$ and $f_{\phi}$ are MLPs and $(.,.)$ denotes concatenation. We maintain invariance to node ordering by encoding both $(i,j)$ and $(j,i)$ for each distance $d_{ij}$ , and both $(i,j,k)$ and $(k,j,i)$ for each angle $\phi_{ijk}$ . For experiments that mask all internal coordinates (i.e., set all bond lengths and angles to 0), $\mathbf{z}_d$ and $\mathbf{z}_{\phi}$ represent aggregations of 2D node states based on subgraphs of local atomic connectivity.
+
+Torsion Encoder. We specially encode torsion angles to achieve two desired properties: 1) an invariance to rotations about internal molecular bonds, and 2) the ability to learn molecular chirality. Both of these properties depend critically on how the model treats coupled torsion angles-torsions that cannot be independently rotated in the molecular conformer. For instance, torsions $\psi_{a},\psi_{b}$ , and $\psi_{c}$ in Figure 2 are coupled, as rotating the internal carbon-carbon bond rotates each torsion simultaneously. Symmetrically aggregating every redundant torsion does not respect this inherent coupling. However, encoding a set of non-redundant torsions-a minimal set that completely define the structure of the conformer-would make the model sensitive to which arbitrary subset was selected.
+
+Ganea et al. (2021) provide a partial solution to this problem in their molecular conformer generator, which we add to below. Rather than encoding each torsion individually, they compute a weighted sum of the cosines and sines of each coupled torsion (which are redundant), where a neural network predicts the weights1. Formally, given a non-terminal (internal) bond between nodes $x$ and $y$ that yields a set of coupled torsions $\{\psi_{ixyj}\}_{(i,j)}$ for $i \in N(x) \setminus \{y\}$ and $j \in N(y) \setminus \{x\}$ , they compute:
+
+$$
+\left(\alpha_ {\cos} ^ {(x y)}, \alpha_ {\sin} ^ {(x y)}\right) = \sum_ {i \in N (x) \backslash \{y \}} \sum_ {j \in N (y) \backslash \{x \}} c _ {i j} ^ {(x y)} \cdot \left(\cos \left(\psi_ {i x y j}\right), \sin \left(\psi_ {i x y j}\right)\right) \tag {8}
+$$
+
+$$
+c _ {i j} ^ {(x y)} = \sigma \left(f _ {c} \left(\mathbf {h} _ {i}, \mathbf {h} _ {x}, \mathbf {h} _ {y}, \mathbf {h} _ {j}\right) + f _ {c} \left(\mathbf {h} _ {j}, \mathbf {h} _ {y}, \mathbf {h} _ {x}, \mathbf {h} _ {i}\right)\right) \tag {9}
+$$
+
+where $f_{c}$ is an MLP that maps to $\mathbb{R}$ . The sigmoid activation $\sigma$ , which keeps each $c_{ij}^{(xy)}$ bounded to $(0,1)$ , is our addition. The following formulation is our novel addition to Ganea et al. (2021).
+
+Because rotating the bond $(x,y)$ rotates the torsions $\{\psi_{ixyj}\}$ together, the sinusoids $\{\sin (\psi_{ixyj})\}_{(i,j)}$ and $\{\cos (\psi_{ixyj})\}_{(i,j)}$ have the same frequency. Therefore, the weighted sums of these cosines and sines are also sinusoids, which when plotted against each other as a function of rotating the bond $(x,y)$ , form a perfect circle (appendix A.1). Critically, the radius of this circle, $||\alpha_{\cos}^{(xy)},\alpha_{\sin}^{(xy)}||$ , is invariant to the rotation of the bond $(x,y)$ (Figure 2). We therefore encode these radii in order to achieve invariance to how any bond in the conformer is rotated.
+
+The above formulation, as presented, is also invariant to chirality (appendix A.2). To break this symmetry, we add a learned phase shift, $\varphi_{ixyj}$ , to each torsion $\psi_{ixyj}$ :
+
+$$
+\left(\cos \varphi_ {i x y j}, \sin \varphi_ {i x y j}\right) = \ell_ {2} ^ {\text {n o r m}} \left(f _ {\varphi} \left(\mathbf {h} _ {i}, \mathbf {h} _ {x}, \mathbf {h} _ {y}, \mathbf {h} _ {j}\right) + f _ {\varphi} \left(\mathbf {h} _ {j}, \mathbf {h} _ {y}, \mathbf {h} _ {x}, \mathbf {h} _ {i}\right)\right) \tag {10}
+$$
+
+$$
+\left(\alpha_ {\cos} ^ {(x y)}, \alpha_ {\sin} ^ {(x y)}\right) = \sum_ {i \in N (x) \backslash \{y \}} \sum_ {j \in N (y) \backslash \{x \}} c _ {i j} ^ {(x y)} \cdot \left(\cos \left(\psi_ {i x y j} + \varphi_ {i x y j}\right), \sin \left(\psi_ {i x y j} + \varphi_ {i x y j}\right)\right) \tag {11}
+$$
+
+where $f_{\varphi}$ is an MLP that maps to $\mathbb{R}^2$ and $\ell_2^{\mathrm{norm}}$ indicates L2-normalization. Because enantiomers have the same 2D graph, the learned coefficients $c_{ij}^{(xy)}$ and phase shifts $\varphi_{ixyj}$ are identical between enantiomers (if $\mathbf{x}_i$ is initialized without chiral tags). However, because enantiomers have different spatial orientations of atoms around chiral centers, the relative values of coupled torsions around bonds involving those chiral centers also differ (Figure 2). As a result, learning phase shifts create different degrees of wave-interference when summing the weighted cosines and sines for inverted chiral centers. The amplitudes of the net waves (corresponding to radius $||\alpha_{\cos}^{(xy)}, \alpha_{\sin}^{(xy)}||$ ) will differ between enantiomers, allowing our model to encode different radii for different enantiomers.
+
+With this torsion aggregation scheme, we complete our torsion encoder by individually encoding each internal molecular bond, along with its learned radius, into a latent vector and sum-pooling:
+
+$$
+\mathbf {z} _ {\alpha} = \sum_ {(x, y) \in G} \mathbf {z} _ {\alpha_ {x y}}, \quad \mathbf {z} _ {\alpha_ {x y}} = f _ {\alpha} \left(\mathbf {h} _ {x}, \mathbf {h} _ {y}, \left\| \alpha_ {\cos} ^ {(x y)}, \alpha_ {\sin} ^ {(x y)} \right\|\right) + f _ {\alpha} \left(\mathbf {h} _ {y}, \mathbf {h} _ {x}, \left\| \alpha_ {\cos} ^ {(x y)}, \alpha_ {\sin} ^ {(x y)} \right\|\right) \tag {12}
+$$
+
+Readout. For property prediction, we concatenate the sum-pooled node states with the conformer embedding components $\mathbf{z}_d$ , $\mathbf{z}_{\phi}$ , and $\mathbf{z}_{\alpha}$ , capturing embeddings of bond lengths, angles, and torsions, respectively. This concatenated representation is then fed through a feed-forward neural network:
+
+$$
+\hat {y} = f _ {\text {o u t}} \left(\sum_ {i \in G} \mathbf {h} _ {i}, \mathbf {z} _ {d}, \mathbf {z} _ {\phi}, \mathbf {z} _ {\alpha}\right) \tag {13}
+$$
+
+Appendix A.3 explores the option of propagating the learned 3D representations of chirality to node states prior to sum-pooling via additional message passing, treating each $\mathbf{z}_{\alpha_{xy}}$ as a vector of edge-attributes. This stage of chiral message passing (CMP) is designed to help propagate local chiral representations across the molecular graph, and to provide an alternative method of augmenting 2D GNNs which include chiral tags as atom features. However, CMP does not significantly affect ChIRo's performance across the tasks considered and is thus not included in our default model.
+
+# 4 EXPERIMENTS
+
+We evaluate the ability of our model to learn chirality with four distinct tasks: contrastive learning to distinguish between 3D conformers of different stereoisomers in a learned latent space, classifying enantiomer chiral centers as R/S, predicting how enantiomers rotate circularly polarized light, and ranking enantiomers by their docking scores in a chiral protein environment. We compare our model with 2D baselines including DMPNN with chiral atom tags (Yang et al., 2019), and Tetra-DMPNN with and without chiral atom tags (Pattanaik et al., 2020a). We also compare our model to 3D GNN baselines, including the E(3)-invariant SchNet and DimeNet++, and the SE(3)-invariant SphereNet.
+
+
+Figure 3: Visualization of how conformers of two enantiomers in the contrastive learning test set cluster in the learned latent space for ChIRo, SchNet, DimeNet++, and SphereNet (top row) using the original OMEGA-generated conformers; (middle row) upon reflecting the conformers, which adds points with inverted chirality (opposite color); and (bottom row) upon rotating internal bonds involving the chiral center. Unlike SchNet, DimeNet++, and even the SE(3)-invariant SphereNet, ChIRo maintains perfect separation between stereoisomers across these conformer transformations.
+
+Contrastive Learning to Distinguish Stereoisomers. For contrastive learning, we use a subset of the PubChem3D dataset, which consists of multiple OMEGA-generated conformations of organic molecules with up to 50 heavy atoms and 15 rotatable bonds (Bolton et al., 2011; Hawkins et al., 2010). Our subset consists of 2.98M conformers of 598K stereoisomers of 257K 2D graphs. Each stereoisomer has at least two conformers, and each graph has at least two stereoisomers. We create 70/15/15 training/validation/test splits, keeping conformers corresponding to the same 2D graphs in the same data partition. See appendix A.5 for full training details.
+
+We formulate this task to answer the following question: can the model learn to cluster conformers sharing the same (chiral) molecular identity in a learned latent space, while distinguishing clusters belonging to different stereoisomers of a shared 2D graph? We train each model with a triplet margin loss (Balntas et al., 2016) with a normalized Euclidean distance metric:
+
+$$
+\mathcal {L} _ {\text {t r i p l e t}} = \max (0, d (\mathbf {z} _ {a}, \mathbf {z} _ {p}) - d (\mathbf {z} _ {a}, \mathbf {z} _ {n}) + 1), \quad d (\mathbf {z} _ {1}, \mathbf {z} _ {2}) = \left\| \frac {\mathbf {z} _ {1}}{\| \mathbf {z} _ {1} \|} - \frac {\mathbf {z} _ {2}}{\| \mathbf {z} _ {2} \|} \right\| \tag {14}
+$$
+
+where $\mathbf{z}_a$ , $\mathbf{z}_p$ , $\mathbf{z}_n$ are learned latent vectors of anchor, positive, and negative examples. For each triplet, we randomly sample a conformer $a$ of stereoisomer $i$ as the anchor, a conformer $p \neq a$ of stereoisomer $i$ as the positive, and a conformer $n$ of stereoisomer $j \neq i$ as the negative, where $i$ and $j$ share the same 2D graph. For ChIRo, we use $\mathbf{z} = \mathbf{z}_{\alpha}$ . For SchNet, DimeNet++, and SphereNet, we use aggregations of node states (out_channels) as $\mathbf{z}$ . We set $\mathbf{z} \in \mathbb{R}^2$ to visualize the latent space.
+
+Figure 3 visualizes how conformers of two enantiomers in the test set separate in the latent space for ChIRo, SchNet, DimeNet++, and SphereNet. We explore how this separation is affected upon reflecting the conformers (which inverts chirality) and rotating bonds around the chiral center. By design, ChIRo maintains perfect separation across these transforms. While SchNet and DimeNet++ may seem to superficially separate the original conformers, the separation collapses upon reflection and rotation due to their E(3)-invariance. SphereNet learns good separation that persists through reflection, but the clusters overlap upon rotation of internal bonds. This emphasizes that 3D GNNs have limited chiral expressivity when not explicitly considering coupled torsions in message updates.
+
+Classifying Tetrahedral Chiral Centers as R/S. As a toy test of chiral perception for SchNet, DimeNet++, SphereNet and ChIRo, we test whether these 3D models can classify tetrahedral chiral centers as R/S, a simple indication of chirality that can be easily encoded into the initial node features. We use a subset of PubChem3D containing 466K conformers of 78K enantiomers with one tetrahedral chiral center. We create 70/15/15 train/validation/test splits, keeping conformers corresponding to the same 2D graphs in the same partition. We train with a cross-entropy loss and sample one conformer per enantiomer in each batch. See Appendix A.5 for full training details.
+
+Table 1 reports classification accuracies when evaluating on all conformers in the test set, without conformer-based averaging. The SE(3)-invariant ChIRo and SphereNet both surpass $98\%$ accuracy, whereas the E(3)-invariant SchNet and DimeNet++ fail to learn this simplest indication of chirality. We emphasize that this classification task, which RDKit trivially solves, is necessary but not sufficient to demonstrate that a model can meaningfully learn chiral representations of molecules.
+
+Predicting Enantiomers' Signs of Optical Rotation. Enantiomers rotate circularly polarized light in different directions, and the sign of rotation designates the
+
+Table 1: R / S classification accuracy on the test set for ChIRo and 3D GNN baselines. Mean and standard deviations are reported across three trials.
+
+| Model | R / S Accuracy (%) ↑ |
| ChIRo | 98.5 ± 0.2 |
| SchNet | 54.5 ± 0.2 |
| DimeNet++ | 65.7 ± 2.9 |
| SphereNet | 98.2 ± 0.2 |
+
+enantiomer as $l$ (levorotatory, -) or $d$ (dextrorotatory, +). Optical activity is an experimental property, and has no correlation with R/S classifications (Table 15, appendix A.7.2). Following Mamede et al. (2021), who used hand-crafted descriptors to predict $l / d$ labels, we extract 30K enantiomers (15K pairs) with their optical activity in a chloroform solvent from the commercial Reaxys database (Reaxys, Accessed Aug. 6-9, 2021), and generate 5 conformers per enantiomer using the ETKDG algorithm in RDKit (Landrum, 2010). Appendix A.7 describes the filtering procedure. We evaluate with 5-fold cross validation, where each pair of enantiomers are randomly assigned to one of the five folds for testing. In each fold, we randomly split the remaining dataset into 87.5/12.5 training/validation splits, assigning enantiomers to the same data partition. We train with a cross-entropy loss. To characterize how conformer data augmentation affects the performance of ChIRO and SphereNet, we employ two training schemes: the first randomly samples a conformer per enantiomer in each batch; the second uses one pre-sampled conformer per enantiomer. In both schemes, we evaluate on all conformers in the test splits. Appendix A.5 specifies full training details.
+
+Table 2 reports the classification accuracies for each model. Notably, ChIRo outperforms SphereNet by a significant $14\%$ . Also, whereas ChIRo's performance does not suffer when only one conformer per enantiomer is used, SphereNet's performance drops by $10\%$ . This may be due to SphereNet confusing differences in conformational structure versus chiral identities when evaluating pairs of enantiomers (appendix A.10). The consistent performance of ChIRo emphasizes its inherent modeling of conformational flexibility without need for data augmentation. ChIRo also offers significant improvement over DMPNN, demonstrating that our torsion encoder yields a more expressive representation of chirality than simply including chiral tags in node features. The (smaller) improvements over Tetra-DMPNN, which was specially designed to treat tetrahedral chirality in 2D GNNs, suggest that using 3D information to encode chirality is more powerful than 2D representations of chirality.
+
+Ranking Enantiomers by Binding Affinity in a Chiral Protein Pocket. In silico docking simulations are widely used to screen drug-ligand interactions, especially in high-throughput virtual screens. However, docking scores can be highly sensitive to the conformation of the docked lig-
+
+Table 2: Comparisons of ChIRo with baselines when classifying enantiomers as $l / d$ and ranking enantiomers by their docking scores. Mean accuracies and standard deviations are reported on the test sets across 5 folds ( $l / d$ ) or three trials (enantiomer ranking).
+
+| Model | Accuracy (%) ↑ |
| l / d | Enantiomer Ranking |
| ChIRo | 79.3 ± 0.4 | 72.0 ± 0.5 |
| ChIRo (1-Conformer) | 79.1 ± 0.5 | 71.9 ± 0.3 |
| SphereNet | 65.5 ± 2.4 | 68.6 ± 0.3 |
| SphereNet (1-Conformer) | 55.2 ± 0.3 | 63.0 ± 0.1 |
| DMPNN with Chiral Tags | 74.4 ± 0.8 | 65.9 ± 0.6 |
| Tetra-DMPNN (permute) | 70.2 ± 0.7 | 66.1 ± 0.3 |
| Tetra-DMPNN (concatenate) | 72.6 ± 0.7 | 68.5 ± 0.3 |
| Tetra-DMPNN (permute) with Chiral Tags | 75.6 ± 1.3 | 67.6 ± 0.6 |
| Tetra-DMPNN (concatenate) with Chiral Tags | 76.5 ± 0.8 | 70.1 ± 0.5 |
+
+Table 3: Effects of abating components of ChIRo on test-set accuracies for the $l / d$ classification and enantiomer docking score ranking tasks. Mean and standard deviations are reported across 5 folds ( $l / d$ ) or 3 repeated trials (enantiomer ranking). The first row indicates the original ChIRo.
+
+| Model Components | Accuracy (%) ↑ |
| Tags | (dij, φijk,psixyj) | (zd, zφ, zα) | l / d | Enantiomer Ranking |
| X | ✓ | ✓ | 79.3 ± 0.4 | 72.0 ± 0.5 |
| ✓ | ✓ | ✓ | 77.7 ± 0.8 | 71.3 ± 0.7 |
| ✓ | X | ✓ | 76.2 ± 0.6 | 68.4 ± 0.9 |
| ✓ | X | X | 70.0 ± 0.6 | 63.7 ± 0.2 |
| X | X | ✓ | 50.0 ± 0.0 | 49.6 ± 0.3 |
+
+and, which creates a noisy background from which to extract meaningful differences in docking scores between enantiomers. To partially control for this stochasticity, we source conformers of 200K pairs of small (MW $\leq 225$ , # of rotatable bonds $\leq 5$ ) enantiomers with only 1 chiral center from PubChem3D (Bolton et al., 2011). We use AutoDock Vina (Trott & Olson, 2010) to dock each enantiomer in a small docking box (PDB ID: 4JBV) three times, and select pairs for which both enantiomers have a range of docking scores $\leq 0.1$ kcal/mol across the three trials. Finally, we select pairs of enantiomers whose difference in (best) scores is $\geq 0.3$ kcal/mol to form a dataset of enantiosensitive docking scores. Each conformer for an enantiomer is assigned the same (best) score. This treats docking score as a stereoisomer-level property. Our final dataset includes 335K conformers of 69K enantiomers (34.5K pairs), which we split into 70/15/15 training/validation/test splits, keeping enantiomers in the same data partition. We train with a mean squared error loss and either randomly sample a conformer per enantiomer in each batch or use one pre-selected conformer per enantiomer. Appendix A.5 specifies full training details. Note that we evaluate the ranking accuracy of the predicted conformer-averaged docking scores between enantiomers in the test set.
+
+ChIRo outperforms SphereNet in ranking enantiomer docking scores, achieving an accuracy of $72\%$ (Table 2). This performance is fairly consistent when evaluating ChIRo on subsets of enantiomers which have various differences in their ground-truth scores (Figure 12, appendix A.9). SphereNet once again suffers a drop in performance without conformer data augmentation, whereas ChIRo's performance remains high without such augmentation. ChIRo also outperforms the 2D baselines, with performance gains similar to those in the $l / d$ classification task.
+
+Ablation Study. To investigate how the components of ChIRo contribute to its performance on the $l / d$ classification and ranking tasks, we ablate various components including whether stereochemical tags are included in node/edge initialization, whether internal coordinates are masked-out (set to zero), and whether the conformer latent vectors $\mathbf{z}_d$ , $\mathbf{z}_{\phi}$ , and $\mathbf{z}_{\alpha}$ are used in readout (Table 3). Overall, when internal coordinates are masked, including $(\mathbf{z}_d, \mathbf{z}_{\phi}, \mathbf{z}_{\alpha})$ in readout improves performance by $\sim 5\%$ on both tasks. This suggests that if chiral tags are used as the only indication of chirality (i.e., 3D geometry is excluded), using the learned node aggregation scheme provides a simple way to improve the ability of 2D GNNs to learn chiral functions. Notably, adding chiral tags to the unablated ChIRo does not improve performance, which is expected given ChIRo's improvements over 2D baselines (Table 2). Omitting chiral tags and 3D geometry yields an achiral 2D GNN.
+
+# 5 CONCLUSION
+
+In this work we design a method for improving representations of molecular stereochemistry in graph neural networks through encoding 3D bond distances, angles, and especially torsions. Our torsion encoder learns expressive representations of tetrahedral chirality by processing coupled torsion angles that share a common bond while simultaneously achieving invariance to rotations about internal molecular bonds, diminishing the need for conformer-based data augmentation to capture conformational flexibility. Comparisons to the E(3)-invariant SchNet and DimeNet++ and the SE(3)-invariant SphereNet on a variety of tasks (one self-supervised, three supervised) dependent on molecular chirality demonstrate that ChIRo achieves state-of-the-art in learning chiral representations from 3D molecular structures, while also outperforming 2D GNNs. We leave consideration of other types of stereoisomerism, particularly cis/trans isomerism and atropisomerism, to future work.
+
+# ETHICS STATEMENT
+
+Advancing representations of molecular chirality and conformational flexibility has the potential to accelerate pharmaceutical drug design, renewable energy development, and progress towards energy-efficient and waste-reducing catalysts, among other areas of scientific research. However, in principle, the same advances could also be used for harmful biological, chemical, or materials research and applications thereof.
+
+# REPRODUCIBILITY STATEMENT
+
+Care has been taken to ensure reproducibility of all models and experiments in this paper. In addition to detailing exact model architectures and training details in the appendix, we make source code with experimental setups, model implementations, and random seeds available at https://github.com/keiradams/ChIRO. Our GitHub site also contains links to the exact datasets and splits used in each experiment for the contrastive learning, R/S classification, and ranking enantiomers by docking score tasks. Although copyright restrictions prevent us from releasing the dataset and splits for the $l / d$ classification task, we detail our data filtering and processing steps in appendix A.7.
+
+# ACKNOWLEDGMENTS
+
+This research was supported by the Office of Naval Research under grant number N00014-21-1-2195. L.P. thanks the MIT-Takeda fellowship program for financial support. The authors acknowledge the MIT SuperCloud and Lincoln Laboratory Supercomputing Center for providing HPC resources that have contributed to the research results reported within this paper. The authors thank Octavian Ganea and John Bradshaw for providing helpful suggestions regarding the content and organization of this paper.
+
+# REFERENCES
+
+Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2019.
+Simon Axelrod and Rafael Gomez-Bombarelli. Molecular machine learning with conformer ensembles. arXiv preprint arXiv:2012.08452, 2021.
+Vassileios Balntas, Edgar Riba, Daniel Ponsa, and Krystian Mikolajczyk. Learning local feature descriptors with triplets and shallow convolutional neural networks. In Edwin R. Hancock Richard C. Wilson and William A. P. Smith (eds.), Proceedings of the British Machine Vision Conference (BMVC), pp. 119.1-119.11. BMVA Press, September 2016. ISBN 1-901725-59-6. doi: 10.5244/C.30.119. URL https://dx.doi.org/10.5244/C.30.119.
+Evan E. Bolton, Jie Chen, Sunghwan Kim, Lianyi Han, Siqian He, Wenyao Shi, Vahan Simonyan, Yan Sun, Paul A. Thiessen, Jiyao Wang, Bo Yu, Jian Zhang, and Stephen H. Bryant. PubChem3D: a new resource for scientists. Journal of Cheminformatics, 3, 2011.
+Nathan Brown, Marco Fiscato, Marwin H.S. Segler, and Alain C. Vaucher. GuacaMol: Benchmarking models for de novo molecular design. Journal of Chemical Information and Modeling, 59(3): 1096-1108, 2019.
+Kangway V. Chuang and Michael J. Keiser. Attention-based learning on molecular ensembles. arXiv preprint arXiv:2011.12820, 2020.
+Kangway V. Chuang, Laura M. Gunsalus, and Michael J. Keiser. Learning molecular representations for medicinal chemistry. Journal of Medicinal Chemistry, 63:8705-8722, 2020.
+Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In Proceedings of the 33rd International Conference on Machine Learning, JMLR: WCP, volume 48, 2016.
+
+David Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gomez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In Proceedings of Advances in Neural Information Processing Systems, volume 28, 2015.
+Daniel C. Elton, Zois Boukouvalas, Mark D. Fuge, and Peter W. Chung. Deep learning for molecular design—a review of the state of the art. Molecular Systems Design & Engineering, 4:828-849, 2019.
+Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with PyTorch Geometric. ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
+Daniel Flam-Shepherd, Tony Wu, Pascal Friederich, and Alan Aspuru-Guzik. Neural message passing on high order paths. Machine Learning: Science and Technology, 2(4), 2021.
+Fabian Fuchs, Daniel Worrall, Volker Fischer, and Max Welling. SE(3)-transformers: 3D roto-translation equivariant attention networks. 34th Conference on Neural Information Processing Systems (NeurIPS), 2020.
+Octavian-Eugen Ganea, Lagnajit Pattanaik, Connor W. Coley, Regina Barzilay, Klavs F. Jensen, William H. Green, and Tommi S. Jaakola. GeoMol: Torsional geometric generation of molecular 3D conformer ensembles. 35th Conference on Neural Information Processing Systems (NeurIPS), 2021.
+Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pp. 1263-1272, 2017.
+Alexander Golbraikh, Danail Bonchev, and Alexander Tropsha. Novel chirality descriptors derived from molecular topology. J. Chem. Inf. Comput. Sci., 41:147-158, 2001.
+Paul C. D. Hawkins, A. Geoffrey Skillman, Gregory L. Warren, Benjamin A. Ellingson, and Matthew T. Stahl. Conformer generation with OMEGA: algorithm and validation using high quality structures from the protein databank and cambridge structural database. Journal of Chemical Information and Modeling, 50(4):572-584, 2010.
+Kexin Huang, Tianfan Fu, Wenhao Gao, Yue Zhao, Yusuf Roohani, Jure Leskovec, Connor W. Coley, Cao Xiao, Jimeng Sun, and Marinka Zitnik. Therapeutics Data Commons: Machine learning datasets and tasks for drug discovery and development. In Proceedings of Neural Information Processing Systems, NeurIPS Datasets and Benchmarks, 2021.
+F. Jamali, R. Mehvar, and F.M. Pasutto. Enantioselective aspects of drug action and disposition: therapeutic pitfalls. Journal of Pharmaceutical Sciences, 78(9):695-715, 1989.
+John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, Alex Bridgland, Clemens Meyer, Simon A. A. Kohl, Andrew J. Ballard, Andrew Cowie, Bernardino Romera-Paredes, Stanislav Nikolov, Rishub Jain, Jonas Adler, Trevor Back, Stig Petersen, David Reiman, Ellen Clancy, Michal Zielinski, Martin Steinegger, Michalina Pacholska, Tamas Berghammer, Sebastian Bodenstein, David Silver, Oriol Vinyals, Andrew W. Senior, Koray Kavukcuoglu, Pushmeet Kohli, and Demis Hassabis. Highly accurate protein structure prediction with alphafold. Nature, 596:583-589, 2021.
+Steven Kearnes, Kevin McCloskey, Marc Berndl, Vijay Pande, and Patrick Riley. Molecular graph convolutions: Moving beyond fingerprints. Journal of Computer-Aided Molecular Design, 30: 595-608, 2016.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Johannes Klicpera, Shankari Giri, Johannes T. Marggraf, and Stephan Gunnemann. Fast and uncertainty-aware directional message passing for non-equilibrium molecules. Machine Learning for Molecules Workshop at NeurIPS, 2020a.
+
+Johannes Klicpera, Janek Groß, and Stephan Gunnemann. Directional message passing for molecular graphs. International Conference on Learning Representations (ICLR), 2020b.
+Johannes Klicpera, Florian Becker, and Stephan Gunnemann. GemNet: Universal directional graph neural networks for molecules. 35th Conference on Neural Information Processing Systems (NeurIPS), 2021.
+Assia Kovatcheva, Alexander Golbraikh, S. Oloff, J. Feng, W. Zheng, and Alexander Tropsha. QSAR modeling of datasets with enantioselective compounds using chirality sensitive molecular descriptors. SAR and QSAR in Environmental Research, 16(1-2):93-102, 2007.
+Greg Landrum. RDKit: Open-source cheminformatics. 2010. URL https://www.rdkit.org/.
+Kuangbiao Liao, Yun-Fang Yang, Yingzi Li, Jacob N. Sanders, K.N. Houk, Djamaladdin G. Musaev, and Huw M.L. Davies. Design of catalysts for site-selective and enantioselective functionalization of non-activated primary C-H bonds. Nature Chemistry, 10:1048-1055, 2018.
+Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E. Gonzalez, and Ion Stoica. Tune: A research platform for distributed model selection and training. arXiv preprint arXiv:1807.05118, 2018.
+Zhiqiu Lin, Jin Sun, Abe Davis, and Noah Snavely. Visual chirality. Computer Vision and Pattern Recognition (CVPR), 2020.
+Yi Liu, Limei Wang, Meng Liu, Xuan Zhang, Bora Oztekin, and Ji Shuiwang. Spherical message passing for 3D graph networks. arXiv preprint arXiv:2102.05013, 2021.
+Gómez-Hortigüela Luis and Bernardo-Maestro Beatz. Chiral Organic Structure-Directing Agents. In: Gómez-Hortigüela, Luis (eds) Insights into the Chemistry of Organic Structure-Directing Agents in the Synthesis of Zeolitic Materials. Structure and Bonding, volume 175. Springer International Publishing, 2018.
+Rafael Mamede, Bruno Simões de Almeida, Mengyao Chen, Qingyou Zhang, and Joao Aires-de Sousa. Machine learning classification of one-chiral-center organic molecules according to optical rotation. Journal of Chemical Information and Modeling, 61(1):67-75, 2021.
+Elman Mansimov, Omar Mahmood, Seokho Kang, and Kyunghyun Cho. Molecular geometry prediction using a deep generative graph neural network. Scientific Reports, 9, 2019.
+Lien Ai Nguyen, Hua He, and Chuong Pham-Huy. Chiral drugs: An overview. International Journal of Biomedical Science, 2(2):85-100, 2006.
+Lagnajit Pattanaik, Octavian-Eugen Ganea, Ian Coley, Klavs F. Jensen, William H. Green, and Connor W. Coley. Message passing networks for molecules with tetrahedral chirality. arXiv preprint arXiv:2012.00094, 2020a.
+Lagnajit Pattanaik, John B Ingraham, Colin A Grambow, and William H Green. Generating transition states of isomerization reactions with deep learning. Physical Chemistry Chemical Physics, 22(41):23618-23626, 2020b.
+Andreas Pfaltz and William J. III Drury. Design of chiral ligands for asymmetric catalysis: From C2-symmetric P,P- and N,N-ligands to sterically and electronically nonsymmetrical P,N-ligands. PNAS, 101(16):5723-5726, 2004.
+Reaxys. Reaxys and the Reaxys trademark are owned and protected by Reed Elsevier Properties SA and used under license. Accessed Aug. 6-9, 2021. URL https://www.reaxys.com/.
+Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E(n) equivariant graph neural networks. In Proceedings of the 38th International Conference on Machine Learning, PMLR, volume 139, pp. 9323-9332, 2021.
+Nadine Schneider, Richard A. Lewis, Nikolas Fechner, and Peter Ertl. Chiral cliffs: Investigating the influence of chirality on binding affinity. *ChemMedChem*, 13(13):1315–1324, 2018.
+
+Kristof T. Schütt, Pieter-Jan Kindermans, Huziel E. Sauceda, Stefan Chmiela, Alexandre Tkatchenko, and KLaus-Robert Müller. SchNet: A continuous-filter convolutional neural network for modeling quantum interactions. In Proceedings of Advances in Neural Information Processing Systems, volume 30, pp. 992-1002, 2017.
+Gregor Simm and Jose Miguel Hernandez-Lobato. A generative model for molecular distance geometry. In Proceedings of the 37th International Conference on Machine Learning, PMLR, volume 119, pp. 8949-8958, 2020.
+Martin Simonovsky and Nikos Komodakis. Dynamic edge-conditioned filters in convolutional neural networks on graphs. Computer Vision and Pattern Recognition (CVPR), 2017.
+Nathaniel Thomas, Tess Smidt, Steven M. Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation- and translation-equivariant neural networks for 3D point clouds. arXiv preprint arXiv:1802.08219, 2018.
+Oleg Trott and Arthur J. Olson. AutoDock Vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization and multithreading. Journal of Computational Chemistry, 31(2):455-461, 2010.
+Jose R. Valdés-Martín, Yovani Marrero-Ponce, César R. García-Jacas, Karina Martinez-Mayorga, Stephen J. Barigye, Yasser Silveira Vaz d'Almeida, Facundo Pérez-Giménez, and Carlos A. Morell. QuBiLS-MAS, open source multi-platform software for atom-and bond-based topological (2D) and chiral (2.5 D) algebraic molecular descriptors computations. Journal of Cheminformatics, 9(1):1-26, 2017.
+Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. International Conference on Learning Representations (ICLR), 2018.
+Jan Weinreich, Nicholas J. Browning, and O. Anatole von Lilienfeld. Machine learning of free energies in chemical compound space using ensemble representations: Reaching experimental uncertainty for solvation. The Journal of Chemical Physics, 154(13), 2021.
+Robin Winter, Frank Noé, and Djork-Arné Clevert. Auto-encoding molecular conformations. arXiv preprint arXiv:2101.01618, 2021.
+Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: A benchmark for molecular machine learning. Chem Sci., 9(2):513-530, 2018.
+Minkai Xu, Shitong Luo, Yoshua Bengio, Jian Peng, and Jian Tang. Learning neural generative dynamics for molecular conformation generation. International Conference on Learning Representations (ICLR), 2021.
+Kevin Yang, Kyle Swanson, Wengong Jin, Connor W. Coley, Philipp Eiden, Hua Gao, Angel Guzman-Perez, Timothy Hopper, Brian Kelley, Miriam Mathea, Andrew Palmer, Volker Settels, Tommi Jaakola, Klavs F. Jensen, and Regina Barzilay. Analyzing learned molecular representations for property prediction. Journal of Chemical Information and Modeling, 59(8):3370-3388, 2019.
+Raymond A. Yeh, Yuan-Ting Hu, and Alexander G. Schwing. Chirality nets for human pose regression. 33rd Conference on Neural Information Processing Systems (NeurIPS), 2019.
+Dmitry V. Zankov, Maxim D. Shevelev, Aleksandra V. Nikoenko, Pavel G. Polishchuk, Asima I. Rakhimbekova, and Timur I. Madzhidov. Multi-instance learning for structure-activity modeling for molecular properties. International Conference on Analysis of Images, Social Networks and Texts, pp. 62–71, 2019.
+Dmitry V. Zankov, Mariia Matveieva, Aleksandra Nikoenko, Ramil Nugmanov, Igor I. Baskin, Alexandre Varnek, Pavel Polishchuk, and Timur Madzhidov. QSAR modeling based on conformation ensembles using a multi-instance learning approach. Journal of Chemical Information and Modeling, 2021.
+
+# A APPENDIX
+
+# CONTENTS
+
+# A Appendix 14
+
+A.1 Why does plotting $\alpha_{\mathrm{sin}}^{(xy)}$ vs. $\alpha_{\mathrm{cos}}^{(xy)}$ yield a perfect circle? 15
+A.2 Why do we need phase shifts? 16
+A.3 Chiral Message Passing 17
+A.4 Model Architectures 17
+
+A.4.1 ChIRo 17
+A.4.2 3D Baselines 20
+A.4.3 2D Baselines 22
+
+A.5 Training Details 23
+
+A.5.1DimeNet++Initializations 23
+A.5.2SphereNet Data Processing Errors 23
+A.5.3 Auxiliary Torsion Loss when Training ChIRo 23
+A.5.4 Contrastive Learning 23
+A.5.5 R/S Classification 24
+A.5.6 $l / d$ Classification 24
+A.5.7 Ranking Enantiomers by Docking Scores 24
+
+A.6 Hyperparameter Optimizations 26
+
+A.6.1 ChIRo 26
+A.6.2SphereNet 27
+A.6.3 DMPNN 27
+
+A.7 Datasets 28
+
+A.7.1 Contrastive Learning and R/S Classification Datasets 28
+A.7.2 $l / d$ Classification Dataset 30
+A.7.3 Ranking Enantiomers by Docking Scores 32
+
+A.8 Additional Ablations 34
+A.9 Additional Evaluation of Ranking Enantiomers by Docking Scores 34
+A.10 Analyzing SE(3)-Invariant 3D GNNs without InterRoto-Invariance 36
+
+A.1 WHY DOES PLOTTING $\alpha_{\mathrm{SIN}}^{(xy)}$ VS. $\alpha_{\mathrm{COS}}^{(xy)}$ YIELD A PERFECT CIRCLE?
+
+It is not immediately obvious that plotting $\alpha_{\sin}^{(xy)}$ versus $\alpha_{\cos}^{(xy)}$ forms a perfect circle with a constant radius, as opposed to an ellipse or other shape with non-constant radii. Yet, this result follows from simple trigonometry.
+
+From Equation 11, we have:
+
+$$
+\alpha_ {\mathrm {c o s}} ^ {(x y)} = \sum_ {i \in N (x) \backslash \{y \}} \sum_ {j \in N (y) \backslash \{x \}} c _ {i j} ^ {(x y)} \cos (\psi_ {i x y j} + \varphi_ {i x y j})
+$$
+
+$$
+\alpha_ {\sin} ^ {(x y)} = \sum_ {i \in N (x) \backslash \{y \}} \sum_ {j \in N (y) \backslash \{x \}} c _ {i j} ^ {(x y)} \sin (\psi_ {i x y j} + \varphi_ {i x y j})
+$$
+
+for a internal molecular bond between nodes $(x,y)$ that forms a set of coupled torsions $\{\psi_{ixyj}\}_{(i,j)}$ where $i\in N(x)\setminus \{y\}$ and $j\in N(y)\setminus \{x\}$ . For clarity, we drop the $(xy)$ notation and index each torsion in this set of $n$ coupled torsions by a single index $k$ such that $\{\psi_{ixyj}\}_{(i,j)} = \{\psi_k\}_{k = 1}^n$ .
+
+We want to show that plotting $\sum_{k=1}^{n} c_k \sin (R + \psi_k + \varphi_k)$ versus $\sum_{k=1}^{n} c_k \cos (R + \psi_k + \varphi_k)$ , where $R \in [0,2\pi)$ is a rotation of the bond $(x,y)$ , yields a circle with a constant radius invariant to the rotation $R$ . As a simple case, consider $n = 2$ . We then have:
+
+$$
+\alpha_ {\cos} = c _ {1} \cos (R + \psi_ {1} + \varphi_ {1}) + c _ {2} \cos (R + \psi_ {2} + \varphi_ {2}) = c _ {1} \cos (R + \theta_ {1}) + c _ {2} \cos (R + \theta_ {2})
+$$
+
+$$
+\alpha_ {\sin} = c _ {1} \sin (R + \psi_ {1} + \varphi_ {1}) + c _ {2} \sin (R + \psi_ {2} + \varphi_ {2}) = c _ {1} \sin (R + \theta_ {1}) + c _ {2} \sin (R + \theta_ {2})
+$$
+
+$\alpha_{\mathrm{cos}}$ can be expanded and simplified as:
+
+$$
+c _ {1} \cos (R + \theta_ {1}) + c _ {2} \cos (R + \theta_ {2}) =
+$$
+
+$$
+c _ {1} \left(\cos (R) \cos (\theta_ {1}) - \sin (R) \sin (\theta_ {1})\right) + c _ {2} \left(\cos (R) \cos (\theta_ {2}) - \sin (R) \sin (\theta_ {2})\right) =
+$$
+
+$$
+a \cos (R) - b \sin (R) = d \cos (R + e)
+$$
+
+where
+
+$$
+a = d \cos e = c _ {1} \cos \left(\theta_ {1}\right) + c _ {2} \cos \left(\theta_ {2}\right)
+$$
+
+$$
+b = d \sin e = c _ {1} \sin \left(\theta_ {1}\right) + c _ {2} \sin \left(\theta_ {2}\right)
+$$
+
+Similarly, $\alpha_{\mathrm{sin}}$ can be expanded and simplified as:
+
+$$
+c _ {1} \sin (R + \theta_ {1}) + c _ {2} \sin (R + \theta_ {2}) =
+$$
+
+$$
+c _ {1} \left(\sin (R) \cos \left(\theta_ {1}\right) + \cos (R) \sin \left(\theta_ {1}\right)\right) + c _ {2} \left(\sin (R) \cos \left(\theta_ {2}\right) + \cos (R) \sin \left(\theta_ {2}\right)\right) =
+$$
+
+$$
+a ^ {\prime} \sin (R) + b ^ {\prime} \cos (R) = d ^ {\prime} \sin (R + e ^ {\prime})
+$$
+
+where
+
+$$
+a ^ {\prime} = d ^ {\prime} \cos e ^ {\prime} = c _ {1} \cos \left(\theta_ {1}\right) + c _ {2} \cos \left(\theta_ {2}\right)
+$$
+
+$$
+b ^ {\prime} = d ^ {\prime} \sin e ^ {\prime} = c _ {1} \sin (\theta_ {1}) + c _ {2} \sin (\theta_ {2})
+$$
+
+Since $d = d'$ and $e = e'$ , we have that $\alpha_{\cos} = d\cos(R + e)$ and $\alpha_{\sin} = d\sin(R + e)$ . It follows that in the general case ( $n \geq 2$ ):
+
+$$
+\alpha_ {\cos} = \sum_ {k = 1} ^ {n} c _ {k} \cos (\omega t + \psi_ {k} + \varphi_ {k}) = r \cos (R + s)
+$$
+
+$$
+\alpha_ {\sin} = \sum_ {k = 1} ^ {n} c _ {k} \sin (\omega t + \psi_ {k} + \varphi_ {k}) = r \sin (R + s)
+$$
+
+for some coefficients $r$ and $s$ , where $R \in [0, 2\pi)$ represents some rotation about the internal bond. It is immediately obvious that plotting $\alpha_{\sin}$ versus $\alpha_{\cos}$ for all $R \in [0, 2\pi)$ yields a perfect circle with radius $r$ .
+
+# A.2 WHY DO WE NEED PHASE SHIFTS?
+
+At first glance, it is unclear as to why Equations 8-9 are insufficient to learn chirality, e.g. why we need to add phase shifts to distinguish enantiomers. To understand why this is the case, consider an arbitrary stereoisomer containing an internal molecular bond between nodes $x$ and $y$ (with $x$ or $y$ being chiral) that forms a set of $n$ coupled torsions $\{\psi_{ixyj}\}_{(i,j)} = \{\psi_{xy}^{(k)}\}_{k=1}^n$ indexed by $k$ . Direct computation of the norm $||\alpha_{\cos}^{(xy)}, \alpha_{\sin}^{(xy)}|| = ||\alpha_{\cos}, \alpha_{\sin}||$ yields:
+
+$$
+| | \alpha_ {\mathrm {c o s}}, \alpha_ {\mathrm {s i n}} | | = \sqrt {\alpha_ {\mathrm {c o s}} ^ {2} + \alpha_ {\mathrm {s i n}} ^ {2}}
+$$
+
+where we have dropped the $(xy)$ notation for clarity. Expanding and squaring Equation 8 gives:
+
+$$
+\alpha_ {\cos} ^ {2} = \sum_ {k = 1} ^ {n} c _ {k} ^ {2} \cos^ {2} \psi_ {k} + \sum_ {k = 1} ^ {n} \sum_ {l = k + 1} ^ {n} 2 c _ {k} c _ {l} \cos \psi_ {k} \cos \psi_ {l}
+$$
+
+$$
+\alpha_ {\sin} ^ {2} = \sum_ {k = 1} ^ {n} c _ {k} ^ {2} \sin^ {2} \psi_ {k} + \sum_ {k = 1} ^ {n} \sum_ {l = k + 1} ^ {n} 2 c _ {k} c _ {l} \sin \psi_ {k} \sin \psi_ {l}
+$$
+
+Now consider reflecting this stereoisomer across a plane to generate its enantiomer with inverted chiral centers. Reflecting a conformer negates all its torsions, and thus the reflected enantiomer's internal bond between (reflected) nodes $x'$ and $y'$ will form a set of $n$ negated torsions $\{\psi_{ixyj}'\}_{(i,j)} = \{\psi_{xyj}'\}_{k=1}^n$ where $\psi_{xyj}'(k) = -\psi_{xyj}^{(k)}$ for each $k$ . Because enantiomers have the same 2D graph connectivity, the learned set of coefficients $\{c_k\}$ (which depend only on the permutation invariant node features, see Equation 5) will be identical between enantiomers. It immediately follows from the identities $\sin(-x) = -\sin(x)$ and $\cos(-x) = \cos(x)$ that $\alpha_{\cos}^{'2} = \alpha_{\cos}^{2}$ and $\alpha_{\sin}^{'2} = \alpha_{\sin}^{2}$ . Because $||\alpha_{\cos}, \alpha_{\sin}||$ is invariant to any rotation of the bond $(x,y)$ , no matter how we rotate $(x,y)$ or $(x',y')$ , $||\alpha_{\cos}, \alpha_{\sin}|| = ||\alpha_{\cos}', \alpha_{\sin}'||$ .
+
+Table 4: Effects of ablating components of ChIRo on test-set accuracies for the $l / d$ classification and enantiomer docking score ranking tasks, when chiral message passing is included prior to readout. Mean and standard deviations are reported across 5 folds ( $l / d$ ) or 3 repeated trials (enantiomer ranking). The first row indicates the original ChIRo without CMP.
+
+| Model Components | Accuracy (%) ↑ |
| CMP | Tags | (dij,ijk, ixyj) | (zd, zφ, zα) | l / d | Enantiomer Ranking |
| X | X | ✓ | ✓ | 79.3 ± 0.4 | 72.0 ± 0.5 |
| ✓ | X | ✓ | ✓ | 78.5 ± 0.5 | 71.5 ± 0.5 |
| ✓ | ✓ | ✓ | ✓ | 77.0 ± 0.5 | 71.7 ± 0.6 |
| ✓ | ✓ | X | ✓ | 75.1 ± 0.3 | 69.8 ± 0.6 |
| ✓ | ✓ | X | X | 75.0 ± 0.9 | 68.9 ± 0.4 |
| ✓ | X | X | ✓ | 50.0 ± 0.0 | 49.9 ± 0.3 |
+
+# A.3 CHIRALMESSAGEPASSING
+
+Tetrahedral chirality is fundamentally a node-level property. Yet, we have treated chirality through the lens of torsions and internal bonds involving chiral centers. To propagate the learned representations of chirality to node states, we may perform an (optional) additional phase of message passing, treating each $\mathbf{z}_{\alpha_{xy}}$ as a vector of edge-attributes. This might allow the model to propagate chiral information across the graph, i.e., help learn the global effects of local chirality. This phase may be included prior to readout, and uses a single EConv layer followed by a sequence of $T_{\mathrm{CMP}}$ GAT layers:
+
+$$
+\mathbf {h} _ {i} ^ {\mathrm {C M P}} = \mathrm {G A T} _ {\mathrm {C M P}} ^ {T _ {\mathrm {C M P}}} \circ \dots \circ \mathrm {G A T} _ {\mathrm {C M P}} ^ {1} \left(\boldsymbol {\Theta} _ {\mathrm {C M P}} \mathbf {h} _ {i} ^ {T} + \sum_ {j \in N (i)} \mathbf {h} _ {j} ^ {T} \cdot f _ {\mathrm {C M P}} (\mathbf {z} _ {\alpha_ {i j}})\right) \tag {15}
+$$
+
+During readout, these updated node states $\mathbf{h}_i^{\mathrm{CMP}}$ are summed rather than the (non-chiral) node states.
+
+Table 4 reports the effects of including chiral message passing on ChIRo's performance on the $l / d$ classification task and the ranking enantiomers by docking scores task, along with the effects of ablating other components of ChIRo. Although CMP does not improve performance (and marginally hurts) the unablated ChIRo, using CMP in place of $(\mathbf{z}_d,\mathbf{z}_{\phi},\mathbf{z}_{\alpha})$ during readout provides another option of augmenting 2D GNNs that solely use chiral tags as the only indication of chirality.
+
+# A.4 MODEL ARCHITECTURES
+
+# A.4.1 CHIRO
+
+Figure 4 visualizes the full architecture of ChIRo. Table 5 specifies the hyperparameters chosen for each task. See appendix A.6 for details on hyperparameter optimizations.
+
+
+Figure 4: Architecture of ChIRO
+
+Table 5: Hyperparameters optimized for ChIRo on each task. Parameters for chiral message passing are shown, although chiral message passing is omitted in the default version of ChIRo.
+
+| Hyperparameters | Task |
| Contrastive | R / S | l / d | Ranking |
| Node Features Dimension | | 52 | | |
| Edge Features Dimension | | 14 | | |
| All MLP Hidden Activations | | LeakyReLU | | |
| All MLP Output Activations | | Identity | | |
| EConv MLP Hidden Layer Size | 32 | 64 | 64 | 32 |
| EConv MLP # Hidden Layers | 2 | 1 | 1 | 2 |
| h0, hT, hTMP Dimension | 64 | 32 | 32 | 64 |
| ht, t = 1,..., T - 1 Dimension | 64 | 64 | 32 | 64 |
| # GAT Layers | 2 | 3 | 2 | 2 |
| # GAT Heads | 4 | 4 | 2 | 4 |
| fdHidden Layer Size | - | 128 | 32 | 64 |
| fd# Hidden Layers | - | 2 | 2 | 2 |
| fφHidden Layer Size | - | 128 | 32 | 64 |
| fφ# Hidden Layers | - | 2 | 2 | 2 |
| fαHidden Layer Size | 64 | 128 | 32 | 64 |
| fα# Hidden Layers | 2 | 2 | 2 | 2 |
| fcHidden Layer Size | 64 | 128 | 32 | 64 |
| fc# Hidden Layers | 2 | 2 | 2 | 2 |
| fφHidden Layer Size | 64 | 256 | 256 | 256 |
| fφ# Hidden Layers | 2 | 2 | 3 | 2 |
| foutHidden Layer Size | - | 64 | 64 | 128 |
| fout# Hidden Layers | - | 2 | 2 | 2 |
| zd, zφ, zα Dimension | 2 | 64 | 8 | 8 |
| CMP EConv Hidden Layer Size | - | 32 | 256 | 256 |
| CMP EConv # Hidden Layers | - | 1 | 3 | 2 |
| # CMP GAT Layers | - | 3 | 3 | 3 |
| # CMP GAT Heads | - | 2 | 2 | 2 |
| γaux | 8.25e-4 | 6.86e-3 | 1.86e-3 | 8.25e-4 |
| Learning Rate | 6.06e-4 | 5.69e-4 | 1.28e-4 | 6.06e-4 |
| Batch Size | 32 | 16 | 16 | 32 |
| # Epochs | 50 | 100 | 100 | 150 |
+
+Table 6: Hyperparameters selected for SphereNet on each task. See appendix A.6 for hyperparameter optimizations.
+
+| Hyperparameters | Task |
| Contrastive | R/S | l/d | Ranking |
| Readout MLP Hidden Activations | | LeakyReLU Identity |
| Readout MLP Output Activation | |
| Readout MLP Hidden Size | - | 256 | 64 | 64 |
| Readout MLP # of Hidden Layers | - | 4 | 2 | 2 |
| hidden_channels | 128 | 256 | 64 | 256 |
| out_channels | 2 | 64 | 64 | 32 |
| cutoff | 5.0 | 5.0 | 5.0 | 5.0 |
| num_layers | 4 | 4 | 4 | 5 |
| int_emb_size | 64 | 32 | 128 | 64 |
| basis_emb_size_dist | 8 | 8 | 8 | 8 |
| basis_emb_size_angle | 8 | 8 | 8 | 8 |
| basis_emb_size_torsion | 8 | 8 | 8 | 8 |
| out_emb_channels | 256 | 128 | 64 | 32 |
| num_spherical | 7 | 7 | 7 | 7 |
| num_radial | 6 | 6 | 6 | 6 |
| envelope_exponent | 5 | 5 | 5 | 5 |
| num_before skips | 1 | 1 | 1 | 1 |
| num_after skips | 2 | 2 | 2 | 2 |
| num_output_layers | 3 | 3 | 3 | 3 |
| Learning Rate | 1e-4 | 1.54e-4 | 4.79e-4 | 1.40e-4 |
| Batch Size | 32 | 64 | 16 | 32 |
+
+# A.4.2 3D BASELINES
+
+To adapt SchNet, DimeNet++, and SphereNet for our tasks, we increase the dimensionality of their respective aggregated node embeddings ("out_channels") and use this aggregation as a latent vector either for direct use in Equation 14 (for self-supervised contrastive learning), or for input to a feedforward readout MLP for downstream regression/classification. For all three 3D GNNs, we use their default node featurizations, using the atomic number as the only node feature.
+
+Table 6 lists the hyperparameters used for SphereNet on all four tasks. Tables 7 and 8 list the hyperparameters used for SchNet and DimeNet++ on the contrastive learning and R / S classification tasks.
+
+Table 7: Hyperparameters selected for SchNet on each task. Apart from the number of out channels and the inclusion of a readout MLP, the default SchNet architecture was used. Note that we used the same readout MLP architecture as in the optimized SphereNet.
+
+| Hyperparameters | Task |
| Contrastive | R / S |
| Readout MLP Hidden Activations | - | LeakyReLU |
| Readout MLP Output Activation | - | Identity |
| Readout MLP Hidden Size | - | 64 |
| Readout MLP # of Hidden Layers | - | 2 |
| hidden_channels | 128 | 128 |
| out_channels | 2 | 32 |
| num_filters | 128 | 128 |
| num_interactions | 6 | 6 |
| num_gaussians | 50 | 50 |
| cutoff | 10.0 | 10.0 |
| max_num_neighbors | 32 | 32 |
| Learning Rate | 1e-4 | 1e-4 |
| Batch Size | 32 | 32 |
+
+Table 8: Hyperparameters selected for DimeNet++ on each task. Apart from the number of out channels and the inclusion of a readout MLP, the default DimeNet++ architecture was used. Note that we used the same readout MLP architecture as in the optimized SphereNet.
+
+| Hyperparameters | Task |
| Contrastive | R / S |
| Readout MLP Hidden Activations | - | LeakyReLU |
| Readout MLP Output Activation | - | Identity |
| Readout MLP Hidden Size | - | 64 |
| Readout MLP # of Hidden Layers | - | 2 |
| hidden_channels | 128 | 128 |
| out_channels | 2 | 32 |
| num_blocks | 4 | 4 |
| cutoff | 5.0 | 5.0 |
| int_emb_size | 64 | 64 |
| basis_emb_size | 8 | 8 |
| out_emb_channels | 256 | 256 |
| num_spherical | 7 | 7 |
| num_radial | 6 | 6 |
| envelope_exponent | 5 | 5 |
| num_before skips | 1 | 1 |
| num_after skips | 2 | 2 |
| num_output_layers | 3 | 3 |
| Learning Rate | 1e-4 | 1e-4 |
| Batch Size | 32 | 32 |
+
+Table 9: Hyperparameters selected for DMPNN on each task. Following Pattanaik et al., we only optimize hyperparameters for the baseline sum aggregator and extend these hyperparameters to the TetraDMPNN models.
+
+| Hyperparameters | Task |
| Contrastive | R / S |
| hidden_size | 300 | 300 |
| depth | 3 | 3 |
| dropout | 0.2 | 0.2 |
| Max Learning Rate | 1e-4 | 1e-4 |
| Batch Size | 50 | 50 |
+
+# A.4.3 2D BASELINES
+
+To optimize hyperparameters for all 2D baselines, we directly use the code provided by Pattanaik et al.. We do not make any modifications to the architectures, since we train on similar tasks as the original work.
+
+# A.5 TRAINING DETAILS
+
+This section describes the full training protocols for each task considered in this paper.
+
+# A.5.1 DIMENET++ INITIALIZATIONS
+
+The default parameter initializations for the output blocks of DimeNet++ make DimeNet++ unable to break symmetry between different output channels when the number of output channels is set $>1$ . Thus, we remove the default initializations for the output blocks when training DimeNet++ on the contrastive learning task (out_channels = 2) and the R/S classification task (out_channels = 32).
+
+# A.5.2 SPHERENET DATA PROCESSING ERRORS
+
+When training SphereNet, occasionally the publicly-available implementation of SphereNet failed to process select conformers. Because this occurred for only a tiny fraction of the conformers in the overall datasets, we removed 2D graphs whose stereoisomers contained problematic conformers from the R/S and $l / d$ datasets for SphereNet only. We emphasize that this filtering step did not meaningfully change the size of the datasets: only 40 2D graphs (out of 39,256) were removed for the R/S task, and only 6 2D graphs (out of 15,038) were removed for the $l / d$ task. No molecules had to be removed for the ranking enantiomers by docking scores task. For the contrastive learning task, we simply skipped the rare batch during training/inference that contained problematic conformers. Only 452 2D graphs out of 257,743 caused processing errors in the contrastive learning dataset.
+
+# A.5.3 AUXILIARY TORSION LOSS WHEN TRAINING CHIRO
+
+In Equation 10, we predict an angular phase shift $\varphi$ by using $f_{\varphi}$ to predict $\cos \varphi$ and $\sin \varphi$ separately with a linear output activation, and then use $\ell_2$ normalization on the vector $[\cos \varphi ,\sin \varphi ]$ to ensure that these sin and cos (and thus the angle $\varphi$ ) have correct circular properties, namely that $\varphi \in [0,2\pi)$ . We have chosen to predict angles using sin and cos rather than directly predicting a scalar $\varphi \in [0,2\pi)$ (e.g., through a scaled sigmoid activation) in order to avoid biasing the predicted phase shifts toward 0. However, the $\ell_2$ normalization can also cause the predicted phase shift to be biased toward $0,\pi /2,\pi$ , and $3\pi /2$ if one of the unnormalized $\cos \varphi$ or $\sin \varphi$ blows up. To prevent this, we follow Jumper et al. (2021) in adding an auxiliary loss during training to encourage the unnormalized $[\cos \varphi ,\sin \varphi ]$ to fall close to the unit circle:
+
+$$
+L _ {\text {a u x}} = \gamma_ {\text {a u x}} (1 - | | \cos \varphi , \sin \varphi | |) \tag {16}
+$$
+
+where $\gamma_{\mathrm{aux}}$ is a small scalar that is tuned during hyperparameter optimization.
+
+# A.5.4 CONTRASTIVE LEARNING
+
+For contrastive learning, we train with a triplet margin loss with a normalized Euclidean distance metric and a margin of 1 (Equation 14). In each training epoch, we randomly partition the training data into $N / b$ minibatches, where $N$ is the number of distinct stereoisomers (not conformers) in the training set and $b$ is the batch size. Before triplet sampling, each minibatch therefore contains $b$ stereoisomers. For each stereoisomer $i = (1,2,\dots,b)$ in the minibatch, we then generate a triplet $(a,p,n)$ , where $a$ (anchor) and $p$ (positive) are two randomly selected (without replacement) conformers of stereoisomer $i$ , and $n$ (negative) is a randomly selected conformer of stereoisomer $j \neq i$ , where $i$ and $j$ share the same 2D graph connectivity. If stereoisomer $i$ has multiple different stereoisomers $j,k,\ldots$ (all sharing the same 2D graph) present in the training set, one of these stereoisomers is randomly chosen. Each anchor, positive, and negative in each triplet are processed independently by the network to generate $b$ triplets of latent vectors $(\mathbf{z}_a,\mathbf{z}_p,\mathbf{z}_n)$ , which are then fed into the triplet margin loss function. Loss contributions from each triplet are averaged to form a loss for the entire batch. In the case of ChIRo, we add the mean auxiliary torsion loss across all conformers in the batch to the batch triplet loss.
+
+We use the Adam optimizer (Kingma & Ba, 2014) with a flat learning rate throughout training, but employ gradient clipping with a maximum gradient L2-norm of 10. We train each model for a maximum of 50 epochs, and use the batch-averaged triplet loss (without the auxiliary torsion loss contributions) on the validation set to select the model with the best estimated generalization performance across the 50 epochs. We do not employ dropout or other forms of explicit regularization.
+
+# A.5.5 R/S CLASSIFICATION
+
+For R / S classification, we train each 3D model with a binary cross-entropy loss. In each training epoch, we randomly partition the training data into $N / b$ minibatches, where $N$ is the number of enantiomers in the training set and $b$ is the batch size. For each enantiomer in the batch, we randomly sample a conformer for that enantiomer and a conformer for its opposite enantiomer with the same 2D graph. This ensures that minibatches contain both enantiomers of the enantiomeric pair such that the stochastic gradient steps consider contributions from both enantiomers. We average the loss contributions for all conformers in the batch. In the case of ChIRo, the mean auxiliary torsion loss across all conformers in the batch is added to the batch cross-entropy loss.
+
+We use the Adam optimizer with a flat learning rate throughout training, but employ gradient clipping with a maximum gradient L2-norm of 10. We train each model for a maximum of 100 epochs, and use the batch-averaged classification accuracy on the validation set to select the model with the best estimated generalization performance across the 100 epochs. We do not employ dropout or other forms of explicit regularization.
+
+For testing, we evaluate the classification accuracy on all conformers in the test set, and do not use any form of conformer-based averaging or voting.
+
+# A.5.6 $l / d$ CLASSIFICATION
+
+For $l / d$ classification, we train each model with a binary cross-entropy loss. In each training epoch, we randomly partition the training data into $N / b$ minibatches, where $N$ is the number of enantiomers in the training set and $b$ is the batch size. For each enantiomer in the batch, we sample either 1) a random conformer or 2) a pre-selected conformer for that enantiomer, and either 1) a random conformer or 2) a pre-selected conformer conformer for its opposite enantiomer with the same 2D graph. This ensures that minibatches contain both enantiomers of the enantiomeric pair such that the stochastic gradient steps consider contributions from both enantiomers. In both cases, we average the loss contributions for all conformers in the batch. In the case of ChIRo, we add the mean auxiliary torsion loss across all conformers in the batch to the batch cross-entropy loss.
+
+We use the Adam optimizer with a flat learning rate throughout training, but employ gradient clipping with a maximum gradient L2-norm of 10. We train each model for a maximum of 100 epochs, and use the batch-averaged classification accuracy on the validation set to select the model with the best estimated generalization performance across the 100 epochs. We do not employ dropout or other forms of explicit regularization.
+
+For testing, we evaluate the classification accuracy on all conformers in the test set, and do not use any form of conformer-based averaging or voting.
+
+# A.5.7 RANKING ENANTIOMERS BY DOCKING SCORES
+
+For ranking enantiomers by their docking scores, we train each model with a mean squared error (MSE) loss, with the target values being the ground-truth docking scores for each enantiomer. Note that although we train the models with an MSE loss, we are more concerned with the ability of each model to correctly rank enantiomers by their docking scores than with the absolute performance of each model as a surrogate model for docking score prediction. Thus, we evaluate this task using the ranking accuracy, defined as whether or not the model correctly predicts a lower docking score for the enantiomer with the lower ground-truth score.
+
+In each training epoch, we randomly partition the training data into $N / b$ minibatches, where $N$ is the number of enantiomers in the training set and $b$ is the batch size. For each enantiomer in the batch, we sample either 1) a random conformer or 2) a pre-selected conformer for that enantiomer, and either 1) a random conformer or 2) a pre-selected conformer conformer for its opposite enantiomer with the same 2D graph. This ensures that minibatches contain both enantiomers of the enantiomeric pair such that the stochastic gradient steps consider contributions from both enantiomers. In both cases, we average the loss contributions for all conformers in the batch. In the case of ChIRo, we add the mean auxiliary torsion loss across all conformers in the batch to the batch MSE loss.
+
+We use the Adam optimizer with a flat learning rate throughout training, but employ gradient clipping with a maximum gradient L2-norm of 10. We train each model for a maximum of 150 epochs,
+
+and use the batch-averaged ranking accuracy on the validation set to select the model with the best estimated generalization performance across the 150 epochs. We do not employ dropout or other forms of regularization.
+
+For testing, we first predict the docking score for all conformers in the test set. We then average the predicted docking scores for each conformer of each enantiomer, yielding a mean predicted score for each enantiomer. Finally, we compute the ranking accuracy using these mean predicted scores.
+
+Table 10: Hyperparameter search space for ChIRo
+
+| Hyperparameter | Search Space |
| EConv MLP Hidden Layer Size | [32, 64, 128, 256] |
| EConv MLP # Hidden Layers | [1,2] |
| h0, hT, htCMP Dimension | [8, 16, 32, 64] |
| ht, t = 1,..., T - 1 Dimension | [16, 32, 64] |
| # GAT Layers | [2,3,4] |
| # GAT Heads | [1,2,4,8] |
| fd, fφ, fα, fc Hidden Layer Size | [32, 64, 128, 256] |
| fd, fφ, fα, fc # Hidden Layers | [1,2,3,4] |
| fφHidden Layer Size | [32, 64, 128, 256] |
| fφ# Hidden Layers | [1,2,3,4] |
| fout Hidden Layer Size | [32, 64, 128, 256] |
| fout # Hidden Layers | [1,2,3,4] |
| zd, zf, zα Dimension | [8, 16, 32, 64] |
| CMP EConv Hidden Layer Size | [32, 64, 128, 256] |
| CMP EConv # Hidden Layers | [1,2,3,4] |
| # CMP GAT Layers | [1,2,3,4] |
| # CMP GAT Heads | [1,2,4,8] |
| γaux | log uniform (1e-4, 1e-2) |
| Learning Rate | log uniform (5e-5, 5e-3) |
| Batch Size | [16, 32, 64, 128, 256] |
+
+# A.6 HYPERPARAMETER OPTIMIZATIONS
+
+# A.6.1 CHIRO
+
+Hyperparameters were tuned for ChIRo on the R / S, $l / d$ , and ranking enantiomers by docking score tasks, using the Raytune (Liaw et al., 2018) Python package with the HyperOpt plug-in. For the R / S classification and ranking enantiomers by docking score tasks, we tuned hyperparameters by training with the training set and evaluating model accuracy on the validation set. For the $l / d$ classification task, we used the training and validation splits of the first cross-validation fold to tune hyperparameters, evaluating model accuracy on the validation split. The optimal hyperparameters were then held constant for the remaining four folds.
+
+For each task below, we used the HyperOptSearch search algorithm in Raytune, which employs Tree-structured Parzen Estimators, to search for optimal hyperparameters over the search space specified in Table 10.
+
+R / S Classification. We trained a total of 100 models with different hyperparameter combinations for a maximum of 50 epochs, using the Async Hyperband Scheduler (grace period = 5, reduction factor = 3, brackets = 1) for aggressive early stopping.
+
+l / d Classification We performed two stages of optimization. We first trained 100 models with different hyperparameter combinations for a maximum of 50 epochs, using the Async Hyperband Scheduler (grace period = 5, reduction factor = 3, brackets = 1) for aggressive early stopping. We then re-ran the optimization for 50 parameter combinations over a maximum of 100 epochs, using the best five models from the first optimization as starting (seed) configurations. In this second stage, we again used HyperOptSearch but changed the Async Hyperband Scheduler to use parameters (grace period = 10, reduction factor = 4, brackets = 1).
+
+Ranking enantiomers by docking score. We trained a total of 100 models with different hyperparameter combinations for a maximum of 50 epochs, using the Async Hyperband Scheduler (grace period $= 5$ , reduction factor $= 3$ , brackets $= 1$ ) for aggressive early stopping.
+
+Table 11: Hyperparameter search space for SphereNet
+
+| Hyperparameter | Search Space |
| hidden_channels | [64, 128, 256] |
| out_channels | [16, 32, 64, 128, 256] |
| cutoff | [5.0, 10.0] |
| num_layers | [3,4,5] |
| int_emb_size | [32, 64, 128] |
| basis_emb_size_dist | 8 |
| basis_emb_size_angle | 8 |
| basis_emb_size_torsion | 8 |
| out_emb_channels | [64, 128, 256] |
| num_spherical | 7 |
| num_radial | 6 |
| envelope_exponent | 5 |
| num_before.skip | 1 |
| num_after skips | 2 |
| num_output_layers | 3 |
| Readout MLP Hidden Size | [32, 64, 128, 256] |
| Readout MLP # of Hidden Layers | [1,2,3,4] |
| Learning Rate | log uniform (5e-5, 1e-2) |
| Batch Size | [16, 32, 64, 128, 256] |
+
+Table 12: Hyperparameter search space for DMPNN
+
+| Hyperparameter | Search Space |
| hidden_size | [300, 600, 900, 1200] |
| depth | [2, 3, 4, 5, 6] |
| dropout | [0, 0.2, 0.4, 0.6, 0.8, 1] |
| Max Learning Rate | log uniform (1e-5, 1e-3) |
| Batch Size | [25, 50, 100] |
+
+# A.6.2 SPHERENET
+
+Hyperparameters were also tuned for SphereNet on the R / S, $l / d$ , and ranking enantiomers by docking score tasks, using the same optimization methodologies as when tuning ChIRo. The hyperparameter search space is specified in Table 11. In each of these tasks, we trained a total of 50 models with different hyperparameter combinations for a maximum of 50 epochs, using the HyperOptSearch algorithm and the Async Hyperband Scheduler (grace period = 5, reduction factor = 3, brackets = 1) for aggressive early stopping.
+
+# A.6.3 DMPNN
+
+We tune hyperparameters for the DMPNN on the $l / d$ classification and ranking enantiomers by docking score tasks using the original code provided by Pattanaik et al., which employs the Optuna hyperoptimization framework (Akiba et al., 2019). We train a total of 100 models using the HyperbandPruner algorithm to prune unpromising trials and the CmaEsSampler to sample new trials. Note that we only optimize hyperparameters for the sum aggregation baseline model, and we extend these hyperparameters to the TetraDMPNN models, following the work of Pattanaik et al.. Because the TetraDMPNN models use a permutation-based aggregation function, the runtime of these models is much slower, which renders a full hyperparameter optimization infeasible.
+
+# A.7 DATASETS
+
+# A.7.1 CONTRASTIVE LEARNING AND R/S CLASSIFICATION DATASETS
+
+To create the datasets for the contrastive learning and R/S classification tasks, we first randomly selected 50 sdf files from the "10 conformers per compound" directory from the PubChem3D FTP site ftp://ftp.ncbi.nlm.nih.gov/pubchem/Compound_3D/, out of 6199 available. After extracting the conformers in each sdf file, we filtered the data to only include conformers of 2D graphs for which at least 2 stereoisomers appear in the data, and where each of these stereoisomers has at least 2 conformers in the data. We further filtered the data to only include 2D graphs whose conformers contain at least 1 torsion, as recognized by RDKit. This dataset was separated into 80/20 partitions, with conformers corresponding to the same 2D graph being assigned to the same data partition. The larger (80%) subset was used as-is for contrastive learning. The smaller (20%) subset was further filtered to only include pairs of enantiomers with only 1 chiral center, excluding 2D graphs that contained other (cis/trans) stereoisomers of these enantiomer pairs in the dataset. Note that this extra step ensures that there are only two stereoisomers (which are enantiomers) per 2D graph. The resultant subset was used as the R/S classification dataset.
+
+Figures 5 and 6 show the distributions of the number of conformers per stereoisomer and the number of stereoisomers per 2D graph in the full contrastive learning dataset. Figure 7 shows the distribution of the number of conformers per enantiomer in the full R/S classification dataset. Table 13 indicates the distribution of R/S labels in the R/S dataset.
+
+The full contrastive learning dataset was split into 70/15/15 sets for training, validation, and testing, respectively, with conformers corresponding to the same 2D graphs being assigned to the same data partition. The training set contains 2,088,008 conformers of 418,922 stereoisomers of 180,426 distinct 2D graphs. The validation set contains 450,726 conformers of 89,786 stereoisomers of 38,658 distinct 2D graphs. The test set contains 448,017 conformers of 89,914 stereoisomers of 38,659 distinct 2D graphs.
+
+The full R/S dataset was similarly separated into 70/15/15 sets, with pairs of enantiomers being assigned to the same data partition. The training set contains 326,865 conformers of 55,084 stereoisomers (27,542 pairs of enantiomers). The validation set contains 70,099 conformers of 11,748 stereoisomers (5874 pairs of enantiomers). The test set contains 69,719 conformers of 11,680 stereoisomers (5840 pairs of enantiomers).
+
+
+Figure 5: Histogram of the number of conformers per stereoisomer in the contrastive learning dataset.
+
+
+Figure 6: Histogram of the number of stereoisomers per 2D graph in the contrastive learning dataset.
+
+
+Figure 7: Histogram of the number of conformers per enantiomer in the R/S classification dataset.
+
+Table 13: Balance of R/S labels in the R/S classification dataset.
+
+| R / S Label | # of Conformers | # of Enantiomers |
| R | 236222 | 39256 |
| S | 230461 | 39256 |
+
+# A.7.2 $l / d$ CLASSIFICATION DATASET
+
+Figure 8 enumerates the data filtering steps used to extract and filter the $l / d$ classification dataset from the experimental Reaxys database. In Reaxys, we queried non-fragmented molecules with molecular weights $\leq 564$ which had optical rotatory power reported at $18 - 30^{\circ}\mathrm{C}$ and a wavelength of $589~\mathrm{nm}$ . We further filtered these molecules to include those with SMILES strings that were validated by RDKit, and those which contained only 1 chiral center. Of these molecules, we removed duplicate entries if they were reported with different signs of optical rotation (which indicates an experimental measurement error). If duplicates had consistent signs of optical rotation, we randomly selected one entry. We then removed entries that did not have full stereochemistry specified in their SMILES strings, since we would later need to generate conformers for each molecule. We also removed molecules whose non-enantiomeric (e.g., cis/trans) stereoisomers also appeared in the dataset. We then checked if pairs of enantiomers were both reported in the dataset, and excluded such pairs if they were reported with the same sign of optical rotation (which indicates an experimental measurement error). For molecules whose opposite enantiomers were not in the dataset, we artificially generated the opposite enantiomer and assigned it the opposite sign of optical rotation. This ensures a balanced dataset. We then selected pairs of enantiomers which were reported with $\geq 95\%$ enantiomeric excess in order to reduce the risk of experimental noise causing labeling errors. Lastly, we used RDKit to generate 5 conformers for each enantiomer in the filtered dataset. If RDKit failed to generate a conformer for any pair of enantiomers, both enantiomers in the pair were removed from the dataset.
+
+Table 14 reports the distribution of $l / d$ labels in the final dataset, which contains 150,380 conformers of 30,076 enantiomers (15,038 pairs of enantiomers). We split this dataset into 5 folds for cross-validation, randomly assigning each pair of enantiomers (with their conformers) to a test set in one of the five folds. For each fold, we randomly split the remaining (i.e., non-testing) pairs of enantiomers into 87.5/12.5 training/validation sets. Note that this ensures each fold has 70/10/20 training/validation/test splits, with pairs of enantiomers being assigned to the same data partition within each fold, and that each pair of enantiomers only appears in one test set across the five folds.
+
+
+Figure 8: Data extraction, filtering, and generation steps for the $l / d$ classification task.
+
+Table 14: Balance of $l/d$ labels in dataset.
+
+| l / d Label | # of Conformers | # of Enantiomers |
| l | 75190 | 15038 |
| d | 75190 | 15038 |
+
+Table 15: Frequency of R/S labels amongst enantiomers in the $l / d$ dataset that rotate light in the positive (d) or negative (l) direction. The balance in R/S labels indicates the lack of empirical correlation between these two classification schemes.
+
+
+
+# A.7.3 RANKING ENANTIOMERS BY DOCKING SCORES
+
+To create the dataset for the ranking enantiomers by their docking scores task, we randomly selected 750 sdf files from the "10 conformers per compound" directory from the PubChem3D FTP site ftp://ftp.ncbi.nlm.nih.gov/pubchem/Compound_3D/, out of the 6199 available, but excluding the 50 sdf files used previously for the contrastive learning and R/S classification datasets. After extracting the conformers in each sdf file, we filtered the data to only include conformers of 2D graphs for which only 2 stereoisomers (corresponding to pairs of enantiomers with 1 chiral center) appeared in the dataset. As before, we only included enantiomers whose conformers contain at least 1 torsion, as recognized by RDKit. We then filtered enantiomers which have a molecular weight $\leq 225$ and $\leq 5$ rotatable bonds (as computed by RDKit). This step was designed to intentionally select small enantiomers which had few rotational degrees of freedom such that the docking simulations would be less stochastic. We then docked each pair of enantiomers three times against the protein (PDB ID: 4JBV) in the docking box centered at [10, 16, 61] with (x,y,z) radii of [10, 14, 12]. In each docking simulation, we increased the exhaustiveness parameter to 24 to help reduce noise in the resultant docking scores. As a final control for stochasticity in the docking simulations, we also removed pairs of enantiomers for which one or both of the enantiomers had a range of (top) docking scores $>0.1\mathrm{kcal / mol}$ across the three simulation trials. Finally, in order to select pairs of enantiomers which exhibit meaningful differences in docking scores, we filtered the dataset to only include pairs of enantiomers which had a difference in their best docking scores (across the three trials) of at least $0.3\mathrm{kcal / mol}$ . These enantiomers and their PubChem3D conformers were used as the final dataset. Figure 9 visualizes the full filtering procedure.
+
+Figure 10 plots the distribution of the number of conformers per enantiomer in the docking dataset. Figure 11 plots the distribution of the difference in docking scores between pairs of enantiomers in the docking dataset. We split the full dataset into 70/15/15 training/validation/test sets, assigning pairs of enantiomers (with their conformers) to the same data partition. The training set contains 234,622 conformers of 48,384 enantiomers (24,192 pairs of enantiomers). The validation set contains 49,878 conformers of 10,368 enantiomers (5184 pairs of enantiomers). The test set contains 50,571 conformers of 10,368 enantiomers (5184 pairs of enantiomers).
+
+
+PubChem3D Conformers
+Figure 9: Data generation and filtering steps for the ranking enantiomers by docking scores task.
+
+
+Figure 10: Histogram of the number of conformers per enantiomer in the docking dataset.
+
+
+Figure 11: Distribution of the differences in (best) docking scores between pairs of enantiomers in the docking dataset.
+
+# A.8 ADDITIONAL ABLATIONS
+
+It is not strictly necessary that ChIRo learn the weight coefficients $c_{ij}^{(xy)}$ in order to distinguish enantiomers. ChIRo can still learn chiral representations and preserve invariance to internal bond rotations if each $c_{ij}^{(xy)}$ is generated by a network with random, untrained parameters. However, this is not the case for the phase shifts $\varphi_{ixyj}$ , which must be learned for good performance. To demonstrate this, we perform additional ablations where the feed-forward network $f_c$ is not trained, but rather keep its initial random parameters. We perform the same analysis for $f_\varphi$ to also evaluate whether ChIRo needs to learn the phase shifts $\varphi_{ixyj}$ , or if these can also be generated by a random network. Table 16 reports the results of not training these MLPs on the otherwise unchanged ChIRo on the $l / d$ classification task and ranking enantiomers by docking scores task. Overall, learning the parameters in $f_c$ leads to only small (if any) performance gains versus keeping the randomly initialized parameters. On the other hand, learning the parameters in $f_\varphi$ leads to considerable performance gains versus not learning $f_\varphi$ . This emphasizes that in our case, relying on random noise to break symmetry between embeddings of enantiomers is insufficient to learn expressive chiral representations. Rather, ChIRo best models the effects of chirality by learning to break the symmetry through learned phase shifts in a task-specific manner.
+
+Table 16: Effects of not learning the parameters in $f_{c}$ and $f_{\varphi}$ on ChIRo's performance on the $l / d$ classification and the ranking enantiomers by docking score tasks. For the original, unablated ChIRo (first row), mean accuracy and standard deviations on the test sets are reported across 5 folds $(l / d)$ or three repeated trials (enantiomer ranking). To better account for the impact of random network initializations, for the ablated models we report the mean accuracy and standard deviations on the test sets across 3 repeated trials (enantiomer ranking) or the mean, fold-averaged accuracy (e.g., mean of means) and standard error of this mean across three repeated 5-fold CV trials $(l / d$ classification).
+
+| Model Components | Accuracy (%) ↑ |
| Learned fc | Learned φ | l / d | Enantiomer Ranking |
| ✓ | ✓ | 79.3 ± 0.4 | 72.0 ± 0.5 |
| X | ✓ | 79.4 ± 0.3 | 71.7 ± 0.2 |
| ✓ | X | 53.7 ± 1.2 | 68.4 ± 0.7 |
| X | X | 50.8 ± 0.8 | 66.8 ± 0.3 |
+
+# A.9 ADDITIONAL EVALUATION OF RANKING ENANTIOMERS BY DOCKING SCORES
+
+Because some enantiomers have larger differences in their ground truth docking scores than other enantiomers, a single ranking accuracy metric may not fully describe the ability of the models to learn the enantioselectivity of the protein pocket. To evaluate model performance more thoroughly, we compute ranking accuracies on various subsets of the test set. Figure 12 plots the ranking accuracies of ChIRo, SphereNet, Tetra-DMPNN (concatenate) with chiral tags, and DMPNN with chiral tags when evaluated on subsets of the test data where the difference in ground truth docking scores are (upper left) greater or equal to a margin, (upper right) less than or equal to a margin, or (bottom) exactly equal to a margin. The plots suggest that while ChIRo is superior in correctly ranking enantiomers which have relatively small differences in their true docking scores, the differences between each model become less distinct when ranking enantiomers with larger differences in their ground-truth docking scores. This may be due to the fact that the docking dataset is imbalanced, skewed heavily toward enantiomers that have smaller differences in their true docking scores (Figure 11).
+
+
+
+
+
+
+Figure 12: Ranking accuracy of the predicted conformer-averaged docking scores when evaluated on subsections of the test set in which the ground truth difference in best docking scores between enantiomers is (upper left) greater than or equal to the specified margin, (upper right) less than or equal to the specified margin, or (bottom) equal to the specified margin. Error bars for the models represent standard deviations in ranking accuracy across three random training/inference trials. Error bars for the random baseline correspond to the standard deviation of a binomial distribution $B(p = 0.5, N)$ , where $N$ is the number of enantiomer pairs in the subset.
+
+# A.10 ANALYZING SE(3)-INVARIANT 3D GNNS WITHOUT INTERROTO-INVARIANCE
+
+The qualitative results shown in Figure 3 suggest that an SE(3)-invariant 3D GNN without InterRoto-invariance, such as SphereNet, will get confused between differences in molecular chirality (e.g., inverted chiral centers) with differences in conformational structure (e.g., bond rotations) when learning chiral-dependent functions. To support this hypothesis with quantitative evidence, Figure 13 shows the distribution of the fraction of conformers per enantiomer in the test sets of the $l / d$ classification task which were predicted to have the same sign of optical rotation by SphereNet and ChIRo, irrespective of the actual accuracy of the predicted class labels. SphereNet predicts the same label for each of the 5 RDKit-generated conformers per enantiomer for only $\sim 32\%$ of the enantiomers in the test sets, compared to $\sim 93\%$ for ChIRo. When only trained on 1 conformer per enantiomer, SphereNet's labeling consistency drops to $14\%$ , whereas ChIRo's labeling consistency remains roughly the same at $\sim 92\%$ . ChIRo's dramatically increased consistency in labeling conformers sharing the same chiral molecular identity compared to SphereNet is a direct result of ChIRo's InterRoto-invariance. Note that ChIRo's consistency is not perfectly $100\%$ because the RDKit-generated conformers have conformational differences not associated with simple bond rotations. For instance, two conformers can slightly differ in their bond distances and bond angles, perturbations to which ChIRo is not invariant.
+
+Moreover, manually rotating bonds near the chiral center (similar to the bottom row in Figure 3) causes SphereNet to get confused when predicting signs of optical rotation for these rotated conformers, even for enantiomers (in the test-set) whose conformers were all originally classified correctly by SphereNet (Figure 14). Since ChIRo is invariant to such bond rotations (Figure 3), it is not susceptible to this particular type of confusion, and therefore has increased ability to generalize to unseen chiral conformers.
+
+
+
+
+
+
+Figure 13: Distribution of the fraction of conformers per enantiomer predicted to have the same class label for the $l / d$ classification task across the test sets in each of the five folds, for both SphereNet and ChIRo when trained on all conformers in the training set (top row) or on a single conformer per enantiomer (bottom row). Note that for the $l / d$ classification task, there are exactly five conformers per enantiomer in the test splits of each fold.
+
+
+
+
+
+
+
+
+
+
+Figure 14: Confusion matrices indicating SphereNet's (mis)classification of conformers of three pairs of enantiomers in the $l / d$ classification task's test set (of the first fold) whose highlighted bonds are each rotated in increments of $12^{\circ}$ (left and center) or $30^{\circ}$ (right). These three pairs of enantiomers were specifically chosen for this confusion analysis because SphereNet correctly classifies all of their original (non-rotated) conformers.
+
+
+
+
\ No newline at end of file
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/images.zip b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..3d72bce9f5b8c237f5c97ae34abf7fee45a6e01f
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed9f1dd4aa41000a7a556a4489fd7b3445a74c61b60276ff4481cdcb6129acf7
+size 1518300
diff --git a/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/layout.json b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7f28fce42c0893724ca7a7ea897af86d0855b6bf
--- /dev/null
+++ b/learning3drepresentationsofmolecularchiralitywithinvariancetobondrotations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7456670a283a3254048d14a837437ca3aca1f79711478c35da3c643d8ed448d5
+size 952846
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_content_list.json b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..563989624accf018d98eabd295dec548b369fc11
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7df1d8e7551bcce1f4f4bce9bd6c5e2dd9fd4155378644fedcb6695dccc5b190
+size 124300
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_model.json b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4902b418004f2a9fe7af3e231d4967e704eb01e5
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c041f4eaadd201c01ec46b30b44e04540e565eeb74b5e8ca6daa0fd14fb2359b
+size 145810
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_origin.pdf b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5a8998210c55bce57e4cb870cf7ca48db5a1db80
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/13fc2e17-fd05-445a-8538-bb2f012044cb_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5237f075b20d99e66f5e87b8046daf6144110ae38022121d6c1a9bc788261705
+size 16603177
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/full.md b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..9d9ec859eef3822866ecaf891b5617d1704a0ac4
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/full.md
@@ -0,0 +1,389 @@
+# LEARNING AUDIO- VISUAL SPEECH REPRESENTATION BY MASKED MULTIMODAL CLUSTER PREDICTION
+
+Bowen Shi $^{1*}$ Wei-Ning Hsu $^{2}$ Kushal Lakhotia $^{2}$ Abdelrahman Mohamed $^{2}$
+
+$^{1}$ Toyota Technological Institute at Chicago $^{2}$ Meta AI
+
+bshi@ttic.edu {wnhsu,kushall,abdo}@fb.com
+
+# ABSTRACT
+
+Video recordings of speech contain correlated audio and visual information, providing a strong signal for speech representation learning from the speaker's lip movements and the produced sound. We introduce Audio-Visual Hidden Unit BERT (AV-HuBERT), a self-supervised representation learning framework for audio-visual speech, which masks multi-stream video input and predicts automatically discovered and iteratively refined multimodal hidden units. AV-HuBERT learns powerful audio-visual speech representation benefiting both lip-reading and automatic speech recognition. On the largest public lip-reading benchmark LRS3 (433 hours), AV-HuBERT achieves $32.5\%$ WER with only 30 hours of labeled data, outperforming the former state-of-the-art approach $(33.6\%)$ trained with a thousand times more transcribed video data (31K hours) (Makino et al., 2019). The lip-reading WER is further reduced to $26.9\%$ when using all 433 hours of labeled data from LRS3 and combined with self-training. Using our audio-visual representation on the same benchmark for audio-only speech recognition leads to a $40\%$ relative WER reduction over the state-of-the-art performance $(1.3\%$ vs $2.3\%)$ . Our code and models are available at https://github.com/facebookresearch/av_hubert
+
+# 1 INTRODUCTION
+
+Human perception of speech is intrinsically multimodal, involving audition and vision. The speech production is accompanied by the movement of lips and teeth, which can be visually interpreted to understand speech. Visual cues of speech not only play an essential role in language learning for pre-lingual children (Meltzoff & Moore, 1977; Davies et al., 2008), but also improve speech understanding in noisy environment (Sumby & Pollack, 1954) and provide patients of speech impairment with means of communication. Furthermore, perceptual studies (McGurk & MacDonald, 1976) have shown that such visual cues can alter the perceived sound.
+
+For machine learning models, the tight coupling between audio and visual lip movement information emerges as a natural source for supervision to learn speech representations, which has not been extensively utilized yet in the self-supervised speech representation learning literature. Recent successful representation learning frameworks for speech (e.g., APC (Chung et al., 2019), CPC (Oord et al., 2018; Kharitonov et al., 2021), wav2vec 2.0 (Baevski et al., 2020; Hsu et al., 2021b), DeCoAR2.0 (Ling & Liu, 2020), HuBERT (Hsu et al., 2021c;a)) are mostly built entirely on audio. The fundamental research question addressed in this paper is whether a self-supervised audio-visual speech representation learned from the lip movement information, alongside the audio signal in video recordings, captures cross-modal correlations and improves downstream performance for visual speech recognition (i.e., lip reading) and automatic speech recognition (ASR) tasks. Existing ML models for lip-reading rely heavily on text transcriptions to achieve an acceptable level of accuracy. The state-of-the-art lip-reading model (Makino et al., 2019) requires 31K hours of transcribed video data for training. Such large amounts of labeled data are expensive and hard to obtain for most of the world's 7,000 languages. The benefit from a robust visual speech representation learning framework goes beyond lip-reading. Additionally, it can benefit a vast range of applications,
+
+including but not limited to keyword spotting in sign language (Albanie et al., 2020), speech enhancement (Xu et al., 2020) and talking face generation (Chen et al., 2018).
+
+In this paper, we present Audio-Visual Hidden Unit BERT (AV-HuBERT), a multimodal self-supervised speech representation learning framework. It encodes masked audio and image sequences into audio-visual features via a hybrid ResNet-transformer architecture to predict the predetermined sequence of discrete cluster assignments. The target cluster assignments are initially generated from signal processing-based acoustic features (e.g., MFCC) and iteratively refined using the features learned by the audio-visual encoder via k-means clustering. AV-HuBERT simultaneously captures linguistic and phonetic information for unmasked regions from both the lip movement and audio streams into its latent representations, then encodes their long-range temporal relationships to solve the masked-prediction task.
+
+The contextualized representations learned by AV-HuBERT show excellent transferability to the lip-reading task, where only the visual modality is available. Pre-training on audio and visual input streams led to substantially better results than only visual input. In the low-resource setup using only 30 hours of labeled data from LRS3 (Afouras et al., 2018b), our model achieves a lip-reading WER of $32.5\%$ , outperforming the previous state-of-the-art model $(33.6\%)$ trained on 31,000 hours of transcribed videos (Makino et al., 2019). Using the complete 433 hours from LRS3 further reduces WER to $28.6\%$ . We further show AV-HuBERT and self-training are complementary to each other: combining both sets a new lip-reading WER record of $26.9\%$ . In addition, we show that the multimodal clusters derived from AV-HuBERT can be used to pre-train a HuBERT model for audio-based speech recognition, outperforming the previous state-of-the-art model $(2.3\%)$ and the unimodal HuBERT pre-trained on audio clusters $(1.5\%)$ by a large margin $(1.3\%)$ .
+
+# 2 RELATED WORK
+
+The strong correlation between video modalities provides an effective means for self-supervised representation learning on videos, which has been explored in many prior works and is still an active research area. This work draws inspiration from two lines of previous research:
+
+Multimodal general video representation focuses on learning self-supervised audio-visual representations of general videos to solve high-level semantic tasks, e.g., action recognition and audio event detection (Arandjelović & Zisserman, 2017; Bruno et al., 2018; Morgado et al., 2021; Chen et al., 2020; Lee et al., 2021). Owens & Efros (2018) learns a multimodal network to predict whether the audio and visual streams of a video are temporally synchronized while Pham et al. (2019) applies a cyclic translation between different modalities. Piergiovanni et al. (2020) learns the visual representation through a multi-tasking framework that incorporates a series of pretext tasks such as reconstruction and temporal ordering prediction. Sharing our work's inspiration of DeepClustering (Caron et al., 2018), XDC (Alwassel et al., 2020) and AV-BERT (Chan et al., 2021) learn cross-modal representations through predicting cross-modal or cluster assignments. In contrast to XDC, AV-HuBERT is trained with a BERT-like masked prediction loss, which forces the model to learn the structure within the multimodal input and was shown in Hsu et al. (2021c) to be more resilient to bad cluster assignments compared to unmasked cluster prediction. On the other hand, AV-BERT focuses on learning utterance-level multimodal environment embeddings that serves as the global context for ASR, while our objective is to learn frame-level audio-visual speech representations and pre-train a model that can be fine-tuned for downstream tasks with either modality.
+
+Semi- and self-supervised audio-visual speech representation learning focuses on improving lip-reading with untranscribed audio-visual speech data. To solve isolated visual word recognition, Chung et al. (2020) learns visual embeddings using a contrastive loss based on audio-visual synchronization. Ma et al. (2021a) learns visual speech representations by minimizing the distance between its latent features and off-the-shelf audio embeddings. Using an external supervised ASR to transcribe unlabeled audio, Afouras et al. (2020) trains their lip-reading model on the augmented labeled and pseudo-labeled data. Unlike Ma et al. (2021a) and Afouras et al. (2020), our model is trained from scratch and encouraged to learn contextualized representations with a masked prediction task. Moreover, our method does not rely on any external pre-trained models.
+
+# 3 METHOD
+
+# 3.1 PRELIMINARY: AUDIO HUBERT
+
+Our research builds on Audio HuBERT (Hsu et al., 2021a) which is a self-supervised learning framework for speech and audio. It alternates between two steps: feature clustering and masked prediction. In the first step, a discrete latent variable model (e.g., k-means) is applied to a sequence of acoustic frames $\mathbf{A}_{1:T}$ producing a sequence of frame-level assignments $\mathbf{z}_{1:T}^{a}$ . Clusters of signal-processing-based acoustic features, e.g., Mel-frequency cepstral coefficients (MFCC), exhibit nontrivial correlations with the inherent acoustic units of speech inputs. Using $(\mathbf{A}_{1:T}, \mathbf{z}_{1:T}^{a})$ pairs, the second step learns new feature representations by minimizing a masked prediction loss, similar to masked language modeling in BERT (Devlin et al., 2019). The pressure to predict cluster assignments of masked audio regions forces the model to learn good local acoustic representations for unmasked regions and long-range temporal dependencies between latent features. Repeating these two steps improves the cluster quality and consequently the quality of the learned representations.
+
+# 3.2 SINGLE-MODAL & CROSS-MODAL VISUAL HUBERT
+
+Single-modal Visual HuBERT: The most naive way to extend HuBERT to the visual domain is by generating targets using visual features. Formally, given an image sequence $\mathbf{I}_{1:T}$ , we first cluster the image features into a sequence of discrete units $\mathbf{z}_{1:T}^i$ via k-means: $z_{t}^{i} = \mathrm{k - means}(G(\mathbf{I}_{t}))\in$ $\{1,2,\dots,V\}$ , where $G$ is an visual feature extractor and $V$ is the codebook size. The cluster assignments $\mathbf{z}_{1:T}^i$ serve as the prediction targets of the model. Initially, $G$ can be an engineered image feature extractor such as Histogram of Oriented Gradients (HoG), analogous to MFCC in audio HuBERT. The intermediate layers of the HuBERT model are used as $G$ in later iterations.
+
+To perform the masked prediction task, the model first encodes $\mathbf{I}_{1:T}$ using a ResNet into an intermediate visual feature sequence $\mathbf{f}_{1:T}^{v}$ , which is then corrupted into $\tilde{\mathbf{f}}_{1:T}^{v}$ via a binary mask $M$ . Specifically, $\forall t \in M$ , $\tilde{\mathbf{f}}_t^v$ is replaced with a learned masked embedding. We adopt the same strategy in HuBERT to generate span masks. The masked visual features $\tilde{\mathbf{f}}_{1:T}^{v}$ are encoded into a sequence of contextualized features $\mathbf{e}_{1:T}$ via a transformer encoder followed by a linear projection layer. The loss is computed over the masked regions and optionally over unmasked ones (when $\alpha \geq 0$ ):
+
+$$
+\mathbf {p} _ {t} = \operatorname {S o f t m a x} (\mathbf {W e} _ {t} + \mathbf {b}), 1 \leq t \leq T
+$$
+
+$$
+L = - \sum_ {t \in M} \log p _ {t} \left(z _ {t} ^ {i}\right) - \alpha \sum_ {t \notin M} \log p _ {t} \left(z _ {t} ^ {i}\right) \tag {1}
+$$
+
+Where $(\mathbf{W} \in \mathbb{R}^{d \times V}, \mathbf{b} \in \mathbb{R}^V)$ are parameters of the projection layer which maps features into logits predicting the cluster assignments.
+
+Cross-modal Visual HuBERT: The single-modal visual HuBERT aims to learn visual speech representation through gradually refined image features. However, it does not employ the audio stream of the video. Presumably, audio features, e.g., MFCC or a pre-trained audio HuBERT model, correlate with phones better than vanilla image features (e.g., HoG) do. To this end, we train an audio encoder based on the aligned audio frame sequence $\mathbf{A}_{1:T}$ in parallel to the visual encoder. The iterative training alternates between the two encoders. In each iteration, an audio encoder $E^a$ is utilized to generate target cluster assignments $\mathbf{z}_{1:T}^a$ . The visual encoder $E^v$ is trained subsequently with $(\mathbf{I}_{1:T}, \mathbf{z}_{1:T}^a)$ . The $\mathbf{z}_{1:T}^a$ is also used to train the next iteration of the audio encoder $E^a$ for refinement.
+
+The cross-modality visual HuBERT can be seen as modeling visual inputs by distilling knowledge from the audio stream, where $\mathbf{z}_{1:T}^{a}$ represents the audio-side knowledge. We hypothesize that the audio feature is more favorable to speech representation learning than the visual feature, which is validated in the Section E.1. Critical for the lip-reading downstream task, the masked prediction objective used by HuBERT forces the model to capture temporal relationships, which facilitates prediction of homophemes, which are groups of sounds with identical visual shapes (e.g., 'p'-'b', 'f'-'v', 'sh'-'ch') that are impossible to distinguish using a single image frame.
+
+
+Figure 1: Illustration of AV-HuBERT. Masked prediction losses are only computed for the three middle frames, because at least one modality is masked for those frames. See section A for its comparison between single-modal and cross-modal visual HuBERT.
+
+# 3.3 AUDIO- VISUAL HUBERT
+
+Our primary model in this work is Audio-Visual HuBERT (AV-HuBERT), shown in figure 1, which is trained iteratively by alternating between feature clustering and masked prediction in a similar way to the Visual HuBERT but with four main improvements:
+
+Audio-visual input: The AV-HuBERT model consumes both acoustic and image frames for the masked prediction training, which enables better modeling and distillation of the correlations between the two modalities. Specifically, image sequences and acoustic features pass through their light-weight modality-specific encoders to produce intermediate features, which are then fused and fed into a shared backbone transformer encoder to predict masked cluster assignments. The targets are generated from clustering audio features or features extracted from the previous iteration of the AV-HuBERT model. When fine-tuned for lip-reading, we drop the audio input to work solely with the visual input. The input discrepancy is addressed by modality dropout described next.
+
+Modality dropout: Audio-visual speech recognition models can relate audio input to lexical output more effortlessly than the visual input stream, as observed in the literature (Afouras et al., 2018a; Ma et al., 2021b). This causes the audio modality to dominate model decisions. The problem is aggravated in our setting because the target cluster assignments are initially generated from acoustic features. To prevent the model's over-reliance on the audio stream in our joint model, we only use a linear layer to encode acoustic input to force the audio encoder to learn simple features.
+
+Additionally, before fusing audio and visual inputs into the backbone transformer encoder, dropout is applied to mask the full features of one modality; we refer to it as modality dropout. With a probability $p_m$ , both modalities are used as input. When only one modality is used, the audio stream is selected with a probability of $p_a$ . Formally, given the encoded audio and visual feature sequence $\mathbf{f}_{1:T}^a$ and $\mathbf{f}_{1:T}^v$ , equation 2 shows feature fusion equipped with modality dropout:
+
+$$
+\mathbf {f} _ {t} ^ {a v} = \left\{ \begin{array}{l l} \operatorname {c o n c a t} \left(\mathbf {f} _ {t} ^ {a}, \mathbf {f} _ {t} ^ {v}\right) & \text {w i t h} p _ {m} \\ \operatorname {c o n c a t} \left(\mathbf {f} _ {t} ^ {a}, \mathbf {0}\right) & \text {w i t h} (1 - p _ {m}) p _ {a} \\ \operatorname {c o n c a t} \left(\mathbf {0}, \mathbf {f} _ {t} ^ {v}\right) & \text {w i t h} (1 - p _ {m}) (1 - p _ {a}) \end{array} \right. \tag {2}
+$$
+
+where concat denotes channel-wise concatenation. Note that modality drop out is applied at the sequence level instead of at the frame-level, which effectively tasks AV-HuBERT to perform masked prediction with visual-only, audio-only, or audio-visual input. Modality dropout prevents the model from ignoring video input and encourages the model to produce the prediction regardless of what modalities are used as input. Furthermore, since the fine-tuning and inference phases use the visual stream alone (no audio input), this modality dropout mechanism bridges the gap between pretraining (multimodal) and fine-tuning/inference (single-modality). A similar dropout mechanism is used in prior work (Zhang et al., 2019a; Makino et al., 2019; Neverova et al., 2014; Abdelaziz et al., 2020) to increase the robustness in multi-modal settings. We verify the modality dropout effectiveness in Section D.
+
+Audio-visual clustering: One benefit of pre-training on both modalities is the ability to generate multimodal cluster assignments that serve as target labels for the masked prediction task of the next iteration. In contrast to the Cross-modal Visual HuBERT where targets are generated from audio-based features or a prior Audio HuBERT model, the targets for AV-HuBERT are naturally multimodal after the first iteration. Lip movement sequences provide complementary information to the audio stream. Combining both modalities produces cluster assignments of higher quality for AV-HuBERT, as shown in Section E.1.
+
+Masking by substitution: We propose a novel masking strategy for AV-HuBERT that masks segments in the visual stream by substituting them with random segments from the same video. More formally, given an input video $\mathbf{I}_{1:T}^v$ , an imposter video $\mathbf{I}_{1:T_f}^{v,f}$ and a mask consisting of $n$ intervals $M = \{(s_i,t_i)\}_{1\leq i\leq n}$ , we corrupted $\mathbf{I}_{1:T}^v$ into $\tilde{\mathbf{I}}_{1:T}^v$ by setting:
+
+$$
+\tilde {\mathbf {I}} _ {s _ {i}: t _ {i}} ^ {v} = \mathbf {I} _ {p _ {i}: p _ {i} + t _ {i} - s _ {i}} ^ {v, f}, \forall 1 \leq i \leq n \tag {3}
+$$
+
+where $p_i$ is a sampled integer offset from the interval $[0, T_f - t_i + s_i]$ . Now, to solve the task, the model needs to first identify the fake frames and then infer the labels belonging to the original frames. Since the "filled-in" segments are from real video segments and temporally smooth, the fake segment detection sub-task becomes less trivial compared to when using vanilla masking or substitution with non-consecutive frames. We show an ablation confirming the advantage of the proposed masking strategy in Section D.
+
+The audio and visual segments are masked independently using two different masking probabilities $m_{a}$ and $m_{v}$ . We hypothesize that the difficulty of the masked prediction task differs for each modality: inferring the masked targets given the audio stream is more straightforward than using the lip movement stream. Setting a high masking probability for acoustic frames is essential to help the whole model capture the language characteristics. On the contrary, setting a high masking probability for the visual input provides the model with more imposter segments than the original ones, hurting its ability to learn meaningful features (studied in Section D of the appendix). Given the output probability $\mathbf{p}_{1:T}$ and target cluster assignments $\mathbf{z}_{1:T}$ , the AV-HuBERT pre-training loss is:
+
+$$
+L = - \sum_ {t \in M ^ {a} \cup M ^ {v}} \log p _ {t} \left(z _ {t}\right) - \alpha \sum_ {t \notin M ^ {a} \cup M ^ {v}} \log p _ {t} \left(z _ {t}\right) \tag {4}
+$$
+
+where $M^a$ and $M^v$ denotes the frames that are masked for the audio and the visual stream. $\alpha$ is a hyperparameter weighting the contribution of the unmasked regions in the overall objective.
+
+# 3.4 FINE-TUNING
+
+The proposed pre-training approaches can be fine-tuned for visual speech recognition using any sequence classification loss. In this paper, we focus on fine-tuning with the connectionist temporal classification (CTC) (Graves et al., 2006) and attention-based sequence-to-sequence cross-entropy loss (Bahdanau et al., 2016) (S2S for brevity), which are the most popular choices. Assume that the feature sequence output of our pre-trained model is $\mathbf{e}_{1:T}$ and the ground-truth transcription is $w = w_{1}, w_{2}, \ldots, w_{s}$ . For CTC, a projection layer is used to map the visual feature sequence into the output probabilities: $\mathbf{p}_t = \mathrm{Softmax}(\mathbf{W}^{ft}\mathbf{e}_t + \mathbf{b}^{ft})$ , where $\mathbf{W}^{ft} \in \mathbb{R}^{d \times (U+1)}$ , $\mathbf{b}^{ft} \in \mathbb{R}^{U+1}$ and $U$ is the output vocabulary size (+1: plus blank symbol). The model is trained with CTC loss: $L_{ctc} = -\log \sum_{\pi \in \mathcal{B}^{-1}(w)} p(\pi | \mathbf{e}_{1:T})$ , where $\mathcal{B}$ maps an alignment sequence $\pi$ to $w$ . For S2S, a transformer decoder is appended to the pre-trained encoder to autoregressively decode the feature sequence $\mathbf{e}_{1:T}$ into target probabilities $p(w_t | w_{1:t-1}, \mathbf{e}_{1:T})$ . The whole model is trained with cross entropy loss: $L_{s2s} = -\sum_{t=1}^{s} \log p(w_t | w_{1:t-1}, \mathbf{e}_{1:T})$ .
+
+# 4 EXPERIMENT
+
+# 4.1 SETUP
+
+We conduct experiments on two datasets: LRS3 (Afouras et al., 2018b) with 433 hours of transcribed English videos and VoxCeleb2 (Chung et al., 2018) with 2442 hours of unlabeled multilingual videos. We only use the English portion of VoxCeleb2, which amounts to 1,326 hours
+
+of content. The inputs to our backbone model are lip Regions-Of-Interest (ROIs) for the visual stream and log filterbank energy feature for the audio stream. The image encoder is a modified ResNet-18, which has been used in prior work (Ma et al., 2021b; Martinez et al., 2020; Stafylakis & Tzimiropoulos, 2017). The audio encoder is simply a linear projection layer. We consider two model configurations: BASE with 12 transformer blocks and LARGE with 24 transformer blocks. For BASE and LARGE, the embedding dimension/feed-forward dimension/attention heads in each transformer block are 768/3072/12 and 1024/4096/16 respectively. The number of parameters in BASE and LARGE are 103M and 325M respectively. $\alpha$ in equation 4 is set to 0.
+
+The model uses five iterations of feature clustering and masked prediction during pre-training. See Section B.4, E for details on clustering. For fine-tuning, we use phone targets for the CTC loss and unigram-based subword units (Kudo, 2018) for the S2S loss. For decoding the CTC-trained model, we use a 4-gram language model trained on LRS3 training text. For the S2S fine-tuned model, we rely only on its own decoder module to incorporate language information, with no external language model employed during inference. To further show the complementary relationship between AV-HuBERT and existing approaches of using unlabeled data, we also experiment on combining AV-HuBERT with self-training. Specifically, we generate pseudo labels for unlabeled data using a fine-tuned HuBERT, and fine-tune the pre-trained AV-HuBERT model with the combination of pseudolabeled videos and original labeled videos. Note that no additional data is used when combined with self-training. More details about the used datasets, data pre-processing, and model training are in Section B.
+
+# 4.2 MAIN RESULT
+
+Table 1 compares the performance of our AV-HuBERT pre-training approach to previously published supervised, semi-supervised, and self-supervised lip-reading systems using different amounts of labeled and unlabeled data. Since the CTC and S2S fine-tuning approaches have similar trends, only S2S results are shown in table 1. Complete results of CTC fine-tuning are in Table C.4.
+
+Using 1,759 hours unlabeled data for pre-training and only 30 hours of labeled data for fine-tuning, AV-HuBERT-LARGE outperforms all the prior lip-reading models, including the model in (Makino et al., 2019) which is trained with 1000 times more labeled data. Fine-tuning with the whole training set of LRS3 further reduces WER. Combining our method and self-training achieves a new SOTA result with only $7\%$ of the data used for training the model in Makino et al. (2019). Furthermore, it shows that AV-HuBERT and self-training are complementary to each other. Note the overall gain is attributed mainly to AV-HuBERT as self-training alone leads to much worse performance ( $>50\%$ WER). More details can be found in section C.3. Many prior models pre-train their visual front-end, e.g., ResNet-18, using word-level annotated lip-reading videos, which is costly to collect since they require word boundary information. In contrast to these models, our models are fully pre-trained from scratch using the proposed approach.
+
+Compared to the semi-supervised approach Jasper-KD (Afouras et al., 2020), which transcribed 334 hours of the English data in VoxCeleb2 using a pre-trained ASR system, our best model achieves $29\%$ lower absolute WER benefiting from VoxCeleb2 for pre-training. Even when limiting our model to the LRS3 data for pre-training and fine-tuning, our model surpasses their semi-supervised system by $18\%$ . Compared to LiRA (Ma et al., 2021a), a recently proposed self-supervised model for lip-reading, AV-HuBERT-BASE provides $17.5\%$ lower absolute WER on average for low-resource and high-resource settings. The implementation details of LiRA are provided in Section B.5.
+
+With the same network architecture, our pre-training approach significantly reduces WER compared to training from scratch, in both low-resource $(92.3\% \to 32.5\%, \text{LARGE})$ and high-resource $(62.3\% \to 28.6\%, \text{LARGE})$ settings. A qualitative view of the improvement can be found in Section F. Additionally, we notice that our AV-HuBERT pre-training helps under a fully supervised setting. Using the LRS3 data only (433 hours), pre-training followed by fine-tuning $(41.6\%, \text{LARGE})$ outperforms training a lip-reading model from scratch $(62.3\%, \text{LARGE})$ to predict the output text.
+
+Table 1: WER (%) of our models and prior work on the LRS3 dataset. †We re-implemented Ma et al. (2021a) with the same architecture since the author source code was not provided.
+
+| Method | Backbone | Criterion | Labeled iso (hrs) | Labeledutt (hrs) | Unlabeled data (hrs) | WER (%) |
| Supervised |
| Afouras et al. (2020) | CNN | CTC | 157 | 433 | - | 68.8 |
| Zhang et al. (2019b) | CNN | S2S | 157 | 698 | - | 60.1 |
| Afouras et al. (2018a) | Transformer | S2S | 157 | 1,362 | - | 58.9 |
| Xu et al. (2020) | RNN | S2S | 157 | 433 | - | 57.8 |
| Shillingford et al. (2019) | RNN | CTC | - | 3,886 | - | 55.1 |
| Ma et al. (2021b) | Conformer | CTC+S2S | - | 433 | - | 46.9 |
| Ma et al. (2021b) | Conformer | CTC+S2S | 157 | 433 | - | 43.3 |
| Makino et al. (2019) | RNN | Transducer | - | 31,000 | - | 33.6 |
| Semi-Supervised & Self-Supervised |
| Afouras et al. (2020) | CNN | CTC | 157 | 433 | 334 | 59.8 |
| Ma et al. (2021a)† | Transformer-BASE | S2S | - | 30 | 433 | 71.9 |
| - | 433 | 1,759 | 49.6 |
| Proposed (Self-Supervised & Self-Supervised + Semi-Supervised) |
| AV-HuBERT | Transformer-BASE | S2S | - | 30 | - | 94.3 |
| - | 30 | 433 | 51.8 |
| - | 30 | 1,759 | 46.1 |
| - | 433 | - | 60.3 |
| - | 433 | 433 | 44.0 |
| - | 433 | 1,759 | 34.8 |
| Transformer-LARGE | S2S | - | 30 | - | 92.3 |
| - | 30 | 433 | 44.8 |
| - | 30 | 1,759 | 32.5 |
| - | 433 | - | 62.3 |
| - | 433 | 433 | 41.6 |
| - | 433 | 1,759 | 28.6 |
| AV-HuBERT + Self-Training | Transformer-LARGE | S2S | - | 30 | 1,759 | 28.6 |
| - | 433 | 1,759 | 26.9 |
+
+AV-HuBERT, pre-trained on video-audio pairs, learns better fine-grained visual representation than the scratch model trained on video-text pairs. The benefits of AV-HuBERT pre-training in various labeled data setups can be found in Section C.1.
+
+# 4.3 AV-HUBERT VS. VISUAL HUBERT
+
+We compare AV-HuBERT against a suite of alternatives, including the Single-modal and Cross-modal Visual HuBERT in Table 2. All the models are BASE pretrained on 433 hours of unlabeled data and fine-tuned on 30 hours of labeled data. For this comparison, we use CTC fine-tuning due to its computational efficiency and given their similarity in results trends to S2S.
+
+Table 2: Fine-tuning performance (in WER, %) of AV-HuBERT and visual HuBERT on different target labels. Init: feature in the initial iteration, sub: feature in subsequent iterations. AV: AV-HuBERT, V: Visual-HuBERT, A: Audio-HuBERT.
+
+| Model/init→sub | Iteration |
| 1 | 2 | 3 | 4 | 5 |
| AV/MFCC→AV | 71.5 | 63.6 | 60.9 | 58.8 | 58.2 |
| AV/MFCC→A | 71.5 | 64.3 | 63.5 | - | - |
| V/MFCC→A | 75.4 | 69.4 | 69.1 | - | - |
| V/MFCC→V | 75.4 | 72.6 | 72.3 | - | - |
| V/HoG→V | 80.3 | 80.1 | - | - | - |
+
+
+
+As shown in table 2, target cluster assignments driven from a single modality, either audio or visual, do not provide much WER reduction beyond the second iteration. Training the AV-HuBERT model
+
+using targets driven from audio-visual features keeps improving for more iterations and achieves better final performance. As mentioned in Section 3, visual information is complementary to audio input; hence, using both produces higher quality target clusters. Measuring the quality of different target labels using cluster quality metrics such as purity and NMI shows the same trend observed from lip-reading WER (See appendix E.1).
+
+Fixing target labels used for the masked-prediction pre-training, AV-HuBERT (AV/MFCC $\rightarrow$ A) outperforms the Cross-modal Visual HuBERT (V/MFCC $\rightarrow$ A) by a large margin. AV-HuBERT effectively transfers knowledge from audio into the visual encoder and the backbone transformer model to benefit visual-only fine-tuning and inference. In contrast to AV-HuBERT, iterative pre-training brings much smaller gains to single-modality visual HuBERT ("V/MFCC $\rightarrow$ V", "V/HoG $\rightarrow$ V").
+
+Starting with audio features is critical for learning effective target labels for the masked-prediction task. Phonetic information, which is crucial for lip-reading, is primarily present in the audio stream. All the models considered so far are based on audio feature MFCC clustering in their initial iteration. As is shown in the "V/HoG $\rightarrow$ V" row, using hand-engineered visual features provides a lousy starting point for iterative learning. Visual features such as HoG mainly incorporate low-level visual cues such as edges and luminance, which is irrelevant to the downstream recognition task. Using features of a higher correlation with phonetic units are more likely to benefit the final lip-reading model. Indeed, clustering MFCC features show much higher purity (30.3%) than HoG clusters (16.4%) if one considers phone labels as the target units, as shown in Table E.1.
+
+# 4.4 MULTILINGUAL VS. MONOLINGUAL
+
+Since the correlation between lip movements and the produced sound is governed by the vocal apparatus that is language-agnostic, the proposed AV-HuBERT can utilize multi-lingual data for such learning. This would be particularly beneficial for low-resource languages. Nevertheless, the masked language modeling aspect in AV-HuBERT is still language-dependent, implying that mixing other languages would increase the language domain discrepancy. To study how these two factors affect AV-HuBERT, we compare using monolingual English data only versus multilingual videos in the pre-training phase. In particular, we vary the amount of English data we use in pre-training while the number of non-English utterances is fixed to 1,116 hours in all the settings. For simplicity, we train AV-HuBERT (BASE) for one iteration with MFCC clusters and fine-tune it with CTC using 30 hours of labeled data.
+
+Table 3: WER (%) with different amounts of unlabeled English utterances in pre-training. Non-En data: 1,116 hours. Labeled data for fine-tuning: 30 hours.
+
+| Hours of En data for Pre-Training | 0 | 100 | 400 | 800 | 1759 |
| Pre-train on En only, WER (%) | 84.1 | 77.8 | 68.9 | 67.9 | 59.9 |
| Pre-train on En + 1,116 hr of non-En, WER (%) | 70.6 | 68.4 | 67.4 | 66.6 | 64.3 |
+
+As is shown in table 3, using non-English data in pre-training significantly reduces WER when there are no or very little English data in pre-training ( $\leq 100$ hours). As we increase the amount of English data, the gain diminishes because the out-of-domain effect brought by non-English data outweighs the benefit of the overall increase in pre-training data. Using the whole English data only for pre-training is better than combining it with other languages (59.9% vs. 64.3%). Training with 5 iterations leads to similar results (47.3% vs. 48.9%). This experiment highlights the importance of the domain match between pre-training and fine-tuning data. For zero/low-resource settings, merging data from other languages in pre-training benefits the downstream task. When the unlabeled data from the target language is abundant, limiting the pre-training data to one language is beneficial.
+
+# 4.5 ASR PERFORMANCE
+
+The multimodal clusters produced by AV-HuBERT, which have higher quality than audio-HuBERT targets, can also benefit speech pre-training. To test our hypothesis, we trained an audio-HuBERT, with only audio input during the masked-prediction pre-training, for one iteration with cluster assignments driven from AV-HuBERT features. We also pre-trained an audio-HuBERT from scratch
+
+using clusters driven from the MFCC features for three iterations. The two pre-trained models are evaluated on a downstream ASR task.
+
+Table 4 shows the performance of different models fine-tuned on the ASR task. We only include the performance of S2S fine-tuning for our models as it consistently outperforms the CTC fine-tuning. An audio-HuBERT pre-trained using targets generated by AV-HuBERT features outperforms the vanilla audio-HuBERT in low-resource (30h) and high-resource settings (433h) fine-tuning settings across different model architectures. With the same amount of labeled data, our best model $(1.4\%)$ outperforms the prior SOTA $(2.3\%)$ even without an external language model during inference.
+
+Given that the AV-HuBERT model utilizes both modalities at its input, it can be fine-tuned, in principle, for the ASR downstream task. In practice, we notice pre-training an audio-HuBERT with audio-visual cluster leads to better ASR performance $(3.8\%)$ than a pre-trained AV-HuBERT $(4.6\%)$ , potentially due to its hyperparameters being selected based on lip reading rather than ASR. In fact, audio-HuBERT can be treated as a special case of AV-HuBERT with $p_m = 0$ , $p_a = 1$ .
+
+Table 4: ASR WER (%) of audio-HuBERT pre-trained with audio-only AUDIO-visual clusters and their comparison to prior work on the LRS3 dataset.
+
+| Method | Backbone | Criterion | LM | Labeled data (hrs) | Unlabeled data (hrs) | WER (%) |
| Supervised |
| Afouras et al. (2018a) | Transformer | S2S | ✓ | 1,362 | - | 8.3 |
| Afouras et al. (2018a) | Transformer | CTC | ✓ | 1,362 | - | 8.9 |
| Xu et al. (2020) | RNN | S2S | - | 433 | - | 7.2 |
| Ma et al. (2021b) | Conformer | CTC+S2S | ✓ | 433 | - | 2.3 |
| Self-Supervised |
| Hsu et al. (2021a) (A/MFCC→A) | Transformer-Base | S2S | - | 30 | 433 | 5.4 |
| - | 30 | 1,759 | 5.0 |
| - | 433 | 1,759 | 2.4 |
| Transformer-Large | S2S | - | 30 | 433 | 4.5 |
| - | 30 | 1,759 | 3.2 |
| - | 433 | 1,759 | 1.5 |
| Proposed (Self-Supervised) |
| A/MFCC→AV | Transformer-Base | S2S | - | 30 | 433 | 4.9 |
| - | 30 | 1,759 | 3.8 |
| - | 433 | 1,759 | 2.0 |
| Transformer-Large | S2S | - | 30 | 433 | 4.2 |
| - | 30 | 1,759 | 2.9 |
| - | 433 | 1,759 | 1.3 |
+
+# 5 CONCLUSION
+
+We presented multiple pre-training models for visual speech recognition. Our AV-HuBERT model leverages the strong correlation between the audio and lip movement streams for self-supervised audio-visual speech representation learning. Our pre-training approaches iteratively alternate between feature clustering and learning new features through a masked-prediction loss. The AV-HuBERT model consumes masked image and audio frames to predict target cluster assignments. The targets are initially generated from MFCC features and gradually refined through iterative training. Experiments on visual speech recognition show that AV-HuBERT achieves SOTA using 433 hours of text transcriptions, two orders of magnitude less than the 31,000 hours of labeled data used in the prior best approach. When using only one-thousandth of labeled data, the lip-reading performance outperforms the prior SOTA by more than $10\%$ (relative). AV-HuBERT also improves the representation for the ASR downstream task. An audio-HuBERT model trained with targets generated by an AV-HuBERT model shows superior performance, achieving the SOTA in the audio-based speech recognition in the LRS3 dataset. As future work, AV-HuBERT can be applied for multilingual lip-reading in low-resource languages. Additionally, our approach can be extended to other applications of visual speech representation, such as speech enhancement and generation.
+
+# ETHICAL STATEMENT
+
+All the data used in this paper are publicly available and are used under the following three licenses: the TED terms of use, the Creative Commons BY-NC-ND 4.0 license and Creative Commons Attribution 4.0 International License. Through spot-checking, we find the datasets are gender balanced and cover a wide range of races and ages. However, the distribution of speakers in the data may not be representative of the global human population. Please be cautious of unintended societal, gender, racial and other biases caused by the fact. To maintain anonymity, only the mouth area of a speaker is visualized wherever used in the paper. The proposed method can be applied in several areas including security and crime investigations. However it can also be used for malicious purposes such as surveillance and wiretapping. We are committed to distributing our code and model carefully, with special attention to any potential security and privacy concerns.
+
+# REPRODUCIBILITY STATEMENT
+
+Our code and models are publicly available. In the meantime, we include as many implementation details as we can in the paper.
+
+# REFERENCES
+
+The CMU pronouncing dictionary. http://wwwspeech.cs.cmu.edu/cgi-bin/cmudict.
+Ahmed Hussen Abdelaziz, Barry-John Theobald, Paul Dixon, Reinhard Knothe, Nicholas Apostoloff, and Sachin Kajareker. Modality dropout for improved performance-driven talking faces. In ICMI, 2020.
+Triantafyllos Afouras, Joon Son Chung, A. Senior, Oriol Vinyals, and Andrew Zisserman. Deep audio-visual speech recognition. IEEE transactions on pattern analysis and machine intelligence, 2018a.
+Triantafyllos Afouras, Joon Son Chung, and Andrew Zisserman. LRS3-TED: a large-scale dataset for visual speech recognition, 2018b. arXiv:1809.00496.
+Triantafyllos Afouras, Joon Son Chung, and Andrew Zisserman. ASR is all you need: Cross-modal distillation for lip reading. In ICASSP, 2020.
+Samuel Albanie, Gül Varol, Liliane Momeni, Triantafyllos Afouras, Joon Son Chung, Neil Fox, and Andrew Zisserman. BSL-1K: Scaling up co-articulated sign language recognition using mouthing cues. In ECCV, 2020.
+Humam Alwassel, Dhruv Mahajan, Bruno Korbar, Lorenzo Torresani, Bernard Ghanem, and Du Tran. Self-supervised learning by cross-modal audio-video clustering. In NeurIPS, 2020.
+Relja Arandjelović and Andrew Zisserman. Look, listen and learn. In ICCV, 2017.
+Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
+Alexei Baevski, Henry Zhou, Abdel rahman Mohamed, and Michael Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. In NeurIPS, 2020.
+Dzmitry Bahdanau, Jan Chorowski, Dmitriy Serdyuk, Philemon Brakel, and Yoshua Bengio. End-to-end attention-based large vocabulary speech recognition. In ICASSP, 2016.
+Korbar Bruno, Tran Du, and Torresani Lorenzo. Cooperative learning of audio and video models from self-supervised synchronization. In NeurIPS, 2018.
+Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 132-149, 2018.
+
+David M. Chan, Shalini Ghosh, Debmalya Chakrabarty, and Björn Hoffmeister. Multi-modal pretraining for automated speech recognition. arXiv preprint arXiv:2110.09890, 2021.
+Lele Chen, Zhiheng Li, Ross K. Maddox, Zhiyao Duan, and Chenliang Xu. Lip movements generation at a glance. In ECCV, 2018.
+Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In ECCV, 2020.
+Joon Son Chung, Arsha Nagrani, and Andrew Zisserman. Voxceleb2: Deep speaker recognition. In INTERSPEECH, 2018.
+Soo-Whan Chung, Hong Kang, and Joon Son Chung. Seeing voices and hearing voices: learning discriminative embeddings using cross-modal self-supervision. In Interspeech, 2020.
+Yu-An Chung, Wei-Ning Hsu, Hao Tang, and James Glass. An unsupervised autoregressive model for speech representation learning. arXiv preprint arXiv:1904.03240, 2019.
+Rebecca Davies, Evan Kidd, and Karen Lander. Investigating the psycholinguistic correlates of speechreading in preschool age children. International journal of language and communication disorders, 44:164-74, 06 2008.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In *NAACL*, 2019.
+Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. In ICLR, 2020.
+Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In ICML, 2006.
+Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. arXiv preprint arXiv:2106.07447, 2021a.
+Wei-Ning Hsu, Anuroop Sriram, Alexei Baevski, Tatiana Likhomanenko, Qiantong Xu, Vineel Pratap, Jacob Kahn, Ann Lee, Ronan Collobert, Gabriel Synnaeve, et al. Robust wav2vec 2.0: Analyzing domain shift in self-supervised pre-training. arXiv preprint arXiv:2104.01027, 2021b.
+Wei-Ning Hsu, Yao-Hung Hubert Tsai, Benjamin Bolte, Ruslan Salakhutdinov, and Abdelrahman Mohamed. Hubert: How much can a bad teacher benefit asr pre-training? In ICASSP, 2021c.
+Eugene Kharitonov, Morgane Rivière, Gabriel Synnaeve, Lior Wolf, Pierre-Emmanuel Mazare, Matthijs Douze, and Emmanuel Dupoux. Data augmenting contrastive learning of speech representations in the time domain. In 2021 IEEE Spoken Language Technology Workshop (SLT), pp. 215–222. IEEE, 2021.
+Davis E. King. Dlib-ml: A machine learning toolkit. Journal of Machine Learning Research, 10: 1755-1758, 2009.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015.
+Taku Kudo. Subword regularization: Improving neural network translation models with multiple subword candidates. In ACL, 2018.
+Sangho Lee, Youngjae Yu, Gunhee Kim, Thomas Breuel, Jan Kautz, and Yale Song. Parameter Efficient Multimodal Transformers for Video Representation Learning. In ICLR, 2021.
+Shaoshi Ling and Yuzong Liu. Decoar 2.0: Deep contextualized acoustic representations with vector quantization. arXiv preprint arXiv:2012.06659, 2020.
+Pingchuan Ma, Rodrigo Mira, Stavros Petridis, Bjorn Schuller, and Maja Pantic. LiRA: Learning visual speech representations from audio through self-supervision. In Interspeech, 2021a.
+
+Pingchuan Ma, Stavros Petridis, and Maja Pantic. End-to-end audio-visual speech recognition with conformers. In ICASSP, 2021b.
+Takaki Makino, Hank Liao, Yannis Assael, Brendan Shillingford, Basilio Garcia, Otavio Braga, and Olivier Siohan. Recurrent neural network transducer for audio-visual speech recognition. In Interspeech, 2019.
+Brais Martinez, Pingchuan Ma, Stavros Petridis, and Maja Pantic. Lipreading using temporal convolutional networks. In ICASSP, 2020.
+Harry McGurk and John MacDonald. Hearing lips and seeing voices. Nature, 264:746-748, 1976.
+Andrew N. Meltzoff and M. Keith Moore. Imitation of facial and manual gestures by human neonates. Science, 198:75-78, 1977.
+Pedro Morgado, Nuno Vasconcelos, and Ishan Misra. Audio-visual instance discrimination with cross-modal agreement. In CVPR, 2021.
+Natalia Neverova, Christian Wolf, Graham Taylor, and Florian Nebout. ModDrop: adaptive multimodal gesture recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014.
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
+Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
+Andrew Owens and Alexei A Efros. Audio-visual scene analysis with self-supervised multisensory features. In ECCV, 2018.
+Hai Pham, Paul Liang, Thomas Manzini, Louis-Philippe Morency, and Barnabas Poczos. Found in translation: Learning robust joint representations by cyclic translations between modalities. In AAAI, 2019.
+AJ Piergiovanni, Anelia Angelova, and Michael Ryoo. Evolving losses for unlabeled video representation learning. In CVPR, 2020.
+Mirco Ravanelli, Jianyuan Zhong, Santiago Pascual, Pawel Swietojanski, João L. Monteiro, Jan Trmal, and Yoshua Bengio. Multi-task self-supervised learning for robust speech recognition. In ICASSP, 2020.
+Brendan Shillingford, Yannis Assael, Matthew Hoffman, Thomas Paine, Cian Hughes, Utsav Prabhu, Hank Liao, Hasim Sak, Kanishka Rao, Lorrayne Bennett, Marie Mulville, Ben Coppin, Ben Laurie, Andrew Senior, and Nando Freitas. Large-scale visual speech recognition. In Interspeech, 2019.
+Themos Stafylakis and Georgios Tzimiropoulos. Combining residual networks with lstms for lipreading. In *Interspeech*, 2017.
+W. H. Sumby and Irwin Pollack. Visual contribution to speech intelligibility in noise. Journal of the Acoustical Society of America, 26:212-215, 1954.
+Bo Xu, Cheng Lu, Yandong Guo, and Jacob Wang. Discriminative multi-modality speech recognition. In CVPR, 2020.
+Shiliang Zhang, Ming Lei, Bin Ma, and Lei Xie. Robust audio-visual speech recognition using bimodal dfsmn with multi-condition training and dropout regularization. In ICASSP, 2019a.
+Xingxuan Zhang, Feng Cheng, and Shilin Wang. Spatio-temporal fusion based convolutional sequence learning for lip reading. In ICCV, 2019b.
+
+# A MODEL ILLUSTRATION
+
+
+Figure A.1: Comparison between the proposed AV-HuBERT with single-modal and cross-modal visual HuBERT
+(a) Single-modal visual HuBERT
+
+
+(b) Cross-modal visual HuBERT
+
+
+(c) Audio-visual HuBERT (proposed)
+
+# B DETAILED EXPERIMENTAL SETUP
+
+# B.1 DATASETS
+
+LRS3 (Afouras et al., 2018b) is the largest publicly available sentence-level lip reading dataset to date. It consists of over 400 hours of video, extracted from TED & TEDx talks in English from YouTube. In the original dataset, the training data is split into two partitions: pretrain (403 hours) and trainval (30 hours). Both parts are transcribed at the sentence level and come from the same source as the test set. The pretrain set differs from trainval in that the duration of its video clips are of a much wider range and can be shorter or longer than a full sentence. In the low-resource setup, we only use trainval as the labeled data. As no official development set is provided, we randomly select 1,200 sequences from trainval as the validation set (about 1 hour) for early stopping and hyperparameter tuning.
+
+VoxCeleb2 (Chung et al., 2018) is originally created for multilingual audio-visual speaker recognition and it contains over 2,442 hours of utterances of over 6,000 speakers extracted from YouTube videos. The dataset naturally serves our purpose as it does not contain ground-truth transcriptions. The VoxCeleb2 has substantial domain discrepancy to the LRS3 data as its utterances are from multiple languages and includes videos in a larger variety of domains including interviews, talks, excerpts under indoor and outdoor environments. In VoxCeleb2, by default we only use the English portion for pre-training. As no ground-truth language label is given in the VoxCeleb2, we use a simple heuristic to choose the English samples. Specifically, we use an off-the-shelf character-based ASR model (Hsu et al., 2021a) trained on Librispeech which achieves $1.9\% / 3.5\%$ WER on clean/other test set. We run greedy decoding on the VoxCeleb2 and use the proportion of valid English words to determine if a target utterance is English or not. An utterance is only selected if the proportion of valid English words is higher than $60\%$ . The total amount of unlabeled data after filtering is 1,326 hours.
+
+# B.2 DATA PREPROCESSING
+
+For each video clip, we detect the 68 facial keypoints using dlib (King, 2009) and align each frame to a reference face frame via affine transformation. We crop a $96 \times 96$ region-of-interest (ROI) centered on the mouth. Each image frame is converted to grayscale. We randomly cropped $88 \times 88$ from the whole ROI and randomly flipped it horizontally with probability of 0.5 during training. At test time, $88 \times 88$ ROI is center cropped and does not go through horizontal flipping. The preprocessing steps remain same as prior works in lip reading (Martinez et al., 2020; Ma et al., 2021b). For the associated audio, we extract the 26-dimensional log filterbank energy feature at a stride of $10\mathrm{ms}$ from the raw waveform and use it as input to the model. As the image frames are sampled at $25\mathrm{Hz}$ , we stack the 4 neighboring acoustic frames to synchronize the two modalities.
+
+# B.3 AV-HUBERT MODEL ARCHITECTURE
+
+In the modified ResNet-18 (Ma et al., 2021b; Martinez et al., 2020; Stafylakis & Tzimiropoulos, 2017), the first convolutional layer is substituted by a 3D convolutional layer with kernel size $5 \times 7 \times 7$ . The visual feature tensor is flattened into a single-dimensional vector through a 2D average pooling layer in the end. We use one linear projection layer as the audio encoding module. The acoustic features are normalized by per-frame statistics before feeding into the network (Ba et al., 2016). We use a dropout of $p = 0.1$ after the self-attention block within each transformer layer, and each transformer layer is dropped (Fan et al., 2020) at a rate of 0.1.
+
+# B.4 TRAINING AND INFERENCE
+
+Pretraining Our models are implemented with fairseq (Ott et al., 2019). The whole network is randomly initialized before pre-training. In pre-training, the model is trained for five iterations in total. For the initial iteration, we generate the targets by running k-means clustering algorithm on 39-dimensional MFCC feature (13 coefficients with its first- and second-order derivatives) extracted from raw audio waveform. For the subsequent iterations, the feature from an intermediate layer of the model in the previous iteration is used for clustering. The layer index (one-based) used for clustering in iteration 1-4 are \{9, 12, 12, 12\}. The number of features are clustered to \{100, 100,
+
+500, 1000, 2000} respectively for the 5 iterations. See section E.3 for analysis. To save training time, we always use the BASE model to generate clusters and LARGE model is only trained in the 5th iteration.
+
+We set both $p_m$ and $p_a$ to 0.5 for modality dropout at training time. To extract features for clustering, both modalities are used. We adopt the strategy used in wav2vec 2.0 (Baevski et al., 2020) to generate masks, where $p\%$ of all frames are randomly selected as start and subsequent $l$ frames are masked. In iteration 1-4, we mask the fused features and set $p / l$ to be 8/10 respectively as we observe such practice generates higher quality cluster assignments (see section E.2). In the last iteration, we set $p / l$ to be 6/5 for video and 8/10 for audio (see section D).
+
+We train the model with Adam (Kingma & Ba, 2015), warming up the learning rate for the first $8\%$ of updates to a peak of 0.002 and then linearly decay it. Videos are batched together to not exceed 1,000 image frames (40 seconds) per GPU. Both BASE and LARGE models are updated for 400K and 600K steps at each iteration, respectively in 433h/1759h unlabeled settings. We train on 32 and 64 V100-GPUs for BASE and LARGE. On average, each iteration takes $\sim 2.0 / 3.0$ days for BASE and $\sim 2.4 / 3.6$ days for LARGE in using 433h/1759h unlabeled data for pre-training.
+
+Fine-tuning After pre-training, we fine-tune the AV-HuBERT model on labeled (video, text) pairs. The audio encoder is removed and its output is replaced by a zero-vector. In CTC fine-tuning, a randomly initialized projection layer is added on top of the transformer to map features into phonemes. The lexicon is constructed with CMUDict (cmu). In fine-tuning with S2S, we use a 6-layer/9-layer transformer decoder on BASE and LARGE model to decode features into unigram-based subword units (Kudo, 2018). The vocabulary size in CTC and S2S are 46 and 1000 respectively.
+
+In CTC, the pre-trained model is updated from the initial iteration without any freezing. The model is fine-tuned for $30\mathrm{K} / 100\mathrm{K}$ steps respectively in $30\mathrm{h} / 433\mathrm{h}$ setting. In S2S, the pre-trained model (i.e., encoder) is frozen for the first $N\%$ updates. $N$ is 100 and 50 for 30h and 433h labeled setting respectively. The entire model is trained for $18\mathrm{K} / 45\mathrm{K}$ steps in the $30\mathrm{h} / 433\mathrm{h}$ setting. Both models are trained with Adam, with the learning rate being warmed up for the first $P\%$ of updates to a peak of 0.001 and linearly decayed. P is tuned among $\{10, 30, 50\}$ . All hyperparameters are tuned on the validation set.
+
+Decoding For CTC, we use a 4-gram language model trained on text data in the LRS3 training set. The perplexity of the 4-gram LM on test set is 110.5. No language model is used for S2S decoding. For CTC, we tune the beam width among $\{5, 10, 20, 50, 100, 150\}$ , the language model weight among $\{0, 1, 2, 4, 8\}$ and word insertion penalty among $\{\pm 4, \pm 2, \pm 1, 0\}$ . For S2S, The beam width and length penalty are tuned among $\{5, 10, 20, 50\}$ and $\{0, \pm 1\}$ . The tuning is done on the validation set.
+
+Self-Training We apply self-training on LARGE AV-HuBERT. Specifically, the fine-tuned LARGE HuBERT model(A/MFCC $\rightarrow$ AV, Table 4) is used to assign pseudo-labels to the unlabeled audiovisual data. In $30\mathrm{h} / 433\mathrm{h}$ setting, the amount of data for fine-tuning A/MFCC $\rightarrow$ AV are $30\mathrm{h}$ and $433\mathrm{h}$ respectively. The pre-trained AV-HuBERT LARGE is fine-tuned with the pseudo-labeled videos and videos with ground-truth text labels (30h/433h). Note the data used here is exactly same with the case of using AV-HuBERT only.
+
+# B.5 LIRA IMPLEMENTATION
+
+We re-implemented the LiRA (Ma et al., 2021a) training objective in our framework, as there does not exist publicly available implementations and we aim to focus the comparison on the pre-training objective rather than the architectural difference. We use the same backbone architecture as the BASE AV-Hubert except the output layer being a linear project layer with an output dimension of 256. The 256-dimensional frame $\mathrm{PASE + }$ feature is extracted from the audio with its official implementation in (Ravanelli et al., 2020). The original $\mathrm{PASE + }$ feature is downsampled to $25\mathrm{Hz}$ for synchronization with the visual stream. The pre-trained model is fine-tuned in both CTC and S2S. The optimizer and learning rate schedule in pre-training, hyperparameter search in fine-tuning and decoding remain the same as AV-HUBERT. Note with our implementation, the WER is reduced by $23\%$ ( $94.3\% \rightarrow 71.9\%$ ) using LiRA when the percentage of labeled data is $6.9\%$ (30h labeled, 433h in total), while Ma et al. (2021a) achieves $\sim 10\%$ improvement in a similar setting.
+
+# C ADDITIONAL LIP-READING RESULTS
+
+# C.1 AMOUNT OF LABELED DATA
+
+Table C.1 shows the effect of pre-training on different amount of labeled data for fine-tuning. We use 433 hours of unlabeled data (LRS3 only) and randomly selected 1, 10 and 100 hours of labeled data for fine-tuning. Overall pre-training brings large and consistent gains across different amount of labeled data. Specifically CTC-based fine-tuning outperforms S2S-based fine-tuning in low-resource settings (1-hour and 10-hour). The larger number of parameters as well as the lack of a language model for decoding makes S2S model more likely to overfit especially when the amount of fine-tuning data is small.
+
+Table C.1: WER (%) in using different amount of labeled data for fine-tuning (BASE, 433 hours unlabeled)
+
+| Labeled (hrs) | Unlabeled (hrs) | Criterion | LM | WER (%) |
| w/o pretrain | w/ pretrain |
| 1 | 433 | CTC | 4-gram | 98.6 | 68.8 |
| S2S | - | 98.9 | 92.0 |
| 10 | 433 | CTC | 4-gram | 90.8 | 57.6 |
| S2S | - | 97.6 | 63.1 |
| 100 | 433 | CTC | 4-gram | 77.8 | 54.2 |
| S2S | - | 84.3 | 48.1 |
+
+# C.2 PERFORMANCE ON SEEN SPEAKERS
+
+The current LRS3 benchmark is under the open-speaker setting, where the speaker identities in training and test set do not overlap. To test the lip reading performance for a fixed set of speakers which is the case for an early versions of LRS3 used before October 2018, we randomly choose 5 groups of utterances from the trainval partition of LRS3 as test set and repeat experiments for each group independently. Each group contains 1322 utterance, which is of the same amount as the original test set. The model we compare is the AV-HUBERT LARGE pre-trained with 1,759 unlabeled data. As is shown in table C.2, the average WER achieved by our model for seen speakers is $18.0 \pm 0.5\%$ , which is significantly lower than the WER for unseen speakers (30.5%) under the open-speaker setting.
+
+Table C.2:WER $(\%)$ under closed-speaker setting for 5 randomly sampled test sets and their average
+
+ | Test set (seen speakers) | AVG |
| 1 | 2 | 3 | 4 | 5 |
| WER (%) | 17.4 | 18.6 | 18.5 | 17.5 | 18.3 | 18.0 ± 0.5 |
+
+# C.3 PERFORMANCE OF SELF-TRAINING ONLY
+
+Table C.3 shows the performance of only applying self-training. The WER of a self-training only model is significantly higher than AV-HuBERT and self-trained AV-HuBERT, which suggests that the gain of the combined approach is primarily from AV-HuBERT.
+
+# C.4 FULL RESULTS WITH CTC FINE-TUNING
+
+Table C.4 shows the full results on LRS3, which includes the CTC fine-tuning performance for all the models we implemented. In general, the conclusions we draw from S2S (e.g., the benefits of our pre-training approach in different settings, the improvement over LiRA) in section 4.2 holds for CTC as well.
+
+Table C.3: Comparison of WER (%) among model trained from scratch, self-training only, AV-HuBERT only and self-trained AV-HuBERT. All models are Transformer-LARGE.
+
+| Labeled (hrs) | Unlabeled (hrs) | Method | WER (%) |
| 30 | 1,759 | w/o pre-training | 92.3 |
| Self-training | 53.0 |
| AV-HuBERT | 32.5 |
| AV-HuBERT + Self-training | 28.6 |
| 433 | 1,759 | w/o pre-training | 62.3 |
| Self-training | 51.7 |
| AV-HuBERT | 28.6 |
| AV-HuBERT + Self-training | 26.9 |
+
+Table C.4: WER (%) of our models and the comparison with prior works on LRS3-TED dataset. †We re-implemented Ma et al. (2021a) using the same model architecture as our approach to have a more fair comparison.
+
+| Method | Backbone | Criterion | Labeled iso (hrs) | Labeled utt (hrs) | Unlabeled data (hrs) | WER (%) |
| Supervised |
| Afouras et al. (2020) | CNN | CTC | 157 | 433 | - | 68.8 |
| Zhang et al. (2019b) | CNN | S2S | 157 | 698 | - | 60.1 |
| Afouras et al. (2018a) | Transformer | S2S | 157 | 1,362 | - | 58.9 |
| Xu et al. (2020) | RNN | S2S | 157 | 433 | - | 57.8 |
| Shillingford et al. (2019) | RNN | CTC | - | 3,886 | - | 55.1 |
| Ma et al. (2021b) | Conformer | CTC+S2S | - | 433 | - | 46.9 |
| Ma et al. (2021b) | Conformer | CTC+S2S | 157 | 433 | - | 43.3 |
| Makino et al. (2019) | RNN | Transducer | - | 31,000 | - | 33.6 |
| Semi-Supervised & Self-Supervised |
| Afouras et al. (2020) | CNN | CTC | 157 | 433 | 334 | 59.8 |
| Ma et al. (2021a)† | Transformer-BASE | CTC | - | 30 | 433 | 72.8 |
| - | 433 | 1,759 | 58.4 |
| S2S | - | 30 | 433 | 71.9 |
| - | 433 | 1,759 | 49.6 |
| Proposed (Self-Supervised & Self-Supervised + Semi-Supervised) |
| AV-HuBERT | Transformer-BASE | CTC | - | 30 | - | 83.7 |
| - | 30 | 433 | 55.3 |
| - | 30 | 1,759 | 47.3 |
| - | 433 | - | 62.5 |
| - | 433 | 433 | 49.3 |
| - | 433 | 1,759 | 43.0 |
| S2S | - | 30 | - | 94.3 |
| - | 30 | 433 | 51.8 |
| - | 30 | 1,759 | 46.1 |
| - | 433 | - | 60.3 |
| - | 433 | 433 | 44.0 |
| - | 433 | 1,759 | 34.8 |
| Transformer-LARGE | CTC | - | 30 | - | 92.2 |
| - | 30 | 433 | 48.4 |
| - | 30 | 1,759 | 40.7 |
| - | 433 | - | 61.9 |
| - | 433 | 433 | 44.3 |
| - | 433 | 1,759 | 38.6 |
| S2S | - | 30 | - | 92.3 |
| - | 30 | 433 | 44.8 |
| - | 30 | 1,759 | 32.5 |
| - | 433 | - | 62.3 |
| - | 433 | 433 | 41.6 |
| - | 433 | 1,759 | 28.6 |
| AV-HuBERT + Self-Training | Transformer-LARGE | S2S | - | 30 | 1,759 | 28.6 |
| - | 433 | 1,759 | 26.9 |
+
+# D ABLATION STUDIES
+
+The ablation studies in this section are done in the last iteration of the AV-HuBERT, pre-trained with 433 hours of unlabeled data. The model is fine-tuned with 30 hours of labeled data using CTC.
+
+Table D.1: Ablation study for hyper-parameters. The ablations are done in the last iteration of AVHUBERT. $m_{a} / m_{v}$ : the probability of an acoustic/image frame being masked.
+
+| Where | Masking
+How | ma | mv | Modality Dropout | Loss
+α | WER
+dev | test |
| pm | pa |
| Input | Sub (same, seg) | 0.8 | 0.3 | 0.5 | 0.5 | 0.0 | 46.8 | 55.3 |
| Sub (same, frm) | | | | | | 47.2 | 55.8 |
| Sub (diff, seg) | | | | | | 47.6 | 56.1 |
| Learned Embedding | | | | | | 52.6 | 57.8 |
| Gauss. Noise | | | | | | 52.4 | 57.9 |
| Feature | Learned Embedding | | | | | | 55.2 | 58.2 |
| Input | Sub (same, seg) | 0.8 | 0.3 | 0.5 | 0.5 | 0.0 | 46.8 | 55.3 |
| | 0.8 | 0.8 | | | | 59.3 | 61.6 |
| | 0.3 | 0.3 | | | | 54.9 | 58.2 |
| Input | Sub (same, seg) | 0.8 | 0.3 | 0.5 | 0.5 | 0.0 | 46.8 | 55.3 |
| | | | 1.0 | n/a | | 55.2 | 57.0 |
| Input | Sub (same, seg) | 0.8 | 0.3 | 0.5 | 0.5 | 0.0 | 46.8 | 55.3 |
| | | | | | 1.0 | 46.7 | 55.7 |
+
+Masking Strategy In the first part of table D.1, we compare the proposed masking strategy against several alternatives. Feature masking applies span mask at feature level and leads to the worst performance, which is due to the leakage of information to ResNet. Directly masking image sequence with random Gaussian noise or a learned embedding slightly improves the performance by preventing the prior issue. However, those artificial frames also corrupts the raw image sequence and enlarges the domain gap in videos between pre-training and fine-tuning. On the other hand, our proposed method achieves better performance. Specifically, using segments from the same utterance ("Sub, (same, seg)") as the imposter leads to the best result compared to sampling from a different utterance ("Sub, (diff, seg)") or sampling non-consecutive frames from the same utterance ("Sub, (same, frm)"). The filled-in fake images are visually similar to the raw images and substitution with a segment keeps the temporal smoothness making the replaced segment more realistic, which enforces the ResNet to encode more fine-grained visual details.
+
+Masking probability We set two different masking probabilities for audio and visual stream in the last iteration. The probabilities of an acoustic frame and image frame being masked are 0.8 and 0.3 respectively. As is shown in the second part of table D.1, setting masks for audio and visual stream independently is essential because the optimal masking probability for audio and visual stream are different. Audio encoder tends to deteriorate into a simple acoustic feature extractor when mask length is small. On the other hand, long visual mask will lead to the model lacking context to distinguish between fake and real images.
+
+Modality dropout The third part of table D.1 compares the model performance with and without modality dropout. Randomly dropping audio sequence prevents the model from over-relying on audio for masked prediction and helps the visual representation learning.
+
+Where to compute prediction loss In the last part of table D.1, we compare the choice of masked prediction vs. prediction. The loss weight on unmasked region does not have a large impact on the fine-tuning performance. This is different from the findings in Audio HuBERT Hsu et al. (2021a), where masked prediction leads to much better performance. Given image frames as input, the prediction of cluster assignments, which are mostly determined by the accompanied audio stream, helps encode phonetic information into the visual representation. The task is much less trivial than
+
+a single-modal model (audio-HuBERT), where setting non-zero weight on unmasked prediction can easily make the model deteriorate into an acoustic feature extractor. In addition, the high quality of targets in the last iteration also makes such prediction more helpful.
+
+# E ANALYSIS ON CLUSTERING
+
+# E.1 MEASURING CLUSTERING QUALITY
+
+For analysis, we use frame-level phonetic labels as the ground-truth and match its correlation between cluster assignments. The phonetic labels are obtained via forced alignment from a monophone based HMM-GMM ASR model trained on LRS3. In particular, we use clustering purity andNormalize Mutual Information (NMI) as the evaluation metrics. Table E.1 shows that (1) The quality of cluster assignments is consistent with fine-tuning performance across different models (2) Hand-engineered audio feature (MFCC, NMI: $21.5\%$ ) has much stronger correlation with phonetic labels than the visual feature (HoG, NMI: $1.6\%$ ) (3) Audio-visual clusters (NMI: $44.2\%$ ) are of better quality than pure audio-based clusters (NMI: $39.7\%$ ). (4) In single-modality visual Hubert $(\mathrm{V / HoG}\rightarrow \mathrm{V})$ , feature quality is improved negligibly through iteration training.
+
+Table E.1: Quality of different cluster assignments. Each number is in the format of Purity (NMI). The metrics of cluster assignments and WER in last iteration of each model are in boldface.
+
+| Model | Iter | Feature | Target K | Purity (%),↑ | NMI (%),↑ | WER (%),↓ |
| AV/MFCC→AV (Proposed) | 1 | MFCC | 100 | 30.3 | 21.5 | 71.5 |
| 2 | AV/MFCC→AV (it1, L9) | 100 | 47.3 | 37.7 | 63.6 |
| 3 | AV/MFCC→AV (it2, L12) | 500 | 61.5 | 42.6 | 60.9 |
| 4 | AV/MFCC→AV (it3, L12) | 1000 | 65.6 | 43.7 | 58.8 |
| 5 | AV/MFCC→AV (it4, L12) | 2000 | 68.8 | 44.2 | 58.2 |
| AV/MFCC→A | 1 | MFCC | 100 | 30.3 | 21.5 | 71.5 |
| 2 | A/MFCC→A (it1, L9) | 100 | 47.0 | 36.7 | 64.3 |
| 3 | A/MFCC→A (it2, L12) | 500 | 56.5 | 39.7 | 63.5 |
| V/MFCC→A | 1 | MFCC | 100 | 30.3 | 21.5 | 75.4 |
| 2 | A/MFCC→A (it1, L9) | 100 | 47.0 | 36.7 | 69.4 |
| 3 | A/MFCC→A (it2, L12) | 500 | 56.5 | 39.7 | 69.1 |
| V/MFCC→V | 1 | MFCC | 100 | 30.3 | 21.5 | 75.4 |
| 2 | V/MFCC→V (it1, L9) | 100 | 32.8 | 22.9 | 72.6 |
| 3 | V/MFCC→V (it2, L12) | 500 | 33.0 | 22.8 | 72.3 |
| V/HoG→V | 1 | HoG | 100 | 16.4 | 1.6 | 80.3 |
| 2 | V/HoG→V (it1, L9) | 100 | 16.4 | 1.8 | 80.1 |
+
+# E.2 FEATURE MASKING PRODUES BETTER FEATURES FOR CLUSTERING
+
+In iteration 1-4, we apply the mask in the fused feature. We observe such practice generates targets of higher quality, thus helping future iterations more. Table E.2 shows a comparison between such two different masking strategies. Input-level masking enhances the learning of visual representation (see table D.1) while produces worse audio-visual feature (NMI: $27.2\%$ ). In contrast, the two streams of original input are better aligned in feature-level masking which is consistent with the cluster generation process, thus leading to better audio-visual clusters (NMI: $37.7\%$ ).
+
+Table E.2: Impact of masking strategy on quality of cluster assignments (purity/NMI: quality of cluster assignments used to train the model)
+
+| Feature | K | Purity (%) | NMI (%) |
| MFCC | 100 | 30.3 | 21.5 |
| AV/MFCC→AV (it1, L9) w/ Feature Masking | 100 | 47.3 | 37.7 |
| AV/MFCC→AV (it1, L9) w/ Input Masking | 100 | 34.5 | 27.2 |
+
+# E.3 CLUSTERING QUALITY ACROSS LAYERS
+
+Figure E.1 shows the clustering quality of features of different layers in different iterations. The cluster assignment quality generally improves with more iterations. In the first iteration, features in
+
+the middle layers show higher quality than the other layers. The target for the first iteration (MFCC clusters) is of worse quality, thus later layers that are more correlated with targets do not yield the best cluster. Target quality improves with more training iterations, thus the best feature layer shifts towards the end. Setting a larger number of clusters increases the clustering quality as can be seen from the comparison between "varied clusters" and "2K clusters". In terms of the 12th layer which we choose, the highest NMI $(44.2\%)$ is achieved in the last iteration. In addition, more iterations of training improves the overall quality of clusters produced by a model though the highest NMI/purity among all layers does not necessarily increase in later iterations. Therefore, setting a larger number of iterations brings stable gains which are more robust to the index of layer chosen for clustering. It is important as the purity/NMI, whose measurement rely on a supervised model, are not used for hyperparameter search in practice.
+
+Figure E.1: Quality of feature clusters from different layers across different iterations (BASE, 433 hours unlabeled data). (Iter $i$ , Layer $j$ ): cluster quality of layer- $j$ feature of iter- $i$ model. Upper row: 100, 500, 1K, 2K clusters for 4 iterations. Bottom row: 2K clusters for all iterations. Purity/NMI of the initial MFCC clusters: $30.3\% / 21.5\%$
+
+
+
+
+
+
+
+
+
+# F QUALITATIVE EXAMPLES
+
+Figure F.2 shows the example outputs from different models. Our self-supervised model is the LARGE AV-HUBERT pre-trained with 1,759 hours unlabeled data and fine-tuned with 433 hours labeled data. The baseline model is the supervised baseline trained with 433 hours labeled data. Both models use the S2S criterion for supervised training and have the same number of parameters. Qualitatively, our approach provides transcriptions with much higher quality. The baseline approach confuses among words of similar sound while our model output more semantically sound sentences. Figure F.2 also shows typical errors made by our model. We noticed many errors are on short sentences. This is mainly because lip reading relies heavily on the context for recognition due to the existence of homophomes. Thus the error rates in lip reading are notably higher in short utterances, which differs from ASR, as can be seen from figure F.1. Substitution among words with homophemes ('fiction' vs. 'vision' in a.4, 'part' vs. 'bunk' in b.5) is another source of error made by the model.
+
+
+Figure F.1: WER vs. sentence length for lip reading (left) and ASR (right)
+
+
+
+Figure F.2: Transcriptions from different lip-reading models. GT: ground-truth, Proposed: self-supervised model, Supervised: supervised model. Red: wrong words in the output
+
+(a) Self-supervised vs. Supervised
+
+| (1) | GT: Proposed: Supervised: | why not ask all of the states to do that instead why not ask all of these things to do that instead why can't i actually all of these things do things and |
| (2) | GT: Proposed: Supervised: | indeed we run the risk of making things worse indeed we want the risk of making things worse in india we roughly receive money in the health world |
| (3) | GT: Proposed: Supervised: | my desire to disappear was still very powerful my desire to disappear was still very powerful my son is speaking with children about food |
| (4) | GT: Proposed: Supervised: | the silent majority does not need to be silent the same majority does not need to be silent this time the total disaster needs to be designed |
| (5) | GT: Proposed: Supervised: | mortality is not going down it's going up mortality is not going down it's going up we're seeing this not only carrying slowly how |
| (b) Failure cases |
| (1) | GT: Proposed: | it's a win all around he's a win on the ground |
| (2) | GT: Proposed: | sort of leadership by humiliation so the leadership by communication |
| (3) | GT: Proposed: | is it about equality ask about quality |
| (4) | GT: Proposed: | science fiction is one of the greatest and most effective forms of political writing stage vision is one of the greatest and most effective forms of political writing |
| (5) | GT: Proposed: | we can't identify with that part we can't identify with that bunk |
\ No newline at end of file
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/images.zip b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c465d3e63a46da5cfb2f8456e441d58c56194d18
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:48a18a29b9fa4ea9a8d71877bb14aad328e3e82a86642f42d8aea77b98137c56
+size 1096487
diff --git a/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/layout.json b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..96357d8f848fdfcd141515b400eacf516aa5cb64
--- /dev/null
+++ b/learningaudiovisualspeechrepresentationbymaskedmultimodalclusterprediction/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6831a75b9e68432d0898343f542bc019d72b09c6c54e81b3aca5539b2cc6bd4b
+size 570993
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_content_list.json b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..01ef48758e309dca8be1170745caed1b86a59645
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b9a033fc7e9f8c8c40a1093d8c8e23ab6ed75792a2c280cae2ac9bfd0fc24608
+size 112097
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_model.json b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..05697692dadc9ac2194cb89f51f9663c0eb743ea
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb96624c0179fd372f3c80aa0d0cf993bae57f1359017cc55d1dbf242830d525
+size 133386
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_origin.pdf b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..789d04762230e02f5e710141e4585857226bc6be
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/3f6b7255-ea0e-49ec-9508-79efd293b370_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:666e2f53af18536246035f178748307f61b2a860220da0c1cca927bac3323efa
+size 19219078
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/full.md b/learningcontinuousenvironmentfieldsviaimplicitfunctions/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..4128cece9d2a547928d147c2b1009ee20abbb23f
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/full.md
@@ -0,0 +1,476 @@
+# LEARNING CONTINUOUS ENVIRONMENT FIELDS VIA IMPLICIT FUNCTIONS
+
+Xueting Li $^{1}$ , Shalini De Mello $^{2}$ , Xiaolong Wang $^{3}$ , Ming-Hsuan Yang $^{1}$ , Jan Kautz $^{2}$ , and Sifei Liu $^{2}$
+
+$^{1}$ UC Merced
+
+2NVIDIA
+
+$^{3}$ UC San Diego
+
+
+(a) 2D Maze map
+
+
+(b) SDF level set
+
+
+
+
+(c) SDF visualized in 3D
+(d) Environment field level set
+
+
+(e) Environment field visualized in 3D
+
+
+(f) Searched trajectories in 3D indoor environments
+Figure 1: Implicit environment fields in 2D and 3D space. With implicit functions, we learn a continuous environment field that encodes the reaching distance between any pair of points in 2D and 3D space. We present utilization of the environment field for 2D maze navigation in (d)-(e) and human scene interaction modeling in 3D scenes in (f). Note that we flip the environment field in (e) upside down for visualization purposes.
+
+
+
+# ABSTRACT
+
+We propose a novel scene representation that encodes reaching distance – the distance between any position in the scene to a goal along a feasible trajectory. We demonstrate that this environment field representation can directly guide the dynamic behaviors of agents in 2D mazes or 3D indoor scenes. Our environment field is a continuous representation and learned via a neural implicit function using discretely sampled training data. We showcase its application for agent navigation in 2D mazes, and human trajectory prediction in 3D indoor environments. To produce physically plausible and natural trajectories for humans, we additionally learn a generative model that predicts regions where humans commonly appear, and enforce the environment field to be defined within such regions. Extensive experiments demonstrate that the proposed method can generate both feasible and plausible trajectories efficiently and accurately.
+
+# 1 INTRODUCTION
+
+Scene understanding aims to analyze and interpret a given environment. The past few years have witnessed tremendous success in scene representation learning for semantic segmentation (Long et al., 2015; Li et al., 2017), 3D scene reconstruction (Sitzmann et al., 2020; 2019), and depth estimation (Godard et al., 2019). The learned representations can be used as inputs for training embodied tasks including visual navigation (Sax et al., 2018; Zhou et al., 2019) and robotic manipulation (Chen et al., 2020; Yen-Chen et al., 2020). This overall process falls into a two-step paradigm, which first learns a static scene representation, and then trains an agent to interact with the scene. While this progress is exciting, we ask for exploring an alternative research direction: Can the scene
+
+representation itself be dynamically interactive? That is, instead of training a Reinforcement Learning agent on top of the scene, we encode the dynamic functioning (i.e., the ability to control and guide the agent's interactions) in the scene representation in one-step training.
+
+Specifically, we study a representation that guides an embodied agent to navigate inside the scene. We propose a scene representation dubbed as the environment field that encodes the reaching distance – distance from any position to a given goal location along a feasible and plausible trajectory. Such an environment field needs to be continuous and densely covering the entire scene. With this continuous scene representation, given an agent in any locations in the scene, we can perform iterative optimization (e.g., gradient descent) over the continuous field to move the agent to a goal. The optimization objective is to minimize the reaching distance, and the agent reaches a given goal when the reaching distance equals to zero.
+
+Compared to search-based algorithms (Sethian, 1996; LaValle, 1998; Kavraki et al., 1996), the proposed environment field enjoys two key advantages: a) Continuity. Search-based methods (Sethian, 1996) assume a discrete searching space, while the proposed environment field is continuous and can easily generalize to continuous scenes such as a 3D indoor environment. b) Efficiency. Instead of applying the time-consuming searching algorithm to every new environment or goal position, a single neural network is learned to efficiently produce different environment fields for different scenes or goal positions, with a forward pass.
+
+How to learn this continuous environment field? Naively learning such a dense field in a supervised matter requires ground truth reaching distance annotation at all possible locations in the scene, which are infinitely many and thus impossible to collect. In this paper, we leverage neural implicit functions (Park et al., 2019; Xu et al., 2019; Sitzmann et al., 2020; Xu et al., 2019; Mescheder et al., 2019) that can learn a continuous field using discretely sampled training data. Specifically, we design an implicit neural network that takes the coordinates of a position in the scene as input and outputs its reaching distance to a given goal location. Even though this implicit neural network is trained using discretely sampled position and reaching distance pairs, yet it produces a dense environment field of a scene. During inference, the reaching distance between any position in the scene and the goal can be efficiently queried via a fast network forward pass and used to navigate an agent towards the goal.
+
+We showcase the application of the proposed environment field in both human trajectory modeling in 3D indoor environments as well as agent navigation in 2D mazes and observe comparable if not better results than state-of-the-art methods. Specially, when applying the environment field to human trajectory modeling, we additionally propose and learn an accessible region - plausible regions for humans to appear in the scene via a variational auto-encoder (VAE). This accessible region can be implicitly encoded into the environment field so that it can guide humans to avoid locations that do not conform to common human behaviors (e.g., navigate a human to travel around rather than under a desk).
+
+The main contributions of this work are:
+
+- We propose the environment field - a novel scene representation that facilitates direct guidance of dynamic agent behaviors in a scene.
+- We learn dense environment fields via implicit functions using discretely sampled training pairs.
+- We apply the environment fields to human trajectory prediction in 3D indoor environments and agent navigation in 2D mazes, where both feasible and plausible trajectories can be produced efficiently and accurately.
+
+# 2 RELATED WORK
+
+Scene representations. Scene understanding aims at parsing and interpreting an environment. Prior approaches learn various scene representations comprising of semantic segmentation (Long et al., 2015; Li et al., 2017), depth (Godard et al., 2019) and meshes (Sitzmann et al., 2020). Nevertheless, these representations only capture static scene attributes while the proposed environment field aims to encode the dynamic functioning of a scene.
+
+**Path planning.** Classical path planning algorithms including Breath First Searching (BFS), Dijkstra's algorithm (Dijkstra, 1959) and the Fast Marching Method (FMM) (Sethian, 1996; Valero-Gomez et al., 2015) require applying the searching algorithm to every new environment or goal position, and hence are not suitable for dynamically changing environments. On the contrary, our
+
+environment field generalizes to changing goals and environments during inference and is thus computationally efficient. Instead of solving path planning numerically, sampling-based methods such as Rapidly Exploring Random Tree (RRT) (LaValle, 1998; LaValle et al., 2001; Bry & Roy, 2011) or Probabilistic Roadmaps (PRM) (Kavraki et al., 1996; 1998) grow and search a tree by sampling feasible locations in the scene. However, the efficiency and performance of such methods depend on the sampling density and algorithm. In contrast, we learn a continuous environment field that predicts the next optimal move instantly for any location in the scene. The potential field algorithm manually computes and combines an attractive and repulsive field and is prone to local minimas, while our algorithm learns a single field in a data-driven way.
+
+The proposed environment field can also be considered as a value function used in learning-based path planning methods (Tamar et al., 2016; Campero et al., 2020; Al-Shedivat et al., 2018; Chaplot et al., 2021). The reaching distance at each location is essentially the reward the agent gets while trying to reach the goal. However, compared to other learning-based path planning algorithms (Tamar et al., 2016; Campero et al., 2020; Al-Shedivat et al., 2018), the environment field enjoys two major benefits. First, it produces the environment field for all locations in the scene with a single network forward pass (in discrete cases such as 2D mazes), instead of predicting optimal steps sequentially, which requires multiple network forward passes. Second, it utilizes implicit functions instead of convolution neural networks and is thus more flexible to generalize to continuous scenarios such as human navigation in 3D scenes.
+
+Implicit neural representations. Implicit neural representations have recently attracted much attention in computer vision due to their continuity, memory-efficiency, and capacity to capture complex object details. Numerous implicit neural representations have been proposed to reconstruct 3D objects (Park et al., 2019; Xu et al., 2019; Michalkiewicz et al., 2019; Tulsiani et al., 2020; Mescheder et al., 2019), scenes (Sitzmann et al., 2019; Jiang et al., 2020; Peng et al., 2020; Mildenhall et al., 2020), humans (Atzmon & Lipman, 2020; Saito et al., 2019; 2020) or even audio and video signals (Sitzmann et al., 2020). Instead of reconstruction, in this work, we use an implicit neural function to encode a continuous environment field and target at agent navigation. A more detailed overview of implicit neural networks can be found in Section 3.1.
+
+Affordance prediction. Affordance prediction models the interactions between humans and objects or scenes (Koppula & Saxena, 2014; Chuang et al., 2018; Zhu et al., 2014; Koppula et al., 2013; Li et al., 2019; Karunratanakul et al., 2020). One line of work describes static human-scene interactions by generating human poses (Wang et al., 2017; Li et al., 2019) or human body meshes (Zhang et al., 2020b;a) given scene images or point clouds. Another line of work (Cao et al., 2020; Monszpart et al., 2019) models dynamic human-scene interactions by predicting a sequence of future human poses given pose history. The proposed method falls into the second category, where we predict plausible human motion sequences containing different actions (e.g., walking and sitting down) while avoiding collisions in 3D scenes. The proposed approach enjoys two major advantages compared to existing work (Cao et al., 2020; Monszpart et al., 2019): a) Our work does not require any past human motion history as a reference. Once the environment field of a scene is encoded by an implicit function, an agent can be navigated from any position to the goal position. b) Our work can generate much longer navigation paths than existing work thanks to the learned environment field that covers the entire scene.
+
+# 3 ENVIRONMENT FIELD
+
+We first introduce the environment field using agent navigation in 2D mazes as a toy example. A real-world application in human trajectory modeling is discussed in Section 4.
+
+# 3.1 OVERVIEW OF IMPLICIT NEURAL NETWORKS
+
+Implicit neural networks have been widely used to represent a 3D object or scene as a signed distance function (SDF). The input to an implicit neural network is the coordinates of a 3D point $(x \in \mathbb{R}^3)$ and the output is the signed distance $(s \in R)$ from this point to the nearest object surface: $s = SDF(x)$ , where $s > 0$ point is inside the object surface and $s < 0$ when the point is outside the object surface. A desirable property of an implicit neural network is that it learns a continuous surface of an object given discretely sampled training pairs $X \coloneqq (x, s)$ , i.e., it is able to predict the SDF value for points not in the training set $X$ once trained. During inference, a continuous object surface can be explicitly recovered by extracting an arbitrarily number of points with zero SDF values, i.e., points on the object surface (Lorensen & Cline, 1987).
+
+# 3.2 ENVIRONMENT FIELD LEARNING VIA NEURAL IMPLICIT NETWORKS
+
+In this work, we take advantage of the continuity property of implicit neural networks described above and learn a continuous environment field from discretely sampled location and reaching distance pairs. Specifically, we represent the environment field as a mapping from location coordinates $x \in \mathbb{R}^2$ to its reaching distance $u(x) \in \mathbb{R}$ towards a given goal and learn an implicit neural network $f_{\theta}$ (see Fig. 3 (a)) such that:
+
+$$
+\hat {u} (x) = f _ {\theta} (x). \tag {1}
+$$
+
+To collect a set of training pairs $X \coloneqq \{x, u(x)\}$ , we resort to an analytical method, e.g., fast marching method (FMM) (Sethian, 1996), that solves $u(x)$ for each cell $x$ in a discrete grid. We then train the implicit function $f_{\theta}$ to regress the reaching distance $u(x)$ computed by the FMM for each cell $x \in X$ using the $L_{1}$ loss function:
+
+$$
+\mathcal {L} \left(f _ {\theta} (x), u (x)\right) = \left| f _ {\theta} (x) - u (x) \right|. \tag {2}
+$$
+
+Thanks to the continuity of implicit functions, the learned implicit neural network is able to predict the reaching distance even for points outside the training set $X$ , enabling us to query the reaching distance for any location in the scene during inference.
+
+# 3.3 TRAJECTORY SEARCH USING ENVIRONMENT FIELD
+
+Given the learned implicit function in Section 3.2, we now describe how to search a trajectory from a starting position $x_{s}$ to the goal position $x_{e}$ . Since the learned implicit neural network is continuous, one intuitive solution for navigation is through a gradient descent method (see Fig. 2(c)). We first feed the current location $x_{c}$ of an agent into the learned implicit function. Then, by minimizing the output reaching distance, the agent can be nudged by the gradients $\Delta x_{c}$ back-propagated from the implicit function to a new position $x_{c} - \Delta x_{c}$ , where the reaching distance is smaller, i.e., closer to the goal. Starting at $x_{s}$ , we repeat the above pro
+
+
+(a)
+Figure 2: Trajectory searching. (a) The 8 possible directions that an agent can take in a 2D maze. (b) Searched trajectory by querying the environment field values of positions the agent can reach within one step. (c) Searched trajectory by gradient descent. The red triangle and the green square represent the starting and goal positions, respectively.
+
+
+(b)
+
+
+(c)
+
+cess and gradually decrease the reaching distance from the current position to the goal until the agent reaches the goal at $x_{e}$ . The gradient descent method computes the direction at each move based on the function values within an infinitesimal area surrounding the current location, and thus the agent can only take an infinitesimally small step at each move.
+
+However, in 2D maze, an agent usually takes a fixed, much larger step, e.g., one grid cell at each move. Therefore, we constrain that an agent moves by one grid cell along one of $2^{3} = 8$ possible directions at each time, as shown in Fig. 2(a). We then query the learned implicit function for the reaching distance values at all possible positions that the agent can reach in one time step and move the agent to the position with the smallest reaching distance. We keep updating the agent's position until it reaches the goal (see Fig. 2(b)).
+
+# 3.4 CONDITIONAL ENVIRONMENT FIELD
+
+We now present how to generalize the environment field to arbitrary goal positions and scenes.
+
+Environment field for arbitrary goal positions. To learn an implicit function that predicts different environment fields for different goal positions in the same scene, we utilize a conditional implicit function (Park et al., 2019) as shown in Fig. 3(b). The input to the implicit function is the concatenation of both the goal coordinates and the query position coordinates. The output is the reaching distance from the query position to the goal, i.e., environment field value. During training, we randomly sample a pair of empty grid cells and set one of them as the goal. We train the implicit function with the reaching distance computed by FMM.
+
+Environment field for arbitrary goal and environment. To further extend the implicit function to an arbitrary environment, we propose a context-aligned implicit function as shown in Fig. 3(c). Given a scene context (i.e., a 2D maze map), we first extract scene context features by a fully convolutional environment encoder. Then, we forward the concatenation of (a) goal coordinates, (b) query position coordinates, and (c) scene context features aligned to the query position into the implicit
+
+
+Figure 3: Variants of implicit environment functions (IEFs). The IEF in (a) assumes a fixed environment and a fixed goal position; (b) generalizes to different goal positions in the same environment; (c) further generalizes to different goal positions in different environments. Goal positions are represented by blue circles. In this figure, we use the 2D maze as an example, but models in (a) and (b) can be generalized to 3D scenes by simply changing the inputs from 2D coordinates to 3D coordinates.
+
+
+Figure 4: Bird's eye view navigation results. We show the searched trajectories for two people in (a). In (b)-(d), we illustrate the positions of the two people at different time steps and how the position of one person (green) affects the reaching distance level-set of the other person (yellow) dynamically to avoid collision. Brighter color in (b), (c) and (d) indicates locations that are closer to the goal.
+
+function and regress the reaching distance value for the query position. The fully convolutional environment encoder and scene environment feature alignment are two key ingredients in this design. The former enlarges the receptive field at the query position so that the implicit function has sufficient contextual information to predict the reaching distance to the goal. The latter encourages the implicit function to focus only on the query position while ignoring other scene context information. We note that hypernetworks (Sitzmann et al., 2020) are another option to encode arbitrary environments and goals. However, the hypernetwork solution is empirically less accurate than the proposed context-aligned implicit function, especially for mazes with larger sizes. Experimental comparisons between these two designs are presented in Section 5.2 and details of the hypernetwork are in Appendix C.1.
+
+For the maze navigation task, we learn the context-aligned implicit function (Fig. 3(c)) using different mazes, along with the reaching distance computed by FMM as training data. During inference, we predict an environment field for an unseen maze with a given goal position and search for a feasible trajectory from any starting position to the goal using the strategy discussed in Section 3.3. Fig. 6 shows learned environment fields along with searched trajectories for unseen maze maps.
+
+# 4 HUMAN NAVIGATION IN INDOOR ENVIRONMENTS
+
+Going beyond the toy example of agent navigation in 2D mazes, we discuss how to apply the environment field to real-world 3D scenes in this section. Given the point cloud of each scene, we aim to generate a physically feasible and semantically plausible trajectory for a human from a starting position to the goal. We then align a random sequence of human poses onto the generated trajectory (see Fig. 7). While the accessible and obstacle locations in 2D mazes are well-defined, the accessible region for humans in 3D scenes is difficult to identify and usually requires prior knowledge of human behavior. We propose two solutions to determine the accessible region in 3D scenes: (a) A simple solution that utilizes the bird's eye view rendering of the 3D scene (see Section 4.1) and only models simple human motion, i.e., walking. (b) A learning-based solution that generates the accessible region in 3D scenes and models more complex human actions, e.g., sitting down, etc. (see Section 4.2).
+
+# 4.1 BIRD'S EYE VIEW ENVIRONMENT FIELD
+
+To model human walking, we define the floor area as the accessible region for humans from the bird's eye view of the 3D scene. We first produce a bird's eye view image and depth through rendering. Then we check the depth of each pixel in the bird's eye view image and label pixels with the maximum depth as the floor. All pixels belonging to the floor area are marked as accessible while other pixels are marked as obstacles. We then use this map as the scene environment condition. Similar to 2D maze navigation discussed in Section 3.4, we assume arbitrary goal positions in a dynamically changing indoor environment and learn a context-aligned implicit function shown in Fig. 3(c) to encode the environment field of the bird's eye view image. During inference, given the starting and goal positions on the floor, we search for a feasible trajectory that leads the human(s) to travel from the starting position to the goal while avoiding collision with obstacles in the room. We target both single and multiple human navigation.
+
+Single human navigation. From a starting position, we assume an average human step size and move the human one step along one of the eight directions (see Fig. 2(a)) that yields the largest reduction in reaching distance. We repeat this process until the human reaches the goal. Given the searched trajectory in the bird's eye view, we align an existing human walking sequence onto it by rotating the human pose towards the tangent direction of the trajectory at each time step. More details of the alignment can be found in Appendix C.3. Fig. 1(f) and Fig. 4(a) show searched trajectories for humans from the bird's eye view together with the aligned human walking pose sequence.
+
+Multiple human navigation. In addition to single human navigation, we show that our method can be easily applied to multiple people navigation – a challenging and computationally expensive task to be solved by any existing approach. Taking the two people in Fig. 4 as an example, we denote the yellow and green ones as person $P_{1}$ and $P_{2}$ , respectively. To navigate $P_{1}$ from the left bottom corner to the center of the room while avoiding collisions with the furniture and $P_{2}$ , at each time step, we modify the scene environment by marking the location of $P_{2}$ as an obstacle. Similarly, we update the scene environment for $P_{2}$ by marking the current position of $P_{1}$ as an obstacle and move $P_{2}$ accordingly. For this task, the scene environment is dynamically changing based on the motion of the other human and so is the predicted environment field. This is why we adopt the context-aligned implicit function in Fig. 3(c) rather than the model in Fig. 3(b). We also randomly mark empty spaces as obstacles during training to mimic the arbitrary scene context encountered during inference. Fig. 4(b)-(d) illustrate how the environment field of $P_{1}$ changes w.r.t. the motion of $P_{2}$ , where the current position of $P_{2}$ is predicted as inaccessible to $P_{1}$ by the learned implicit function.
+
+# 4.2 3D SCENE ENVIRONMENT FIELD
+
+The solution discussed above simplifies human navigation in the 3D space to the 2D image space but is restricted to modeling the motion that mostly happens in the horizontal floor plane, i.e., walking. Next, we demonstrate how to generalize the environment field to 3D scenes and model more complex motions such as sitting and lying down, getting up, etc..
+
+Modeling data-driven accessible region in 3D scenes. Unlike 2D mazes or the bird's eye view where the unoccupied floor region is explicitly given as the accessible region, in the 3D indoor scene, we define accessible region as plausible regions for human torsos to be placed. Given human pose sequences from the training set, we learn a VAE (Kingma & Welling, 2013) to model the distribution of human torso locations conditioned on the scene layout. As shown in Fig. 5, given a scene point cloud, we first take the global feature produced by the pooling layer of a PointNet (Qi et al., 2017) as the scene context feature. We map the context feature together with human torso location observations to a normal distribution using an encoder. A decoder then reconstructs the human torso location given the concatenation of a sampled noise from the normal distribution and the scene context feature.
+
+We learn this conditional VAE using the reconstruction objective on human torso locations together with the Kullback-Leibler (KL) divergence objective (Kingma & Welling, 2013). During inference, we sample random noise from a standard normal distri
+
+
+Figure 5: Conditional VAE for accessible space generation.
+
+bution to generate feasible locations for human torsos to formulate the accessible region in a 3D scene. To further suppress the noisy generation by the VAE model and filter out locations that potentially lead to collisions with furniture in the room, we project all generated locations to the bird's
+
+eye view and remove locations that fall on furniture or walls. Examples of generated accessible regions are shown in Fig. 7, where the VAE successfully predicts plausible locations suitable for humans to sit and walk on, etc. while avoiding collisions with furniture in the room.
+
+Environment field learning for 3D scenes. Given the learned accessible region above, we define the environment field value of locations outside the accessible region as negative (i.e., inaccessible). We then model the field using the network in Fig. 3 (b), where the input to the implicit function is the concatenation of both the goal coordinates and the query position's coordinates. The output is the distance from the query position to the goal.
+
+Pose-dependent trajectory from a continuous field. Given the starting and goal positions as well as a random sequence of human poses, we use the learned environment field to search a path and then align the human pose sequence onto the predicted path. Note that we focus on trajectory instead of human pose modeling, therefore we assume the action of the given pose sequence is consistent with the given starting and goal position. For instance, if given a random sequence of a human sitting down, the goal position should be on an object (e.g., soft, chair, etc.) that can afford the sitting action. Such a setting is commonly observed in applications such as motion matching (Holden et al., 2020). The key to navigating the human at each step is deciding its step length and direction. For direction computation, we assume the human can take one of the $3^3 = 27$ directions (denoted as $v_{i}, i = 1, 2, \ldots, 27$ ) in 3D space, similarly to the 2D maze scenario shown in Fig. 2. For step length, we compute the distance of adjacent torso locations in the given pose sequence as the step length denoted by $s$ . Thus each possible location $l_i'$ human can reach within one step can be computed as $l_i' = l + v_i \times s$ , where $l$ is the human's current location. Although the possible locations can be anywhere in the scene, the continuity of the learned environment field allows us to efficiently query the reaching distance for each possible location by feeding each $l_i'$ together with the goal's coordinates into the learned environment field. The human is then moved towards the location with the minimum reaching distance. This process is repeated until the human reaches the goal position. We emphasize that different from the existing human motion prediction method (Cao et al., 2020), the above trajectory prediction process can be carried out given arbitrarily far away starting and goal positions since the environment field densely covers the entire scene.
+
+Path optimization by affordance. The path searching process discussed above can be further optimized by taking affordance into consideration at each step. For each possible location the human can reach within one step size, we check if the human is well supported and does not collide with other objects at these locations. We move the human to the location with the smallest reaching distance value while obeying these two constraints. Similar to (Li et al., 2019), to determine if a pose is well supported, we check if the torso, the left lap, and the right lap joints of sitting poses, as well as the feet joints of standing poses have non-positive signed distances to the scene surface. To determine if a pose collides with other objects, we check if all joints of the pose except the aforementioned support joints have non-negative signed distances. Finally, we align the pose sequences onto the searched path, details of this alignment process are discussed in Appendix C.3. Fig. 7(b), (d) and (e) illustrate the searched trajectory along with the aligned human poses.
+
+# 5 EXPERIMENTS
+
+# 5.1 EXPERIMENTAL SETTINGS
+
+We train the conditional VAE described in Section 4.2 and all implicit functions using the Adam solver (Kingma & Ba, 2014) with a learning rate of $5 \times 10^{-5}$ . To balance the KL-divergence and the reconstruction objectives in the VAE, we adopt the Cyclical Annealing Schedule introduced in (Fu et al., 2019). We evaluate the proposed environment field on agent navigation in 2D mazes (Section 5.2) and compare with the VIN (Tamar et al., 2016). For dynamic human motion modeling in 3D scenes (Section 5.3), we compare with the HMP (Cao et al., 2020) and continuous sampling-based methods RRT (Bry & Roy, 2011) and PRM (Kavraki et al., 1996). We note that VIN is based on Convolutional Networks and cannot be easily extended to 3D scenes.
+
+# 5.2 AGENT NAVIGATION IN 2D MAZES
+
+We evaluate the proposed environment field on the Minigrid (Chevalier-Boisvert et al., 2018) and Gridworld maze datasets (Tamar et al., 2016), which include 2D mazes with randomly placed obstacles (see Fig. 6(a)). Fig. 6(b) and (c) show the learned environment fields and the level sets (each level set consists of locations of the same reaching distance to the goal) respectively. Each environment field accurately encodes the reaching distance from any accessible point to the goal while
+
+Table 1: Ablation study on network architecture. The $11 \times 11$ mazes are from the Minigrid (Chevalier-Boisvert et al., 2018) dataset while all other mazes are from the Gridworld (Tamar et al., 2016) dataset. IF stands for implicit function.
+
+| Maze Size | 8×8 | 11×11 | 16×16 | 28×28 |
| Hypernetworks | 98.08 | 82.05 | 20.77 | 3.13 |
| Context-aligned IF | 99.69 | 80.14 | 98.29 | 97.00 |
+
+Table 2: Success rate and efficiency for maze navigation.
+
+ | Success rate↑ | Efficiency (milliseconds)↓ |
| Size | 8×8 | 16×16 | 28×28 | 8×8 | 16×16 | 28×28 |
| VIN | 99.60 | 99.30 | 96.97 | 3.88 | 22.72 | 82.07 |
| Ours | 99.69 | 98.29 | 97.00 | 13.26 | 14.81 | 20.41 |
+
+successfully detecting all obstacles in the maze. Figure 6(a) demonstrates the effectiveness of using the learned environment field in navigating an agent to the goal while avoiding collision with obstacles. Quantitatively, we use the success rate – the percentage of paths that successfully lead an agent to the goal among all searched paths, as the evaluation metric.
+
+Hypernetworks v.s. context-aligned implicit function. Table 1 shows the ablation study on the network architectures discussed in Section 3.4. The context-aligned implicit function performs comparably to hypernetworks on smaller-sized mazes (8 × 8 and 11 × 11 mazes). However, hypernetworks fail on larger-sized mazes (16 × 16 and 28 × 28 mazes), demonstrating the superiority of context-aligned implicit functions over hypernetworks.
+
+Comparison with VIN. We compare the proposed method with VIN (Tamar et al., 2016) on the Minigrid dataset (Chevalier-Boisvert et al., 2018). We use the same train and test split as VIN, and learn different implicit functions for mazes of different sizes. Table 2 shows the suc
+
+
+Figure 6: Grid-world maze navigation. Blue paths in (a) are planned by FMM while red paths are searched by the learned environment field. Green circles and orange squares represent starting positions and goal positions. In (b)(c), a brighter area or contour is closer to the goal.
+
+cess rate and average time taken to search a path by different methods. The proposed method achieves a comparable success rate with much less time in larger-sized mazes compared to VIN. This is because the VIN requires a network forward pass at each location to decide the next optimal step, while the proposed method only needs one network forward pass to obtain the reaching distance values of all locations in the maze and can guide the agent at any location to reach the goal.
+
+# 5.3 INDOOR HUMAN NAVIGATION MODELING
+
+Bird's eye view navigation. In Fig. 4(b)-(d), we illustrate how the current position of one person affects the environment field of the other person. First, the learned level set effectively encodes the reaching distance between any point to the goal position. Areas that are closer to the goal have lower reaching distance values and vice versa. Second, the learned environment field dynamically changes based on the position of the other person. For instance, in Fig. 4(b), the current location of the person colored in green is successfully predicted as inaccessible by the other person, i.e., it has a large reaching distance value. These results show that the learned implicit function can effectively model the environment field in a scene and generalize to a dynamically changing environment.
+
+Data-driven human accessible region learning. We show qualitative results of the generated accessible region (see Section 4.2) in Fig. 7(b). The generated accessible region uniformly spreads out in the 3D room and is plausible for all kinds of human actions. For instance, the points on the chair and sofa are feasible locations for sitting human torsos, while the points in midair are plausible locations for walking human torsos. Besides generated accessible region, we show the learned environment field in Fig. 7(a), where the closer a point is to the goal, the smaller its reaching distance value is (brighter point).
+
+Human trajectory prediction. We search a trajectory for a random human pose sequence (see Section 4.2) in Fig. 7(c) and (d). The trajectory successfully avoids colliding with furniture in the room while leading the human towards the goal. We emphasize that the starting and goal positions are 120 frames (8 seconds) apart, showing the capacity of the proposed method in predicting long-term dynamic human motion (see the video in the supplementary material). Our model outperforms
+
+
+(a) Environment field
+
+
+(c) Trajectory with a sitting down pose sequence
+
+
+
+
+
+
+(b) Accessible region
+
+
+
+
+(d) Trajectory with a walking pose sequence
+Figure 7: Dynamic human motion modeling on PROX (Hassan et al., 2019) The accessible region in (b) includes generated torso locations by the VAE model discussed in Section 4.2. In the environment field in (a), the brighter a point is, the closer it is to the goal.
+Table 3: Quantitative comparison with RRT (LaValle, 1998) and PRM (Kavraki et al., 1996) on the PROX dataset. "AFF" indicates the pose dependent search discussed in Section 4.2.
+
+
+
+| Method | RRT | PRM | Ours (w/o AFF) | Ours |
| distance ↓ | 0.127 | 0.139 | 0.015 | 0.015 |
| time (s) ↓ | 0.153 | 1.310 | 0.028 | 0.038 |
+
+the state-of-art method (Cao et al., 2020) that can only effectively capture human motion within 2 seconds. Furthermore, the human poses are plausible at each location on the trajectory, demonstrating the effectiveness of the pose-dependent trajectory search process discussed in Section 4.2.
+
+Comparison with RRT (LaValle, 1998) and PRM (Kavraki et al., 1996). We present quantitative comparisons with sampling-based path planning methods in Table 3. We evaluate two metrics: (a) distance between the end points of a searched path and the goal. (b) average time cost for a single trajectory search. The number of sampling points and nearest neighbors in PRM are set to 500 and 5. For RRT, the maximum iteration for trajectory search is 500. More details can be found in Appendix C.6. Overall, our method is more efficient thanks to the continuous environment field, from which the next step can be predicted by a single fast network forward pass. In addition, our method yields better trajectories that successfully reach the goal as shown in Table 3.
+
+Comparison with HMP (Cao et al., 2020). Since we focus on trajectory prediction, we quantitatively evaluate with the PathNet in the HMP using the distance metric discussed above as well as the ratio of valid poses to all poses on the trajectory. As described in Section 4.2, we define a pose as valid if it is both well supported and collision-free in the scene. We use the same train and test trajectories as the HMP method, with each trajectory including 30 frames. We note that the PathNet in the HMP requires torso locations in the first 10 frames of each trajectory as input and predicts the torso locations for the following 20 frames. While our method directly predicts 30 locations that lead the human to the goal for the entire 30 frames. Quantitative results in Table 4 show that our method is effective for navigating humans towards goal positions. Furthermore, after taking affordance into consideration (see Section 4.2), our model is able to better fit the human poses to the scene, as shown in the last column of Table 4.
+
+Table 4: Quantitative evaluations of human motion trajectory prediction on the PROX dataset. "AFF" is the same as in Table 3. "Support" and "free" indicate the ratio of poses that are either well supported or collision-free, respectively. "Valid" indicates the ratio of poses that obey both constraints.
+
+| Method | distance ↓ | support ↑ | free ↑ | valid ↑ |
| HMP (Cao et al., 2020) | 0.019 | 81.40 | 72.34 | 65.00 |
| Ours (w/o AFF) | 0.015 | 84.47 | 75.43 | 71.36 |
| Ours | 0.015 | 86.22 | 78.56 | 75.32 |
+
+# 6 CONCLUSION
+
+In this paper, we propose the environment field that encodes the reaching distance between a pair of points in either 2D or 3D space, with implicit functions. The learned environment field is a continuous energy surface that can navigate agents in 2D mazes in dynamically changing environments. We further extend the environment field to 3D scenes to model dynamic human motion in indoor environments. Extensive experiments demonstrate the effectiveness of the proposed method in solving 2D mazes and modeling human motion in 3D scenes.
+
+# ACKNOWLEDGMENTS
+
+Ming-Hsuan Yang is supported in part by the NSF CAREER grant 1149783.
+
+# REPRODUCIBILITY STATEMENT
+
+We describe the proposed framework in Fig. 3, with training and implementation details described in Section C.5 in the Appendix. Our method is evaluated on publicly available dataset (Chevalier-Boisvert et al., 2018; Tamar et al., 2016; Hassan et al., 2019). We plan to release the code.
+
+# REFERENCES
+
+Maruan Al-Shedivat, Lisa Lee, Ruslan Salakhutdinov, and Eric Xing. On the complexity of exploration in goal-driven navigation. arXiv preprint arXiv:1811.06889, 2018. 3
+Matan Atzmon and Yaron Lipman. SAL: Sign agnostic learning of shapes from raw data. In CVPR, 2020. 3
+Adam Bry and Nicholas Roy. Rapidly-exploring random belief trees for motion planning under uncertainty. In ICRA, 2011. 3, 7, 15
+Andres Campero, Roberta Raileanu, Heinrich Kuttler, Joshua B Tenenbaum, Tim Rocktäschel, and Edward Grefenstette. Learning with amigo: Adversarily motivated intrinsic goals. arXiv preprint arXiv:2006.12122, 2020.3
+Zhe Cao, Hang Gao, Karttikeya Mangalam, Qizhi Cai, Minh Vo, and Jitendra Malik. Long-term human motion prediction with scene context. In ECCV. 2020. 3, 7, 9, 14, 15, 16, 18
+Devendra Singh Chaplot, Deepak Pathak, and Jitendra Malik. Differentiable spatial planning using transformers. In ICML, 2021. 3
+Bryan Chen, Alexander Sax, Gene Lewis, Iro Armeni, Silvio Savarese, Amir Zamir, Jitendra Malik, and Lerrel Pinto. Robust policies via mid-level visual representations: An experimental study in manipulation and navigation. arXiv preprint arXiv:2011.06698, 2020. 1
+Maxime Chevalier-Boisvert, Lucas Willems, and Suman Pal. Minimalistic gridworld environment for operai gym. https://github.com/maximecb/gym-minigrid, 2018. 7, 8, 10
+Ching-Yao Chuang, Jiaman Li, Antonio Torralba, and Sanja Fidler. Learning to act properly: Predicting and explaining affordances from images. In CVPR, 2018. 3
+Edsger W Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik, 1959. 2, 15
+Hao Fu, Chunyuan Li, Xiaodong Liu, Jianfeng Gao, Asli Celikyilmaz, and Lawrence Carin. Cyclical annealing schedule: A simple approach to mitigating KL vanishing. In NAACL, 2019. 7
+Clément Godard, Oisin Mac Aodha, Michael Firman, and Gabriel J. Brostow. Digging into self-supervised monocular depth prediction. In ICCV, 2019. 1, 2
+David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016. 13
+Mohamed Hassan, Vasileios Choutas, Dimitrios Tzionas, and Michael J. Black. Resolving 3d human pose ambiguities with 3d scene constraints. In ICCV, 2019. 9, 10, 17
+Mohamed Hassan, Duygu Ceylan, Ruben Villegas, Jun Saito, Jimei Yang, Yi Zhou, and Michael Black. Stochastic scene-aware motion prediction. In ICCV, 2021. 14
+Daniel Holden, Oussama Kanoun, Maksym Perepichka, and Tiberiu Popa. Learned motion matching. ACM Transactions on Graphics (TOG), 2020. 7
+
+Chiyu Jiang, Avneesh Sud, Ameesh Makadia, Jingwei Huang, Matthias Nießner, and Thomas Funkhouser. Local implicit grid representations for 3d scenes. In CVPR, 2020. 3
+Korrawe Karunratanakul, Jinlong Yang, Yan Zhang, Michael Black, Krikamol Muandet, and Siyu Tang. Grasping field: Learning implicit representations for human grasps. arXiv preprint arXiv:2008.04451, 2020.3
+Lydia E. Kavraki, Petr Svestka, J.-C. Latombe, and Mark H. Overmars. Probabilistic roadmaps for path planning in high-dimensional configuration spaces. IEEE Transactions on Robotics and Automation, 1996. 2, 3, 7, 9, 15
+Lydia E Kavraki, Mihail N Kolountzakis, and J-C Latombe. Analysis of probabilistic roadmaps for path planning. IEEE Transactions on Robotics and Automation, 1998. 3
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 7, 15
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 6
+Hema S Koppula and Ashutosh Saxena. Physically grounded spatio-temporal object affordances. In ECCV, 2014. 3
+Hema Swetha Koppula, Rudhir Gupta, and Ashutosh Saxena. Learning human activities and object affordances from rgb-d videos. *IJRR*, 2013. 3
+Steven M. LaValle. Rapidly-exploring random trees: A new tool for path planning. Technical Report TR98-11, Computer Science Department, Iowa State University, 1998. 2, 3, 9
+Steven M. LaValle, James J. Kuffner, BR. Donald, et al. Rapidly-exploring random trees: Progress and prospects. Algorithmic and Computational Robotics: New Directions, 2001. 3
+Xueting Li, Sifei Liu, Kihwan Kim, Xiaolong Wang, Ming-Hsuan Yang, and Jan Kautz. Putting humans in a scene: Learning affordance in 3d indoor environments. In CVPR, 2019. 3, 7
+Yi Li, Haozhi Qi, Jifeng Dai, Xiangyang Ji, and Yichen Wei. Fully convolutional instance-aware semantic segmentation. In CVPR, 2017. 1, 2
+Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 1, 2
+William E. Lorensen and Harvey E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. SIGGRAPH, 1987. 3
+Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In CVPR, 2019. 2, 3
+Mateusz Michalkiewicz, Jhony K. Pontes, Dominic Jack, Mahsa Baktashmotlagh, and Anders Eriksson. Implicit surface representations as layers in neural networks. In ICCV, 2019. 3
+Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. 3
+Aron Monszpart, Paul Guerrero, Duygu Ceylan, Ersin Yumer, and Niloy J. Mitra. iMapper: Interaction-guided scene mapping from monocular videos. SIGGRAPH, 2019. 3
+Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. DeepSDF: Learning continuous signed distance functions for shape representation. In CVPR, 2019. 2, 3, 4
+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 NeurIPS, 2019. 15
+
+Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. In ECCV, 2020. 3
+Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017. 6
+Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. In ICCV, 2019. 3
+Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixel-aligned implicit function for high-resolution 3d human digitization. In CVPR, 2020. 3
+Alexander Sax, Bradley Emi, Amir R Zamir, Leonidas Guibas, Silvio Savarese, and Jitendra Malik. Mid-level visual representations improve generalization and sample efficiency for learning visuomotor policies. arXiv preprint arXiv:1812.11971, 2018. 1
+James A Sethian. A fast marching level set method for monotonically advancing fronts. PNAS, 1996. 2, 4
+Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In NeurIPS, 2019. 1, 3
+Vincent Sitzmann, Julien N.P. Martel, Alexander W. Bergman, David B. Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In NeurIPS, 2020. 1, 2, 3, 5, 13
+Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. In NeurIPS, 2016. 3, 7, 8, 10, 13
+Shubham Tulsiani, Nilesh Kulkarni, and Abhinav Gupta. Implicit mesh reconstruction from unannotated image collections. arXiv preprint arXiv:2007.08504, 2020. 3
+Alberto Valero-Gomez, Javier Gomez, Santiago Garrido, and Luis Moreno. Fast marching methods in path planning. IEEE Robotics Automation Magazine, 2015. 2
+Gül Varol, Javier Romero, Xavier Martin, Naureen Mahmood, Michael J. Black, Ivan Laptev, and Cordelia Schmid. Learning from synthetic humans. In CVPR, 2017. 14
+Xiaolong Wang, Rohit Girdhar, and Abhinav Gupta. Binge watching: Scaling affordance learning from sitcoms. In CVPR, 2017. 3
+Qiangeng Xu, Weiyue Wang, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. DISN: Deep implicit surface network for high-quality single-view 3d reconstruction. In NeurIPS, 2019. 2, 3
+Lin Yen-Chen, Andy Zeng, Shuran Song, Phillip Isola, and Tsung-Yi Lin. Learning to see before learning to act: Visual pre-training for manipulation. In ICRA, 2020. 1
+Siwei Zhang, Yan Zhang, Qianli Ma, Michael J. Black, and Siyu Tang. PLACE: Proximity learning of articulation and contact in 3D environments. In 3DV, 2020a. 3
+Yan Zhang, Mohamed Hassan, Heiko Neumann, Michael J. Black, and Siyu Tang. Generating 3d people in scenes without people. In CVPR, 2020b. 3
+Brady Zhou, Philipp Krahenbuhl, and Vladlen Koltun. Does computer vision matter for action? arXiv preprint arXiv:1905.12887, 2019. 1
+Yuke Zhu, Alireza Fathi, and Li Fei-Fei. Reasoning about object affordances in a knowledge base representation. In ECCV, 2014. 3
+
+# A OVERVIEW
+
+In this appendix, we provide more details and experimental results of the proposed implicit environment field approach. First, we differentiate the proposed method and VIN (Tamar et al., 2016) in Section B. Then, we discuss the implementation details of our method and baselines in Section C. Finally, more experimental results, including failure cases are shown in Section D.
+
+# B COMPARISON WITH VIN
+
+Our method is fundamentally different from VIN (Tamar et al., 2016) in the following aspects: a) Goal. We aim to utilize scene understanding to model dynamic agent behaviors, especially human behaviors in indoor environments. However, VIN aims at learning neural networks to approximate the value-iteration algorithm and focuses on learning reward, transition and value functions to obtain the optimal policy for agent navigation. b) Capacity. Our method is more powerful than VIN and other reinforcement learning methods. For instance, it naturally enables navigating multiple humans in the same scene, which is hard to achieve using VIN if corresponding supervision is not provided. c) Flexibility. We utilize implicit functions - a representation of a 3D scene to model the inherent property (reaching distance) of the scene, which captures how long it takes to travel from a point to a given goal plausibly and feasibly. Thanks to such a representation, our method can be flexibly generalized to complex continuous scenes like 3D indoor environments. While VIN depends on convolution operations, which cannot be directly applied to continuous 3D scenes.
+
+Comparisons with other path planning methods can be found in Section 2.
+
+# C IMPLEMENTATION DETAILS
+
+# C.1 HYPERNETWORKS
+
+To encode different maze environments as well as goal positions, we use a hypernetwork (Ha et al., 2016) as shown in Fig. 8. For each maze map, we first use a hypernetwork (blue trapezoid in Fig. 8) to predict the parameters of a hyponetwork (yellow trapezoid in Fig. 8). The hyponetwork takes the concatenation of the goal coordinates as well as the query position coordinates and outputs the reaching distance between them. The hypernetwork includes 11 convolutional layers followed by 7 fully-connected layers. The hyponetwork contains 7 fully-connected layers, each of which is followed by a periodic activation as in (Sitzmann et al., 2020). A comparisons between the hypernetwork architecture and the proposed context-aligned implicit function can be found in Section 5.2.
+
+
+Figure 8: Hypernetwork architecture. Blue trapezoid is the hypernetwork that predicts the parameters of the hyponetwork (the yellow trapezoid).
+
+# C.2 TRAJECTORY SEARCHING IN 2D MAZES
+
+The agent in a 2D maze may be stuck at a location during the trajectory searching process. To resolve this issue, we sample from all possible locations in the next step, instead of directly taking the one with the smallest reaching distance. Specifically, for all eight possible directions, we compute a probability vector formed as the inverse of their reaching distance. We treat this probability vector as a multinomial probability distribution and sample one direction out of eight.
+
+# C.3 TRAJECTORY SEARCHING IN THE BIRD'S EYE VIEW
+
+Multiple humans navigation. Here we summarize the algorithm to navigate multiple humans simultaneously while avoiding collision with objects or other humans, as discussed in Section 4.1. As shown in Algorithm 1, for each human $i$ at each time step $t$ , we mark the current positions of other humans $j$ as obstacles and search the optimal step based on the modified scene environment. We denote the total step number as $T$ and total human number as $H$ .
+
+Algorithm 1 Multiple humans navigation.
+```txt
+$t\gets 1$ $i\gets 1$ $j\gets 1$
+while $t\leq T$ do while $i\leq H$ do Initialize scene environment while $j\leq H$ do if $i\neq j$ then Mark the position of human $j$ as an obstacle end if end while Predict environment field for human $i$ w.r.t the modified scene environment Search next optimal step for human i
+end while
+end while
+```
+
+Aligning walking sequence to searched trajectories. As discussed in Section 4.1, we align a random human walking sequence from the SURREAL dataset (Varol et al., 2017) to the searched trajectory from the bird's eye view. We show this process in Fig. 9. At each step, we compute the angle $\theta$ between the human torso displacement (red arrow) and the trajectory's tangent (green arrow). The human pose is then rotated by $\theta$ to align with the trajectory's direction.
+
+
+Figure 9: Aligned walking sequence to searched trajectory. The figure is for visualization purposes only. The human takes a much smaller step in reality.
+
+# C.4 TRAJECTORY SEARCHING IN 3D INDOOR ENVIRONMENT
+
+Aligning pose sequence to searched trajectories. Given the predicted trajectory in a 3D room (see Section 4.2), we align a random walking or getting-up pose sequence from the SAMP dataset (Hassan et al., 2021) onto the trajectory. The alignment process of a walking sequence is the same as in the bird's eye view scenario discussed in Section C.3. While for the getting-up pose sequence, we first translate each pose by moving its torso onto the predicted trajectory. To enforce the poses to be well afforded by its surroundings, we adjust it by rotating within [-6, 6] degrees and choose the angle with the best affordance (i.e. with the most joints well supported and collision-free). Note that the fitting process is the same for trajectories predicted by our method and the baseline method (Cao et al., 2020) for fair comparisons.
+
+# C.5 NETWORK TRAINING
+
+In this work, instead of using the raw reaching distance computed by FMM as supervision to learn the implicit function, we make two changes: (a) We use the reciprocal of the reaching distance from the feasible point to the goal and normalize it to $[0,1]$ . (b) We encourage the implicit function to predict negative one instead of a extremely small values for locations occupied by obstacles. In this way, the network can better differentiate feasible locations and obstacles.
+
+During the training of the VAE model discussed in Section 4.2, besides the points on the training human trajectories, we also augment more points in the room. Specifically, we use a random standing human pose and include all locations that can afford this pose, i.e., the pose can be supported by the floor and does not collide with other objects.
+
+We learn a single conditional VAE model for all training trajectories in different scenes as in (Cao et al., 2020), while a separate implicit function is trained for each 3D indoor scene. All models introduced in this paper are trained with the Adam solver (Kingma & Ba, 2014) using a learning rate of $5 \times 10^{-5}$ . We implement the proposed method in the PyTorch framework (Paszke et al., 2019).
+
+# C.6 PATH PLANNING BY RRT AND PRM
+
+
+(a) Road map built by PRM
+
+
+(b) Tree searched by RRT
+Figure 10: Visualization of path planning by RRT (Bry & Roy, 2011) and PRM (Kavraki et al., 1996). Ground-truth trajectories are colored in red.
+
+For path planning, the RRT (Bry & Roy, 2011) method starts from a given point and builds a tree by adding randomly sampled collision-free points to the tree until one branch of the tree reaches close to the goal. Instead, the PRM (Kavraki et al., 1996) first samples a set of collision-free points in the space and builds a map by establishing edges wherever possible. It then searches a trajectory from a given point to the goal using the Dijkstra's algorithm (Dijkstra, 1959). Both these methods are less efficient than the proposed method due to the randomness in the sampling process. As shown in Fig. 10, the two methods build a large road map or tree even when searching for a short trajectory (green circles). On the contrary, the proposed method efficiently computes the next optimal step with one network forward pass and thus is more efficient. A quantitative comparison can be found in Table 3.
+
+# D EXPERIMENTAL RESULTS
+
+# D.1 MORE 2D MAZE NAVIGATION RESULTS
+
+In Fig. 11, we show more results of agent navigation in 2D mazes as well as learned environment fields. As discussed in Section 5.2, the learned environment field successfully captures the reaching distance from any point to the goal (see Fig. 11(b)&(c)) and effectively guides the agent from the starting position to the goal in Fig. 11(a).
+
+# D.2 DATA-DRIVEN HUMAN MOTION MODELING
+
+In Fig. 13, we show more results of fitting given human pose sequences to searched trajectories in 3D indoor environments.
+
+As discussed in Section 4.2, given a human pose sequence, we compute the step size of the human at each time step and dynamically determine the best next move w.r.t the step size. We also utilize the given human pose to avoid moving humans to locations that violate physical constraints in the room, i.e., locations that cannot well support the human or lead to collision with other objects.
+
+# D.3 FAILURE CASES
+
+Since we only focus on predicting human trajectories using the learned environment field in this work, we fit a given random pose sequence onto the predicted trajectory rather than model human
+
+
+(a) Paths
+
+
+(b) Learned level set
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 11: Grid-world maze navigation results.
+
+
+Figure 12: Failure cases.
+
+
+
+pose distribution. Although we assume the action of the given human pose sequence is consistent with the start and goal position (e.g. fit a getting-up sequence to a trajectory ending at a sofa's surface), however, the given pose sequence may still not well suite for the scene. For instance, The red circle shown in Fig. 12 demonstrates a failure case where the human collides with the floor. This collision is mainly caused by the fact that the given "getting-up" sequence does not suite the height of the sofa. We believe a possible solution is to further utilize the environment field to predict human poses besides trajectories. We leave further exploration along this line to future works.
+
+# D.4 TRAJECTORY IN 3D SCENES VISUALIZATION
+
+In Fig. 14, we visualize the trajectories searched by our method and the baseline method Cao et al. (2020). As shown in the figure, our method produces trajectories that include less noise and align better with the ground truth trajectories better.
+
+
+Time
+Figure 13: Dynamic human motion modeling on PROX (Hassan et al., 2019). We highly recommend viewing the accompanying video for dynamic visualizations.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 14: Trajectory visualization in 3D scenes. The ground truth trajectory, the trajectory searched by HMP Cao et al. (2020) and the trajectory searched by our algorithm are shown in red, blue and green.
+
+
+
+
\ No newline at end of file
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/images.zip b/learningcontinuousenvironmentfieldsviaimplicitfunctions/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..80e232025c597eb101a4d61cb20aed39e6a92c72
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4cfdd48171841bd55a44197d87ba8570dcbad30ef53281439c29089b75f8ad57
+size 907203
diff --git a/learningcontinuousenvironmentfieldsviaimplicitfunctions/layout.json b/learningcontinuousenvironmentfieldsviaimplicitfunctions/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..46820329c35e52ce17839dcfd7e802f9751bbce2
--- /dev/null
+++ b/learningcontinuousenvironmentfieldsviaimplicitfunctions/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6893cef939de2a2af42a7c6b0dfda2af1ecc12dbbf090d7d3c5a9578de68893c
+size 556391
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_content_list.json b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..569c1a45381ef581db9c33ea07d16efa08a5bcea
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3aa83e44dbb4d282589a26cf8474c6df604a13937d4eff9b80eb98bb5a39b9a2
+size 454482
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_model.json b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8deb768b5eec9392df4934daec0d34234a0f0ac9
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb1d55c7038e8fb93af9c6c05a62f308ca74acafac5460b50dc3fcec7b7858d4
+size 497293
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_origin.pdf b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..2c558d1b92c113e56452a14f1fedff5480c2e605
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/c67ed6a5-78de-448f-a08b-3557a9d6ebe7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2b98a45794ea135729b2a577cff9007b4bebd5ef05198b0f2ab79426936bea7
+size 1694573
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/full.md b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7425dd73c6b56d2ebae914859a9d926b970d3624
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/full.md
@@ -0,0 +1,2080 @@
+# LEARNING CURVES FOR GAUSSIAN PROCESS REGRESSION WITH POWER-LAW PRIORS AND TARGETS
+
+Hui Jin
+
+UCLA
+
+huijin@ucla.edu
+
+Pradeep Kr. Banerjee
+
+MPI MiS
+
+pradeep@misp.mpg.de
+
+Guido Montúfar
+
+UCLA & MPI MiS
+
+montufar@math.ucla.edu
+
+# ABSTRACT
+
+We characterize the power-law asymptotics of learning curves for Gaussian process regression (GPR) under the assumption that the eigenspectrum of the prior and the eigenexpansion coefficients of the target function follow a power law. Under similar assumptions, we leverage the equivalence between GPR and kernel ridge regression (KRR) to show the generalization error of KRR. Infinitely wide neural networks can be related to GPR with respect to the neural network GP kernel and the neural tangent kernel, which in several cases is known to have a power-law spectrum. Hence our methods can be applied to study the generalization error of infinitely wide neural networks. We present toy experiments demonstrating the theory.
+
+# 1 INTRODUCTION
+
+Gaussian processes (GPs) provide a flexible and interpretable framework for learning and adaptive inference, and are widely used for constructing prior distributions in non-parametric Bayesian learning. From an application perspective, one crucial question is how fast do GPs learn, i.e., how much training data is needed to achieve a certain level of generalization performance. Theoretically, this is addressed by analyzing so-called "learning curves", which describe the generalization error as a function of the training set size $n$ . The rate at which the curve approaches zero determines the difficulty of learning tasks and conveys important information about the asymptotic performance of GP learning algorithms. In this paper, we study the learning curves for Gaussian process regression. Our main result characterizes the asymptotics of the generalization error in cases where the eigenvalues of the GP kernel and the coefficients of the eigenexpansion of the target function have a power-law decay. In the remainder of this introductory section, we review related work and outline our main contributions.
+
+Gaussian processes A GP model is a probabilistic model on an infinite-dimensional parameter space (Williams and Rasmussen, 2006; Orbanz and Teh, 2010). In GP regression (GPR), for example, this space can be the set of all continuous functions. Assumptions about the learning problem are encoded by way of a prior distribution over functions, which gets transformed into a posterior distribution given some observed data. The mean of the posterior is then used for prediction. The model uses only a finite subset of the available parameters to explain the data and this subset can grow arbitrarily large as more data are observed. In this sense, GPs are "non-parametric" and contrast with parametric models, where there is a fixed number of parameters. For regression with Gaussian noise, a major appeal of the GP formalism is that the posterior is analytically tractable. GPs are also one important part in learning with kernel machines (Kanagawa et al., 2018) and modeling using GPs has recently gained considerable traction in the neural network community.
+
+Neural networks and kernel learning From a GP viewpoint, there exists a well known correspondence between kernel methods and infinite neural networks (NNs) first studied by Neal (1996). Neal showed that the outputs of a randomly initialized one-hidden layer neural network (with appropriate scaling of the variance of the initialization distribution) converges to a GP over functions in the limit of an infinite number of hidden units. Follow-up work extended this correspondence with analytical expressions for the kernel covariance for shallow NNs by Williams (1997), and more recently for deep fully-connected NNs (Lee et al., 2018; de G. Matthews et al., 2018), convolutional NNs with many channels (Novak et al., 2019; Garriga-Alonso et al., 2019), and more general architectures (Yang, 2019). The correspondence enables exact Bayesian inference in the associated GP model for
+
+infinite-width NNs on regression tasks and has led to some recent breakthroughs in our understanding of overparameterized NNs (Jacot et al., 2018; Lee et al., 2019; Arora et al., 2019; Belkin et al., 2018; Daniely et al., 2016; Yang and Salman, 2019; Bietti and Mairal, 2019). The most prominent kernels associated with infinite-width NNs are the Neural Network Gaussian Process (NNGP) kernel (Lee et al., 2018; de G. Matthews et al., 2018), and the Neural Tangent Kernel (NTK) (Jacot et al., 2018). Empirical studies have shown that inference with such infinite network kernels is competitive with standard gradient descent-based optimization for fully-connected architectures (Lee et al., 2020).
+
+Learning curves A large-scale empirical characterization of the generalization performance of state-of-the-art deep NNs showed that the associated learning curves often follow a power law of the form $n^{-\beta}$ with the exponent $\beta$ ranging between 0.07 and 0.35 depending on the data and the algorithm (Hestness et al., 2017; Spigler et al., 2020). Power-law asymptotics of learning curves have been theoretically studied in early works for the Gibbs learning algorithm (Amari et al., 1992; Amari and Murata, 1993; Haussler et al., 1996) that showed a generalization error scaling with exponent $\beta = 0.5$ , 1 or 2 under certain assumptions. More recent results from statistical learning theory characterize the shape of learning curves depending on the properties of the hypothesis class (Bousquet et al., 2021). In the context of GPs, approximations and bounds on learning curves have been investigated in several works (Sollich, 1999; Sollich and Halees, 2002; Sollich, 2001; Opper and Vivarelli, 1999; Opper and Malzahn, 2002; Williams and Vivarelli, 2000; Malzahn and Opper, 2001a;b; Seeger et al., 2008; Van Der Vaart and Van Zanten, 2011; Le Gratiet and Garnier, 2015), with recent extensions to kernel regression from a spectral bias perspective (Bordelon et al., 2020; Canatar et al., 2021). For a review on learning curves in relation to its shape and monotonicity, see Loog et al. (2019); Viering et al. (2019); Viering and Loog (2021). A related but complementary line of work studies the convergence rates and posterior consistency properties of Bayesian non-parametric models (Barron, 1998; Seeger et al., 2008; Van Der Vaart and Van Zanten, 2011).
+
+Power-law decay of the GP kernel eigenspectrum The rate of decay of the eigenvalues of the GP kernel conveys important information about its smoothness. Intuitively, if a process is "rough" with more power at high frequencies, then the eigenspectrum decays more slowly. On the other hand, kernels that define smooth processes have a fast-decaying eigenspectrum (Stein, 2012; Williams and Rasmussen, 2006). The precise eigenvalues $(\lambda_p)_{p\geq 1}$ of the operators associated to many kernels and input distributions are not known explicitly, except for a few special cases (Williams and Rasmussen, 2006). Often, however, the asymptotic properties are known. The asymptotic rate of decay of the eigenvalues of stationary kernels for input distributions with bounded support is well understood (Widom, 1963; Ritter et al., 1995). Ronen et al. (2019) showed that for inputs distributed uniformly on a hypersphere, the eigenfunctions of the arc-cosine kernel are spherical harmonics and the eigenvalues follow a power-law decay. The spectral properties of the NTK are integral to the analysis of training convergence and generalization of NNs, and several recent works empirically justify and rely on a power law assumption for the NTK spectrum (Bahri et al., 2021; Canatar et al., 2021; Lee et al., 2020; Nitanda and Suzuki, 2021). Velikanov and Yarotsky (2021) showed that the asymptotics of the NTK of infinitely wide shallow ReLU networks follows a power-law that is determined primarily by the singularities of the kernel and has the form $\lambda_p \propto p^{-\alpha}$ with $\alpha = 1 + \frac{1}{d}$ , where $d$ is the input dimension.
+
+Asymptotics of the generalization error of kernel ridge regression (KRR) There is a well known equivalence between GPR and KRR with the additive noise in GPR playing the role of regularization in KRR (Kanagawa et al., 2018). Analysis of the decay rates of the excess generalization error of KRR has appeared in several works, e.g. in the noiseless case with constant regularization (Bordelon et al., 2020; Spigler et al., 2020; Jun et al., 2019), and the noisy optimally regularized case (Caponnetto and De Vito, 2007; Steinwart et al., 2009; Fischer and Steinwart, 2020) under the assumption that the kernel eigenspectrum, and the eigenexpansion coefficients of the target function follow a power law. These assumptions, which are often called resp. the capacity and source conditions are related to the effective dimension of the problem and the difficulty of learning the target function (Caponnetto and De Vito, 2007; Blanchard and Mücke, 2018). Cui et al. (2021) present a unifying picture of the excess error decay rates under the capacity and source conditions in terms of the interplay between noise and regularization illustrating their results with real datasets.
+
+Contributions In this work, we characterize the asymptotics of the generalization error of GPR and KRR under the capacity and source conditions. Our main contributions are as follows:
+
+- When the eigenspectrum of the prior decays with rate $\alpha$ and the eigenexpansion coefficients of the target function decay with rate $\beta$ , we show that with high probability over the draw of $n$ input samples, the negative log-marginal likelihood behaves as $\Theta(n^{\max\left\{\frac{1}{\alpha}, \frac{1 - 2\beta}{\alpha} + 1\right\}})$ (Theorem 7) and the generalization error behaves as $\Theta(n^{\max\left\{\frac{1}{\alpha} - 1, \frac{1 - 2\beta}{\alpha}\right\}})$ (Theorem 9). In the special case that the model is correctly specified, i.e., the GP prior is the true one from which the target functions are actually generated, our result implies that the generalization error behaves as $O(n^{\frac{1}{\alpha} - 1})$ recovering as a special case a result due to Sollich and Halees (2002) (vide Remark 10).
+- Under similar assumptions as in the previous item, we leverage the equivalence between GPR and KRR to show that the excess generalization error of KRR behaves as $\Theta (n^{\max \left\{\frac{1}{\alpha} - 1, \frac{1 - 2\beta}{\alpha}\right\}})$ (Theorem 12). In the noiseless case with constant regularization, our result implies that the generalization error behaves as $\Theta (n^{\frac{1 - 2\beta}{\alpha}})$ recovering as a special case a result due to Bordelon et al. (2020). Specializing to the case of KRR with Gaussian design, we recover as a special case a result due to Cui et al. (2021) (vide Remark 14).
+
+For the unrealizable case, i.e., when the target function is outside the span of the eigenfunctions with positive eigenvalues, we show that the generalization error converges to a constant.
+
+- We present a few toy experiments demonstrating the theory for GPR with arc-cosine kernel without biases (resp. with biases) which is the conjugate kernel of an infinitely wide shallow network with two inputs and one hidden layer without biases (resp. with biases) (Cho and Saul, 2009; Ronen et al., 2019).
+
+# 2 BAYESIAN LEARNING AND GENERALIZATION ERROR FOR GPS
+
+In GP regression, our goal is to learn a target function $f: \Omega \mapsto \mathbb{R}$ between an input $x \in \Omega$ and output $y \in \mathbb{R}$ based on training samples $D_{n} = \{(x_{i},y_{i})\}_{i=1}^{n}$ . We consider an additive noise model $y_{i} = f(x_{i}) + \epsilon_{i}$ , where $\epsilon_{i} \stackrel{\text{i.i.d.}}{\sim} \mathcal{N}(0,\sigma_{\text{true}}^{2})$ . If $\rho$ denotes the marginal density of the inputs $x_{i}$ , then the pairs $(x_{i},y_{i})$ are generated according to the density $q(x,y) = \rho(x)q(y|x)$ , where $q(y|x) = \mathcal{N}(y|f(x),\sigma_{\text{true}}^{2})$ . We assume that there is a prior distribution $\Pi_0$ on $f$ which is defined as a zero-mean GP with continuous and bounded covariance function $k:\Omega \times \Omega \to \mathbb{R}$ , i.e., $f \sim \mathcal{GP}(0,k)$ . This means that for any finite set $\mathbf{x} = (x_{1},\dots,x_{n})^{T}$ , the random vector $f(\mathbf{x}) = (f(x_{1}),\dots,f(x_{n}))^{T}$ follows the multivariate normal distribution $\mathcal{N}(0,K_n)$ with covariance matrix $K_{n} = (k(x_{i},x_{j}))_{i,j=1}^{n} \in \mathbb{R}^{n\times n}$ . By Bayes' rule, the posterior distribution over $f$ given the training data is given by
+
+$$
+d \Pi_ {n} (f | D _ {n}) = \frac {1}{Z (D _ {n})} \prod_ {i = 1} ^ {n} \mathcal {N} (y _ {i} | f (x _ {i}), \sigma_ {\mathrm {m o d e l}} ^ {2}) d \Pi_ {0} (f),
+$$
+
+where $\Pi_0$ is the prior distribution, $Z(D_{n}) = \int \prod_{i = 1}^{n}\mathcal{N}(y_{i}|f(x_{i}),\sigma_{\mathrm{model}}^{2})d\Pi_{0}(f)$ is the marginal likelihood or model evidence and $\sigma_{\mathrm{model}}$ is the sample variance used in GPR. In practice, we do not know the exact value of $\sigma_{\mathrm{true}}$ and so our choice of $\sigma_{\mathrm{model}}$ can be different from $\sigma_{\mathrm{true}}$ . The GP prior and the Gaussian noise assumption allows for exact Bayesian inference and the posterior distribution over functions is again a GP with mean and covariance function given by
+
+$$
+\bar {m} (x) = K _ {\mathbf {x} x} ^ {T} \left(K _ {n} + \sigma_ {\text {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} \mathbf {y}, x \in \Omega \tag {1}
+$$
+
+$$
+\bar {k} (x, x ^ {\prime}) = k (x, x ^ {\prime}) - K _ {\mathbf {x} x} ^ {T} \left(K _ {n} + \sigma_ {\mathrm {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} K _ {\mathbf {x} x ^ {\prime}}, x, x ^ {\prime} \in \Omega , \tag {2}
+$$
+
+where $K_{\mathbf{x}x} = (k(x_1,x),\dots,k(x_n,x))^T$ and $\mathbf{y} = (y_1,\dots,y_n)^T \in \mathbb{R}^n$ (Williams and Rasmussen, 2006, Eqs. 2.23-24).
+
+The performance of GPR depends on how well the posterior approximates $f$ as the number of training samples $n$ tends to infinity. The distance of the posterior to the ground truth can be measured in various ways. We consider two such measures, namely the Bayesian generalization error (Seeger et al., 2008; Haussler and Opper, 1997; Opper and Vivarelli, 1999) and the excess mean squared error (Sollich and Halees, 2002; Le Gratiet and Garnier, 2015; Bordelon et al., 2020; Cui et al., 2021).
+
+Definition 1 (Bayesian generalization error). The Bayesian generalization error is defined as the Kullback-Leibler divergence between the true density $q(y|x)$ and the Bayesian predictive density $p_n(y|x, D_n) = \int \mathcal{N}(y|f(x), \sigma_{\mathrm{model}}^2) d\Pi_n(f|D_n)$ ,
+
+$$
+G \left(D _ {n}\right) = \int q (x, y) \log \frac {q (y \mid x)}{p _ {n} (y \mid x , D _ {n})} d x d y. \tag {3}
+$$
+
+A related quantity of interest is the stochastic complexity (SC), also known as the free energy, which is just the negative log-marginal likelihood. We shall primarily be concerned with a normalized version of the stochastic complexity which is defined as follows:
+
+$$
+F ^ {0} (D _ {n}) = - \log \frac {Z (D _ {n})}{\prod_ {i = 1} ^ {n} q \left(y _ {i} \mid x _ {i}\right)} = - \log \frac {\int \prod_ {i = 1} ^ {n} \mathcal {N} \left(y _ {i} \mid f \left(x _ {i}\right) , \sigma_ {\text {m o d e l}} ^ {2}\right) d \Pi_ {0} (f)}{\prod_ {i = 1} ^ {n} q \left(y _ {i} \mid x _ {i}\right)}. \tag {4}
+$$
+
+The generalization error (3) can be expressed in terms of the normalized SC as follows (Watanabe, 2009, Theorem 1.2):
+
+$$
+G \left(D _ {n}\right) = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} F ^ {0} \left(D _ {n + 1}\right) - F ^ {0} \left(D _ {n}\right), \tag {5}
+$$
+
+where $D_{n + 1} = D_n\cup \{(x_{n + 1},y_{n + 1})\}$ is obtained by augmenting $D_{n}$ with a test point $(x_{n + 1},y_{n + 1})$
+
+If we only wish to measure the performance of the mean of the Bayesian posterior, then we can use the excess mean squared error:
+
+Definition 2 (Excess mean squared error). The excess mean squared error is defined as
+
+$$
+M (D _ {n}) = \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} (\bar {m} (x _ {n + 1}) - y _ {n + 1}) ^ {2} - \sigma_ {\mathrm {t r u e}} ^ {2} = \mathbb {E} _ {x _ {n + 1}} (\bar {m} (x _ {n + 1}) - f (x _ {n + 1})) ^ {2}. \qquad (6)
+$$
+
+Proposition 3 (Normalized stochastic complexity for GPR). Assume that $\sigma_{\mathrm{model}}^2 = \sigma_{\mathrm{true}}^2 = \sigma^2$ . The normalized $SCF^0(D_n)$ (4) for GPR with prior $\mathcal{GP}(0,k)$ is given as
+
+$$
+F ^ {0} (D _ {n}) = \frac {1}{2} \log \det \left(I _ {n} + \frac {K _ {n}}{\sigma^ {2}}\right) + \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \left(I _ {n} + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} \mathbf {y} - \frac {1}{2 \sigma^ {2}} (\mathbf {y} - f (\mathbf {x})) ^ {T} (\mathbf {y} - f (\mathbf {x})), \tag {7}
+$$
+
+where $\epsilon = (\epsilon_{1},\dots,\epsilon_{n})^{T}$ . The expectation of the normalized SC w.r.t. the noise $\epsilon$ is given as
+
+$$
+\mathbb {E} _ {\epsilon} F ^ {0} (D _ {n}) = \frac {1}{2} \log \det \left(I _ {n} + \frac {K _ {n}}{\sigma^ {2}}\right) - \frac {1}{2} \operatorname {T r} \left(I _ {n} - \left(I _ {n} + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1}\right) + \frac {1}{2 \sigma^ {2}} f (\mathbf {x}) ^ {T} \left(I _ {n} + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}). \tag {8}
+$$
+
+This is a basic result and has applications in relation to model selection in GPR (Williams and Rasmussen, 2006). For completeness, we give a proof of Proposition 3 in Appendix B. Seeger et al. (2008, Theorem 1) gave an upper bound on the normalized stochastic complexity for the case when $f$ lies in the reproducing kernel Hilbert space (RKHS) of the GP prior. It is well known, however, that sample paths of GP almost surely fall outside the corresponding RKHS (Van Der Vaart and Van Zanten, 2011) limiting the applicability of the result.
+
+We next derive the asymptotics of $\mathbb{E}_{\epsilon}F^{0}(D_{n})$ , the expected generalization error $\mathbb{E}_{\epsilon}G(D_n) = \mathbb{E}_{\epsilon}\mathbb{E}_{(x_{n + 1},y_{n + 1})}F^{0}(D_{n} + 1) - \mathbb{E}_{\epsilon}F^{0}(D_{n})$ , and the excess mean squared error $\mathbb{E}_{\epsilon}M(D_{n})$ .
+
+# 3 ASYMPTOTIC ANALYSIS OF GP REGRESSION WITH POWER-LAW PRIORS
+
+We begin by introducing some notations and assumptions. We assume that $f \in L^{2}(\Omega, \rho)$ . By the generalization of Mercer's theorem (Steinwart and Scovel, 2012, Corollary 3.2), the covariance function of the GP prior can be decomposed as $k(x_{1}, x_{2}) = \sum_{p=1}^{\infty} \lambda_{p} \phi_{p}(x_{1}) \phi_{p}(x_{2}) \rho$ -almost surely, where $(\phi_{p}(x))_{p \geq 1}$ are the eigenfunctions of the operator $L_{k}: L^{2}(\Omega, \rho) \mapsto L^{2}(\Omega, \rho)$ ; $(L_{k}f)(x) = \int_{\Omega} k(x,s)f(s)\mathrm{d}\rho(s)$ , and $(\lambda_{p})_{p \geq 1}$ are the corresponding positive eigenvalues. We index the sequence of eigenvalues in decreasing order, that is $\lambda_{1} \geq \lambda_{2} \geq \dots > 0$ . The target function $f(x)$ is decomposed into the orthonormal set $(\phi_{p}(x))_{p \geq 1}$ and its orthogonal complement $\{ \phi_{p}(x): p \geq 1 \}^{\perp}$ as
+
+$$
+f (x) = \sum_ {p = 1} ^ {\infty} \mu_ {p} \phi_ {p} (x) + \mu_ {0} \phi_ {0} (x) \in L ^ {2} (\Omega , \rho), \tag {9}
+$$
+
+where $\pmb{\mu} = (\mu_0, \mu_1, \dots, \mu_p, \dots)^T$ are the coefficients of the decomposition, and $\phi_0(x)$ satisfies $\| \phi_0(x) \|_2 = 1$ and $\phi_0(x) \in \{\phi_p(x) : p \geq 1\}^\perp$ . For given sample inputs $\mathbf{x}$ , let $\phi_p(\mathbf{x}) = (\phi_p(x_1), \dots, \phi_p(x_n))^T$ , $\Phi = (\phi_0(\mathbf{x}), \phi_1(\mathbf{x}), \dots, \phi_p(\mathbf{x}), \dots)$ and $\Lambda = \mathrm{diag}\{0, \lambda_1, \dots, \lambda_p, \dots\}$ . Then the covariance matrix $K_n$ can be written as $K_n = \Phi \Lambda \Phi^T$ , and the function values on the sample inputs can be written as $f(\mathbf{x}) = \Phi \pmb{\mu}$ .
+
+We shall make the following assumptions in order to derive the power-law asymptotics of the normalized stochastic complexity and the generalization error of GPR:
+
+Assumption 4 (Power law decay of eigenvalues). The eigenvalues $(\lambda_p)_{p\geq 1}$ follow the power law
+
+$$
+\underline {{C}} _ {\lambda} p ^ {- \alpha} \leq \lambda_ {p} \leq \overline {{C _ {\lambda}}} p ^ {- \alpha}, \forall p \geq 1 \tag {10}
+$$
+
+where $\underline{C}_{\lambda}, \overline{C_{\lambda}}$ and $\alpha$ are three positive constants which satisfy $0 < \underline{C}_{\lambda} \leq \overline{C_{\lambda}}$ and $\alpha > 1$ .
+
+As mentioned in the introduction, this assumption, called the capacity condition, is fairly standard in kernel learning and is adopted in many recent works (Bordelon et al., 2020; Canatar et al., 2021; Jun et al., 2019; Bietti et al., 2021; Cui et al., 2021). Velikanov and Yarotsky (2021) derived the exact value of the exponent $\alpha$ when the kernel function has a homogeneous singularity on its diagonal, which is the case for instance for the arc-cosine kernel.
+
+Assumption 5 (Power law decay of coefficients of decomposition). Let $C_{\mu}, \underline{C_{\mu}} > 0$ and $\beta > 1/2$ be positive constants and let $\{p_i\}_{i \geq 1}$ be an increasing integer sequence such that $\sup_{i \geq 1} (p_{i+1} - p_i) < \infty$ . The coefficients $(\mu_p)_{p \geq 1}$ of the decomposition (9) of the target function follow the power law
+
+$$
+\left| \mu_ {p} \right| \leq C _ {\mu} p ^ {- \beta}, \forall p \geq 1 \quad a n d \quad \left| \mu_ {p _ {i}} \right| \geq \underline {{C _ {\mu}}} p _ {i} ^ {- \beta}, \forall i \geq 1. \tag {11}
+$$
+
+Since $f \in L^{2}(\Omega, \rho)$ , we have $\sum_{p=0}^{\infty} \mu_p^2 < \infty$ . The condition $\beta > 1/2$ in Assumption 5 ensures that the sum $\sum_{p=0}^{\infty} \mu_p^2$ does not diverge. When the orthonormal basis $(\phi_p(x))_p$ is the Fourier basis or the spherical harmonics basis, the coefficients $(\mu_p)_p$ decay at least as fast as a power law so long as the target function $f(x)$ satisfies certain smoothness conditions (Bietti and Mairal, 2019). Velikanov and Yarotsky (2021) gave examples of some natural classes of functions for which Assumption 5 is satisfied, such as functions that have a bounded support with smooth boundary and are smooth on the interior of this support, and derived the corresponding exponents $\beta$ .
+
+Assumption 6 (Boundedness of eigenfunctions). The eigenfunctions $(\phi_p(x))_{p\geq 0}$ satisfy
+
+$$
+\left\| \phi_ {0} \right\| _ {\infty} \leq C _ {\phi} \quad a n d \quad \left\| \phi_ {p} \right\| _ {\infty} \leq C _ {\phi} p ^ {\tau}, p \geq 1, \tag {12}
+$$
+
+where $C_{\phi}$ and $\tau$ are two positive constants which satisfy $\tau < \frac{\alpha - 1}{2}$ .
+
+The second condition in (12) appears, for example, in Valdivia (2018, Hypothesis $\mathrm{H}_1$ ) and is less restrictive than the assumption of uniformly bounded eigenfunctions that has appeared in several other works in the GP literature, see, e.g., Braun (2006); Chatterji et al. (2019); Vakili et al. (2021).
+
+Define
+
+$$
+T _ {1} \left(D _ {n}\right) = \frac {1}{2} \log \det \left(I _ {n} + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) - \frac {1}{2} \operatorname {T r} \left(I _ {n} - \left(I _ {n} + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right), \tag {13}
+$$
+
+$$
+T _ {2} \left(D _ {n}\right) = \frac {1}{2 \sigma^ {2}} f (\mathbf {x}) ^ {T} \left(I _ {n} + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}), \tag {14}
+$$
+
+$$
+G _ {1} (D _ {n}) = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(T _ {1} \left(D _ {n + 1}\right) - T _ {1} \left(D _ {n}\right)\right), \tag {15}
+$$
+
+$$
+G _ {2} (D _ {n}) = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(T _ {2} \left(D _ {n + 1}\right) - T _ {2} \left(D _ {n}\right)\right). \tag {16}
+$$
+
+Using (8) and (5), we have $\mathbb{E}_{\epsilon}F^{0}(D_{n}) = T_{1}(D_{n}) + T_{2}(D_{n})$ and $\mathbb{E}_{\epsilon}G(D_n) = G_1(D_n) + G_2(D_n)$ . Intuitively, $G_{1}$ corresponds to the effect of the noise on the generalization error irrespective of the target function $f$ , whereas $G_{2}$ corresponds to the ability of the model to fit the target function. As we will see next in Theorems 9 and 11, if $\alpha$ is large, then the error associated with the noise is smaller. When $f$ is contained in the span of the eigenfunctions $\{\phi_p\}_{p\geq 1}$ , $G_{2}$ decreases with increasing $n$ , but if $f$ contains an orthogonal component, then the error remains constant and GP regression is not able to learn the target function.
+
+# 3.1 ASYMPTOTICS OF THE NORMALIZED STOCHASTIC COMPLEXITY
+
+We derive the asymptotics of the normalized SC (8) for the following two cases: $\mu_0 = 0$ and $\mu_0 > 0$ . When $\mu_0 = 0$ , the target function $f(x)$ lies in the span of all eigenfunctions with positive eigenvalues.
+
+Theorem 7 (Asymptotics of the normalized SC, $\mu_0 = 0$ ). Assume that $\mu_0 = 0$ and $\sigma_{\mathrm{model}}^2 = \sigma_{\mathrm{true}}^2 = \sigma^2 = \Theta(1)$ . Under Assumptions 4, 5 and 6, with probability of at least $1 - n^{-q}$ over sample inputs $(x_i)_{i=1}^n$ , where $0 \leq q < \min\{\frac{(2\beta - 1)(\alpha - 1 - 2\tau)}{4\alpha^2}, \frac{\alpha - 1 - 2\tau}{2\alpha}\}$ , the expected normalized SC (8) has the asymptotic behavior:
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} F ^ {0} (D _ {n}) = \left[ \frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1}\right) + \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} \right] (1 + o (1)) \\ = \Theta \left(n ^ {\max \left\{\frac {1}{\alpha}, \frac {1 - 2 \beta}{\alpha} + 1 \right\}}\right). \tag {17} \\ \end{array}
+$$
+
+The complete proof of Theorem 7 is given in Appendix D.1. We give a sketch of the proof below. In the sequel, we use the notations $\mathcal{O}$ and $\Theta$ to denote the standard mathematical orders and the notation $\tilde{\mathcal{O}}$ to suppress logarithmic factors.
+
+Proof sketch of Theorem 7. By (8), (13) and (14) we have $\mathbb{E}_{\epsilon}F^{0}(D_{n}) = T_{1}(D_{n}) + T_{2}(D_{n})$ . In order to analyze the terms $T_{1}(D_{n})$ and $T_{2}(D_{n})$ , we will consider truncated versions of these quantities and bound the corresponding residual errors. Given a truncation parameter $R \in \mathbb{N}$ , let $\Phi_R = (\phi_0(\mathbf{x}), \phi_1(\mathbf{x}), \dots, \phi_R(\mathbf{x})) \in \mathbb{R}^{n \times R}$ be the truncated matrix of eigenfunctions evaluated at the data points, $\Lambda_R = \mathrm{diag}(0, \lambda_1, \dots, \lambda_R) \in \mathbb{R}^{(R+1) \times (R+1)}$ and $\pmb{\mu}_R = (\mu_0, \mu_1, \dots, \mu_R) \in \mathbb{R}^{R+1}$ . We define the truncated version of $T_{1}(D_{n})$ as follows:
+
+$$
+T _ {1, R} \left(D _ {n}\right) = \frac {1}{2} \log \det \left(I _ {n} + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) - \frac {1}{2} \operatorname {T r} \left(I _ {n} - \left(I _ {n} + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right). \tag {18}
+$$
+
+Similarly, define $\Phi_{>R} = (\phi_{R+1}(\mathbf{x}), \phi_{R+2}(\mathbf{x}), \dots, \phi_p(\mathbf{x}), \dots)$ , $\Lambda_{>R} = \mathrm{diag}(\lambda_{R+1}, \dots, \lambda_p, \dots)$ , $f_R(x) = \sum_{p=1}^{R} \mu_p \phi_p(x)$ , $f_R(\mathbf{x}) = (f_R(x_1), \dots, f_R(x_n))^T$ , $f_{>R}(x) = f(x) - f_R(x)$ , and $f_{>R}(\mathbf{x}) = (f_{>R}(x_1), \dots, f_{>R}(x_n))^T$ . The truncated version of $T_2(D_n)$ is then defined as
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \frac {1}{2 \sigma^ {2}} f _ {R} (\mathbf {x}) ^ {T} \left(I _ {n} + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) ^ {T}. \tag {19}
+$$
+
+The proof consists of three steps:
+
+- Approximation step: In this step, we show that the asymptotics of $T_{1,R}$ resp. $T_{2,R}$ dominate that of the residuals, $|T_{1,R}(D_n) - T_1(D_n)|$ resp. $|T_{2,R}(D_n) - T_2(D_n)|$ (see Lemma 32). This builds upon first showing that $\|\Phi_{>R}\Lambda_{>R}\Phi_{>R}^T\|_2 = \tilde{O}(\max\{nR^{-\alpha}, n^{\frac{1}{2}}R^{\frac{1 - 2\alpha}{2}}, R^{1 - \alpha}\})$ (see Lemma 25) and then choosing $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ when we have $\|\Phi_{>R}\Lambda_{>R}\Phi_{>R}^T\|_2 = o(1)$ . Intuitively, the choice of the truncation parameter $R$ is governed by the fact that $\lambda_R = \Theta(R^{-\alpha}) = n^{-1 + \kappa \alpha} = o(n^{-1})$ .
+- Decomposition step: In this step, we decompose $T_{1,R}$ into a term independent of $\Phi_R$ and a series involving $\Phi_R^T\Phi_R - nI_R$ , and likewise for $T_{2,R}$ (see Lemma 34). This builds upon first showing using the Woodbury matrix identity (Williams and Rasmussen, 2006, §A.3) that
+
+$$
+T _ {1, R} (D _ {n}) = \frac {1}{2} \log \det \left(I _ {R} + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) - \frac {1}{2} \operatorname {T r} \Phi_ {R} \left(\sigma^ {2} I _ {R} + \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T}, \tag {20}
+$$
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \Phi_ {R} \left(\sigma^ {2} I _ {R} + \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R}, \tag {21}
+$$
+
+and then Taylor expanding the matrix inverse $(\sigma^2 I_R + \Lambda_R\Phi_R^T\Phi_R)^{-1}$ in (20) and (21) to show that the $\Phi_R$ -independent terms in the decomposition of $T_{1,R}$ and $T_{2,R}$ are, respectively, $\frac{1}{2}\mathrm{logdet}(I_R + \frac{n}{\sigma^2}\Lambda_R) - \frac{1}{2}\mathrm{Tr}\big(I_R - \big(I_R + \frac{n}{\sigma^2}\Lambda_R\big)^{-1}\big)$ , and $\frac{n}{2\sigma^2}\pmb{\mu}_R^T (I_R + \frac{n}{\sigma^2}\Lambda_R)^{-1}\pmb{\mu}_R$
+
+- Concentration step: Finally, we use concentration inequalities to show that these $\Phi_R$ -independent terms dominate the series involving $\Phi_R^T\Phi_R - nI_R$ (see Lemma 35) when we have
+
+$$
+T _ {1, R} (D _ {n}) = \left(\frac {1}{2} \log \det \left(I _ {R} + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I _ {R} - \left(I _ {R} + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) (1 + o (1)) = \Theta \left(n ^ {\frac {1}{\alpha}}\right),
+$$
+
+$$
+T_{2,R}(D_{n}) = \bigl(\frac{n}{2\sigma^{2}}\boldsymbol{\mu}_{R}^{T}(I_{R} + \frac{n}{\sigma^{2}}\Lambda_{R})^{-1}\boldsymbol{\mu}_{R}\bigr)(1 + o(1))\\ = \left\{ \begin{array}{ll}\Theta (n^{\max \{0,\frac{1 - 2\beta}{\alpha} +1\}}, & \alpha \neq 2\beta -1,\\ \Theta (\log n), & \alpha = 2\beta -1. \end{array} \right.
+$$
+
+The key idea is to consider the matrix $\Lambda_R^{1/2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-1/2}\Phi_R^T\Phi_R(I + \frac{n}{\sigma^2}\Lambda_R)^{-1/2}\Lambda_R^{1/2}$ and show that it concentrates around $n\Lambda_R(I + \frac{n}{\sigma^2})^{-1}$ (see Corollary 22). Note that an ordinary application of the matrix Bernstein inequality to $\Phi_R^T\Phi_R - nI_R$ yields $\| \Phi_R^T\Phi_R - nI\|_2 = O(R\sqrt{n})$ , which is not sufficient for our purposes, since this would give $O(R\sqrt{n}) = o(n)$ only when $\alpha > 2$ . In contrast, our results are valid for $\alpha > 1$ and cover cases of practical interest, e.g., the NTK of infinitely wide shallow ReLU network (Velikanov and Yarotsky, 2021) and the arc-cosine kernels over high-dimensional hyperspheres (Ronen et al., 2019) that have $\alpha = 1 + O\left(\frac{1}{d}\right)$ , where $d$ is the input dimension.
+
+For $\mu_0 > 0$ , we note the following result:
+
+Theorem 8 (Asymptotics of the normalized SC, $\mu_0 > 0$ ). Assume $\mu_0 > 0$ and $\sigma_{\mathrm{model}}^2 = \sigma_{\mathrm{true}}^2 = \sigma^2 = \Theta(1)$ . Under Assumptions 4, 5 and 6, with probability of at least $1 - n^{-q}$ over sample inputs $(x_i)_{i=1}^n$ , where $0 \leq q < \min\{\frac{2\beta - 1}{2}, \alpha\} \cdot \min\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\}$ , the expected normalized SC (8) has the asymptotic behavior: $\mathbb{E}_{\epsilon} F^0(D_n) = \frac{1}{2\sigma^2} \mu_0^2 n + o(n)$ .
+
+The proof of Theorem 8 is given in Appendix D.1 and follows from showing that when $\mu_0 > 0$ , $T_{2,R}(D_n) = \left(\frac{n}{2\sigma^2}\pmb{\mu}_R^T (I_R + \frac{n}{\sigma^2}\Lambda_R)^{-1}\pmb {\mu}_R\right)(1 + o(1)) = \frac{1}{2\sigma^2}\mu_0^2 n + o(n)$ (see Lemma 38), which dominates $T_{1}(D_{n})$ and the residual $|T_{2,R}(D_n) - T_2(D_n)|$
+
+# 3.2 ASYMPTOTICS OF THE BAYESIAN GENERALIZATION ERROR
+
+In this section, we derive the asymptotics of the expected generalization error $\mathbb{E}_{\epsilon}G(D_n)$ by analyzing the asymptotics of the components $G_{1}(D_{n})$ and $G_{2}(D_{n})$ in resp. (15) and (16) for the following two cases: $\mu_0 = 0$ and $\mu_0 > 0$ . First, we consider the case $\mu_0 = 0$ .
+
+Theorem 9 (Asymptotics of the Bayesian generalization error, $\mu_0 = 0$ ). Let Assumptions 4, 5, and 6 hold. Assume that $\mu_0 = 0$ and $\sigma_{\mathrm{model}}^2 = \sigma_{\mathrm{true}}^2 = \sigma^2 = \Theta(n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Then with probability of at least $1 - n^{-q}$ over sample inputs $(x_i)_{i=1}^n$ where $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ , the expectation of the Bayesian generalization error (3) w.r.t. the noise $\epsilon$ has the asymptotic behavior:
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} G (D _ {n}) = \frac {1 + o (1)}{2 \sigma^ {2}} \left(\operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \Lambda - \| \Lambda^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \| _ {F} ^ {2} + \| \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} \| _ {2} ^ {2}\right) \\ = \frac {1}{\sigma^ {2}} \Theta \left(n ^ {\max \left\{\frac {(1 - \alpha) (1 - t)}{\alpha}, \frac {(1 - 2 \beta) (1 - t)}{\alpha} \right\}}\right). \tag {22} \\ \end{array}
+$$
+
+The proof of Theorem 9 is given in Appendix D.2. Intuitively, for a given $t$ , the exponent $\frac{(1 - \alpha)(1 - t)}{\alpha}$ in (22) captures the rate at which the model suppresses the noise, while the exponent $\frac{(1 - 2\beta)(1 - t)}{\alpha}$ captures the rate at which the model learns the target function. A larger $\beta$ implies that the exponent $\frac{(1 - 2\beta)(1 - t)}{\alpha}$ is smaller and it is easier to learn the target. A larger $\alpha$ implies that the exponent $\frac{(1 - \alpha)(1 - t)}{\alpha}$ is smaller and the error associated with the noise is smaller as well. A larger $\alpha$ , however, also implies that the exponent $\frac{(1 - 2\beta)(1 - t)}{\alpha}$ is larger (recall that $\alpha > 1$ and $\beta > 1/2$ by Assumptions 4 and 5, resp.), which means that it is harder to learn the target.
+
+Remark 10. If $f \sim \mathcal{GP}(0, k)$ , then using the Karhunen-Loève expansion we have $f(x) = \sum_{p=1}^{\infty} \sqrt{\lambda_p} \omega_p \phi_p(x)$ , where $(\omega_p)_{p=1}^{\infty}$ are i.i.d. standard Gaussian variables. We can bound $\omega_p$ almost surely as $|\omega_p| \leq C \log p$ , where $C = \sup_{p \geq 1} \frac{|\omega_p|}{\log p}$ is a finite constant. Comparing with the expansion of $f(x)$ in (9), we find that $\mu_p = \sqrt{\lambda_p} \omega_p = O(p^{-\alpha/2} \log p) = O(p^{-\alpha/2 + \varepsilon})$ where $\varepsilon > 0$ is arbitrarily small. Choosing $\beta = \alpha/2 - \varepsilon$ in (22), we have $\mathbb{E}_{\epsilon} G(D_n) = O(n^{\frac{1}{\alpha} - 1 + \frac{2\varepsilon}{\alpha}})$ . This rate matches that of an earlier result due to Sollich and Halees (2002), where it is shown that the asymptotic learning curve (as measured by the expectation of the excess mean squared error; $\mathbb{E}_f M(D_n)$ ) scales as $n^{\frac{1}{\alpha} - 1}$ when the model is correctly specified, i.e., $f$ is a sample from the same Gaussian process $\mathcal{GP}(0, k)$ , and the eigenvalues decay as a power law for large $i$ , $\lambda_i \sim i^\alpha$ .
+
+For $\mu_0 > 0$ , we note the following result:
+
+Theorem 11 (Asymptotics of the Bayesian generalization error, $\mu_0 > 0$ ). Let Assumptions 4, 5, and 6 hold. Assume that $\mu_0 > 0$ and $\sigma_{\mathrm{model}}^2 = \sigma_{\mathrm{true}}^2 = \sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Then with probability of at least $1 - n^{-q}$ over sample inputs $(x_i)_i = 1$ , where $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ , the expectation of the Bayesian generalization error (3) w.r.t. the noise $\epsilon$ has the asymptotic behavior: $\mathbb{E}_{\epsilon}G(D_n) = \frac{1}{2\sigma^2}\mu_0^2 + o(1)$ .
+
+In general, if $\mu_0 > 0$ , then the generalization error remains constant when $n \to \infty$ . This means that if the target function contains a component in the kernel of the operator $L_k$ , then GP regression is not able to learn the target function. The proof of Theorem 11 is given in Appendix D.2.
+
+# 3.3 ASYMPTOTICS OF THE EXCESS MEAN SQUARED ERROR
+
+In this section we derive the asymptotics of the excess mean squared error in Definition 2.
+
+Theorem 12 (Asymptotics of excess mean squared error). Let Assumptions 4, 5, and 6 hold. Assume $\sigma_{\mathrm{model}}^2 = \Theta(n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Then with probability of at least $1 - n^{-q}$ over sample inputs $(x_i)_{i=1}^n$ , where $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ , the excess mean squared error (6) has the asymptotic:
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} M (D _ {n}) = (1 + o (1)) \left[ \frac {\sigma_ {\text {t r u e}} ^ {2}}{\sigma_ {\text {m o d e l}} ^ {2}} \left(\operatorname {T r} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \Lambda - \| \Lambda^ {1 / 2} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \| _ {F} ^ {2}\right) \right. \\ \left. + \left\| \left(I + \frac {n}{\sigma_ {\mathrm {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} \right\| _ {2} ^ {2} \right] = \Theta \left(\max \left\{\sigma_ {\mathrm {t r u e}} ^ {2} n ^ {\frac {1 - \alpha - t}{\alpha}}, n ^ {\frac {(1 - 2 \beta) (1 - t)}{\alpha}} \right\}\right) \\ \end{array}
+$$
+
+when $\mu_0 = 0$ , and $\mathbb{E}_{\epsilon}M(D_n) = \mu_0^2 + o(1)$ , when $\mu_0 > 0$ .
+
+The proof of Theorem 12 uses similar techniques as Theorem 9 and is given in Appendix D.3.
+
+Remark 13 (Correspondence with kernel ridge regression). The kernel ridge regression (KRR) estimator arises as a solution to the optimization problem
+
+$$
+\hat {f} = \underset {f \in \mathcal {H} _ {k}} {\operatorname {a r g m i n}} \frac {1}{n} \sum_ {i = 1} ^ {n} \left(f \left(x _ {i}\right) - y _ {i}\right) ^ {2} + \lambda \| f \| _ {\mathcal {H} _ {k}} ^ {2}, \tag {23}
+$$
+
+where the hypothesis space $\mathcal{H}_k$ is chosen to be an RKHS, and $\lambda > 0$ is a regularization parameter. The solution to (23) is unique as a function, and is given by $\hat{f}(x) = K_{xx}^T (K_n + n\lambda I_n)^{-1}\mathbf{y}$ , which coincides with the posterior mean function $\bar{m}(x)$ of the GPR (1) if $\sigma_{\mathrm{model}}^2 = n\lambda$ (Kanagawa et al., 2018, Proposition 3.6). Thus, the additive Gaussian noise in GPR plays the role of regularization in KRR. Leveraging this well-known equivalence between GPR and KRR we observe that Theorem 12 also describes the generalization error of KRR as measured by the excess mean squared error.
+
+Remark 14. Cui et al. (2021) derived the asymptotics of the expected excess mean-squared error for different regularization strengths and different scales of noise. In particular, for KRR with Gaussian design where $\Lambda_R^{1/2}(\phi_1(x), \dots, \phi_R(x))$ is assumed to follow a Gaussian distribution $\mathcal{N}(0, \Lambda_R)$ , and regularization $\lambda = n^{t-1}$ where $1 - \alpha \leq t$ , Cui et al. (2021, Eq. 10) showed that
+
+$$
+\mathbb {E} _ {\left\{x _ {i} \right\} _ {i = 1} ^ {n}} \mathbb {E} _ {\epsilon} M (D _ {n}) = O \left(\max \left\{\sigma_ {\text {t r u e}} ^ {2} n ^ {\frac {1 - \alpha - t}{\alpha}}, n ^ {\frac {(1 - 2 \beta) (1 - t)}{\alpha}} \right\}\right). \tag {24}
+$$
+
+Let $\delta = n^{-q}$ , where $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ . By Markov's inequality, this implies that with probability of at least $1 - \delta$ , $\mathbb{E}_{\epsilon}M(D_n) = O\left(\frac{1}{\delta}\max \{\sigma_{\mathrm{true}}^2n^{\frac{1 - \alpha - t}{\alpha}},n^{\frac{(1 - 2\beta)(1 - t)}{\alpha}}\}\right) = O(n^q\max \{\sigma_{\mathrm{true}}^2n^{\frac{1 - \alpha - t}{\alpha}},n^{\frac{(1 - 2\beta)(1 - t)}{\alpha}}\})$ . Theorem 12 improves upon this by showing that with probability of at least $1 - \delta$ , we have an optimal bound $\mathbb{E}_{\epsilon}M(D_n) = \Theta (\max \{\sigma_{\mathrm{true}}^2n^{\frac{1 - \alpha - t}{\alpha}},n^{\frac{(1 - 2\beta)(1 - t)}{\alpha}}\})$ . Furthermore, in contrast to the approach by Cui et al. (2021), we have no requirement on the distribution of $\phi_p(x)$ , and hence our result is more generally applicable. For example, Theorem 12 can be applied to KRR with the arc-cosine kernel when the Gaussian design assumption is not valid. In the noiseless setting ( $\sigma_{\mathrm{true}} = 0$ ) with constant regularization ( $t = 0$ ), Theorem 12 implies that the mean squared error behaves as $\Theta (n^{\frac{1 - 2\beta}{\alpha}})$ . This recovers a result in Bordelon et al. (2020, §2.2).
+
+Our upper bound in Theorem 12 matches with the ones derived in (Steinwart et al., 2009; Fischer and Steinwart, 2020). Steinwart et al. (2009) and Fischer and Steinwart (2020) also derived algorithm independent minmax lower bounds. In contrast to their results, our Theorem 12 gives lower bounds for different regularization strengths $\lambda$ .
+
+# 4 EXPERIMENTS
+
+We illustrate our theory on a few toy experiments. We let the input $x$ be uniformly distributed on a unit circle, i.e., $\Omega = S^1$ and $\rho = \mathcal{U}(S^1)$ . The points on $S^1$ can be represented by $x = (\cos\theta, \sin\theta)$ where $\theta \in [-\pi, \pi)$ . We use the first order arc-cosine kernel function without bias, $k_{\mathrm{w/o bias}}^{(1)}(x_1, x_2) = \frac{1}{\pi} (\sin\psi + (\pi - \psi)\cos\psi)$ , where $\psi = \langle x_1, x_2 \rangle$ is the angle between $x_1$ and $x_2$ . Hence Assumption 4 is satisfied with $\alpha = 4$ . We consider the target functions in Table 1, which satisfy Assumption 5 with the indicated $\beta$ , and $\mu_0$ indicates whether the function lies in the span of eigenfunctions of the kernel. For each target we conduct GPR 20 times and report the mean and standard deviation of the normalized SC and the Bayesian generalization error in Figure 1, which agree with the asymptotics predicted in Theorems 7 and 9. The details of the experiments appear in Appendix A, where we also show more experiments confirming our theory for zero- and second-order arc-cosine kernels, with and without biases.
+
+# 5 CONCLUSION
+
+We described the learning curves for GPR for the case that the kernel and target function follow a power law. This setting is frequently encountered in kernel learning and relates to recent advances on neural networks. Our approach is based on a tight analysis of the concentration of the inner product of empirical eigenfunctions $\Phi^T\Phi$ around $nI$ . This allowed us to obtain more general results with more
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | 0 | Θ(n1/4) | Θ(n-3/4) |
| f2 | θ2 | 2 | >0 | Θ(n) | Θ(1) |
| f3 | (|θ|−π/2)2 | 2 | 0 | Θ(n1/4) | Θ(n-3/4) |
| f4 | {π/2−θ, θ∈[0,π) -π/2−θ, θ∈[−π,0)} | 1 | 0 | Θ(n3/4) | Θ(n-1/4) |
+
+Table 1: Target functions used in the experiments for the first order arc-cosine kernel without bias $k_{\mathrm{w/o bias}}^{(1)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+
+
+
+
+
+
+
+
+
+Figure 1: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with the kernel $k_{\mathrm{w/o bias}}^{(1)}$ and the target functions in Table 1. The orange curves show the linear regression fit for the experimental values (in blue) of the log Bayesian generalization error as a function of log $n$ .
+
+
+
+
+
+
+
+realistic assumptions than previous works. In particular, we recovered some results on learning curves for GPR and KRR previously obtained under more restricted settings (vide Remarks 10 and 14).
+
+We showed that when $\beta \geq \alpha / 2$ , meaning that the target function has a compact representation in terms of the eigenfunctions of the kernel, the learning rate is as good as in the correctly specified case. In addition, our result allows us to interpret $\beta$ from a spectral bias perspective. When $\frac{1}{2} < \beta \leq \frac{\alpha}{2}$ , the larger the value of $\beta$ , the faster the decay of the generalization error. This implies that low-frequency functions are learned faster in terms of the number of training data points.
+
+By leveraging the equivalence between GPR and KRR, we obtained a result on the generalization error of KRR. In the infinite-width limit, training fully-connected deep NNs with gradient descent and infinitesimally small learning rate under least-squared loss is equivalent to solving KRR with respect to the NTK (Jacot et al., 2018; Lee et al., 2019; Domingos, 2020), which in several cases is known to have a power-law spectrum (Velikanov and Yarotsky, 2021). Hence our methods can be applied to study the generalization error of infinitely wide neural networks. In future work, it would be interesting to estimate the values of $\alpha$ and $\beta$ for the NTK and the NNGP kernel of deep fully-connected or convolutional NNs and real data distributions and test our theory in these cases. Similarly, it would be interesting to consider extensions to finite width kernels.
+
+# ACKNOWLEDGMENT
+
+This project has received funding from the European Research Council (ERC) under the EU's Horizon 2020 research and innovation programme (grant agreement $\mathfrak{n}^{\mathrm{o}}$ 757983).
+
+# REFERENCES
+
+S. Amari and N. Murata. Statistical theory of learning curves under entropic loss criterion. Neural Computation, 5(1):140-153, 1993.
+S. Amari, N. Fujita, and S. Shinomoto. Four types of learning curves. *Neural Computation*, 4(4): 605-618, 1992.
+S. Arora, S. S. Du, W. Hu, Z. Li, R. R. Salakhutdinov, and R. Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, volume 32, pages 8139-8148, 2019.
+Y. Bahri, E. Dyer, J. Kaplan, J. Lee, and U. Sharma. Explaining neural scaling laws. arXiv preprint arXiv:2102.06701, 2021.
+A. R. Barron. Information-theoretic characterization of Bayes performance and the choice of priors in parametric and nonparametric problems. In D. A. Bernardo J., Berger J. and S. A., editors, Bayesian statistics, volume 6, pages 27-52. Oxford University Press, 1998.
+M. Belkin, S. Ma, and S. Mandal. To understand deep learning we need to understand kernel learning. In Proceedings of the 35th International Conference on Machine Learning (ICML), pages 541-549, 2018.
+A. Bietti and J. Mairal. On the inductive bias of neural tangent kernels. In Advances in Neural Information Processing Systems, volume 32, pages 12873-12884, 2019.
+A. Bietti, L. Venturi, and J. Bruna. On the sample complexity of learning with geometric stability. arXiv preprint arXiv:2106.07148, 2021.
+G. Blanchard and N. Mücke. Optimal rates for regularization of statistical inverse learning problems. Foundations of Computational Mathematics, 18(4):971-1013, 2018.
+B. Bordelon, A. Canatar, and C. Pehlevan. Spectrum dependent learning curves in kernel regression and wide neural networks. In Proceedings of the 37th International Conference on Machine Learning (ICML), pages 1024-1034, 2020.
+O. Bousquet, S. Hanneke, S. Moran, R. van Handel, and A. Yehudayoff. A theory of universal learning. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 532-541, 2021.
+M. L. Braun. Accurate error bounds for the eigenvalues of the kernel matrix. The Journal of Machine Learning Research, 7:2303-2328, 2006.
+A. Canatar, B. Bordelon, and C. Pehlevan. Spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks. Nature communications, 12(1):1-12, 2021.
+A. Caponnetto and E. De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331-368, 2007.
+N. Chatterji, A. Pacchiano, and P. Bartlett. Online learning with kernel losses. In Proceedings of the 36th International Conference on Machine Learning (ICML), pages 971-980, 2019.
+Y. Cho and L. K. Saul. Kernel methods for deep learning. In Advances in Neural Information Processing Systems, volume 22, pages 342-350, 2009.
+H. Cui, B. Loureiro, F. Krzakala, and L. Zdeborova. Generalization error rates in kernel regression: The crossover from the noiseless to noisy regime. arXiv preprint arXiv:2105.15004, 2021.
+A. Daniely, R. Frostig, and Y. Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, volume 29, pages 2253-2261, 2016.
+
+A. G. de G. Matthews, J. Hron, M. Rowland, R. E. Turner, and Z. Ghahramani. Gaussian process behaviour in wide deep neural networks. In International Conference on Learning Representations, 2018.
+P. Domingos. Every model learned by gradient descent is approximately a kernel machine. arXiv preprint arXiv:2012.00152, 2020.
+S. Fischer and I. Steinwart. Sobolev norm learning rates for regularized least-squares algorithms. Journal of Machine Learning Research, 21:1-38, 2020.
+A. Garriga-Alonso, C. E. Rasmussen, and L. Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
+D. Haussler and M. Opper. Mutual information, metric entropy and cumulative relative entropy risk. The Annals of Statistics, 25(6):2451-2492, 1997.
+D. Haussler, M. Kearns, H. S. Seung, and N. Tishby. Rigorous learning curve bounds from statistical mechanics. Machine Learning, 25(2-3):195-236, 1996.
+J. Hestness, S. Narang, N. Ardalani, G. Diamos, H. Jun, H. Kianinejad, M. Patwary, M. Ali, Y. Yang, and Y. Zhou. Deep learning scaling is predictable, empirically. arXiv preprint arXiv:1712.00409, 2017.
+A. Jacot, F. Gabriel, and C. Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, volume 31, pages 8571-8580, 2018.
+K.-S. Jun, A. Cutkosky, and F. Orabona. Kernel truncated randomized ridge regression: Optimal rates and low noise acceleration. Advances in Neural Information Processing Systems, 32:15358-15367, 2019.
+M. Kanagawa, P. Hennig, D. Sejdinovic, and B. K. Sriperumbudur. Gaussian processes and kernel methods: A review on connections and equivalences. arXiv preprint arXiv:1807.02582, 2018.
+L. Le Gratiet and J. Garnier. Asymptotic analysis of the learning curve for Gaussian process regression. Machine Learning, 98(3):407-433, 2015.
+J. Lee, J. Sohl-Dickstein, J. Pennington, R. Novak, S. Schoenholz, and Y. Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
+J. Lee, L. Xiao, S. Schoenholz, Y. Bahri, R. Novak, J. Sohl-Dickstein, and J. Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in Neural Information Processing Systems, volume 32, pages 8572-8583, 2019.
+J. Lee, S. Schoenholz, J. Pennington, B. Adlam, L. Xiao, R. Novak, and J. Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. In Advances in Neural Information Processing Systems, volume 33, pages 15156-15172, 2020.
+M. Loog, T. Viering, and A. Mey. Minimizers of the empirical risk and risk monotonicity. In Advances in Neural Information Processing Systems, volume 32, pages 7478-7487, 2019.
+D. Malzahn and M. Opper. Learning curves for Gaussian processes regression: A framework for good approximations. In Advances in Neural Information Processing Systems, volume 13, pages 273-279, 2001a.
+D. Malzahn and M. Opper. Learning curves for Gaussian processes models: Fluctuations and universality. In International Conference on Artificial Neural Networks, pages 271-276, 2001b.
+R. M. Neal. Bayesian Learning for Neural Networks. Springer-Verlag, Berlin, Heidelberg, 1996. ISBN 0387947248.
+A. Nitanda and T. Suzuki. Optimal rates for averaged stochastic gradient descent under neural tangent kernel regime. In International Conference on Learning Representations, 2021.
+
+R. Novak, L. Xiao, Y. Bahri, J. Lee, G. Yang, D. A. Abolafia, J. Pennington, and J. Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019.
+M. Opper and D. Malzahn. A variational approach to learning curves. In Advances in Neural Information Processing Systems, volume 14, pages 463-469, 2002.
+M. Opper and F. Vivarelli. General bounds on Bayes errors for regression with Gaussian processes. In Advances in Neural Information Processing Systems, volume 11, pages 302-308, 1999.
+P. Orbanz and Y. W. Teh. Bayesian nonparametric models. In Encyclopedia of Machine Learning, pages 81-89. Springer, 2010.
+K. Ritter, G. W. Wasilkowski, and H. Wozniakowski. Multivariate integration and approximation for random fields satisfying Sacks-Ylvisaker conditions. The Annals of Applied Probability, pages 518-540, 1995.
+B. Ronen, D. Jacobs, Y. Kasten, and S. Kritchman. The convergence rate of neural networks for learned functions of different frequencies. Advances in Neural Information Processing Systems, 32:4761-4771, 2019.
+M. W. Seeger, S. M. Kakade, and D. P. Foster. Information consistency of nonparametric Gaussian process methods. IEEE Transactions on Information Theory, 54(5):2376-2382, 2008.
+P. Sollich. Learning curves for Gaussian processes. In Advances in Neural Information Processing Systems, volume 11, pages 344-350, 1999.
+P. Sollich. Gaussian process regression with mismatched models. In Advances in Neural Information Processing Systems, volume 13, pages 519-526, 2001.
+P. Sollich and A. Halees. Learning curves for Gaussian process regression: Approximations and bounds. Neural Computation, 14(6):1393-1428, 2002.
+S. Spigler, M. Geiger, and M. Wyart. Asymptotic learning curves of kernel methods: empirical data versus teacher-student paradigm. Journal of Statistical Mechanics: Theory and Experiment, 2020 (12):124001, 2020.
+M. L. Stein. Interpolation of spatial data: Some theory for kriging. Springer Science & Business Media, 2012.
+I. Steinwart and C. Scovel. Mercer's theorem on general domains: On the interaction between measures, kernels, and rkhss. Constructive Approximation, 35:363-417, 2012.
+I. Steinwart, D. R. Hush, C. Scovel, et al. Optimal rates for regularized least squares regression. In Conference on Learning Theory, pages 79-93, 2009.
+J. A. Tropp. User-friendly tail bounds for sums of random matrices. Foundations of computational mathematics, 12(4):389-434, 2012.
+S. Vakili, K. Khezeli, and V. Picheny. On information gain and regret bounds in Gaussian process bandits. In International Conference on Artificial Intelligence and Statistics, pages 82-90, 2021.
+E. A. Valdivia. Relative concentration bounds for the spectrum of kernel matrices. arXiv preprint arXiv:1812.02108, 2018.
+A. Van Der Vaart and H. Van Zanten. Information rates of nonparametric Gaussian process methods. Journal of Machine Learning Research, 12(6), 2011.
+M. Velikanov and D. Yarotsky. Universal scaling laws in the gradient descent training of neural networks. arXiv preprint arXiv:2105.00507, 2021.
+T. Viering and M. Loog. The shape of learning curves: A review. arXiv preprint arXiv:2103.10948, 2021.
+
+T. Viering, A. Mey, and M. Loog. Open problem: Monotonicity of learning. In Conference on Learning Theory, pages 3198-3201, 2019.
+S. Watanabe. Algebraic Geometry and Statistical Learning Theory. Cambridge University Press, 2009.
+H. Widom. Asymptotic behavior of the eigenvalues of certain integral equations. Transactions of the American Mathematical Society, 109(2):278-295, 1963.
+C. K. Williams. Computing with infinite networks. In Advances in Neural Information Processing Systems, volume 9, pages 295-301, 1997.
+C. K. Williams and C. E. Rasmussen. Gaussian processes for machine learning. MIT press, 2006.
+C. K. Williams and F. Vivarelli. Upper and lower bounds on the learning curve for Gaussian processes. Machine Learning, 40(1):77-102, 2000.
+G. Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. In Advances in Neural Information Processing Systems, volume 32, pages 9951-9960, 2019.
+G. Yang and H. Salman. A fine-grained spectral perspective on neural networks. arXiv preprint arXiv:1907.10599, 2019.
+
+# APPENDIX
+
+# A EXPERIMENTS FOR ARC-COSINE KERNELS OF DIFFERENT ORDERS
+
+In our experiment, the input space and input distribution are $\Omega = S^1$ and $\rho = \mathcal{U}(S^1)$ , and we use the first order arc-cosine kernel function. (Cho and Saul, 2009) showed that this kernel is the conjugate kernel of an infinitely wide shallow ReLU network with two inputs and no biases in the hidden layer. GP regression with prior $\mathcal{GP}(0,k)$ corresponds to Bayesian training of this network (Lee et al., 2018). Under this setting, the eigenvalues and eigenfunctions are $\lambda_1 = \frac{4}{\pi^2}$ , $\lambda_2 = \lambda_3 = \frac{1}{4}$ , $\lambda_{2p} = \lambda_{2p + 1} = \frac{4}{\pi^2((2p - 2)^2 - 1)^2}$ , $p\geq 2$ and $\phi_1(\theta) = 1$ , $\phi_2(\theta) = \frac{\sqrt{2}}{2}\cos \theta$ , $\phi_3(\theta) = \frac{\sqrt{2}}{2}\sin \theta$ , $\phi_{2p}(\theta) = \frac{\sqrt{2}}{2}\cos (2p - 2)\theta$ , $\phi_{2p + 1}(\theta) = \frac{\sqrt{2}}{2}\sin (2p - 2)\theta$ , $p\geq 2$ . Hence Assumption 4 is satisfied with $\alpha = 4$ , and the second part of Assumption 6 is satisfied with $\| \phi_p\| \leq \frac{\sqrt{2}}{2}$ , $p\geq 1$ .
+
+The training and test data are generated as follows: We independently sample training inputs $x_{1},\ldots ,x_{n}$ and test input $x_{n + 1}$ from $\mathcal{U}(S^1)$ and training outputs $y_{i}$ , $i = 1,\dots,n$ from $\mathcal{N}(f(x_i),\sigma^2)$ , where we choose $\sigma = 0.1$ . The Bayesian predictive density conditioned on the test point $x_{n + 1}$ $\mathcal{N}(\bar{m} (x_{n + 1}),\bar{k} (x_{n + 1},x_{n + 1}))$ is obtained by (1) and (2). We compute the normalized SC by (7) and the Bayesian generalization error by the Kullback-Leibler divergence between $\mathcal{N}(f(x_{n + 1}),\sigma^2)$ and $\mathcal{N}(\bar{m} (x_{n + 1}),\bar{k} (x_{n + 1},x_{n + 1}))$ .
+
+Next we present experiment results for arc-cosine kernels of different orders and arc-cosine kernels with biases. Consider the first order arc-cosine kernel function with biases,
+
+$$
+k _ {\mathrm {w} / \text {b i a s}} ^ {(1)} \left(x _ {1}, x _ {2}\right) = \frac {1}{\pi} \left(\sin \bar {\psi} + (\pi - \bar {\psi}) \cos \bar {\psi}\right), \text {w h e r e} \bar {\psi} = \operatorname {a r c c o s} \left(\frac {1}{2} \left(\langle x _ {1}, x _ {2} \rangle + 1\right)\right). \tag {25}
+$$
+
+Ronen et al. (2019) showed that this kernel is the conjugate kernel of an infinitely wide shallow ReLU network with two inputs and one hidden layer with biases, whose eigenvalues satisfy Assumption 4 with $\alpha = 4$ . The eigenfunctions of this kernel are the same as that of the first-order arc-cosine kernel without biases, $k_{\mathrm{w / o~bias}}^{(1)}$ in Section 4. We consider the target functions in Table 3, which satisfy Assumption 5 with the indicated $\beta$ , and $\mu_0$ indicates whether the function lies in the span of eigenfunctions of the kernel. For each target we conduct GPR 20 times and report the mean and standard deviation of the normalized SC and the Bayesian generalization error in Figure 3, which agree with the asymptotics predicted in Theorems 7 and 9.
+
+Table 2 summarizes all the different kernel functions that we consider in our experiments with pointers to the corresponding tables and figures.
+
+Summarizing the observations from these experiments, we see that the smoothness of the activation function (which is controlled by the order of the arc-cosine kernel) influences the decay rate $\alpha$ of the
+
+ | kernel function | α | activation function | bias | pointer |
| kw/o bias | 1/π(sinψ+(π-ψ)cosψ) | 4 | max{0,x} | no | Table 1/Figure 1 |
| kw/bias | 1/π(sinψ+(π-ψ)cosψ) | 4 | max{0,x} | yes | Table 3/Figure 3 |
| kw/o bias | 1/π(3sinψcosψ+(π-ψ)(1+2cos2ψ)) | 6 | (max{0,x})2 | no | Table 4/Figure 4 |
| kw/bias | 1/π(3sinψcosψ+(π-ψ)(1+2cos2ψ)) | 6 | (max{0,x})2 | yes | Table 5/Figure 5 |
| kw/o bias | 1/π(sinψ+(π-ψ)cosψ) | 2 | 1/2(1+sign(x)) | no | Table 6/Figure 6 |
| kw/bias | 1/π(sinψ+(π-ψ)cosψ) | 2 | 1/2(1+sign(x)) | yes | Table 7/Figure 7 |
+
+eigenvalues. In general, when the activation function is smoother, the decay rate $\alpha$ is larger. Theorem 9 then implies that smooth activation functions are more capable in suppressing noise but slower in learning the target. We also observe that networks with biases are more capable at learning functions compared to networks without bias. For example, the function $\cos(2\theta)$ cannot be learned by the zero order arc-cosine kernel without biases (see Table 6 and Figure 6), but it can be learned by the zero order arc-cosine kernel with biases (see Table 7 and Figure 7).
+
+Table 2: The different kernel functions used in our experiments, their values of $\alpha$ , the corresponding neural network activation function along with a pointer to the tables showing the target functions used for the kernels and the corresponding figures.
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | 0 | Θ(n1/4) | Θ(n-3/4) |
| f2 | θ2 | 2 | 0 | Θ(n1/4) | Θ(n-3/4) |
| f3 | (|θ|−π/2)2 | 2 | 0 | Θ(n1/4) | Θ(n-3/4) |
| f4 | {π/2−θ, θ∈[0,π) −π/2−θ, θ∈[−π,0)} | 1 | 0 | Θ(n3/4) | Θ(n-1/4) |
+
+Table 3: Target functions used in the experiments for the first order arc-cosine kernel with bias, $k_{\mathrm{w / bias}}^{(1)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+
+
+
+
+
+
+
+
+
+Figure 3: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with kernel $k_{\mathrm{w}/\mathrm{bias}}^{(1)}$ and the target functions in Table 3. The orange curves show the linear regression fit for the experimental values (in blue) of the log Bayesian generalization error as a function of log $n$ .
+
+
+
+
+
+
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | 0 | Θ(n1/6) | Θ(n-5/6) |
| f2 | sign(θ) | 1 | 0 | Θ(n5/6) | Θ(n-1/6) |
| f3 | π/2-|θ| | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f4 | {π/2-θ, θ∈[0,π) -π/2-θ, θ∈[-π,0)} | 1 | >0 | Θ(n) | Θ(1) |
+
+
+
+
+
+
+
+
+
+
+Figure 4: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with kernel $k_{\mathrm{w/o bias}}^{(2)}$ and the target functions in Table 4.
+
+
+
+
+
+
+
+Table 4: Target functions used in the experiments for the second order arc-cosine kernel without bias, $k_{\mathrm{w/o}}^{(2)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | 0 | Θ(n1/6) | Θ(n-5/6) |
| f2 | θ2 | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f3 | (|θ|−π/2)2 | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f4 | {π/2−θ, θ∈[0,π) -π/2−θ, θ∈[−π,0)} | 1 | 0 | Θ(n5/6) | Θ(n-1/6) |
+
+Table 5: Target functions used in the experiments for the second order arc-cosine kernel with bias, $k_{\mathrm{w}/\mathrm{bias}}^{(2)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+
+
+
+
+
+
+
+
+
+Figure 5: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with kernel $k_{\mathrm{w}/\mathrm{bias}}^{(2)}$ and the target functions in Table 5.
+
+
+
+
+
+
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | >0 | Θ(n) | Θ(1) |
| f2 | sign(θ) | 1 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f3 | π/2-|θ| | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f4 | {π/2-θ, θ∈[0,π) -π/2-θ, θ∈[-π,0)} | 1 | >0 | Θ(n) | Θ(1) |
+
+
+
+
+
+
+
+
+
+
+Figure 6: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with kernel $k_{\mathrm{w/o bias}}^{(0)}$ and the target functions in Table 6.
+
+
+
+
+
+
+
+Table 6: Target functions used in the experiments for the zero order arc-cosine kernel without bias, $k_{\mathrm{w/o bias}}^{(0)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+ | function value | β | μ0 | EεF0(Dn) | EεG(Dn) |
| f1 | cos2θ | +∞ | 0 | Θ(n1/2) | Θ(n-1/2) |
| f2 | θ2 | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f3 | (|θ|−π/2)2 | 2 | 0 | Θ(n1/2) | Θ(n-1/2) |
| f4 | {π/2−θ, θ∈[0,π) −π/2−θ, θ∈[−π,0)} | 1 | 0 | Θ(n1/2) | Θ(n-1/2) |
+
+Table 7: Target functions used in the experiments for the zero order arc-cosine kernel with bias, $k_{\mathrm{w}/\mathrm{bias}}^{(0)}$ , their values of $\beta$ and $\mu_0$ , and theoretical rates for the normalized SC and the Bayesian generalization error from our theorems.
+
+
+
+
+
+
+
+
+
+
+Figure 7: Normalized SC (top) and Bayesian generalization error (bottom) for GPR with kernel $k_{\mathrm{w}/\mathrm{bias}}^{(0)}$ and the target functions in Table 7.
+
+
+
+
+
+
+
+# B PROOFS RELATED TO THE MARGINAL LIKELIHOOD
+
+Proof of Proposition 3. Let $\bar{\mathbf{y}} = (\bar{y}_1,\dots ,\bar{y}_n)^T$ be the outputs of the GP regression model on training inputs $\mathbf{x}$ . Under the GP prior, the prior distribution of $\bar{\mathbf{y}}$ is $\mathcal{N}(0,K_n)$ . Then the evidence of the model is given as follows:
+
+$$
+\begin{array}{l} Z _ {n} = \int_ {\mathbb {R} ^ {n}} \left(\prod_ {i = 1} ^ {n} \frac {1}{\sqrt {2 \pi} \sigma} e ^ {- \frac {\left(\bar {y} _ {i} - y _ {i}\right) ^ {2}}{2 \sigma^ {2}}}\right) \frac {1}{(2 \pi) ^ {n / 2} \det \left(K _ {n}\right) ^ {1 / 2}} e ^ {- \frac {1}{2} \bar {\mathbf {y}} ^ {T} K _ {n} ^ {- 1} \bar {\mathbf {y}}} d \bar {\mathbf {y}} \tag {26} \\ = \frac {1}{(2 \pi) ^ {n} \sigma^ {n} \det (K _ {n}) ^ {1 / 2}} \int_ {\mathbb {R} ^ {n}} e ^ {- \frac {1}{2} \bar {\mathbf {y}} ^ {T} (K _ {n} ^ {- 1} + \frac {1}{\sigma^ {2}} I) \bar {\mathbf {y}} + \frac {1}{\sigma^ {2}} \bar {\mathbf {y}} ^ {T} \mathbf {y} - \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y}} d \bar {\mathbf {y}}. \\ \end{array}
+$$
+
+Letting $\tilde{K}_n^{-1} = K_n^{-1} + \frac{1}{\sigma^2} I$ and $\mu = \frac{1}{\sigma^2}\tilde{K}_n\mathbf{y}$ , we have
+
+$$
+\begin{array}{l} Z _ {n} = \frac {1}{(2 \pi) ^ {n} \sigma^ {n} \operatorname * {d e t} (K _ {n}) ^ {1 / 2}} \int_ {\mathbb {R} ^ {n}} e ^ {- \frac {1}{2} (\bar {\mathbf {y}} - \mu) ^ {T} \tilde {K} _ {n} ^ {- 1} (\bar {\mathbf {y}} - \mu) - \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y} + \frac {1}{2} \mu^ {T} \tilde {K} _ {n} ^ {- 1} \mu} \mathrm {d} \bar {\mathbf {y}} \\ = \frac {1}{(2 \pi) ^ {n} \sigma^ {n} \det (K _ {n}) ^ {1 / 2}} (2 \pi) ^ {n / 2} \det (\tilde {K} _ {n}) ^ {1 / 2} e ^ {- \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y} + \frac {1}{2} \mu^ {T} \tilde {K} _ {n} ^ {- 1} \mu} \tag {27} \\ = \frac {\operatorname * {d e t} (\tilde {K} _ {n}) ^ {1 / 2}}{(2 \pi) ^ {n / 2} \sigma^ {n} \operatorname * {d e t} (K _ {n}) ^ {1 / 2}} e ^ {- \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y} + \frac {1}{2} \mu^ {T} \tilde {K} _ {n} ^ {- 1} \mu}. \\ \end{array}
+$$
+
+The normalized evidence is
+
+$$
+\begin{array}{l} Z _ {n} ^ {0} = \frac {Z _ {n}}{(2 \pi) ^ {- n / 2} \sigma^ {- n} e ^ {- \frac {1}{2 \sigma^ {2}} (\mathbf {y} - f (\mathbf {x})) ^ {T} (\mathbf {y} - f (\mathbf {x}))}} \tag {28} \\ = \frac {\det (\tilde {K} _ {n}) ^ {1 / 2}}{\det (K _ {n}) ^ {1 / 2}} e ^ {- \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y} + \frac {1}{2} \mu^ {T} \tilde {K} _ {n} ^ {- 1} \mu + \frac {1}{2 \sigma^ {2}} (\mathbf {y} - f (\mathbf {x})) ^ {T} (\mathbf {y} - f (\mathbf {x}))}. \\ \end{array}
+$$
+
+So the normalized stochastic complexity is
+
+$$
+\begin{array}{l} F ^ {0} (D _ {n}) = - \log Z _ {n} ^ {0} \\ = - \frac {1}{2} \mathrm {l o g d e t} (\tilde {K} _ {n}) ^ {1 / 2} + \frac {1}{2} \mathrm {l o g d e t} (K _ {n}) ^ {1 / 2} + \frac {1}{2 \sigma^ {2}} {\bf y} ^ {T} {\bf y} - \frac {1}{2} \mu^ {T} \tilde {K} _ {n} ^ {- 1} \mu - \frac {1}{2 \sigma^ {2}} ({\bf y} - f ({\bf x})) ^ {T} ({\bf y} - f ({\bf x})) \\ = - \frac {1}{2} \log \det \left(K _ {n} ^ {- 1} + \frac {1}{\sigma^ {2}} I\right) ^ {- 1} + \frac {1}{2} \log \det \left(K _ {n}\right) + \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \mathbf {y} - \frac {1}{2 \sigma^ {4}} \mathbf {y} ^ {T} \left(K _ {n} ^ {- 1} + \frac {1}{\sigma^ {2}} I\right) ^ {- 1} \mathbf {y} \\ - \frac {1}{2 \sigma^ {2}} (\mathbf {y} - f (\mathbf {x})) ^ {T} (\mathbf {y} - f (\mathbf {x})) \\ = \frac {1}{2} \log \det \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) + \frac {1}{2 \sigma^ {2}} \mathbf {y} ^ {T} \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} \mathbf {y} - \frac {1}{2 \sigma^ {2}} (\mathbf {y} - f (\mathbf {x})) ^ {T} (\mathbf {y} - f (\mathbf {x})). \\ = \frac {1}{2} \log \det \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) + \frac {1}{2 \sigma^ {2}} f (\mathbf {x}) ^ {T} \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) + \frac {1}{2 \sigma^ {2}} \boldsymbol {\epsilon} ^ {T} \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} \boldsymbol {\epsilon} - \frac {1}{2 \sigma^ {2}} \boldsymbol {\epsilon} ^ {T} \boldsymbol {\epsilon} \\ + \frac {1}{2 \sigma^ {2}} \boldsymbol {\epsilon} ^ {T} \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) \\ \end{array}
+$$
+
+(29)
+
+After taking the expectation over noises $\epsilon$ , we get
+
+$$
+\mathbb {E} _ {\epsilon} F ^ {0} \left(D _ {n}\right) = \frac {1}{2} \log \det \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) + \frac {1}{2 \sigma^ {2}} f (\mathbf {x}) ^ {T} \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {K _ {n}}{\sigma^ {2}}\right) ^ {- 1}\right). \tag {30}
+$$
+
+This concludes the proof.
+
+□
+
+# C HELPER LEMMAS
+
+Lemma 15. Assume that $m \to \infty$ as $n \to \infty$ . Given constants $a_1, a_2, s_1, s_2 > 0$ , if $s_1 > 1$ and $s_2 s_3 > s_1 - 1$ , we have that
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \Theta \left(m ^ {\frac {1 - s _ {1}}{s _ {2}}}\right). \tag {31}
+$$
+
+If $s_1 > 1$ and $s_2s_3 = s_1 - 1$ , we have that
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \Theta \left(m ^ {- s _ {3}} \log m\right). \tag {32}
+$$
+
+If $s_1 > 1$ and $s_2s_3 < s_1 - 1$ , we have that
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \Theta \left(m ^ {- s _ {3}}\right). \tag {33}
+$$
+
+Overall, if $s_1 > 1$ and $m \to \infty$ ,
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \left\{ \begin{array}{l l} \Theta \left(m ^ {\max \left\{- s _ {3}, \frac {1 - s _ {1}}{s _ {2}} \right\}}\right), & s _ {2} s _ {3} \neq s _ {1} - 1, \\ \Theta \left(m ^ {\frac {1 - s _ {1}}{s _ {2}}} \log m\right), & s _ {2} s _ {3} = s _ {1} - 1. \end{array} \right. \tag {34}
+$$
+
+Proof of Lemma 15. First, when $s_1 > 1$ and $s_2s_3 > s_1 - 1$ , we have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + \int_ {[ 1, + \infty ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} m x ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} x \\ = \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1, + \infty ]} \frac {a _ {1} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {1}}}{(1 + a _ {2} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} \frac {x}{m ^ {1 / s _ {2}}} \\ = \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, + \infty ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} x \\ = \Theta (m ^ {\frac {1 - s _ {1}}{s _ {2}}}). \\ \end{array}
+$$
+
+On the other hand, we have
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \geq \int_ {[ 1, R + 1 ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} m x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ = m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1, R + 1 ]} \frac {a _ {1} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {1}}}{(1 + a _ {2} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {2}}) ^ {s _ {3}}} d \frac {x}{m ^ {1 / s _ {2}}} \\ = m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, (R + 1) / m ^ {1 / s _ {2}} ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ = \Theta \big (m ^ {\frac {1 - s _ {1}}{s _ {2}}} \big). \\ \end{array}
+$$
+
+Second, when $s_1 > 1$ and $s_2 s_3 = s_1 - 1$ , we have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, + \infty ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} O (\log m ^ {(1 / s _ {2})}) \\ = \Theta \big (m ^ {\frac {1 - s _ {1}}{s _ {2}}} \log n \big). \\ \end{array}
+$$
+
+On the other hand, we have
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \geq \int_ {[ 1, R + 1 ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} m x ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} x \\ = m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1, R + 1 ]} \frac {a _ {1} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {1}}}{(1 + a _ {2} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} \frac {x}{m ^ {1 / s _ {2}}} \\ = m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, (R + 1) / m ^ {1 / s _ {2}} ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ = \Theta \big (m ^ {\frac {1 - s _ {1}}{s _ {2}}} \log n \big). \\ \end{array}
+$$
+
+Third, when $s_1 > 1$ and $s_2s_3 < s_1 - 1$ , we have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, + \infty ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} x \\ \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \Theta (m ^ {(- 1 / s _ {2}) (1 - s _ {1} + s _ {2} s _ {3})}) \\ = \Theta (m ^ {- s _ {3}}). \\ \end{array}
+$$
+
+On the other hand, we have
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 2 / m ^ {1 / s _ {2}}, (R + 1) / m ^ {1 / s _ {2}} ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ \leq \frac {a _ {1}}{\left(1 + a _ {2} m\right) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \Theta \left(m ^ {\left(- 1 / s _ {2}\right) \left(1 - s _ {1} + s _ {2} s _ {3}\right)}\right) \\ = \Theta (m ^ {- s _ {3}}). \\ \end{array}
+$$
+
+Overall, if $s_1 > 1$ ,
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \left\{ \begin{array}{l l} \Theta \left(m ^ {\max \left\{- s _ {3}, \frac {1 - s _ {1}}{s _ {2}} \right\}}\right), & s _ {2} s _ {3} \neq s _ {1} - 1, \\ \Theta \left(m ^ {- s _ {3}} \log n\right), & s _ {2} s _ {3} = s _ {1} - 1. \end{array} \right. \tag {35}
+$$
+
+
+
+Lemma 16. Assume that $R = m^{\frac{1}{s2} + \kappa}$ for $\kappa > 0$ . Given constants $a_1, a_2, s_1, s_2 > 0$ , if $s_1 \leq 1$ , we have that
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \tilde {O} \left(\max \left\{m ^ {- s _ {3}}, R ^ {1 - s _ {1}} \right\}\right). \tag {36}
+$$
+
+Proof of Lemma 16. First, when $s_1 \leq 1$ and $s_2 s_3 > s_1 - 1$ , we have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + \int_ {[ 1, R ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} m x ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} x \\ = \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1, R ]} \frac {a _ {1} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {1}}}{(1 + a _ {2} \left(\frac {x}{m ^ {1 / s _ {2}}}\right) ^ {- s _ {2}}) ^ {s _ {3}}} \mathrm {d} \frac {x}{m ^ {1 / s _ {2}}} \\ = \frac {a _ {1}}{\left(1 + a _ {2} m\right) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, R / m ^ {1 / s _ {2}} ]} \frac {a _ {1} x ^ {- s _ {1}}}{\left(1 + a _ {2} x ^ {- s _ {2}}\right) ^ {s _ {3}}} \mathrm {d} x \\ = \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + \tilde {O} (m ^ {\frac {1 - s _ {1}}{s _ {2}}} (\frac {R}{m ^ {1 / s _ {2}}}) ^ {1 - s _ {1}}) \\ = \tilde {O} \left(\max \left\{m ^ {- s _ {3}}, R ^ {1 - s _ {1}} \right\}\right). \\ \end{array}
+$$
+
+Second, when $s_1 \leq 1$ and $s_2 s_3 \leq s_1 - 1$ , we have that
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{(1 + a _ {2} m i ^ {- s _ {2}}) ^ {s _ {3}}} \leq \frac {a _ {1}}{(1 + a _ {2} m) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \int_ {[ 1 / m ^ {1 / s _ {2}}, R / m ^ {1 / s _ {2}} ]} \frac {a _ {1} x ^ {- s _ {1}}}{(1 + a _ {2} x ^ {- s _ {2}}) ^ {s _ {3}}} d x \\ \leq \frac {a _ {1}}{\left(1 + a _ {2} m\right) ^ {s _ {3}}} + m ^ {\frac {1 - s _ {1}}{s _ {2}}} \tilde {O} \left(m ^ {\left(- 1 / s _ {2}\right) \left(1 - s _ {1} + s _ {2} s _ {3}\right)} + \left(\frac {R}{m ^ {1 / s _ {2}}}\right) ^ {1 - s _ {1}}\right) \\ = \tilde {O} \left(\max \left\{m ^ {- s _ {3}}, R ^ {1 - s _ {1}} \right\}\right). \\ \end{array}
+$$
+
+Overall, if $s_1 \leq 1$ ,
+
+$$
+\sum_ {i = 1} ^ {R} \frac {a _ {1} i ^ {- s _ {1}}}{\left(1 + a _ {2} m i ^ {- s _ {2}}\right) ^ {s _ {3}}} = \tilde {O} \left(\max \left\{m ^ {- s _ {3}}, R ^ {1 - s _ {1}} \right\}\right). \tag {37}
+$$
+
+
+
+Lemma 17. Assume that $f \in L^{2}(\Omega, \rho)$ . Consider the random vector $f(\mathbf{x}) = (f(x_{1}), \dots, f(x_{n}))^{T}$ , where $x_{1}, \dots, x_{n}$ are drawn i.i.d from $\rho$ . Then with probability of at least $1 - \delta_{1}$ , we have
+
+$$
+\| f (\mathbf {x}) \| _ {2} ^ {2} = \sum_ {i = 1} ^ {n} f ^ {2} \left(x _ {i}\right) = \tilde {O} \left(\left(\frac {1}{\delta_ {1}} + 1\right) n \| f \| _ {2} ^ {2}\right),
+$$
+
+where $\| f\| _2^2 = \int_{x\in \Omega}f^2 (x)\mathrm{d}\rho (x).$
+
+Proof of Lemma 17. Given a positive number $C \geq \| f \|_2^2$ , applying Markov's inequality we have
+
+$$
+\mathbb {P} (f ^ {2} (X) > C) \leq \frac {1}{C} \| f \| _ {2} ^ {2}.
+$$
+
+Let $A$ be the event that for all sample inputs $(x_{i})_{i = 1}^{n}$ , $f^2 (x_i)\leq C$ . Then
+
+$$
+\mathbb {P} (A) \geq 1 - n \mathbb {P} \left(f ^ {2} (X) > C\right) \geq 1 - \frac {1}{C} n \| f \| _ {2} ^ {2}. \tag {38}
+$$
+
+Define $\bar{f}^2(x) = \min\{f^2(x), C\}$ . Then $\mathbb{E}\bar{f}^2(X) \leq \mathbb{E}f^2(X) = \|f\|_2^2$ . So $|\bar{f}^2(X) - \mathbb{E}\bar{f}^2(X)| \leq \max\{C, \|f\|_2^2\} = C$ Since $0 \leq \bar{f}^2(x) \leq C$ , we have
+
+$$
+\mathbb {E} \left(\bar {f} ^ {4} (X)\right) \leq C \mathbb {E} \left(\bar {f} ^ {2} (X)\right) \leq C \| f \| _ {2} ^ {2}. \tag {39}
+$$
+
+So we have
+
+$$
+\mathbb {E} \left| \bar {f} ^ {2} (X) - \mathbb {E} \bar {f} ^ {2} (X) \right| ^ {2} \leq \mathbb {E} \left(\bar {f} ^ {4} (X)\right) \leq C \| f \| _ {2} ^ {2}. \tag {40}
+$$
+
+Applying Bernstein's inequality, we have
+
+$$
+\begin{array}{l} \mathbb {P} \left(\sum_ {i = 1} ^ {n} \bar {f} ^ {2} \left(x _ {i}\right) > t + n \mathbb {E} \bar {f} ^ {2} (X)\right) \leq \exp \left(- \frac {t ^ {2}}{2 \left(n \mathbb {E} | \bar {f} ^ {2} (X) - \mathbb {E} \bar {f} ^ {2} (X) | ^ {2}\right) + \frac {C t}{3}}\right) \\ \leq \exp \left(- \frac {t ^ {2}}{2 \left(n C \| f \| _ {2} ^ {2} + \frac {C t}{3}\right)}\right) \\ \leq \exp \left(- \frac {t ^ {2}}{4 \max \{n C \| f \| _ {2} ^ {2} , \frac {C t}{3} \}}\right). \\ \end{array}
+$$
+
+Hence, with probability of at least $1 - \delta_1 / 2$ we have
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {n} \bar {f} ^ {2} \left(x _ {i}\right) \leq \max \left\{\sqrt {4 C \log \frac {2}{\delta_ {1}} n \| f \| _ {2} ^ {2}}, \frac {4 C}{3} \log \frac {2}{\delta_ {1}} \right\} + n \mathbb {E} \bar {f} ^ {2} (X) \tag {41} \\ \leq \max \left\{\sqrt {4 C \log \frac {2}{\delta_ {1}} n \| f \| _ {2} ^ {2}}, \frac {4 C}{3} \log \frac {2}{\delta_ {1}} \right\} + n \| f \| _ {2} ^ {2}. \\ \end{array}
+$$
+
+When event $A$ happens, $f^2(x_i) = \bar{f}^2(x_i)$ for all sample inputs. According to (38) and (41), with probability at least $1 - \frac{1}{C} n \| f \|_2^2 - \delta_1 / 2$ , we have
+
+$$
+\sum_ {i = 1} ^ {n} f ^ {2} \left(x _ {i}\right) = \sum_ {i = 1} ^ {n} \bar {f} ^ {2} \left(x _ {i}\right) \leq \max \left\{\sqrt {4 C \log \frac {2}{\delta_ {1}} n \| f \| _ {2} ^ {2}}, \frac {4 C}{3} \log \frac {2}{\delta_ {1}} \right\} + n \| f \| _ {2} ^ {2}.
+$$
+
+Choosing $C = \frac{2}{\delta_1} n \| f \|_2^2$ , with probability of at least $1 - \delta_1$ we have
+
+$$
+\sum_ {i = 1} ^ {n} f ^ {2} (x _ {i}) = \sum_ {i = 1} ^ {n} \bar {f} ^ {2} (x _ {i}) \leq \max \Bigg \{\sqrt {\frac {8}{\delta_ {1}} \log \frac {2}{\delta_ {1}} n ^ {2} \| f \| _ {2} ^ {4}}, \frac {8}{3 \delta_ {1}} n \| f \| _ {2} ^ {2} \log \frac {2}{\delta_ {1}} \Bigg \} + n \| f \| _ {2} ^ {2} = \tilde {O} \Big ((\frac {1}{\delta_ {1}} + 1) n \| f \| _ {2} ^ {2} \Big).
+$$
+
+
+
+Lemma 18. Assume that $f \in L^{2}(\Omega, \rho)$ . Consider the random vector $f(\mathbf{x}) = (f(x_{1}), \dots, f(x_{n}))^{T}$ , where $x_{1}, \dots, x_{n}$ are drawn i.i.d from $\rho$ . Assume that $\| f \|_{\infty} = \sup_{x \in \Omega} f(x) \leq C$ . With probability of at least $1 - \delta_{1}$ , we have
+
+$$
+\left\| f (\mathbf {x}) \right\| _ {2} ^ {2} = \tilde {O} \left(\sqrt {C ^ {2} n \| f \| _ {2} ^ {2}} + C ^ {2}\right) + n \| f \| _ {2} ^ {2},
+$$
+
+where $\| f\| _2^2 = \int_{x\in \Omega}f^2 (x)\mathrm{d}\rho (x).$
+
+Proof of Lemma 18. We have $|f^2(X) - \mathbb{E}f^2(X)| \leq \max\{C^2, \|f\|_2^2\} = C^2$ . Since $0 \leq f^2(x) \leq C$ , we have
+
+$$
+\mathbb {E} \left(f ^ {4} (X)\right) \leq C ^ {2} \mathbb {E} \left(f ^ {2} (X)\right) \leq C ^ {2} \| f \| _ {2} ^ {2}. \tag {42}
+$$
+
+So we have
+
+$$
+\mathbb {E} \left| f ^ {2} (X) - \mathbb {E} f ^ {2} (X) \right| ^ {2} \leq \mathbb {E} \left(f ^ {4} (X)\right) \leq C ^ {2} \| f \| _ {2} ^ {2}. \tag {43}
+$$
+
+Applying Bernstein's inequality, we have
+
+$$
+\begin{array}{l} \mathbb {P} \left(\sum_ {i = 1} ^ {n} f ^ {2} \left(x _ {i}\right) > t + n \mathbb {E} f ^ {2} (X)\right) \leq \exp \left(- \frac {t ^ {2}}{2 \left(n \mathbb {E} | f ^ {2} (X) - \mathbb {E} f ^ {2} (X) | ^ {2}\right) + \frac {C ^ {2} t}{3}}\right) \\ \leq \exp \left(- \frac {t ^ {2}}{2 \left(n C ^ {2} \| f \| _ {2} ^ {2} + \frac {C ^ {2} t}{3}\right)}\right) \\ \leq \exp \left(- \frac {t ^ {2}}{4 \max \{n C ^ {2} \| f \| _ {2} ^ {2} , \frac {C ^ {2} t}{3} \}}\right). \\ \end{array}
+$$
+
+Hence, with probability of at least $1 - \delta_{1}$ we have
+
+$$
+\begin{array}{l} \sum_ {i = 1} ^ {n} f ^ {2} \left(x _ {i}\right) \leq \max \left\{\sqrt {4 C ^ {2} \log \frac {1}{\delta_ {1}} n \| f \| _ {2} ^ {2}}, \frac {4 C ^ {2}}{3} \log \frac {1}{\delta_ {1}} \right\} + n \mathbb {E} f ^ {2} (X) \\ \leq \tilde {O} \left(\max \left\{\sqrt {C ^ {2} n \| f \| _ {2} ^ {2}}, C ^ {2} \right\}\right) + n \| f \| _ {2} ^ {2} \tag {44} \\ \leq \tilde {O} \left(\sqrt {C ^ {2} n \| f \| _ {2} ^ {2}} + C ^ {2}\right) + n \| f \| _ {2} ^ {2}. \\ \end{array}
+$$
+
+
+
+For the proofs in the reminder of this section, the definitions of the relevant quantities are given in Section 3.
+
+Corollary 19. With probability of at least $1 - \delta_{1}$ , we have
+
+$$
+\left\| f _ {> R} (\mathbf {x}) \right\| _ {2} ^ {2} = \tilde {O} \left(\left(\frac {1}{\delta_ {1}} + 1\right) n R ^ {1 - 2 \beta}\right).
+$$
+
+Proof of Corollary 19. The $L_{2}$ norm of $f_{>R}(x)$ is given by $\| f_{>R}\| _2^2 = \sum_{p = R + 1}^{\infty}\mu_p^2\leq \frac{C_\mu}{2\beta - 1} R^{1 - 2\beta}$ . Applying Lemma 17 we get the result.
+
+Corollary 20. For any $\nu \in \mathbb{R}^R$ , with probability of at least $1 - \delta_1$ we have
+
+$$
+\| \Phi_ {R} \nu \| _ {2} ^ {2} = \tilde {O} \left(\left(\frac {1}{\delta_ {1}} + 1\right) n \| \nu \| _ {2} ^ {2}\right).
+$$
+
+Proof of Corollary 20. Let $g(x) = \sum_{p=1}^{R} \nu_p \phi_p(x)$ . Then $\Phi_R \nu = g(\mathbf{x})$ . The $L_2$ norm of $g(x)$ is given by $\| g \|_2^2 = \sum_{p=1}^{R} \nu_p^2 = \| \nu \|_2^2$ . Applying Lemma 17 we get the result.
+
+Next we consider the quantity, $\Phi_R^T\Phi_R - nI$ . The key tool that we use is the matrix Bernstein inequality that describes the upper tail of a sum of independent zero-mean random matrices.
+
+Lemma 21. Let $D = \mathrm{diag}\{d_1, \ldots, d_R\}$ , $d_1, \ldots, d_R > 0$ and $d_{\max} = \max \{d_1, \ldots, d_R\}$ . Let $M = \max \{\sum_{p=0}^{R} d_p^2 \| \phi_p \|^2_\infty, d_{\max}^2\}$ . Then with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| D \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) D \right\| _ {2} \leq \max \left\{\sqrt {n d _ {\operatorname* {m a x}} ^ {2} M \log \frac {R}{\delta}}, M \log \frac {R}{\delta}) \right\}. \tag {45}
+$$
+
+Proof of Lemma 21. Let $Y_{j} = (\phi_{1}(x_{j}),\ldots ,\phi_{R}(x_{j}))^{T}$ and $Z_{j} = DY_{j}$ . It is easy to verify that $\mathbb{E}(Z_jZ_j^T) = D^2$ . Then the left hand side of (45) is $\sum_{j = 1}^{n}[Z_{j}Z_{j}^{T} - \mathbb{E}(Z_{j}Z_{j}^{T})]$ . We note that
+
+$$
+\left\| Z _ {j} Z _ {j} ^ {T} - \mathbb {E} \left(Z _ {j} Z _ {j} ^ {T}\right) \right\| _ {2} \leq \max \left\{\left\| Z _ {j} Z _ {j} ^ {T} \right\| _ {2}, \left\| \mathbb {E} \left(Z _ {j} Z _ {j} ^ {T}\right) \right\| _ {2} \right\} \leq \max \left\{\left\| Z _ {j} \right\| _ {2} ^ {2}, d _ {\max } ^ {2} \right\}.
+$$
+
+For $\| Z_j\| _2^2$ we have
+
+$$
+\left\| Z _ {j} \right\| _ {2} ^ {2} = \sum_ {p = 0} ^ {R} d _ {p} ^ {2} \phi_ {p} ^ {2} \left(x _ {j}\right) \leq \sum_ {p = 0} ^ {R} d _ {p} ^ {2} \left\| \phi_ {p} \right\| _ {\infty} ^ {2}, \tag {46}
+$$
+
+we have
+
+$$
+\left\| Z _ {j} Z _ {j} ^ {T} - \mathbb {E} \left(Z _ {j} Z _ {j} ^ {T}\right) \right\| _ {2} \leq \max \left\{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2}, d _ {\max } ^ {2} \right\}.
+$$
+
+On the other hand,
+
+$$
+\mathbb {E} [ (Z _ {j} Z _ {j} ^ {T} - \mathbb {E} (Z _ {j} Z _ {j} ^ {T})) ^ {2} ] = \mathbb {E} [ \| Z _ {j} \| _ {2} ^ {2} Z _ {j} Z _ {j} ^ {T} ] - (\mathbb {E} (Z _ {j} Z _ {j} ^ {T})) ^ {2}.
+$$
+
+Since
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| Z _ {j} \| _ {2} ^ {2} Z _ {j} Z _ {j} ^ {T} \right] \preccurlyeq \mathbb {E} \left[ \sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} Z _ {j} Z _ {j} ^ {T} \right], \quad (\text {b y}) \\ = \sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} \mathbb {E} [ Z _ {j} Z _ {j} ^ {T} ], \\ \end{array}
+$$
+
+we have
+
+$$
+\begin{array}{l} \| \mathbb {E} [ (Z _ {j} Z _ {j} ^ {T} - \mathbb {E} (Z _ {j} Z _ {j} ^ {T})) ^ {2} ] \| _ {2} \leq \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} \| \mathbb {E} [ Z _ {j} Z _ {j} ^ {T} ] \| _ {2}, d _ {\max } ^ {4} \} \\ \leq \max \left\{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} d _ {\max } ^ {2}, d _ {\max } ^ {4} \right\} \\ \leq d _ {\max} ^ {2} \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2}, d _ {\max} ^ {2} \}. \\ \end{array}
+$$
+
+Using the matrix Bernstein inequality (Tropp, 2012, Theorem 6.1), we have
+
+$$
+\begin{array}{l} \mathbb {P} \left(\| \sum_ {j = 1} ^ {n} \left[ Z _ {j} Z _ {j} ^ {T} - \mathbb {E} \left(Z _ {j} Z _ {j} ^ {T}\right) \right] \| _ {2} > t\right) \\ \leq R \mathrm {e x p} \left(\frac {- t ^ {2}}{2 (n \| \mathbb {E} [ (Z _ {j} Z _ {j} ^ {T} - \mathbb {E} (Z _ {j} Z _ {j} ^ {T})) ^ {2} ] \| _ {2} + \frac {t \max _ {j} \| Z _ {j} Z _ {j} ^ {T} - \mathbb {E} (Z _ {j} Z _ {j} ^ {T}) \| _ {2}}{3})}\right) \\ \leq R \exp \left(\frac {- t ^ {2}}{2 (n d _ {\max} ^ {2} \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} , d _ {\max} ^ {2} \} + \frac {t \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} , d _ {\max} ^ {2} \}}{3})}\right) \\ = R \exp \left(\frac {- t ^ {2}}{O \left(\max \left\{n d _ {\operatorname* {m a x}} ^ {2} \max \left\{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} , d _ {\operatorname* {m a x}} ^ {2} \right\} , t \max \left\{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} , d _ {\operatorname* {m a x}} ^ {2} \right\} \right\}\right)}\right). \\ \end{array}
+$$
+
+Then with probability of at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \| \sum_ {j = 1} ^ {n} \left[ Z _ {j} Z _ {j} ^ {T} - \mathbb {E} \left(Z _ {j} Z _ {j} ^ {T}\right) \right] \| _ {2} \\ \leq \max \Bigg \{\sqrt {n d _ {\mathrm {m a x}} ^ {2} \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2} , d _ {\mathrm {m a x}} ^ {2} \} \log \frac {R}{\delta}}, \max \{\sum_ {p = 0} ^ {R} d _ {p} ^ {2} \| \phi_ {p} \| _ {\infty} ^ {2}, d _ {\mathrm {m a x}} ^ {2} \} \log \frac {R}{\delta} \Bigg \}. \\ \end{array}
+$$
+
+
+
+Corollary 22. Suppose that the eigenvalues $(\lambda_p)_{p\geq 1}$ satisfy Assumption 4, and the eigenfunctions satisfy Assumption 6. Assume $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ Let $\gamma$ be a positive number such that $\frac{1 + \alpha + 2\tau - (1 + 2\tau + 2\alpha)t}{2\alpha(1 - t)} < \gamma \leq 1$ . Then with probability of at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \| \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \Lambda_ {R} ^ {\gamma / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- \gamma / 2} \| _ {2} \\ \leq O \left(n ^ {\frac {1 + \alpha + 2 \tau - (1 + 2 \tau + 2 \alpha) t}{2 \alpha} - \gamma (1 - t)} \sqrt {\log \frac {R}{\delta}}\right). \tag {47} \\ \end{array}
+$$
+
+Proof of Corollary 22. Use the same notation as in Lemma 21. Let $D = (I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\Lambda_R^{\gamma /2}$ . Then $d_{\mathrm{max}}^2\leq \frac{\sigma^{2\gamma}}{n^\gamma}$ and $\sum_{p = 0}^{R}d_{p}^{2}\| \phi_{p}\|_{\infty}^{2}\leq \sum_{p = 0}^{R}C_{\phi}^{2}\frac{\lambda_{p}^{\gamma}p^{2\tau}}{(1 + \frac{n}{\sigma^2}\lambda_p)^\gamma} = O((\frac{n}{\sigma^2})^{\frac{1 - \gamma\alpha + 2\tau}{\alpha}})$ , where the first inequality follows from Assumptions 4 and 6 and the last equality from Lemma 15. Then $M = \max \{\sum_{p = 0}^{R}d_{p}^{2}\| \phi_{p}\|_{\infty}^{2},d_{\mathrm{max}}^{2}\} = O((\frac{n}{\sigma^2})^{\frac{1 - \gamma\alpha + 2\tau}{\alpha}})$ . Applying Lemma 21, we have
+
+$$
+\begin{array}{l} \| \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \Lambda_ {R} ^ {\gamma / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- \gamma / 2} \| _ {2} \\ \leq \frac {1}{\sigma^ {2}} \max \left\{\sqrt {n ^ {\frac {\sigma^ {2 \gamma}}{n ^ {\gamma}}} O \left(\left(\frac {n}{\sigma^ {2}}\right) ^ {\frac {1 - \gamma \alpha + 2 \tau}{\alpha}}\right) \log \frac {R}{\delta}}, O \left(\left(\frac {n}{\sigma^ {2}}\right) ^ {\frac {1 - \gamma \alpha + 2 \tau}{\alpha}}\right) \log \frac {R}{\delta} \right\} \\ = O \left(\frac {1}{\sigma^ {2}} \left(\frac {n}{\sigma^ {2}}\right) ^ {\frac {1 - 2 \gamma \alpha + 2 \tau}{2 \alpha}} n ^ {\frac {1}{2}}\right) = O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {(1 - 2 \gamma \alpha + 2 \tau) (1 - t)}{2 \alpha} + \frac {1}{2} - t}\right) \tag {48} \\ = O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1 + \alpha + 2 \tau}{2 \alpha} - \frac {(1 + 2 \tau + 2 \alpha) t}{2 \alpha} - \gamma (1 - t)}\right). \\ \end{array}
+$$
+
+
+
+Corollary 23. Suppose that the eigenvalues $(\lambda_p)_{p\geq 1}$ satisfy Assumption 4, and the eigenfunctions satisfy Assumption 6. Let $\tilde{\Lambda}_{1,R} = \mathrm{diag}\{1,\lambda_1,\dots,\lambda_R\}$ . Assume $\sigma^2 = \Theta (n^t)$ where $t < 1$ Let $\gamma$ be a positive number such that $\frac{1 + 2\tau}{\alpha} < \gamma \leq 1$ . Then with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \tilde {\Lambda} _ {1, R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \tilde {\Lambda} _ {1, R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \right\| _ {2} \leq O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}}\right). \tag {49}
+$$
+
+Proof of Corollary 23. Use the same notation as in Lemma 21. Let $D = (I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\tilde{\Lambda}_{1,R}^{\gamma /2}$ . Then $d_{\max}^{2}\leq 1$ and $\sum_{p = 0}^{R}d_{p}^{2}\| \phi_{p}\|_{\infty}^{2}\leq C_{\phi}^{2} + \sum_{p = 1}^{R}C_{\phi}^{2}\frac{\lambda_{p}^{\gamma}p^{2\tau}}{(1 + \frac{n}{\sigma^{2}}\lambda_{p})^{\gamma}} = C_{\phi}^{2} + O(n^{\frac{(1 - \gamma\alpha + 2\tau)(1 - t)}{\alpha}}) = O(1)$ where the first inequality follows from Assumptions 4 and 6 and the second equality from Lemma 15. Then $M = \max \{\sum_{p = 0}^{R}d_{p}^{2}\| \phi_{p}\|_{\infty}^{2},d_{\max}^{2}\} = O(1)$ . Applying Lemma 21, we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \right\| _ {2} \\ \leq \max \left\{\sqrt {\log \frac {R}{\delta} n O (1)}, \log \frac {R}{\delta} O (1) \right\} \tag {50} \\ = O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}}\right). \\ \end{array}
+$$
+
+
+
+Corollary 24. Suppose that the eigenvalues $(\lambda_p)_{p\geq 1}$ satisfy Assumption 4, and the eigenfunctions satisfy Assumption 6. Let $\Phi_{R + 1:S} = (\phi_{R + 1}(\mathbf{x}),\dots,\phi_S(\mathbf{x}))$ , and $\Lambda_{R + 1:S} = (\lambda_{R + 1},\dots,\lambda_S)$ . Then with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| \Lambda_ {R + 1: S} ^ {1 / 2} \left(\Phi_ {R + 1: S} ^ {T} \Phi_ {R + 1: S} - n I\right) \Lambda_ {R + 1: S} ^ {1 / 2} \right\| _ {2} \leq O \left(\log \frac {S - R}{\delta} \max \left\{n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \right\}\right). \tag {51}
+$$
+
+Proof of Corollary 24. Use the same notation as in Lemma 21. Let $D = \Lambda_{R + 1:S}^{1/2}$ . Then $d_{\max}^2 \leq \overline{C_\lambda} R^{-\alpha} = O(R^{-\alpha})$ and $\sum_{p = R + 1}^{S} C_\phi^2 d_p^2 p^{2\tau} \leq \sum_{p = R + 1}^{S} C_\phi^2 \overline{C_\lambda} p^{-\alpha} p^{2\tau} = O(R^{1 - \alpha + 2\tau})$ , where the first inequality follows from Assumptions 4 and 6. Then $M = \max \{\sum_{p = R + 1}^{S} C_\phi^2 d_p^2 p^{2\tau}, d_{\max}^2\} = O(R^{1 - \alpha + 2\tau})$ . Applying Lemma 21, we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \right\| _ {2} \\ \leq \max \left\{\sqrt {\log \frac {S - R}{\delta} n O (R ^ {- \alpha}) O \left(R ^ {1 - \alpha + 2 \tau}\right)}, \log \frac {S - R}{\delta} O \left(R ^ {1 - \alpha + 2 \tau}\right) \right\} \tag {52} \\ = O \big (\log \frac {S - R}{\delta} \mathrm {m a x} \{n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \} \big). \\ \end{array}
+$$
+
+
+
+Lemma 25. Under the assumptions of Corollary 24, with probability of at least $1 - \delta$ , we have
+
+$$
+\| \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T} \| _ {2} = \tilde {O} \big (\max \{n R ^ {- \alpha}, n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \} \big).
+$$
+
+Proof of Lemma 25. For $S\in \mathbb{N}$ , we have
+
+$$
+\begin{array}{l} \| \Phi_ {> S} \Lambda_ {> S} \Phi_ {> S} ^ {T} \| _ {2} \leq \sum_ {p = S + 1} ^ {\infty} \| \Lambda_ {p} \phi_ {p} (\mathbf {x}) \phi_ {p} (\mathbf {x}) ^ {T} \| _ {2} \\ = \sum_ {p = S + 1} ^ {\infty} \lambda_ {p} \| \phi_ {p} (\mathbf {x}) \| _ {2} ^ {2} \\ \leq \sum_ {p = S + 1} ^ {\infty} \lambda_ {p} n C _ {\phi} ^ {2} p ^ {2 \tau} \\ = O \left(n S ^ {1 - \alpha + 2 \tau}\right). \\ \end{array}
+$$
+
+Let $S = R^{\frac{\alpha}{\alpha - 1 - 2\tau}}$ . Then we get $\| \Phi_{>S}\Lambda_{>S}\Phi_{>S}^{T}\|_{2} = O(nR^{-\alpha})$ .
+
+Let $\Phi_{R + 1:S} = (\phi_{R + 1}(\mathbf{x}),\dots,\phi_S(\mathbf{x}))$ $\Lambda_{R + 1:S} = (\lambda_{R + 1},\dots,\lambda_S)$ . We then have
+
+$$
+\begin{array}{l} \left\| \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T} \right\| _ {2} \leq \left\| \Phi_ {> S} \Lambda_ {> S} \Phi_ {> S} ^ {T} \right\| _ {2} + \left\| \Phi_ {R + 1: S} \Lambda_ {R + 1: S} \Phi_ {R + 1: S} ^ {T} \right\| _ {2} \\ \leq O (n R ^ {- \alpha}) + \| \Lambda_ {R + 1: S} ^ {1 / 2} \Phi_ {R + 1: S} ^ {T} \Phi_ {R + 1: S} \Lambda_ {R + 1: S} ^ {1 / 2} \| _ {2} \\ \leq O (n R ^ {- \alpha}) + n \| \Lambda_ {R + 1: S} \| _ {2} + \| \Lambda_ {R + 1: S} ^ {1 / 2} \left(\Phi_ {R + 1: S} ^ {T} \Phi_ {R + 1: S} - n I\right) \Lambda_ {R + 1: S} ^ {1 / 2} \| _ {2} \\ \leq O (n R ^ {- \alpha}) + O (n R ^ {- \alpha}) + O (\log \frac {R ^ {\frac {\alpha}{\alpha - 1}} - R}{\delta} \max \{n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \}) \\ = \tilde {O} \left(\max \left\{n R ^ {- \alpha}, n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \right\}\right), \\ \end{array}
+$$
+
+where in the fourth inequality we use Corollary 24.
+
+Corollary 26. Assume that $\sigma^2 = \Theta(1)$ . If $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{\alpha(1 + 2\tau)}$ , then with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \right\| _ {2} \leq \left\| \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \right\| _ {2} = \tilde {O} (n ^ {- \kappa \alpha}) = o (1).
+$$
+
+Proof of Corollary 26. By Lemma 25 and the assumption $R = n^{\frac{1}{\alpha} + \kappa}$ , we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \right\| _ {2} \leq \left\| \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \right\| _ {2} \\ \leq \tilde {O} (\max \{n R ^ {- \alpha}, n ^ {\frac {1}{2}} R ^ {\frac {1 - 2 \alpha + 2 \tau}{2}}, R ^ {1 - \alpha + 2 \tau} \}) \\ = \tilde {O} \left(n ^ {- \kappa \alpha}\right). \\ \end{array}
+$$
+
+Lemma 27. Assume that $\| \frac{1}{\sigma^2} (I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\Lambda_R^{\gamma /2}(\Phi_R^T\Phi_R - nI)\Lambda_R^{\gamma /2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\| _2 < 1$ where $\frac{1 + 2\tau}{\alpha} < \gamma \leq 1$ . We then have
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \big (\Phi_ {R} ^ {T} \Phi_ {R} - n I \big)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1}. \\ \end{array}
+$$
+
+Proof of Lemma 27. First note that
+
+$$
+\begin{array}{l} \left\| \frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right\| _ {2} \\ < \left\| \frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \right\| _ {2} < 1. \\ \end{array}
+$$
+
+Let $\tilde{\Lambda}_{\epsilon,R} = \mathrm{diag}\{\epsilon,\lambda_1,\dots,\lambda_R\}$ . Since $\Lambda_R = \mathrm{diag}\{0,\lambda_1,\dots,\lambda_R\}$ , we have that when $\epsilon$ is sufficiently small, $\| \frac{1}{\sigma^2} (I + \frac{n}{\sigma^2}\tilde{\Lambda}_{\epsilon,R})^{-1 / 2}\tilde{\Lambda}_{\epsilon,R}^{1 / 2}(\Phi_R^T\Phi_R - nI)\tilde{\Lambda}_{\epsilon,R}^{1 / 2}(I + \frac{n}{\sigma^2}\tilde{\Lambda}_{\epsilon,R})^{-1 / 2}\| _2 < 1$ . Since all diagonal entries of $\tilde{\Lambda}_{\epsilon,R}$ are positive, we have
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = \big (I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R} + \frac {1}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \big) ^ {- 1} \\ = \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \left[ I + \frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \right] ^ {- 1} \\ \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1 / 2} \\ = \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1} \\ + \sum_ {j = 1} ^ {\infty} \left[ (- 1) ^ {j} \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \tilde {\Lambda} _ {\epsilon , R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2}\right) ^ {j} \right. \\ \left. \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1 / 2} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1 / 2} \right] \\ = \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1}. \\ \end{array}
+$$
+
+Letting $\epsilon \to 0$ , we get
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1}. \\ \end{array}
+$$
+
+This concludes the proof.
+
+
+
+Lemma 28. If $\| (I + \frac{\Phi_R\Lambda_R\Phi_R^T}{\sigma^2})^{-1}\frac{\Phi_{>R}\Lambda_{>R}\Phi_{>R}^T}{\sigma^2}\| _2 < 1$ , then we have
+
+$$
+(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} - (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} = \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}. \tag {53}
+$$
+
+In particular, assume that $\sigma^2 = \Theta(1)$ . Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{\alpha(1 + 2\tau)}$ . Then with probability of at least $1 - \delta$ , for sufficiently large $n$ , we have $\| (I + \frac{\Phi_R \Lambda_R \Phi_R^T}{\sigma^2})^{-1} \frac{\Phi_{>R} \Lambda_{>R} \Phi_{>R}^T}{\sigma^2} \|_2 < 1$ and (53) holds.
+
+Proof of Lemma 28. Define $\Phi_{>R} = (\phi_{R + 1}(\mathbf{x}),\phi_{R + 2}(\mathbf{x}),\dots),\Lambda_{>R} = \mathrm{diag}(\lambda_{R + 1},\lambda_{R + 2},\dots)$ . Then we have
+
+$$
+\begin{array}{l} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \\ = \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}} + \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \\ = \left(\left(I + \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} - I\right) \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}. \\ \end{array}
+$$
+
+By Corollary 26, for sufficiently large $n$ , $\| (I + \frac{\Phi_R\Lambda_R\Phi_R^T}{\sigma^2})^{-1}\frac{\Phi_{>R}\Lambda_{>R}\Phi_{>R}^T}{\sigma^2}\|_2 < 1$ with probability of at least $1 - \delta$ . Hence
+
+$$
+\begin{array}{l} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \\ = \left(\left(I + \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} - I\right) \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \\ = \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}. \\ \end{array}
+$$
+
+
+
+Lemma 29. Assume that $\mu_0 = 0$ and $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Let $R = n^{(\frac{1}{\alpha} +\kappa)(1 - t)}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{\alpha^2(1 - t)}$ . Then when $n$ is sufficiently large, with probability of at least $1 - 2\delta$ we have
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {\max \{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \}}\right). \tag {54}
+$$
+
+Proof of Lemma 29. Let $\Lambda_{1:R} = \mathrm{diag}\{\lambda_1, \ldots, \lambda_R\}$ , $\Phi_{1:R} = (\phi_1(\mathbf{x}), \phi_1(\mathbf{x}), \ldots, \phi_R(\mathbf{x}))$ and $\pmb{\mu}_{1:R} = (\mu_1, \ldots, \mu_R)$ . Since $\mu_0 = 0$ , we have $(I + \frac{1}{\sigma^2} \Phi_R \Lambda_R \Phi_R^T)^{-1} f_R(\mathbf{x}) = (I + \frac{1}{\sigma^2} \Phi_{1:R} \Lambda_{1:R} \Phi_{1:R}^T)^{-1} \Phi_{1:R} \pmb{\mu}_{1:R}$ . Using the Woodbury matrix identity, we have that
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: R} \Lambda_ {1: R} \Phi_ {1: R} ^ {T}\right) ^ {- 1} \Phi_ {1: R} \boldsymbol {\mu} _ {1: R} = \left[ I - \Phi_ {1: R} \left(\sigma^ {2} I + \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \right] \Phi_ {1: R} \boldsymbol {\mu} _ {1: R} \\ = \Phi_ {1: R} \boldsymbol {\mu} _ {1: R} - \Phi_ {1: R} \left(\sigma^ {2} I + \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R} \boldsymbol {\mu} _ {1: R} \\ = \Phi_ {1: R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R}. \tag {55} \\ \end{array}
+$$
+
+Let $A = (I + \frac{n}{\sigma^2}\Lambda_{1:R})^{-1/2}\Lambda_{1:R}^{1/2}(\Phi_{1:R}^T\Phi_{1:R} - nI)\Lambda_{1:R}^{1/2}(I + \frac{n}{\sigma^2}\Lambda_{1:R})^{-1/2}$ . By Corollary 22, with probability of at least $1 - \delta$ , we have $\| \frac{1}{\sigma^2}A\|_2 = \sqrt{\log\frac{R}{\delta}}n^{\frac{1 - \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau)t}{2\alpha}}$ . When $n$ is sufficiently large, $\| \frac{1}{\sigma^2}A\|_2 = o(1)$ is less than 1 because $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . By Lemma 27, we have
+
+$$
+\begin{array}{l} (I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}) ^ {- 1} \\ = \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R} \big) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \big (\frac {1}{\sigma^ {2}} \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R} \big) ^ {- 1} \Lambda_ {1: R} \big (\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I \big) \big) ^ {j} \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R} \big) ^ {- 1}. \\ \end{array}
+$$
+
+We then have
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2}
+$$
+
+$$
+\begin{array}{l} = \left\| \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \Lambda_ {1: R} \left(\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1}\right) \boldsymbol {\mu} _ {1: R} \right\| _ {2} \\ \leq \left(\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} + \sum_ {j = 1} ^ {\infty} \left\| \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \Lambda_ {1: R} \left(\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2}\right). \tag {56} \\ \end{array}
+$$
+
+By Lemma 15 and Assumption 5, assuming that $\sup_{i\geq 1}p_{i + 1} - p_i = h$ , we have
+
+$$
+\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2} \leq \sqrt {\sum_ {p = 1} ^ {R} \frac {C _ {\mu} ^ {2} p ^ {- 2 \beta}}{\left(1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}\right) ^ {2}}} = \Theta \left(n ^ {\max \{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \}} \log^ {k / 2} n\right),
+$$
+
+$$
+\| (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2} \geq \sqrt {\sum_ {i = 1} ^ {\lfloor \frac {R}{h} \rfloor} \frac {C _ {\underline {{\mu}}} ^ {2} i ^ {- 2 \beta}}{(1 + \frac {n}{\sigma^ {2}} \overline {{C _ {\lambda}}} (h i) ^ {- \alpha}) ^ {2}}} = \Theta (n ^ {\max \{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \}} \log^ {k / 2} n)
+$$
+
+where $k = \left\{ \begin{array}{ll}0, & 2\alpha \neq 2\beta -1,\\ 1, & 2\alpha = 2\beta -1. \end{array} \right.$ . Overall we have
+
+$$
+\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right). \tag {57}
+$$
+
+Using the fact that $\| \frac{1}{\sigma^2} A \|_2 = \sqrt{\log \frac{R}{\delta}} n^{\frac{1 - \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau)t}{2\alpha}}$ and $\|(I + \frac{n}{\sigma^2} \Lambda_{1:R})^{-1} \Lambda_{1:R}\|_2 \leq n^{-1}$ , we have
+
+$$
+\begin{array}{l} \left\| \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \Lambda_ {1: R} \left(\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I\right)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} \\ = \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- \frac {1}{2}} \Lambda_ {1: R} ^ {\frac {1}{2}} \left(\frac {1}{\sigma^ {2}} A\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- \frac {1}{2}} \Lambda_ {1: R} ^ {\frac {1}{2}} \boldsymbol {\mu} _ {1: R} \right\| _ {2} \tag {58} \\ \leq \tilde {O} \left(n ^ {- \frac {1 - t}{2}}\right) \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- \frac {1}{2}} \Lambda_ {1: R} ^ {- \frac {1}{2}} \boldsymbol {\mu} _ {1: R} \| _ {2} \\ \end{array}
+$$
+
+By Lemma 16 and the assumption $R = n^{\left(\frac{1}{\alpha} + \kappa\right)(1 - t)}$ ,
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- \frac {1}{2}} \Lambda_ {1: R} ^ {- \frac {1}{2}} \boldsymbol {\mu} _ {1: R} \right\| _ {2} \leq \sqrt {\sum_ {p = 1} ^ {R} \frac {\left(C _ {\lambda} p ^ {- \alpha}\right) ^ {- 1} C _ {\mu} ^ {2} p ^ {- 2 \beta}}{\left(1 + n \underline {{C}} _ {\lambda} p ^ {- \alpha} / \sigma^ {2}\right) ^ {1}}} \tag {59} \\ = \tilde {O} \left(\max \left\{n ^ {- (1 - t) / 2}, R ^ {1 / 2 - \beta + \alpha / 2} \right\}\right) \\ = \tilde {O} \left(\max \left\{n ^ {- (1 - t) / 2}, n ^ {\left(\frac {1}{2} + \frac {1 - 2 \beta}{2 \alpha} + \kappa (1 / 2 - \beta + \alpha / 2)\right) (1 - t)} \right\}\right) \\ \end{array}
+$$
+
+We then have
+
+$$
+\begin{array}{l} \left\| \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \Lambda_ {1: R} \left(\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} \tag {60} \\ = \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \tilde {O} (\max \{n ^ {- (1 - t)}, n ^ {(\frac {1 - 2 \beta}{2 \alpha} + \kappa (1 / 2 - \beta + \alpha / 2)) (1 - t)} \}) \\ \end{array}
+$$
+
+By (56), (57) and (60), we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} \\ = \Theta (n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n) + \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \tilde {O} (\max \{n ^ {- (1 - t)}, n ^ {(1 - t) \frac {1 - 2 \beta}{2 \alpha} + \kappa (1 - t) (1 / 2 - \beta + \alpha / 2)} \}) \\ = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) + \tilde {O} \left(n ^ {\frac {1 - \alpha + 2 \tau}{2 \alpha} - \frac {(1 + 2 \tau) t}{2 \alpha}}\right) \tilde {O} \left(\max \{n ^ {- (1 - t)}, n ^ {(1 - t) \frac {1 - 2 \beta}{2 \alpha} + \kappa (1 - t) (1 / 2 - \beta + \alpha / 2)} \}\right). \tag {61} \\ \end{array}
+$$
+
+By assumption $\kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{\alpha^2(1 - t)}$ , we have that
+
+$$
+\kappa (1 - t) (1 / 2 - \beta + \alpha / 2) + \frac {1 - \alpha + 2 \tau}{2 \alpha} - \frac {(1 + 2 \tau) t}{2 \alpha} < \kappa \alpha (1 - t) / 2 + \frac {1 - \alpha + 2 \tau}{2 \alpha} - \frac {(1 + 2 \tau) t}{2 \alpha} < 0.
+$$
+
+Using (61), we then get
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \\ = \frac {1 + o (1)}{\sigma^ {2}} \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2}. \tag {62} \\ \end{array}
+$$
+
+By Corollary 20, with probability of at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \left\| \Phi_ {1: R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} = \tilde {O} (\sqrt {\left(\frac {1}{\delta} + 1\right) n} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2}) \tag {63} \\ = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right). \\ \end{array}
+$$
+
+From (55), we get $\| (I + \frac{1}{\sigma^2}\Phi_{1:R}\Lambda_{1:R}\Phi_{1:R}^T)^{-1}\Phi_{1:R}\pmb{\mu}_{1:R}\|_2 = \tilde{O} (\sqrt{(\frac{1}{\delta} + 1)n}\cdot n^{(1 - t)\max \left\{-1,\frac{1 - 2\beta}{2\alpha}\right\}})$ . This concludes the proof.
+
+Lemma 30. Assume that $\mu_0 > 0$ and $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Let $R = n^{\frac{1}{\alpha} +\kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{\alpha^2}$ . Then when $n$ is sufficiently large, with probability of at least $1 - 2\delta$ , we have
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n}\right). \tag {64}
+$$
+
+Proof of Lemma 30. Using the Woodbury matrix identity, we have that
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} f _ {R} (\mathbf {x}) = \left[ I - \Phi_ {R} \left(\sigma^ {2} I + \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T} \right] \Phi_ {R} \pmb {\mu} _ {R} \\ = \Phi_ {R} \boldsymbol {\mu} _ {R} - \Phi_ {R} \left(\sigma^ {2} I + \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R} \boldsymbol {\mu} _ {R} \tag {65} \\ = \Phi_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R}. \\ \end{array}
+$$
+
+Let $\pmb{\mu}_{R,1} = (\mu_0,0,\dots,0)$ and $\pmb{\mu}_{R,2} = (0,\mu_1,\dots,\mu_R)$ . Then $\pmb{\mu}_R = \pmb{\mu}_{R,1} + \pmb{\mu}_{R,2}$ . Then we have
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right\| _ {2} = \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} + \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 2} \right\| _ {2}. \tag {66}
+$$
+
+According to (62) in the proof of Lemma 29, we have $\| (I + \frac{1}{\sigma^2}\Lambda_R\Phi_R^T\Phi_R)^{-1}\pmb{\mu}_{R,2}\|_2 = \tilde{O}(n^{\max\{-(1-t), \frac{(1-t)(1-2\beta)}{2\alpha}})$ . Next we estimate $\| (I + \frac{1}{\sigma^2}\Lambda_R\Phi_R^T\Phi_R)^{-1}\pmb{\mu}_{R,1}\|_2$ .
+
+Let
+
+$$
+A = (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- \gamma / 2} \Lambda_ {1: R} ^ {\gamma / 2} (\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I) \Lambda_ {1: R} ^ {\gamma / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- \gamma / 2}
+$$
+
+where $\frac{1}{1 - t} \left( \frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} \right) < \gamma < 1$ . Since $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ , $\frac{1}{1 - t} \left( \frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} \right) < 1$ so the range for $\gamma$ is well-defined. By Corollary 22, with probability of at least $1 - \delta$ , we have $\| \frac{1}{\sigma^2} A \|_2 = \tilde{O} \left( \sqrt{\log \frac{R}{\delta}} n^{\frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} - \gamma(1 - t)} \right) = o(1)$ . When $n$ is sufficiently large, $\| \frac{1}{\sigma^2} A \|_2$ is less than 1 because $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . By Lemma 27, we have
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \big (\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \big) ^ {j} \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) ^ {- 1}. \\ \end{array}
+$$
+
+We then have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \\ = \left\| \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right) \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \\ \leq \left(\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} + \sum_ {j = 1} ^ {\infty} \left\| \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2}\right). \tag {67} \\ \end{array}
+$$
+
+By Lemma 15,
+
+$$
+\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \leq \sqrt {\mu_ {0} ^ {2} + \sum_ {p = 1} ^ {R} \frac {C _ {\mu} ^ {2} p ^ {- 2 \beta}}{\left(1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}\right) ^ {2}}} = O (1). \tag {68}
+$$
+
+Let $\tilde{\Lambda}_{1,R} = \mathrm{diag}\{1,\lambda_1,\ldots ,\lambda_R\}$ and $I_{0,R} = (0,1,\dots,1)$ . Then $\Lambda_R = \tilde{\Lambda}_{1,R}I_{0,R}$ . Let $B = (I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\tilde{\Lambda}_{1,R}^{\gamma /2}(\Phi_R^T\Phi_R - nI)\tilde{\Lambda}_{1,R}^{\gamma /2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}$ . According to Corollary 23, we have $\| B\| _2 = O\big(\sqrt{\log\frac{R}{\delta}} n^{\frac{1}{2}}\big)$ . Using the fact that $\| \frac{1}{\sigma^2} A\| _2 = \tilde{O}\big(\sqrt{\log\frac{R}{\delta}} n^{\frac{1 + \alpha + 2\tau}{2\alpha} -\frac{(1 + 2\tau + 2\alpha)t}{2\alpha} - \gamma (1 - t)}\big)$ , we have
+
+$$
+\begin{array}{l} \left\| \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \\ = \frac {1}{\sigma^ {2 j}} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} \Lambda_ {R} ^ {1 - \frac {\gamma}{2}} \left(A \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma}\right) ^ {j - 1} B \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \\ \leq \frac {1}{\sigma^ {2}} \left(n ^ {\left(- 1 + \frac {\gamma}{2} + (- 1 + \gamma) (j - 1)\right) (1 - t)} \tilde {O} \left(\sqrt {\log \frac {R}{\delta}} n ^ {(j - 1) \left(\frac {1 + \alpha + 2 \tau}{2 \alpha} - \frac {(1 + 2 \tau + 2 \alpha) t}{2 \alpha} - \gamma (1 - t)\right)}\right) \sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}} \| \boldsymbol {\mu} _ {R, 1} \| _ {2} \right. \\ \leq n ^ {(- 1 + \frac {\gamma}{2}) (1 - t) + \frac {1}{2} - t} \tilde {O} (n ^ {\frac {[ 1 - \alpha + 2 \tau - (1 + 2 \tau) t ] (j - 1)}{2 \alpha}}) \sqrt {\log \frac {R}{\delta}} \| \boldsymbol {\mu} _ {R , 1} \| _ {2} \\ = \tilde {O} \left(n ^ {- \frac {1}{2} + \frac {\gamma}{2} (1 - t) + \frac {[ 1 - \alpha + 2 \tau - (1 + 2 \tau) t ] (j - 1)}{2 \alpha}}\right). \tag {69} \\ \end{array}
+$$
+
+Since $\frac{1}{1 - t} \left( \frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} \right) < \gamma < 1$ and $-\frac{1}{2} + \frac{1}{1 - t} \left( \frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} \right) \frac{1 - t}{2} < 0$ , we can let $\gamma$ be a little bit larger than $\frac{1}{1 - t} \left( \frac{1 + \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau + 2\alpha)t}{2\alpha} \right)$ and make $-\frac{1}{2} + \frac{\gamma}{2} (1 - t) < 0$ holds. By (67), (68), (69), we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \right\| _ {2} \\ \leq O (1) + \sum_ {j = 1} ^ {\infty} \tilde {O} \left(n ^ {- \frac {1}{2} + \frac {\gamma}{2} (1 - t) + \frac {[ 1 - \alpha + 2 \tau - (1 + 2 \tau) t ] (j - 1)}{2 \alpha}}\right) \tag {70} \\ \leq O (1) + o (1) = O (1). \\ \end{array}
+$$
+
+According to (66), we have $\| (I + \frac{1}{\sigma^2}\Lambda_R\Phi_R^T\Phi_R)^{-1}\pmb {\mu}_R\| _2 = \tilde{O} (n^{\max \left\{-(1 - t),\frac{(1 - t)(1 - 2\beta)}{2\alpha}\right\}}) + O(1) =$ $O(1)$ . By Corollary 20, with probability of at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \left\| \Phi_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \right\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \| _ {2}) \\ = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n}\right). \\ \end{array}
+$$
+
+From (65), we get $\| (I + \frac{1}{\sigma^2}\Phi_R\Lambda_R\Phi_R^T)^{-1}f_R(\mathbf{x})\| _2 = \tilde{O}\bigg(\sqrt{(\frac{1}{\delta} + 1)n}\bigg)$ . This concludes the proof.
+
+
+
+Lemma 31. Assume that $\sigma^2 = \Theta(1)$ . Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{\alpha^2}$ . Assume that $\mu_0 = 0$ . Then when $n$ is sufficiently large, with probability of at least $1 - 3\delta$ we have
+
+$$
+\left\| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right). \tag {71}
+$$
+
+Assume that $\mu_0 > 0$ . Then when $n$ is sufficiently large, with probability of at least $1 - 3\delta$ we have
+
+$$
+\left\| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n}\right). \tag {72}
+$$
+
+Proof of Lemma 31. We have
+
+$$
+\begin{array}{l} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \\ = \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) + \left(\left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right) f _ {R} (\mathbf {x}). \tag {73} \\ \end{array}
+$$
+
+When $\mu_0 = 0$ , by Lemma 29, with probability of at least $1 - 2\delta$ , we have
+
+$$
+\| (I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} = \tilde {O} (\sqrt {(\frac {1}{\delta} + 1) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}).
+$$
+
+Since $\frac{\alpha - 1 - 2\tau}{\alpha^2} < \frac{\alpha - 1 - 2\tau}{\alpha(1 + 2\tau)}$ , we apply Lemma 28 and Corollary 26 and get that with probability of at least $1 - \delta$ , the second term in the right hand side of (73) is estimated as follows:
+
+$$
+\begin{array}{l} \left\| \left(\left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right) f _ {R} (\mathbf {x}) \right\| _ {2} \\ = \| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} \\ = \sum_ {j = 1} ^ {\infty} \left\| \left(\left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) \right\| _ {2} ^ {j} \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} \\ = \sum_ {j = 1} ^ {\infty} \tilde {O} (n ^ {- j \kappa \alpha}) \tilde {O} (\sqrt {(\frac {1}{\delta} + 1) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}) \\ = o (\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}). \\ \end{array}
+$$
+
+Overall, from (73), we have that with probability $1 - 3\delta$
+
+$$
+\left\| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right\| _ {2} = \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right).
+$$
+
+When $\mu_0 > 0$ , using the same approach and Lemma 30, we can prove that $\| (I + \frac{\Phi \Lambda \Phi^T}{\sigma^2})^{-1} f_R(\mathbf{x}) \|_2 = \tilde{O}(\sqrt{\left(\frac{1}{\delta} + 1\right)n})$ . This concludes the proof.
+
+# D PROOF OF THE MAIN RESULTS
+
+# D.1 PROOFS RELATED TO THE ASYMPTOTICS OF THE NORMALIZED STOCHASTIC COMPLEXITY
+
+Lemma 32. Under Assumptions 4, 5 and 6, with probability of at least $1 - 2\delta$ we have, we have
+
+$$
+\left| T _ {1, R} \left(D _ {n}\right) - T _ {1} \left(D _ {n}\right) \right| = \tilde {O} \left(\frac {1}{\sigma^ {2}} \left(n R ^ {1 - \alpha} + n ^ {1 / 2} R ^ {1 - \alpha + \tau} + R ^ {1 - \alpha + 2 \tau}\right)\right) \tag {74}
+$$
+
+If $R = n^{\frac{1}{\alpha} + \kappa}$ where $\kappa > 0$ , we have $|T_{1,R}(D_n) - T_1(D_n)| = o\left(\frac{1}{\sigma^2} n^{\frac{1}{\alpha}}\right)$ . If we further assume that $0 < \kappa < \frac{\alpha - 1 - 2\tau}{\alpha^2}$ , $\mu_0 = 0$ and $\sigma^2 = \Theta(1)$ , then for sufficiently large $n$ with probability of at least $1 - 4\delta$ we have
+
+$$
+\left| T _ {2, R} \left(D _ {n}\right) - T _ {2} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{\left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 + \frac {1 - 2 \beta}{\alpha} + \frac {(1 - 2 \beta) \kappa}{2}, - 1 - \kappa \alpha , 1 + \frac {1 - 2 \beta}{\alpha} - \kappa \alpha \right\}}\right). \tag {75}
+$$
+
+Proof of Lemma 32. Define $\Phi_{>R} = (\phi_{R+1}(\mathbf{x}), \phi_{R+2}(\mathbf{x}), \ldots, \phi_p(\mathbf{x}), \ldots)$ , and $\Lambda_{>R} = \mathrm{diag}(\lambda_{R+1}, \dots, \lambda_p, \dots)$ . We then have
+
+$$
+\begin{array}{l} \left| T _ {1} \left(D _ {n}\right) - T _ {1, R} \left(D _ {n}\right) \right| = \left| \frac {1}{2} \log \det \left(I + \frac {1}{\sigma^ {2}} \Phi \Lambda \Phi^ {T}\right) - \frac {1}{2} \log \det \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) \right| \\ + \frac {1}{2} \left| \operatorname {T r} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \operatorname {T r} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \right|. \\ \end{array}
+$$
+
+As for the first term in the right hand side of (76), we have
+
+$$
+\begin{array}{l} \left| \frac {1}{2} \mathrm {l o g d e t} \left(I + \frac {1}{\sigma^ {2}} \Phi \Lambda \Phi^ {T}\right) - \frac {1}{2} \mathrm {l o g d e t} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) \right| \\ = \left| \frac {1}{2} \mathrm {l o g d e t} \left((I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}) ^ {- 1} (I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T} + \frac {1}{\sigma^ {2}} \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T})\right) \right| \\ = \left| \frac {1}{2} \operatorname {l o g d e t} \left(I + \frac {1}{\sigma^ {2}} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}\right) \right| \\ = \frac {1}{2} \left| \operatorname {T r} \log \left(I + \frac {1}{\sigma^ {2}} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}\right) \right|. \\ \end{array}
+$$
+
+Given a concave function $h$ and a matrix $B \in \mathbb{R}^{n \times n}$ whose eigenvalues $\zeta_1, \dots, \zeta_n$ are all positive, we have that
+
+$$
+\operatorname {T r} h (B) = \sum_ {p = 1} ^ {n} h (\zeta_ {i}) \leq n h \left(\frac {1}{n} \sum_ {p = 1} ^ {n} \zeta_ {i}\right) \leq n h \left(\frac {1}{n} \operatorname {T r} B\right), \tag {78}
+$$
+
+where we used Jensen's inequality. Using $h(x) = \log (1 + x)$ in (78), with probability $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \left| \frac {1}{2} \mathrm {l o g d e t} (I + \frac {1}{\sigma^ {2}} \Phi \Lambda \Phi^ {T}) - \frac {1}{2} \mathrm {l o g d e t} (I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}) \right| \\ \leq \frac {n}{2} \log \left(1 + \frac {1}{n} \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}\right)\right) \\ \leq \frac {n}{2} \log \left(1 + \frac {1}{n \sigma^ {2}} \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \| _ {2} \operatorname {T r} \left(\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}\right)\right) \\ \leq \frac {n}{2} \log \left(1 + \frac {1}{n \sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \| \phi_ {p} (\mathbf {x}) \| _ {2} ^ {2}\right) \leq \frac {1}{2 \sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \| \phi_ {p} (\mathbf {x}) \| _ {2} ^ {2} \tag {79} \\ = \frac {1}{2 \sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \left(C _ {\phi} ^ {2} \tilde {O} \left(\sqrt {p ^ {2 \tau} n \| \phi_ {p} \| _ {2} ^ {2}} + p ^ {2 \tau}\right) + n \| \phi_ {p} \| _ {2} ^ {2}\right) \\ = \tilde {O} \big (\frac {1}{\sigma^ {2}} n \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} + n ^ {1 / 2} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} p ^ {\tau} + \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} p ^ {2 \tau} \big) \\ = \tilde {O} \left(\frac {1}{\sigma^ {2}} \left(n R ^ {1 - \alpha} + n ^ {1 / 2} R ^ {1 - \alpha + \tau} + R ^ {1 - \alpha + 2 \tau}\right)\right) = o \left(\frac {1}{\sigma^ {2}} n ^ {\frac {1}{\alpha}}\right), \\ \end{array}
+$$
+
+where in the second inequality we use the fact that $\mathrm{Tr}AB\leq \| A\| _2\mathrm{Tr}B$ when $A$ and $B$ are symmetric positive definite matrices, and in the last inequality we use Lemma 18.
+
+As for the second term in the right hand side of (76), let $A = \left(I + \frac{\Phi_R\Lambda_R\Phi_R^T}{\sigma^2}\right)^{-1 / 2}$ . Then we have
+
+$$
+\begin{array}{l} \frac {1}{2} \left| \operatorname {T r} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \operatorname {T r} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \right| \\ = \frac {1}{2} \left| \operatorname {T r} A \left[ I - (I + A (\frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}) A) ^ {- 1} \right] A \right| \\ \leq \frac {1}{2} \operatorname {T r} \left[ I - \left(I + A \left(\frac {\Phi_ {> R} \Lambda_ {> R}}{\sigma^ {2}} \Phi_ {> R} ^ {T}\right) A\right) ^ {- 1} \right] \\ \leq \frac {n}{2} (1 - (1 + \frac {1}{n} \mathrm {T r} A (\frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}) A) ^ {- 1}) \leq \frac {n}{2} (1 - (1 + \frac {1}{n} \mathrm {T r} (\frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}})) ^ {- 1}) \\ \leq \frac {n}{2} (1 - (1 + \frac {1}{n \sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \| \phi_ {p} (\mathbf {x}) \| _ {2} ^ {2})) ^ {- 1}) \leq \frac {1}{2 \sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \| \phi_ {p} (\mathbf {x}) \| _ {2} ^ {2} \\ = \tilde {O} \Big (\frac {1}{\sigma^ {2}} (n R ^ {1 - \alpha} + n ^ {1 / 2} R ^ {1 - \alpha + \tau} + R ^ {1 - \alpha + 2 \tau}) \Big) = o \Bigg (\frac {1}{\sigma^ {2}} n ^ {\frac {1}{\alpha}} \Bigg), \\ \end{array}
+$$
+
+where in the first inequality we use the fact that $\| A \|_2 < 1$ and $\operatorname{Tr} ABA \leq \| A \|_2^2 \operatorname{Tr} B$ when $A$ and $B$ are symmetric positive definite matrices, in the second inequality we use $h(x) = 1 - 1 / (1 + x)$ in (78) and in the last equality we use the last few steps of (79). This concludes the proof of the first statement.
+
+As for $|T_{2}(D_{n}) - T_{2,R}(D_{n})|$ , we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \left| f (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \tag {80} \\ + \left| f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right|. \\ \end{array}
+$$
+
+For the first term on the right-hand side of (80), we have
+
+$$
+\begin{array}{l} \left| f (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq 2 \left| f _ {> R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| + \left| f _ {> R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {> R} (\mathbf {x}) \right| \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} \| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} \| _ {2} \| f _ {> R} (\mathbf {x}) \| _ {2} \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} ^ {2}. \\ \end{array}
+$$
+
+Applying Corollary 19 and Lemma 31, with probability of at least $1 - 4\delta$ , we have
+
+$$
+\begin{array}{l} \left| f (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq 2 \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}}\right) \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {\max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}\right) \\ = 2 \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2} + \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) (1 - 2 \beta)}\right) \\ = 2 \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2} + \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right), \\ \end{array}
+$$
+
+where the last equality holds because $\left(\frac{1}{\alpha} + \kappa\right)\frac{1 - 2\beta}{2} < \frac{1 - 2\beta}{2\alpha}$ when $\kappa > 0$ .
+
+As for the second term on the right-hand side of (80), according to Lemma 28, Corollary 26 and Lemma 29, we have
+
+$$
+\begin{array}{l} \left| f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ = \left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} f _ {R} (\mathbf {x}) ^ {T} \left(\left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq \sum_ {j = 1} ^ {\infty} \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \| _ {2} ^ {j - 1} \cdot \| \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \| _ {2} ^ {j} \cdot \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} ^ {2} \tag {81} \\ = \sum_ {j = 1} ^ {\infty} \tilde {O} \left(n ^ {- j \kappa \alpha}\right) \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \max \{- 2, \frac {1 - 2 \beta}{\alpha} \}}\right) \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \max \{- 2, \frac {1 - 2 \beta}{\alpha} \} - \kappa \alpha}\right). \\ \end{array}
+$$
+
+By (80), we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2} + \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \max \{- 2, \frac {1 - 2 \beta}{\alpha} \} - \kappa \alpha}\right) \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{\left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 + \frac {1 - 2 \beta}{\alpha} + \frac {(1 - 2 \beta) \kappa}{2}, - 1 - \kappa \alpha , 1 + \frac {1 - 2 \beta}{\alpha} - \kappa \alpha \right\}}\right). \\ \end{array}
+$$
+
+This concludes the proof of the second statement.
+
+
+
+In Lemma 32, we gave a bound for $|T_{2,R}(D_n) - T_2(D_n)|$ when $n^{\frac{1}{\alpha}} < R < n^{\frac{1}{\alpha} + \frac{\alpha - 1 - 2\tau}{\alpha^2}}$ . For $R > n$ , we note the following lemma:
+
+Lemma 33. Let $R = n^C$ and $\sigma^2 = n^t$ . Assume that $C \geq 1$ and $C(1 - \alpha + 2\tau) - t < 0$ . Under Assumptions 4, 5 and 6, for sufficiently large $n$ and with probability of at least $1 - 3\delta$ we have
+
+$$
+\left| T _ {2, R} \left(D _ {n}\right) - T _ {2} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n R ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right). \tag {82}
+$$
+
+Proof of Lemma 33. Define $\Phi_{>R} = (\phi_{R+1}(\mathbf{x}), \phi_{R+2}(\mathbf{x}), \ldots, \phi_p(\mathbf{x}), \ldots)$ , and $\Lambda_{>R} = \mathrm{diag}(\lambda_{R+1}, \dots, \lambda_p, \dots)$ . Then we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \left| f (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \tag {83} \\ + \left| f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right|. \\ \end{array}
+$$
+
+For the first term on the right-hand side of (83), with probability $1 - 3\delta$ we have
+
+$$
+\begin{array}{l} \left| f (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq 2 \left| f _ {> R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| + \left| f _ {> R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {> R} (\mathbf {x}) \right| \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} \| _ {2} \| f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} \| (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} \| _ {2} \| f _ {> R} (\mathbf {x}) \| _ {2} \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} ^ {2} \\ \leq 2 \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}}\right) \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot \| f \| _ {2}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}\right) \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n R ^ {1 / 2 - \beta}\right), \\ \end{array}
+$$
+
+where we used Corollary 19 and Lemma 17 for the last inequality.
+
+The assumption $C(1 - \alpha + 2\tau) - t < 0$ means that $\frac{R^{1 - \alpha + 2\tau}}{\sigma^2} = o(1)$ . For the second term on the right-hand side of (83), by Lemmas 28 and 25, we have
+
+$$
+\begin{array}{l} \left| f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ = \left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} f _ {R} (\mathbf {x}) ^ {T} \left((I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq \sum_ {j = 1} ^ {\infty} \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \| _ {2} ^ {j + 1} \cdot \| \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \| _ {2} ^ {j} \cdot \| f _ {R} (\mathbf {x}) \| _ {2} ^ {2} \tag {84} \\ = \sum_ {j = 1} ^ {\infty} \tilde {O} \left(\frac {1}{\sigma^ {2}} R ^ {j (1 - \alpha + 2 \tau)}\right) \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n \| f \| _ {2} ^ {2}\right) \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n R ^ {1 - \alpha + 2 \tau}\right). \\ \end{array}
+$$
+
+Using (83), we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n R ^ {1 / 2 - \beta}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n \frac {1}{\sigma^ {2}} R ^ {1 - \alpha + 2 \tau}\right) \\ = \tilde {O} \left((\frac {1}{\delta} + 1) n \frac {1}{\sigma^ {2}} R ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right). \\ \end{array}
+$$
+
+
+
+Next we consider the asymptotics of $T_{1,R}(D_n)$ and $T_{2,R}(D_n)$ .
+
+Lemma 34. Let $A = (I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}\Lambda_R^{\gamma /2}(\Phi_R^T\Phi_R - nI)\Lambda_R^{\gamma /2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-\gamma /2}$ . Assume that $\| A\| _2 < 1$ where $\frac{1 + 2\tau}{\alpha} < \gamma \leq 1$ . Then we have
+
+$$
+T _ {2, R} (D _ {n}) = \frac {n}{2 \sigma^ {2}} \pmb {\mu} _ {R} ^ {T} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \pmb {\mu} _ {R} + \frac {1}{2} \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} E _ {j},
+$$
+
+where
+
+$$
+E _ {j} = \pmb {\mu} _ {R} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \big (\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \big) ^ {j - 1} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \pmb {\mu} _ {R}.
+$$
+
+Proof of Lemma 34. Let $\tilde{\Lambda}_{\epsilon,R} = \mathrm{diag}\{\epsilon,\lambda_1,\dots,\lambda_R\}$ . Since $\Lambda_R = \mathrm{diag}\{0,\lambda_1,\dots,\lambda_R\}$ , we have that when $\epsilon$ is sufficiently small, $\| \frac{1}{\sigma^2}(I + \frac{n}{\sigma^2}\tilde{\Lambda}_{\epsilon,R})^{-1/2}\tilde{\Lambda}_{\epsilon,R}^{1/2}(\Phi_R^T\Phi_R - nI)\tilde{\Lambda}_{\epsilon,R}^{1/2}(I + \frac{n}{\sigma^2}\tilde{\Lambda}_{\epsilon,R})^{-1/2}\|_2 < 1$ .
+
+Since all diagonal entries of $\tilde{\Lambda}_{\epsilon,R}$ are positive, we have
+
+$$
+\begin{array}{l} \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T}\right) ^ {- 1} \Phi_ {R} \boldsymbol {\mu} _ {R} \\ = \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \left[ I - \Phi_ {R} \left(\sigma^ {2} I + \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \right] \Phi_ {R} \boldsymbol {\mu} _ {R} \\ = \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \Phi_ {R} \boldsymbol {\mu} _ {R} - \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \Phi_ {R} \left(\sigma^ {2} I + \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R} \boldsymbol {\mu} _ {R} \tag {85} \\ = \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \Phi_ {R} \left(\sigma^ {2} I + \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ = \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R} \left(\sigma^ {2} I + \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ = \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \boldsymbol {\mu} _ {R} - \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R}. \\ \end{array}
+$$
+
+Using Lemma 27, we have
+
+$$
+\begin{array}{l} \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \boldsymbol {\mu} _ {R} - \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ = \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \boldsymbol {\mu} _ {R} - \frac {1}{2} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} \boldsymbol {\mu} _ {R} ^ {T} \tilde {\Lambda} _ {\epsilon , R} ^ {- 1} \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}) ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}) ^ {- 1} \boldsymbol {\mu} _ {R} \\ = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} \boldsymbol {\mu} _ {R} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}) ^ {- 1} \tilde {\Lambda} _ {\epsilon , R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j - 1} \\ \end{array}
+$$
+
+$$
+(I + \frac {n}{\sigma^ {2}} \tilde {\Lambda} _ {\epsilon , R}) ^ {- 1} \boldsymbol {\mu} _ {R} \tag {86}
+$$
+
+Letting $\epsilon \to 0$ , we get
+
+$$
+\begin{array}{l} T _ {2, R} (D _ {n}) = \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \Phi_ {R} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}\right) ^ {- 1} \Phi_ {R} \boldsymbol {\mu} _ {R} \\ = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} \left[ (- 1) ^ {j + 1} \boldsymbol {\mu} _ {R} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j - 1} \right. \\ \end{array}
+$$
+
+$$
+\left. \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right]
+$$
+
+This concludes the proof.
+
+Lemma 35. Assume that $\sigma^2 = \Theta(1)$ . Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ . Under Assumptions 4, 5 and 6, with probability of at least $1 - \delta$ , we have
+
+$$
+T _ {1, R} \left(D _ {n}\right) = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) (1 + o (1)) = \Theta \left(n ^ {\frac {1}{\alpha}}\right). \tag {87}
+$$
+
+Furthermore, if we assume $\mu_0 = 0$ , we have
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \left(\frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R}\right) (1 + o (1)) = \left\{ \begin{array}{l l} \Theta \left(n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}\right), & \alpha \neq 2 \beta - 1, \\ \Theta (\log n), & \alpha = 2 \beta - 1. \end{array} \right. \tag {88}
+$$
+
+Proof of Lemma 35. Let
+
+$$
+A = \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2}, \tag {89}
+$$
+
+where $\frac{1 + \alpha + 2\tau}{2\alpha} < \gamma \leq 1$ . By Corollary 22, with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| A \right\| _ {2} = \tilde {O} \left(n ^ {\frac {1 - 2 \gamma \alpha + \alpha + 2 \tau}{2 \alpha}}\right). \tag {90}
+$$
+
+When $n$ is sufficiently large, $\| A \|_2$ is less than 1. Let $B = (I + \frac{n}{\sigma^2} \Lambda_R)^{-1/2} \Lambda_R^{1/2} (\Phi_R^T \Phi_R - n I) \Lambda_R^{1/2} (I + \frac{n}{\sigma^2} \Lambda_R)^{-1/2}$ . Then $\| B \|_2 = \frac{\sigma^{2(1-\gamma)}}{n^{1-\gamma}} \| A \|_2 = \tilde{O}(n^{\frac{1-\alpha+2\tau}{2\alpha}})$ . Using the Woodbury matrix identity, we compute $T_{1,R}(D_n)$ as follows:
+
+$$
+\begin{array}{l} T _ {1, R} (D _ {n}) = \frac {1}{2} \mathrm {l o g d e t} (I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}) - \frac {1}{2} \mathrm {T r} \Phi_ {R} (\sigma^ {2} I + \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T} \\ = \frac {1}{2} \mathrm {l o g d e t} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) + \frac {1}{2} \mathrm {l o g d e t} [ I + \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} ] \\ - \frac {1}{2} \mathrm {T r} \big (\sigma^ {2} I + \Lambda \Phi_ {R} ^ {T} \Phi_ {R} \big) ^ {- 1} \Lambda \Phi_ {R} ^ {T} \Phi_ {R} \\ = \frac {1}{2} \mathrm {l o g d e t} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) + \frac {1}{2} \mathrm {T r l o g} [ I + \frac {1}{\sigma^ {2}} B ] - \frac {1}{2} \mathrm {T r} (I - \sigma^ {2} (\sigma^ {2} I + \Lambda \Phi_ {R} ^ {T} \Phi_ {R}) ^ {- 1})) \\ = \frac {1}{2} \mathrm {l o g d e t} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) + \frac {1}{2} \mathrm {T r} \sum_ {j = 1} ^ {\infty} \frac {(- 1) ^ {j - 1}}{j} (\frac {1}{\sigma^ {2}} B) ^ {j} \\ - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right) \\ = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) + \frac {1}{2} \operatorname {T r} \sum_ {j = 1} ^ {\infty} \frac {(- 1) ^ {j - 1}}{j} \left(\frac {1}{\sigma^ {2}} B\right) ^ {j} \\ - \frac {1}{2} \operatorname {T r} \left(\sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} B ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2}\right), \tag {91} \\ \end{array}
+$$
+
+where in the last equality we apply Lemma 27.
+
+Let $h(x) = \log (1 + x) - \left(1 - \frac{1}{1 + x}\right)$ . It is easy to verify that $h(x)$ is increasing on $[0, +\infty)$ . As for the first term on the right hand side of (91), we have
+
+$$
+\begin{array}{l} \frac {1}{2} \mathrm {l o g d e t} \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) - \frac {1}{2} \mathrm {T r} \big (I - \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) ^ {- 1} \big) \\ = \frac {1}{2} \sum_ {p = 1} ^ {R} \left(\log (1 + \frac {n}{\sigma^ {2}} \lambda_ {p}) - \left(1 - \frac {1}{1 + \frac {n}{\sigma^ {2}} \lambda_ {p}}\right)\right) \\ = \frac {1}{2} \sum_ {p = 1} ^ {R} h (\frac {n}{\sigma^ {2}} \lambda_ {p}) \leq \frac {1}{2} \sum_ {p = 1} ^ {R} h (\frac {n}{\sigma^ {2}} \overline {{C _ {\lambda}}} p ^ {- \alpha}) \\ \leq \frac {1}{2} h \left(\frac {n}{\sigma^ {2}} \bar {C} _ {\lambda}\right) + \frac {1}{2} \int_ {[ 1, R ]} h \left(\frac {n}{\sigma^ {2}} \bar {C} _ {\lambda} x ^ {- \alpha}\right) d x \\ = \frac {1}{2} h \left(\frac {n}{\sigma^ {2}} \overline {{C _ {\lambda}}}\right) + \frac {1}{2} n ^ {1 / \alpha} \int_ {[ 1 / n ^ {1 / \alpha}, R / n ^ {1 / \alpha} ]} h \left(\frac {\overline {{C _ {\lambda}}}}{\sigma^ {2}} x ^ {- \alpha}\right) d x \\ = \Theta (n ^ {1 / \alpha}), \\ \end{array}
+$$
+
+where in the last equality we use the fact that $\int_{[0, +\infty]} h(x^{-\alpha}) \mathrm{d}x < \infty$ . On the other hand, we have
+
+$$
+\begin{array}{l} \frac {1}{2} \log \det (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right) \\ = \frac {1}{2} \sum_ {p = 1} ^ {R} h \left(\frac {n}{\sigma^ {2}} \lambda_ {p}\right) \geq \frac {1}{2} \sum_ {p = 1} ^ {R} h \left(\frac {n}{\sigma^ {2}} C _ {\lambda} p ^ {- \alpha}\right) \\ \geq \frac {1}{2} \int_ {[ 1, R + 1 ]} h \left(\frac {n}{\sigma^ {2}} \underline {{C _ {\lambda}}} x ^ {- \alpha}\right) \mathrm {d} x \\ = \frac {1}{2} n ^ {1 / \alpha} \int_ {[ 1 / n ^ {1 / \alpha}, (R + 1) / n ^ {1 / \alpha} ]} h \left(\frac {1}{\sigma^ {2}} \underline {{C _ {\lambda}}} x ^ {- \alpha}\right) d x \\ = \Theta (n ^ {1 / \alpha}). \\ \end{array}
+$$
+
+Overall, we have $\frac{1}{2}\mathrm{logdet}(I + \frac{n}{\sigma^2}\Lambda_R) - \frac{1}{2}\mathrm{Tr}\big(I - (I + \frac{n}{\sigma^2}\Lambda_R)^{-1}\big) = \Theta (n^{1 / \alpha})$
+
+As for the second term on the right hand side of (91), we have
+
+$$
+\begin{array}{l} \left| \operatorname {T r} \sum_ {j = 1} ^ {\infty} \frac {(- 1) ^ {j - 1}}{j} \left(\frac {1}{\sigma^ {2}} B\right) ^ {j} \right| \leq R \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} B \| _ {2} ^ {j} = R \sum_ {j = 1} ^ {\infty} \frac {1}{\sigma^ {2 j}} \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau)}{2 \alpha}}\right) \\ = R \tilde {O} \left(n ^ {\frac {1 - \alpha + 2 \tau}{2 \alpha}}\right) = \tilde {O} \left(n ^ {\frac {1}{\alpha} + \kappa + \frac {1 - \alpha + 2 \tau}{2 \alpha}}\right). \\ \end{array}
+$$
+
+As for the third term on the right hand side of (91), we have
+
+$$
+\begin{array}{l} \left| \operatorname {T r} \left(\sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} B ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2}\right) \right| \\ \leq \sum_ {j = 1} ^ {\infty} \left| \operatorname {T r} \left(\frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} B ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2}\right) \right| \\ \leq R \sum_ {j = 1} ^ {\infty} \left\| \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} B ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right\| _ {2} \\ \leq R \sum_ {j = 1} ^ {\infty} \left\| \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} B ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right\| _ {2} \\ \leq R \sum_ {j = 1} ^ {\infty} \left\| \frac {1}{\sigma^ {2 j}} B ^ {j} \right\| _ {2} = \tilde {O} \left(n ^ {\frac {1}{\alpha} + \kappa + \frac {1 - \alpha + 2 \tau}{2 \alpha}}\right). \\ \end{array}
+$$
+
+Then the asymptotics of $T_{1,R}(D_n)$ is given by
+
+$$
+\begin{array}{l} T _ {1, R} (D _ {n}) = \frac {1}{2} \mathrm {l o g d e t} \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) - \frac {1}{2} \mathrm {T r} \big (I - \big (I + \frac {n}{\sigma^ {2}} \Lambda_ {R} \big) ^ {- 1} \big) + \tilde {\cal O} (n ^ {\frac {1}{\alpha} + \kappa + \frac {1 - \alpha + 2 \tau}{2 \alpha}}) + \tilde {\cal O} (n ^ {\frac {1}{\alpha} + \kappa + \frac {1 - \alpha + 2 \tau}{2 \alpha}}) \\ = \Theta (n ^ {1 / \alpha}) + \tilde {O} (n ^ {\frac {1}{\alpha} + \kappa + \frac {1 - \alpha + 2 \tau}{2 \alpha}}) \\ = \Theta (n ^ {\frac {1}{\alpha}}), \\ \end{array}
+$$
+
+where in the last inequality we use the assumption that $\kappa < \frac{\alpha - 1 - 2\tau}{2\alpha}$ . Since $\tilde{O}(n^{\frac{1}{\alpha} + \kappa + \frac{1 - \alpha + 2\tau}{2\alpha}})$ is lower order term compared to $\Theta(n^{\frac{1}{\alpha}})$ , we further have
+
+$$
+T _ {1, R} (D _ {n}) = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) (1 + o (1)).
+$$
+
+This concludes the proof of the first statement.
+
+Let $\Lambda_{1:R} = \mathrm{diag}\{\lambda_1,\dots,\lambda_R\}$ , $\Phi_{1:R} = (\phi_1(\mathbf{x}),\phi_1(\mathbf{x}),\dots,\phi_R(\mathbf{x}))$ and $\pmb{\mu}_{1:R} = (\mu_1,\dots,\mu_R)$ . Since $\mu_0 = 0$ , we have $T_{2,R}(D_n) = \frac{1}{2\sigma^2}\pmb{\mu}_{1:R}^T\Phi_{1:R}^T (I + \frac{1}{\sigma^2}\Phi_{1:R}\Lambda_{1:R}\Phi_{1:R}^T)^{-1}\Phi_{1:R}\pmb{\mu}_{1:R}$ . According to Lemma 34, we
+
+have
+
+$$
+\begin{array}{l} T _ {2, R} (D _ {n}) = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} \boldsymbol {\mu} _ {1: R} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} (\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \Lambda_ {1: R} (\Phi_ {1: R} ^ {T} \Phi_ {1: R} - n I)\right) ^ {j - 1} \\ = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} \left[ (- 1) ^ {j + 1} \frac {1}{\sigma^ {2 j}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} A \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma} \Lambda_ {1: R} ^ {1 - \gamma} A\right) ^ {j - 1} \right. \\ \left. \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} \boldsymbol {\mu} _ {1: R} \right] \tag {92} \\ \end{array}
+$$
+
+where in the second to last equality we used the definition of $A$ (89). As for the first term on the right hand side of (92), by Lemma 15, Assumption 4 and Assumption 5, we have
+
+$$
+\frac{n}{2\sigma^{2}}\boldsymbol{\mu}_{1:R}^{T}(I + \frac{n}{\sigma^{2}}\Lambda_{1:R})^{-1}\boldsymbol{\mu}_{1:R}\leq \frac{n}{2\sigma^{2}}\sum_{p = 1}^{R}\frac{C_{\mu}^{2}p^{-2\beta}}{1 + \frac{n}{\sigma^{2}}\underline{C_{\lambda}}p^{-\alpha}} = \left\{ \begin{array}{ll}\Theta (n^{\max \{0,1 + \frac{1 - 2\beta}{\alpha}\}}), & \alpha \neq 2\beta -1,\\ \Theta (\log n), & \alpha = 2\beta -1. \end{array} \right.
+$$
+
+On the other hand, by Assumption 5, assuming that $\sup_{i\geq 1}p_{i + 1} - p_i = h$ , we have
+
+$$
+\begin{array}{l} \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: R} ^ {T} (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1} \boldsymbol {\mu} _ {1: R} \geq \frac {n}{2 \sigma^ {2}} \sum_ {i = 1} ^ {\lfloor \frac {R}{h} \rfloor} \frac {C _ {\mu} ^ {2} p _ {i} ^ {- 2 \beta}}{1 + \frac {n}{\sigma^ {2}} \overline {{C _ {\lambda}}} p _ {i} ^ {- \alpha}} \\ \geq \frac {n}{2 \sigma^ {2}} \sum_ {i = 1} ^ {\lfloor \frac {R}{h} \rfloor} \frac {C _ {\mu} ^ {2} i ^ {- 2 \beta}}{1 + \frac {n}{\sigma^ {2}} \overline {{C _ {\lambda}}} (h i) ^ {- \alpha}} \\ = \left\{ \begin{array}{l l} \Theta (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}), & \alpha \neq 2 \beta - 1, \\ \Theta (\log n), & \alpha = 2 \beta - 1. \end{array} \right. \\ \end{array}
+$$
+
+Overall, we have
+
+$$
+\frac{n}{2\sigma^{2}}\boldsymbol{\mu}_{1:R}^{T}(I + \frac{n}{\sigma^{2}}\Lambda_{1:R})^{-1}\boldsymbol{\mu}_{1:R} = \Theta (n^{\max \{0,1 + \frac{1 - 2\beta}{\alpha}\}}\log^{k}n),\text{where} k = \left\{ \begin{array}{ll}0, & \alpha \neq 2\beta -1,\\ 1, & \alpha = 2\beta -1. \end{array} \right.
+$$
+
+By Lemma 16, we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} \boldsymbol {\mu} _ {1: R} \right\| _ {2} ^ {2} \leq \sum_ {p = 1} ^ {R} \frac {C _ {\mu} ^ {2} p ^ {- 2 \beta} \left(\underline {{C _ {\lambda}}} p ^ {- \alpha}\right) ^ {- \gamma}}{\left(1 + \frac {n}{\sigma^ {2}} \underline {{C _ {\lambda}}} p ^ {- \alpha}\right) ^ {2 - \gamma}} \tag {93} \\ = \tilde {O} (\max \{n ^ {- 2 + \gamma}, R ^ {1 - 2 \beta + \alpha \gamma} \}) \\ = \tilde {O} \left(n ^ {\max \{- 2 + \gamma , \frac {1 - 2 \beta}{\alpha} + \gamma + \kappa (1 - 2 \beta + \alpha \gamma) \}}\right). \\ \end{array}
+$$
+
+Using (90), the second term on the right hand side of (92) is computed as follows:
+
+$$
+\begin{array}{l} \frac {1}{2} \sum_ {j = 1} ^ {\infty} \left[ (- 1) ^ {j + 1} \frac {1}{\sigma^ {2 j}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} A \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma} \Lambda_ {1: R} ^ {1 - \gamma} A\right) ^ {j - 1} \right. \\ \left. \left. (I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} \pmb {\mu} _ {1: R} \right] \right. \\ \leq \frac {1}{2} \sum_ {j = 1} ^ {\infty} \frac {1}{\sigma^ {2 j}} \| A \| ^ {j} \left(\frac {n}{\sigma^ {2}}\right) ^ {(- 1 + \gamma) (j - 1)} \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} \boldsymbol {\mu} _ {1: R} \| _ {2} ^ {2} \tag {94} \\ \leq \frac {1}{2} \sum_ {j = 1} ^ {\infty} \frac {1}{\sigma^ {2 j}} \tilde {O} \left(n ^ {\frac {j (1 - 2 \gamma \alpha + \alpha + 2 \tau)}{2 \alpha}}\right) \left(\frac {n}{\sigma^ {2}}\right) ^ {(- 1 + \gamma) (j - 1)} \tilde {O} \left(n ^ {\max \{- 2 + \gamma , \frac {1 - 2 \beta}{\alpha} + \gamma + \kappa (1 - 2 \beta + \alpha \gamma) \}}\right) \\ = \tilde {O} \left(n ^ {\max \{- 2 + \gamma + \frac {1 - 2 \gamma \alpha + \alpha + 2 \tau}{2 \alpha}, \frac {1 - 2 \beta}{\alpha} + \gamma + \frac {1 - 2 \gamma \alpha + \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \}}\right) \\ = \tilde {O} \left(n ^ {\max \left\{- 2 + \frac {1 + \alpha + 2 \tau}{2 \alpha}, \frac {1 - 2 \beta}{\alpha} + \frac {1 + \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \right\}}\right). \\ \end{array}
+$$
+
+Since $\frac{1 + \alpha + 2\tau}{2\alpha} < \frac{1 + \alpha + 2\tau}{\alpha + 1 + 2\tau} = 1$ , we have $-2 + \frac{1 + \alpha + 2\tau}{2\alpha} < 0$ . Also we have
+
+$$
+\begin{array}{l} \frac {1 - 2 \beta}{\alpha} + \frac {1 + \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \\ = \frac {1 - 2 \beta}{\alpha} + 1 + \frac {1 - \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \tag {95} \\ \leq \frac {1 - 2 \beta}{\alpha} + 1 + \frac {1 - \alpha + 2 \tau}{2 \alpha} + \kappa \alpha \gamma \\ < \frac {1 - 2 \beta}{\alpha} + 1, \\ \end{array}
+$$
+
+where the last inequality holds because $\kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ and $\gamma \leq 1$ . Hence we have
+
+$$
+\begin{array}{l} T _ {2, R} (D _ {n}) = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} + \tilde {O} \left(n ^ {\max \left\{- 2 + \frac {1 + \alpha + 2 \tau}{2 \alpha}, \frac {1 - 2 \beta}{\alpha} + \frac {1 + \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \right\}}\right) \\ = \Theta (n ^ {\max \left\{0, 1 + \frac {1 - 2 \beta}{\alpha} \right\}} \log^ {k} n) + \tilde {O} (n ^ {\max \left\{- 2 + \frac {1 + \alpha + 2 \tau}{2 \alpha}, \frac {1 - 2 \beta}{\alpha} + \frac {1 + \alpha + 2 \tau}{2 \alpha} + \kappa (1 - 2 \beta + \alpha \gamma) \right\}}) \\ = \Theta (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}} \log^ {k} n). \\ \end{array}
+$$
+
+where $k = \left\{ \begin{array}{ll}0, & \alpha \neq 2\beta -1,\\ 1, & \alpha = 2\beta -1. \end{array} \right.$ Since $\tilde{O} (n^{\max \{-2 + \frac{1 + \alpha + 2\tau}{2\alpha},\frac{1 - 2\beta}{\alpha} + \frac{1 + \alpha + 2\tau}{2\alpha} + \kappa (1 - 2\beta + \alpha \gamma)\}})$ is lower order term compared to $\Theta (n^{\max \{0,1 + \frac{1 - 2\beta}{\alpha}\}}\log^{k}n)$ , we further have
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \left(\frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R}\right) (1 + o (1))
+$$
+
+This concludes the proof of the second statement.
+
+
+
+Lemma 36. Under Assumptions 4, 5 and 6, with probability of at least $1 - 5\delta$ , we have
+
+$$
+T _ {1} \left(D _ {n}\right) = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1}\right)\right) (1 + o (1)) = \Theta \left(n ^ {\frac {1}{\alpha}}\right), \tag {96}
+$$
+
+Furthermore, let $\delta = n^{-q}$ where $0\leq q < \min \left\{\frac{(2\beta - 1)(\alpha - 1 - 2\tau)}{4\alpha^2},\frac{\alpha - 1 - 2\tau}{2\alpha}\right\}$ . If we assume $\mu_0 = 0$ , we have
+
+$$
+T _ {2} \left(D _ {n}\right) = \left(\frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu}\right) (1 + o (1)) = \left\{ \begin{array}{l l} \Theta \left(n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}\right), & \alpha \neq 2 \beta - 1, \\ \Theta (\log n), & \alpha = 2 \beta - 1. \end{array} \right. \tag {97}
+$$
+
+Proof of Lemma 36. Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 \leq \kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ . By Lemmas 32 and 35, with probability of at least $1 - 5\delta$ we have
+
+$$
+\left| T _ {1, R} \left(D _ {n}\right) - T _ {1} \left(D _ {n}\right) \right| = \tilde {O} \left(n ^ {\frac {1}{\alpha} + \kappa (1 - \alpha)}\right), \tag {98}
+$$
+
+and
+
+$$
+\left| T _ {2, R} \left(D _ {n}\right) - T _ {2} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{\left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 + \frac {1 - 2 \beta}{\alpha} + \frac {(1 - 2 \beta) \kappa}{2}, - 1 - \kappa \alpha , 1 + \frac {1 - 2 \beta}{\alpha} - \kappa \alpha \right\}}\right) \tag {99}
+$$
+
+as well as
+
+$$
+T _ {1, R} \left(D _ {n}\right) = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) (1 + o (1)) = \Theta \left(n ^ {\frac {1}{\alpha}}\right), \tag {100}
+$$
+
+and
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \left(\frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu}\right) (1 + o (1)) = \left\{ \begin{array}{l l} \Theta \left(n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}\right), & \alpha \neq 2 \beta - 1, \\ \Theta (\log n), & \alpha = 2 \beta - 1. \end{array} \right. \tag {101}
+$$
+
+We then have
+
+$$
+T _ {1} (D _ {n}) = T _ {1, R} (D _ {n}) + T _ {1, R} (D _ {n}) - T _ {1} (D _ {n}) = \Theta (n ^ {\frac {1}{\alpha}}) + \tilde {O} (n ^ {\frac {1}{\alpha} + \kappa (1 - \alpha)}) = \Theta (n ^ {\frac {1}{\alpha}}).
+$$
+
+Since $\tilde{O}(n^{\frac{1}{\alpha} + \kappa(1 - \alpha)})$ is lower order term compared to $\Theta(n^{\frac{1}{\alpha}})$ , we further have
+
+$$
+T _ {1} \left(D _ {n}\right) = \left(\frac {1}{2} \log \det \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right)\right) (1 + o (1)) = \Theta \left(n ^ {\frac {1}{\alpha}}\right)
+$$
+
+Besides, we have
+
+$$
+\begin{array}{l} \operatorname {l o g d e t} (I + \frac {n}{\sigma^ {2}} \Lambda) - \operatorname {l o g d e t} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) \\ = \sum_ {p = R + 1} ^ {\infty} \log \left(1 + \frac {n}{\sigma^ {2}} \lambda_ {p}\right) \leq \frac {n}{\sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} \lambda_ {p} \leq \frac {n}{\sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} C _ {\lambda} p ^ {- \alpha} = \frac {n}{\sigma^ {2}} O \left(R ^ {1 - \alpha}\right) \\ = \frac {n}{\sigma^ {2}} O \left(n ^ {\left(1 - \alpha\right) \left(\frac {1}{\alpha} + \kappa\right)}\right) \\ = o \left(n ^ {\frac {1}{\alpha}}\right). \\ \end{array}
+$$
+
+Then we have $\log \det(I + \frac{n}{\sigma^2} \Lambda_R) = \log \det(I + \frac{n}{\sigma^2} \Lambda)(1 + o(1))$ . Similarly we can prove $\operatorname{Tr}\big(I - (I + \frac{n}{\sigma^2} \Lambda)^{-1}\big) = \operatorname{Tr}\big(I - (I + \frac{n}{\sigma^2} \Lambda_R)^{-1}\big)(1 + o(1))$ . This concludes the proof of the first statement.
+
+As for $T_{2}(D_{n})$ , we have
+
+$$
+\begin{array}{l} T _ {2} (D _ {n}) = T _ {2, R} (D _ {n}) + T _ {2, R} (D _ {n}) - T _ {2} (D _ {n}) \\ = \Theta (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}} \log^ {k} n) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{\left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 + \frac {1 - 2 \beta}{\alpha} + \frac {(1 - 2 \beta) \kappa}{2}, - 1 - \kappa \alpha , 1 + \frac {1 - 2 \beta}{\alpha} - \kappa \alpha \right\}}\right) \\ = \Theta (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}} \log^ {k} n) + \tilde {O} \left(n ^ {q + \max \{\left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 + \frac {1 - 2 \beta}{\alpha} + \frac {(1 - 2 \beta) \kappa}{2}, - 1 - \kappa \alpha , 1 + \frac {1 - 2 \beta}{\alpha} - \kappa \alpha \}}\right) \\ \end{array}
+$$
+
+where we use $\delta = n^{-q}$ $k = \left\{ \begin{array}{ll}0, & \alpha \neq 2\beta -1,\\ 1, & \alpha = 2\beta -1. \end{array} \right.$
+
+Since $0 \leq \kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ and $0 \leq q < \min \left\{ \frac{(2\beta - 1)(\alpha - 1 - 2\tau)}{4\alpha^2}, \frac{\alpha - 1 - 2\tau}{2\alpha} \right\}$ , we can choose $\kappa < \frac{\alpha - 1 - 2\tau}{2\alpha^2}$ and $\kappa$ is arbitrarily close to $\frac{\alpha - 1 - 2\tau}{2\alpha^2}$ such that $0 \leq q < \min \left\{ \frac{(2\beta - 1)\kappa}{2}, \kappa\alpha \right\}$ . Then we have $\left( \frac{1}{\alpha} + \kappa \right) \frac{1 - 2\beta}{2} + q < 0$ , $-1 - \kappa\alpha + q < 0$ , $\frac{(1 - 2\beta)\kappa}{2} + q < 0$ and $-\kappa\alpha + q < 0$ . So we have
+
+$$
+T _ {2, R} (D _ {n}) = \Theta (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}} \log^ {k} n).
+$$
+
+Since $\tilde{O}\left(\left(\frac{1}{\delta} + 1\right)n^{\max \left\{\left(\frac{1}{\alpha} + \kappa\right)\frac{1 - 2\beta}{2}, 1 + \frac{1 - 2\beta}{\alpha} + \frac{(1 - 2\beta)\kappa}{2}, -1 - \kappa\alpha, 1 + \frac{1 - 2\beta}{\alpha} - \kappa\alpha\right\}}\right)$ is lower order term compared to $\Theta(n^{\max \left\{0, 1 + \frac{1 - 2\beta}{\alpha}\right\}} \log^{k} n)$ , we further have
+
+$$
+T _ {2} (D _ {n}) = T _ {2, R} (D _ {n}) (1 + o (1)) = \left(\frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R}\right) (1 + o (1)).
+$$
+
+Furthermore, we have
+
+$$
+\begin{array}{l} \boldsymbol {\mu} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} - \boldsymbol {\mu} _ {\boldsymbol {R}} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {\boldsymbol {R}} \\ = \sum_ {p = R + 1} ^ {\infty} \frac {\mu_ {p} ^ {2}}{\left(1 + \frac {n}{\sigma^ {2}} \lambda_ {p}\right)} \leq \sum_ {p = R + 1} ^ {\infty} \mu_ {p} ^ {2} \leq \frac {n}{\sigma^ {2}} \sum_ {p = R + 1} ^ {\infty} C _ {\mu} ^ {2} p ^ {- 2 \beta} = O (R ^ {1 - 2 \beta}) \\ = O \left(n ^ {\left(1 - 2 \beta\right) \left(\frac {1}{\alpha} + \kappa\right)}\right) \\ = o \left(n ^ {\frac {1 - 2 \beta}{\alpha}}\right). \\ \end{array}
+$$
+
+Then we have $\pmb{\mu}^T (I + \frac{n}{\sigma^2}\Lambda)^{-1}\pmb {\mu} = \pmb{\mu}_R^T (I + \frac{n}{\sigma^2}\Lambda_R)^{-1}\pmb {\mu}_R(1 + o(1))$ . This concludes the proof of the second statement.
+
+Proof of Theorem 7. Using Lemma 36 and noting that $\frac{1}{\alpha} >0$ , with probability of at least $1 - 5\bar{\delta}$ , we have
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} F ^ {0} (D _ {n}) = T _ {1} (D _ {n}) + T _ {2} (D _ {n}) \\ = \left[ \frac {1}{2} \operatorname {l o g d e t} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1}\right) \right. \\ \left. + \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right] (1 + o (1)) \\ = \Theta \left(n ^ {\max \left\{\frac {1}{\alpha}, \frac {1 - 2 \beta}{\alpha} + 1 \right\}}\right) \\ \end{array}
+$$
+
+Letting $\delta = 5\tilde{\delta}$ , we get the result.
+
+In the case of $\mu_0 > 0$ , we have the following lemma:
+
+Lemma 37. Assume that $\sigma^2 = \Theta(1)$ . Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau}{\alpha^2}$ . Assume that $\mu_0 > 0$ . Under Assumptions 4, 5 and 6, for sufficiently large $n$ with probability of at least $1 - 4\delta$ we have
+
+$$
+\left| T _ {2, R} \left(D _ {n}\right) - T _ {2} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 - \kappa \alpha \right\}}\right). \tag {102}
+$$
+
+Proof of Lemma 37. As for $|T_{2}(D_{n}) - T_{2,R}(D_{n})|$ , we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \left| f (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) - f _ {R} \left(\mathbf {x}\right) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ + \left| f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right|. \tag {103} \\ \end{array}
+$$
+
+For the first term on the right-hand side of (103), we have
+
+$$
+\begin{array}{l} \left| f (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq 2 \left| f _ {> R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| + \left| f _ {> R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {> R} (\mathbf {x}) \right| \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} \| (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} \| _ {2} \| f _ {> R} (\mathbf {x}) \| _ {2} \\ \leq 2 \| f _ {> R} (\mathbf {x}) \| _ {2} \| (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} + \| f _ {> R} (\mathbf {x}) \| _ {2} ^ {2}. \\ \end{array}
+$$
+
+Applying Corollary 19 and Lemma 31, with probability of at least $1 - 4\delta$ , we have
+
+$$
+\begin{array}{l} \left| f (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} (I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq 2 \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}}\right) \tilde {O} \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n R ^ {1 - 2 \beta}\right) \\ = 2 \tilde {O} \left((\frac {1}{\delta} + 1) n ^ {1 + (\frac {1}{\alpha} + \kappa) \frac {1 - 2 \beta}{2}}\right) + \tilde {O} ((\frac {1}{\delta} + 1) n ^ {1 + (\frac {1}{\alpha} + \kappa) (1 - 2 \beta)}) \\ = 2 \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}}\right). \\ \end{array}
+$$
+
+As for the second term on the right-hand side of (80), according to Lemma 28, Corollary 26 and Lemma 30, we have
+
+$$
+\begin{array}{l} \left| f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi \Lambda \Phi^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) - f _ {R} (\mathbf {x}) ^ {T} \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ = \left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} f _ {R} (\mathbf {x}) ^ {T} \left((I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}}\right) ^ {j} (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1} f _ {R} (\mathbf {x}) \right| \\ \leq \sum_ {j = 1} ^ {\infty} \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} \| _ {2} ^ {j - 1} \cdot \| \frac {\Phi_ {> R} \Lambda_ {> R} \Phi_ {> R} ^ {T}}{\sigma^ {2}} \| _ {2} ^ {j} \cdot \| \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} f _ {R} (\mathbf {x}) \| _ {2} ^ {2} \tag {104} \\ = \sum_ {j = 1} ^ {\infty} \tilde {O} (n ^ {- j \kappa \alpha}) \tilde {O} ((\frac {1}{\delta} + 1) n) \\ = \tilde {O} \big ((\frac {1}{\delta} + 1) n ^ {1 - \kappa \alpha} \big). \\ \end{array}
+$$
+
+By (80), we have
+
+$$
+\begin{array}{l} \left| T _ {2} \left(D _ {n}\right) - T _ {2, R} \left(D _ {n}\right) \right| = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {1 - \kappa \alpha}\right) \\ = \tilde {O} \bigg ((\frac {1}{\delta} + 1) n ^ {\max \{1 + (\frac {1}{\alpha} + \kappa) \frac {1 - 2 \beta}{2}, 1 - \kappa \alpha \}} \bigg). \\ \end{array}
+$$
+
+
+
+Lemma 38. Assume that $\sigma^2 = \Theta(1)$ . Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \min \left\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\right\}$ . Assume that $\mu_0 > 0$ . Under Assumptions 4, 5 and 6, with probability of at least $1 - \delta$ , we have
+
+$$
+T _ {2, R} \left(D _ {n}\right) = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} \left(n ^ {\max \left\{\frac {1 + 7 \alpha + 2 \tau}{8 \alpha}, 1 + \frac {1 - 2 \beta}{\alpha} \right\}}\right). \tag {105}
+$$
+
+Proof of Lemma 38. Let
+
+$$
+A = \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2} \Lambda_ {R} ^ {\gamma / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {\gamma / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- \gamma / 2}, \tag {106}
+$$
+
+where $\frac{1 + \alpha + 2\tau}{2\alpha} < \gamma \leq 1$ . By Corollary 22, with probability of at least $1 - \delta$ , we have
+
+$$
+\left\| A \right\| _ {2} = \tilde {O} \left(n ^ {\frac {1 - 2 \gamma \alpha + \alpha + 2 \tau}{2 \alpha}}\right). \tag {107}
+$$
+
+When $n$ is sufficiently large, $\| A\| _2$ is less than 1. Let $\pmb{\mu}_{R,1} = (\mu_0,0,\dots,0)$ and $\pmb{\mu}_{R,2} = (0,\mu_1,\dots,\mu_R)$ . Then $\pmb{\mu}_R = \pmb{\mu}_{R,1} + \pmb{\mu}_{R,2}$ . Let $\tilde{\Lambda}_{1,R} = \mathrm{diag}\{1,\lambda_1,\ldots ,\lambda_R\}$ and $I_{0,R} = (0,1,\dots,1)$ . Then $\Lambda_R = \tilde{\Lambda}_{1,R}I_{0,R}$ . Let $B = (I + \frac{n}{\sigma^2}\Lambda_R)^{-1 / 2}\tilde{\Lambda}_{1,R}^{1 / 2}(\Phi_R^T\Phi_R - nI)\tilde{\Lambda}_{1,R}^{1 / 2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-1 / 2}$ . By Corollary 23, we have $\| B\| _2 = O(\sqrt{\log\frac{R}{\delta}} n^{\frac{1}{2}})$ . By Lemma 34, we have
+
+$$
+\begin{array}{l} T _ {2, R} (D _ {n}) = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \\ + \frac {1}{2} \sum_ {j = 1} ^ {\infty} \left[ (- 1) ^ {j + 1} \pmb {\mu} _ {R} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j - 1} \right] \\ \end{array}
+$$
+
+$$
+\left. \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right] \tag {108}
+$$
+
+As for the first term on the right hand side of (108), by Lemma 15, we have
+
+$$
+\frac {n}{2 \sigma^ {2}} \mu^ {T} (I + \frac {n}{\sigma^ {2}} \Lambda) ^ {- 1} \mu \leq \frac {n}{2 \sigma^ {2}} \left(\mu_ {0} ^ {2} + \sum_ {p = 1} ^ {R} \frac {C _ {\mu} ^ {2} p ^ {- 2 \beta}}{1 + \frac {n}{\sigma^ {2}} C _ {\lambda} p ^ {- \alpha}}\right) = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}).
+$$
+
+We define $Q_{1,j}, Q_{2,j}$ and $Q_{3,j}$ by
+
+$$
+\begin{array}{l} Q _ {1, j} = \pmb {\mu} _ {R, 1} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j - 1} \\ \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R, 1} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} Q _ {2, j} = \boldsymbol {\mu} _ {R, 1} ^ {T} \frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j - 1} \tag {109} \\ (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \pmb {\mu} _ {R, 2} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} Q _ {3, j} = \boldsymbol {\mu} _ {R, 2} ^ {T} \frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} (\Phi_ {R} ^ {T} \Phi_ {R} - n I) \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j - 1} \\ (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \pmb {\mu} _ {R, 2} \\ \end{array}
+$$
+
+The quantity $Q_{3,j}$ actually shows up in the case of $\mu_0 = 0$ in the proof of Lemma 35. By (92), (94) and (95), we have that
+
+$$
+\left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} Q _ {3, j} \right| = \left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} \tilde {O} \left(n ^ {\frac {(j - 1) (1 - \alpha + 2 \tau)}{2 \alpha}}\right) o \left(n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}\right) \right| = o \left(n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}\right). \tag {110}
+$$
+
+For $Q_{1,j}$ , we have
+
+$$
+\begin{array}{l} Q _ {1, 1} = \frac {1}{\sigma^ {2 j}} \boldsymbol {\mu} _ {R, 1} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} B \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 1} \\ \leq \frac {1}{\sigma^ {2 j}} \| \boldsymbol {\mu} _ {R, 1} \| _ {2} ^ {2} \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 + \frac {\gamma}{2}} \| _ {2} ^ {2} \| B \| _ {2} \\ = O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}}\right), \\ \end{array}
+$$
+
+where in the last equality we use $\| B\| _2 = O(\sqrt{\log\frac{R}{\delta}} n^{\frac{1}{2}})$ . For $j\geq 2$ , we have
+
+$$
+\begin{array}{l} Q _ {1, j} = \frac {1}{\sigma^ {2 j}} \boldsymbol {\mu} _ {R, 1} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} B \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma} A\right) ^ {j - 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma} \\ B \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 1} \\ \leq \frac {1}{\sigma^ {2 j}} \| \boldsymbol {\mu} _ {R, 1} \| _ {2} ^ {2} \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 + \frac {\gamma}{2}} \| _ {2} ^ {2} \| B \| _ {2} ^ {2} \| A \| _ {2} ^ {j - 2} \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma} \| _ {2} ^ {j - 1} \\ = O \left(\log \frac {R}{\delta} n \cdot n ^ {\frac {(j - 2) (1 - 2 \gamma \alpha + \alpha + 2 \tau)}{2 \alpha}} \cdot n ^ {- (1 - \gamma) (j - 1)}\right) \\ = O \left(\log \frac {R}{\delta} n ^ {\gamma} \cdot n ^ {\frac {(j - 2) (1 - \alpha + 2 \tau)}{2 \alpha}}\right). \\ \end{array}
+$$
+
+Then we have
+
+$$
+\left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} Q _ {1, j} \right| \leq O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}}\right) + \sum_ {j = 2} ^ {\infty} O \left(\log \frac {R}{\delta} n ^ {\gamma} \cdot n ^ {\frac {(j - 2) (1 - \alpha + 2 \tau)}{2 \alpha}}\right) = O \left(\log \frac {R}{\delta} n ^ {\gamma}\right) \tag {111}
+$$
+
+For $Q_{2,j}$ , we have
+
+$$
+\begin{array}{l} Q _ {2, j} = \frac {1}{\sigma^ {2 j}} \boldsymbol {\mu} _ {R, 1} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \frac {\gamma}{2}} B \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma} A\right) ^ {j - 1} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1 + \frac {\gamma}{2}} \tilde {\Lambda} _ {1, R} ^ {- \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 2} \\ \leq \frac {1}{\sigma^ {2 j}} \| \boldsymbol {\mu} _ {R, 1} \| _ {2} \| B \| _ {2} \| A \| _ {2} ^ {j - 1} \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 + \gamma} \Lambda_ {R} ^ {1 - \gamma} \| _ {2} ^ {j - 1} \| (I + \frac {n}{\sigma^ {2}} \Lambda) ^ {- 1 + \frac {\gamma}{2}} \tilde {\Lambda} _ {1, R} ^ {- \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 2} \| _ {2} \\ = O \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1}{2}} \cdot n ^ {\frac {(j - 1) (1 - \alpha + 2 \tau)}{2 \alpha}}\right) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1 + \frac {\gamma}{2}} \tilde {\Lambda} _ {1, R} ^ {- \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 2} \| _ {2}. \\ \end{array}
+$$
+
+Since $\| (I + \frac{n}{\sigma^2}\Lambda)^{-1 + \frac{\gamma}{2}}\tilde{\Lambda}_{1,R}^{-\frac{\gamma}{2}}\pmb{\mu}_{R,2}\| _2$ is actually the case of $\mu_0 = 0$ , we can use (93) in the proof of Lemma 35 and get
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1 + \frac {\gamma}{2}} \tilde {\Lambda} _ {1, R} ^ {- \frac {\gamma}{2}} \boldsymbol {\mu} _ {R, 2} \right\| _ {2} ^ {2} = \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1 + \gamma / 2} \Lambda_ {1: R} ^ {- \gamma / 2} \boldsymbol {\mu} _ {1: R} \right\| _ {2} ^ {2} \\ = \tilde {O} \left(n ^ {\max \{- 2 + \gamma , \frac {1 - 2 \beta}{\alpha} + \gamma + \kappa (1 - 2 \beta + \alpha \gamma) \}} \right. \tag {112} \\ = \tilde {O} \left(n ^ {\max \{- 2 + \gamma , \frac {1 - 2 \beta}{\alpha} + \gamma + \kappa (1 - 2 \beta + \alpha \gamma) \}}\right) \\ = o \left(n ^ {\gamma}\right), \\ \end{array}
+$$
+
+where in the last equality we use $\kappa < \frac{2\beta - 1}{\alpha^2}$ . Then we have
+
+$$
+\left| \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} Q _ {2, j} \right| \leq \sum_ {j = 1} ^ {\infty} o \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1 + \gamma}{2}} \cdot n ^ {\frac {(j - 1) (1 - \alpha + 2 \tau)}{2 \alpha}}\right) = o \left(\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1 + \gamma}{2}}\right) \tag {113}
+$$
+
+Choosing $\gamma = \frac{1}{2}\left(1 + \frac{1 + \alpha + 2\tau}{2\alpha}\right) = \frac{1 + 3\alpha + 2\tau}{4\alpha} < 1$ , we have
+
+$$
+\begin{array}{l} T _ {2, R} (D _ {n}) = \frac {n}{2 \sigma^ {2}} \boldsymbol {\mu} _ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j + 1} \left(Q _ {1, j} + Q _ {2, j} + Q _ {3, j}\right) \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}) + o (n ^ {\max \{0, 1 + \frac {1 - 2 \beta}{\alpha} \}}) + O (\log \frac {R}{\delta} n ^ {\gamma}) + o (\sqrt {\log \frac {R}{\delta}} n ^ {\frac {1 + \gamma}{2}}) \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} (n ^ {\max \{\frac {1 + \gamma}{2}, 1 + \frac {1 - 2 \beta}{\alpha} \}}) \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} \left(n ^ {\max \left\{\frac {1 + 7 \alpha + 2 \tau}{8 \alpha}, 1 + \frac {1 - 2 \beta}{\alpha} \right\}}\right). \\ \end{array}
+$$
+
+
+
+Proof of Theorem 8. Let $R = n^{\frac{1}{\alpha} + \kappa}$ where $0 < \kappa < \min \left\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\right\}$ . Since $0 \leq q < \min \left\{\frac{2\beta - 1}{2}, \alpha\right\} \cdot \min \left\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\right\}$ , we can choose $\kappa < \min \left\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\right\}$ and $\kappa$ is arbitrarily close to $\kappa < \min \left\{\frac{\alpha - 1 - 2\tau}{2\alpha^2}, \frac{2\beta - 1}{\alpha^2}\right\}$ such that $0 \leq q < \min \left\{\frac{(2\beta - 1)\kappa}{2}, \kappa\alpha\right\}$ . Then we have $(\frac{1}{\alpha} + \kappa)\frac{1 - 2\beta}{2} + q < 0$ , and $-\kappa\alpha + q < 0$ . As for $T_2(D_n)$ , we have
+
+$$
+\begin{array}{l} T _ {2} (D _ {n}) \leq T _ {2, R} (D _ {n}) + | T _ {2, R} (D _ {n}) - T _ {2} (D _ {n}) | \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} \left(n ^ {\max \left\{\frac {1 + 7 \alpha + 2 \tau}{8 \alpha}, 1 + \frac {1 - 2 \beta}{\alpha} \right\}}\right) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) n ^ {\max \left\{1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 - \kappa \alpha \right\}}\right) \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + \tilde {O} \left(n ^ {\max \left\{\frac {1 + 7 \alpha + 2 \tau}{8 \alpha}, 1 + \frac {1 - 2 \beta}{\alpha} \right\}}\right) + \tilde {O} \left(n ^ {q + \max \left\{1 + \left(\frac {1}{\alpha} + \kappa\right) \frac {1 - 2 \beta}{2}, 1 - \kappa \alpha \right\}}\right) \\ = \frac {n}{2 \sigma^ {2}} \mu_ {0} ^ {2} + o (n). \\ \end{array}
+$$
+
+By Lemma 36, we have $T_{1}(D_{n}) = O(n^{\frac{1}{\alpha}})$ . Hence $\mathbb{E}_{\epsilon}F^{0}(D_{n}) = T_{1}(D_{n}) + T_{2}(D_{n}) = \frac{n}{2\sigma^{2}}\mu_{0}^{2} + o(n)$ .
+
+# D.2 PROOFS RELATED TO THE ASYMPTOTICS OF THE GENERALIZATION ERROR
+
+Lemma 39. Assume $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Let $R = n^{\left(\frac{2\alpha - 1}{\alpha(\alpha - 1)} + 1\right)(1 - t)}$ . Under Assumptions 4, 5 and 6, with probability of at least $1 - \delta$ over sample inputs $(x_{i})_{i = 1}^{n}$ , we have
+
+$$
+G _ {1} \left(D _ {n}\right) = \frac {1 + o (1)}{2 \sigma^ {2}} \left(\operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} - \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \| _ {F} ^ {2}\right) = \frac {1}{\sigma^ {2}} \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right). \tag {114}
+$$
+
+Proof of Lemma 39. Let $G_{1,R}(D_n) = \mathbb{E}_{(x_{n + 1},y_{n + 1})}(T_{1,R}(D_{n + 1}) - T_{1,R}(D_n))$ , where $R = n^C$ for some constant $C$ . By Lemma 32, we have that
+
+$$
+\begin{array}{l} \left| G _ {1} \left(D _ {n}\right) - G _ {1, R} \left(D _ {n}\right) \right| = \left| \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left[ T _ {1} \left(D _ {n + 1}\right) - T _ {1, R} \left(D _ {n + 1}\right) \right] - \left[ T _ {1} \left(D _ {n}\right) - T _ {1, R} \left(D _ {n}\right) \right] \right| \\ = \left| \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} O ((n + 1) R ^ {1 - \alpha}) \right| + \left| O (n R ^ {1 - \alpha}) \right] \mid \tag {115} \\ = O \left(\frac {1}{\sigma^ {2}} n R ^ {1 - \alpha}\right). \\ \end{array}
+$$
+
+Define $\eta_R = (\phi_0(x_{n+1}), \phi_1(x_{n+1}), \dots, \phi_R(x_{n+1}))^T$ and $\widetilde{\Phi}_R = (\Phi_R^T, \eta_R)^T$ . As for $G_{1,R}(D_n)$ , we have
+
+$$
+\begin{array}{l} G _ {1, R} (D _ {n}) = \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \left(T _ {1, R} (D _ {n + 1}) - T _ {1, R} (D _ {n})\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{2} \log \det \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right)\right) \\ - \left(\frac {1}{2} \log \det \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) - \frac {1}{2} \operatorname {T r} \left(I - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right)\right) \tag {116} \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det \left(I + \frac {\widetilde {\Phi_ {R}} \Lambda_ {R} \widetilde {\Phi_ {R}} ^ {T}}{\sigma^ {2}}\right) - \log \det \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right)\right) \\ - \frac {1}{2} \left(\mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \mathrm {T r} (I - (I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1}) - \mathrm {T r} (I - (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}) ^ {- 1})\right). \\ \end{array}
+$$
+
+As for the first term in the right hand side (116), we have
+
+$$
+\begin{array}{l} \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) - \log \det \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right)\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det (I + \frac {\Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} \widetilde {\Phi} _ {R}}{\sigma^ {2}}) - \log \det (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}})\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \mathrm {l o g d e t} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R} + \eta_ {R} \eta_ {R} ^ {T}}{\sigma^ {2}}) - \mathrm {l o g d e t} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}})\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det \left((I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}) ^ {- 1} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}} + \frac {\Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T}}{\sigma^ {2}})\right)\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det \left(I + \left(I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}\right) ^ {- 1} \frac {\Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T}}{\sigma^ {2}}\right)\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \left(1 + \frac {1}{\sigma^ {2}} \eta_ {R} ^ {T} \left(I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}\right) ^ {- 1} \Lambda_ {R} \eta_ {R}\right)\right) \\ \end{array}
+$$
+
+Let
+
+$$
+A = \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right) \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2}. \tag {117}
+$$
+
+According to Corollary 22, with probability of at least $1 - \delta$ , we have $\| \frac{1}{\sigma^2} A \|_2 = O(\sqrt{\log \frac{R}{\delta}} n^{\frac{1 - \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau)t}{2\alpha}}) = o(1)$ . When $n$ is sufficiently large, $\| \frac{1}{\sigma^2} A \|_2$ is less than 1. By Lemma 27, we have
+
+$$
+\begin{array}{l} \eta_ {R} ^ {T} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}) ^ {- 1} \Lambda_ {R} \eta_ {R} \\ = \eta_ {R} ^ {T} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \eta_ {R} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \eta_ {R} ^ {T} \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} (\Phi_ {R} ^ {T} \Phi_ {R} - n I)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \eta_ {R} \\ = \eta_ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \eta_ {R} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \eta_ {R} ^ {T} \left(I + \frac {n}{\sigma^ {2 j}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} \eta_ {R} \\ \leq \eta_ {R} ^ {T} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \eta_ {R} + \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} \eta_ {R} \| _ {2} ^ {2} \\ \leq \sum_ {p = 1} ^ {R} \phi_ {p} ^ {2} (x _ {n + 1}) \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha}}{1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} + \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \sum_ {p = 1} ^ {R} \phi_ {p} ^ {2} (x _ {n + 1}) \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha}}{1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} \\ \leq \sum_ {p = 1} ^ {R} \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha} p ^ {2 \tau}}{1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} + \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \sum_ {p = 1} ^ {R} \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha} p ^ {2 \tau}}{1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} \\ \leq O \left(n ^ {\frac {(1 - \alpha + 2 \tau) (1 - t)}{\alpha}}\right) + \sum_ {j = 1} ^ {\infty} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} O \left(n ^ {\frac {(1 - \alpha + 2 \tau) (1 - t)}{\alpha}}\right) \\ = O \left(n ^ {\frac {(1 - \alpha + 2 \tau) (1 - t)}{\alpha}}\right) = o (1), \tag {118} \\ \end{array}
+$$
+
+where we use Lemma 15 in the last inequality. Next we have
+
+$$
+\begin{array}{l} \frac {1}{2} \left(\mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \log \det (I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}) - \log \det (I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}})\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \left(1 + \frac {1}{\sigma^ {2}} \eta_ {R} ^ {T} \left(I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}\right) ^ {- 1} \Lambda_ {R} \eta_ {R}\right)\right) \\ = \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{\sigma^ {2}} \eta_ {R} ^ {T} \left(I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}\right) ^ {- 1} \Lambda_ {R} \eta_ {R}\right) (1 + o (1))\right) \\ = \frac {1}{2 \sigma^ {2}} \bigg (\mathrm {T r} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}) ^ {- 1} \Lambda_ {R} \bigg) (1 + o (1)), \\ \end{array}
+$$
+
+where in the last equality we use the fact that $\mathbb{E}_{(x_{n + 1},y_{n + 1})}\eta_R\eta_R^T = I$ . By Lemma 27, we have
+
+$$
+\begin{array}{l} \operatorname {T r} (I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}) ^ {- 1} \Lambda_ {R} \\ = \operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \left(\Phi_ {R} ^ {T} \Phi_ {R} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \\ = \operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \operatorname {T r} \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2}. \\ \end{array}
+$$
+
+By Lemma 15, we have
+
+$$
+\begin{array}{l} \operatorname {T r} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \leq \sum_ {p = 1} ^ {R} \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha}}{1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} = \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) \\ \operatorname {T r} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} \geq \sum_ {p = 1} ^ {R} \frac {\underline {{C}} _ {\lambda} p ^ {- \alpha}}{1 + n \overline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}} = \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}). \\ \end{array}
+$$
+
+Overall,
+
+$$
+\operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right). \tag {119}
+$$
+
+Since $\| \frac{1}{\sigma^2} A \|_2^j = o(1)$ , we have that the absolute values of diagonal entries of $\frac{1}{\sigma^{2j}} A^j$ are at most $o(1)$ . Let $(A^j)_{p,p}$ denote the $(p,p)$ -th entry of the matrix $A^j$ . Then we have
+
+$$
+\begin{array}{l} \left| \operatorname {T r} \frac {1}{\sigma^ {2 j}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \Lambda_ {R} ^ {1 / 2} \right| \\ = \left| \sum_ {p = 1} ^ {R} \frac {\lambda_ {p} \frac {1}{\sigma^ {2 j}} (A ^ {j}) _ {p , p}}{1 + n \lambda_ {p} / \sigma^ {2}} \right| \leq \sum_ {p = 1} ^ {R} \frac {\lambda_ {p} \| \frac {1}{\sigma^ {2 j}} A \| _ {2} ^ {j}}{1 + n \lambda_ {p} / \sigma^ {2}} = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t)}{2 \alpha}} (\log R) ^ {j / 2}\right), \tag {120} \\ \end{array}
+$$
+
+where in the last step we used (119). According to (119) and (120), we have
+
+$$
+\begin{array}{l} \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \log \det \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) - \log \det \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right)\right) \\ = \frac {1}{2 \sigma^ {2}} \left(\operatorname {T r} \left(I + \frac {\Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}}{\sigma^ {2}}\right) ^ {- 1} \Lambda_ {R}\right) (1 + o (1)) \\ = \frac {1}{\sigma^ {2}} \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) + \frac {1}{\sigma^ {2}} \sum_ {j = 1} ^ {\infty} \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t)}{2 \alpha}} (\log R) ^ {j / 2}\right) \tag {121} \\ = \frac {1}{\sigma^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) + \frac {1}{\sigma^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) o (1) = \frac {1}{\sigma^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) \\ = \frac {1}{2 \sigma^ {2}} \left(\operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R}\right) (1 + o (1)). \\ \end{array}
+$$
+
+Using the Woodbury matrix identity, the second term in the right hand side (116) is given by
+
+$$
+\begin{array}{l} \frac {1}{2} \left( \right.\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(I - \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \operatorname {T r} \left(I - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right)\right. \\ = \frac {1}{2} \left( \right.\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \widetilde {\Phi} _ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} \widetilde {\Phi} _ {R}\right) ^ {- 1} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} - \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \Phi_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T}\right)\right. \\ = \frac {1}{2} \left( \right.\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} \widetilde {\Phi} _ {R}\right) ^ {- 1} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} \widetilde {\Phi} _ {R} - \operatorname {T r} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right)\right) \\ = - \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T} \widetilde {\Phi} _ {R}\right) ^ {- 1} - \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1}\right) \\ = - \frac {1}{2} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R} + \frac {1}{\sigma^ {2}} \Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T}\right) ^ {- 1} - \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1}\right) \\ = \frac {1}{2 \sigma^ {2}} \left(\mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \mathrm {T r} \frac {(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}) ^ {- 1} \Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T} (I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}) ^ {- 1}}{1 + \frac {1}{\sigma^ {2}} \eta_ {R} ^ {T} (I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}) ^ {- 1} \Lambda_ {R} \eta_ {R}}\right), \\ \end{array}
+$$
+
+where the last equality uses the Sherman-Morrison formula. According to (118), we get
+
+$$
+\begin{array}{l} \frac {1}{2 \sigma^ {2}} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \frac {\left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1}}{1 + \frac {1}{\sigma^ {2}} \eta_ {R} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \eta_ {R}}\right) \\ = \frac {1}{2 \sigma^ {2}} \left(\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \eta_ {R} \eta_ {R} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} (1 + o (1))\right) \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \operatorname {T r} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} ^ {1 / 2} \Phi_ {R} ^ {T} \Phi_ {R} \Lambda_ {R} ^ {1 / 2}\right) ^ {- 1} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} ^ {1 / 2} \Phi_ {R} ^ {T} \Phi_ {R} \Lambda_ {R} ^ {1 / 2}\right) ^ {- 1} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} ^ {1 / 2} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} ^ {1 / 2} \Phi_ {R} ^ {T} \Phi_ {R} \Lambda_ {R} ^ {1 / 2}\right) ^ {- 1} \Lambda_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} ^ {1 / 2} \Phi_ {R} ^ {T} \Phi_ {R} \Lambda_ {R} ^ {1 / 2}\right) ^ {- 1} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} ^ {1 / 2} \Phi_ {R} ^ {T} \Phi_ {R} \Lambda_ {R} ^ {1 / 2}\right) ^ {- 1} \| _ {F} ^ {2} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \left(I + \frac {1}{\sigma^ {2}} A\right) ^ {- 1} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \| _ {F} ^ {2}, \\ \end{array}
+$$
+
+where in the penultimate equality we use $\mathrm{Tr}(BB^T) = \| B\| _F^2$ $\| B\| _F$ is the Frobenius norm of $A$ , and in the last equality we use the definition of $A$ (117). Then we have
+
+$$
+\begin{array}{l} \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \left(I + \frac {1}{\sigma^ {2}} A\right) ^ {- 1} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \| _ {F} ^ {2} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} (I + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} A ^ {j}) (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} \| _ {F} ^ {2} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \| _ {F} ^ {2}. \tag {122} \\ \end{array}
+$$
+
+By Lemma 15, we have
+
+$$
+\| \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \| _ {F} \leq \sqrt {\sum_ {p = 1} ^ {R} \frac {\overline {{C _ {\lambda}}} p ^ {- \alpha}}{(1 + n \underline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}) ^ {2}}} = \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{2 \alpha}})
+$$
+
+$$
+\| \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \| _ {F} \geq \sqrt {\sum_ {p = 1} ^ {R} \frac {C _ {\lambda} p ^ {- \alpha}}{(1 + n \overline {{C _ {\lambda}}} p ^ {- \alpha} / \sigma^ {2}) ^ {2}}} = \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{2 \alpha}}).
+$$
+
+Overall, we have
+
+$$
+\left\| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \right\| _ {F} = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{2 \alpha}}\right). \tag {123}
+$$
+
+Since $\| \frac{1}{\sigma^2} A \|_2 = O(\sqrt{\log \frac{R}{\delta}} n^{\frac{1 - \alpha + 2\tau}{2\alpha} - \frac{(1 + 2\tau)t}{2\alpha}}) = o(1)$ , we have
+
+$$
+\begin{array}{l} \| \frac {1}{\sigma^ {2 j}} \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} A ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1 / 2} \| _ {F} \\ \leq \left\| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right\| _ {F} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j} \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \| _ {2} \tag {124} \\ = O \left(n ^ {\frac {(1 - \alpha) (1 - t)}{2 \alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t)}{2 \alpha}} (\log R) ^ {j / 2}\right), \\ \end{array}
+$$
+
+where in the first inequality we use the fact that $\| AB\| _F\leq \| A\| _F\| B\| _2$ when $B$ is symmetric. By Lemma 15, we have
+
+$$
+\begin{array}{l} \frac {1}{\sigma^ {2 j}} \left| \operatorname {T r} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right| \\ = \left| \sum_ {p = 1} ^ {R} \frac {\lambda_ {p} \left(\left(\frac {1}{\sigma^ {2}} A\right) ^ {j}\right) _ {p , p}}{(1 + n \lambda_ {p} / \sigma^ {2}) ^ {2}} \right| \leq \sum_ {p = 1} ^ {R} \frac {\lambda_ {p} \| \frac {1}{\sigma^ {2}} A \| _ {2} ^ {j}}{(1 + n \lambda_ {p} / \sigma^ {2}) ^ {2}} = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t)}{2 \alpha}} (\log R) ^ {j / 2}\right), \tag {125} \\ \end{array}
+$$
+
+According to (123), (124) and (125), we have
+
+$$
+\begin{array}{l} \frac {1}{2} \left( \right.\mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \operatorname {T r} \left(I - \left(I + \frac {\widetilde {\Phi} _ {R} \Lambda_ {R} \widetilde {\Phi} _ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1} - \operatorname {T r} \left(I - \left(I + \frac {\Phi_ {R} \Lambda_ {R} \Phi_ {R} ^ {T}}{\sigma^ {2}}\right) ^ {- 1}\right)\right. \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \operatorname {T r} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \Lambda_ {R} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {R} \Phi_ {R} ^ {T} \Phi_ {R}\right) ^ {- 1} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \| _ {F} ^ {2} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \left(\| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \| _ {F} ^ {2} + \sum_ {j = 1} ^ {\infty} \left\| \frac {1}{\sigma^ {2 j}} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} \right\| _ {F} ^ {2} \right. \\ \left. + 2 \operatorname {T r} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \frac {1}{\sigma^ {2 j}} \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2} A ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1 / 2}\right) \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \left(\Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) + \sum_ {j = 1} ^ {\infty} \frac {1}{\sigma^ {2 j}} O \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t}{2 \alpha}} (\log R) ^ {j / 2}\right) \right. \\ \left. + 2 \sum_ {j = 1} ^ {\infty} \frac {1}{\sigma^ {2 j}} \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) \tilde {O} \left(n ^ {\frac {j (1 - \alpha + 2 \tau - (1 + 2 \tau) t)}{2 \alpha}} (\log R) ^ {j / 2}\right)\right) \\ = \frac {1}{\sigma^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) = \frac {1 + o (1)}{2 \sigma^ {2}} \| \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \| _ {F} ^ {2}. \tag {126} \\ \end{array}
+$$
+
+Combining (121) and (126) we get that $G_{1,R}(D_n) = \frac{1 + o(1)}{2\sigma^2} (\mathrm{Tr}(I + \frac{n}{\sigma^2}\Lambda_R)^{-1}\Lambda_R + \|\Lambda_R^{1/2}(I + \frac{n}{\sigma^2}\Lambda_R)^{-1}\|_F^2) = \frac{1}{\sigma^2}\Theta(n^{\frac{(1-\alpha)(1-t)}{\alpha}})$ . From (115) we have that $G_{1}(D_{n}) \leq G_{1,R}(D_{n}) + |G_{1}(D_{n}) - G_{1,R}(D_{n})| = \frac{1}{\sigma^2}\Theta(n^{\frac{(1-\alpha)(1-t)}{\alpha}}) + O(n\frac{1}{\sigma^2}R^{1-\alpha})$ . Choosing $R = n^{\left(\frac{2\alpha-1}{\alpha(\alpha-1)}+1\right)(1-t)}$ we conclude the proof.
+
+Lemma 40. Assume $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Let $S = n^{D}$ . Assume that $\| \xi \| _2 = 1$ . When $n$ is sufficiently large, with probability of at least $1 - 2\delta$ we have
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}\right) ^ {- 1} \Phi_ {S} \Lambda_ {S} \xi \right\| _ {2} = O \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {- (1 - t)}\right). \tag {127}
+$$
+
+Proof of Lemma 40. Using the Woodbury matrix identity, we have that
+
+$$
+\begin{array}{l} \left(\left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}\right) ^ {- 1} \Phi_ {S} \Lambda_ {S} \xi = \left[ I - \Phi_ {S} \left(\sigma^ {2} I + \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \Phi_ {S} ^ {T} \right] \Phi_ {S} \Lambda_ {S} \xi \right. \\ = \Phi_ {S} \Lambda_ {S} \xi - \Phi_ {S} \left(\sigma^ {2} I + \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S} \Lambda_ {S} \xi \tag {128} \\ = \Phi_ {S} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \xi . \\ \end{array}
+$$
+
+Let $A = \left(I + \frac{n}{\sigma^2}\Lambda_S\right)^{-\gamma /2}\Lambda_S^{\gamma /2}(\Phi_S^T\Phi_S - nI)\Lambda_S^{\gamma /2}\left(I + \frac{n}{\sigma^2}\Lambda_S\right)^{-\gamma /2}$ , where $\gamma >\frac{1 + \alpha + 2\tau - (1 + 2\tau + 2\alpha)t}{2\alpha(1 - t)}$
+
+By Corollary 22, with probability of at least $1 - \delta$ , we have $\| \frac{1}{\sigma^2} A \|_2 = \tilde{O}(n^{\frac{1 + \alpha + 2\tau - (1 + 2\tau + 2\alpha)t}{2\alpha} - \gamma(1 - t)})$ .
+
+When $n$ is sufficiently large, $\| \frac{1}{\sigma^2} A \|_2$ is less than 1. By Lemma 27, we have
+
+$$
+\begin{array}{l} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \\ = (I + \frac {n}{\sigma^ {2}} \Lambda_ {S}) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} (I + \frac {n}{\sigma^ {2}} \Lambda_ {S}) ^ {- 1} \Lambda_ {S} \big (\Phi_ {S} ^ {T} \Phi_ {S} - n I \big)\right) ^ {j} (I + \frac {n}{\sigma^ {2}} \Lambda_ {S}) ^ {- 1}. \\ \end{array}
+$$
+
+Then we have
+
+$$
+\begin{array}{l} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \| _ {2} \\ = \left\| \left(\left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} + \sum_ {j = 1} ^ {\infty} (- 1) ^ {j} \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \left(\Phi_ {S} ^ {T} \Phi_ {S} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1}\right) \Lambda_ {S} \xi \right\| _ {2} \\ \leq \left(\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \| _ {2} + \sum_ {j = 1} ^ {\infty} \left\| \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \left(\Phi_ {S} ^ {T} \Phi_ {S} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \right\| _ {2}\right). \tag {129} \\ \end{array}
+$$
+
+For the first term in the right hand side of the last equation, we have
+
+$$
+\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \right\| _ {2} \leq \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \right\| _ {2} \| \xi \| _ {2} \leq \frac {\sigma^ {2}}{n} = O \left(n ^ {- (1 - t)}\right). \tag {130}
+$$
+
+Using the fact that $\| \frac{1}{\sigma^2} A \|_2 = \tilde{O}(n^{\frac{1 + \alpha + 2\tau - (1 + 2\tau + 2\alpha)t}{2\alpha} - \gamma(1 - t)})$ and $\| (I + \frac{n}{\sigma^2}\Lambda_S)^{-1}\Lambda_S \|_2 \leq n^{-1}$ , we have
+
+$$
+\begin{array}{l} \left\| \left(\frac {1}{\sigma^ {2}} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \left(\Phi_ {S} ^ {T} \Phi_ {S} - n I\right)\right) ^ {j} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \right\| _ {2} \\ = \frac {1}{\sigma^ {2 j}} \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1 + \frac {\gamma}{2}} \Lambda_ {S} ^ {1 - \frac {\gamma}{2}} \left(A \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1 + \gamma} \Lambda_ {S} ^ {1 - \gamma}\right) ^ {j - 1} A \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1 + \frac {\gamma}{2}} \Lambda_ {S} ^ {- \frac {\gamma}{2}} \Lambda_ {S} \xi \right\| _ {2} \\ \leq n ^ {(1 - t) (- 1 + \frac {\gamma}{2} + (- 1 + \gamma) (j - 1))} \tilde {O} \left(n ^ {\frac {j (1 + \alpha + 2 \tau - (1 + 2 \tau + 2 \alpha) t)}{2 \alpha} - j \gamma (1 - t)}\right) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1 + \frac {\gamma}{2}} \Lambda_ {S} ^ {1 - \frac {\gamma}{2}} \xi \| _ {2} \\ = \tilde {O} \left(n ^ {- \frac {\gamma}{2} (1 - t) + \frac {(1 - \alpha + 2 \tau - (1 + 2 \tau) t) j}{2 \alpha}}\right) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {S}\right) ^ {- 1 + \frac {\gamma}{2}} \Lambda_ {S} ^ {1 - \frac {\gamma}{2}} \| _ {2} \| \xi \| _ {2} \\ = \tilde {O} \left(n ^ {- \frac {\gamma}{2} (1 - t) + \frac {(1 - \alpha + 2 \tau - (1 + 2 \tau) t) j}{2 \alpha}}\right) O \left(n ^ {(- 1 + \gamma / 2) (1 - t)}\right) \\ = \tilde {O} \left(n ^ {- (1 - t) + \frac {(1 - \alpha + 2 \tau - (1 + 2 \tau) t) j}{2 \alpha}}\right). \tag {131} \\ \end{array}
+$$
+
+Using (129), (130) and (131), we have
+
+$$
+\begin{array}{l} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \xi \| _ {2} \\ = \left(\tilde {O} \left(n ^ {- (1 - t)}\right) + \sum_ {j = 1} ^ {\infty} \tilde {O} \left(n ^ {- 1 + \frac {(1 - \alpha + 2 \tau - (1 + 2 \tau) t) j}{2 \alpha}}\right)\right) \tag {132} \\ = \left(\tilde {O} (n ^ {- (1 - t)}) + \tilde {O} (n ^ {- 1 + \frac {1 - \alpha + 2 \tau - (1 + 2 \tau) t}{2 \alpha}})\right) \\ = \tilde {O} (n ^ {- (1 - t)}). \\ \end{array}
+$$
+
+By Corollary 20, with probability of at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} \| \Phi_ {S} (I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}) ^ {- 1} \Lambda_ {S} \xi \| _ {2} = \tilde {O} (\sqrt {\left(\frac {1}{\delta} + 1\right) n} \| (I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}) ^ {- 1} \Lambda_ {S} \xi \| _ {2}) \\ = \tilde {O} (\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {- (1 - t)}). \\ \end{array}
+$$
+
+From (128) we get $\| (I + \frac{1}{\sigma^2}\Phi_S\Lambda_S\Phi_S^T)^{-1}f_S(\mathbf{x})\| _2 = \tilde{O} (\sqrt{(\frac{1}{\delta} + 1)n}\cdot n^{-(1 - t)})$ . This concludes the proof.
+
+Lemma 41. Assume $\sigma^2 = \Theta (n^t)$ where $1 - \frac{\alpha}{1 + 2\tau} < t < 1$ . Let $\delta = n^{-q}$ where $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ . Under Assumptions 4, 5 and 6, assume that $\mu_0 = 0$ . Let $R = n^{(\frac{1}{\alpha} + \kappa)(1 - t)}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ . Then with probability of at least $1 - 6\delta$ over sample inputs $(x_i)_{i=1}^n$ , we have $G_2(D_n) = \frac{(1 + o(1))}{2\sigma^2} \| (I + \frac{n}{\sigma^2} \Lambda_R)^{-1} \pmb{\mu}_R \|_2^2 = \frac{1}{\sigma^2} \Theta (n^{\max\{-2(1 - t), \frac{(1 - 2\beta)(1 - t)}{\alpha}\}} \log^{k/2} n)$ , where $k = \begin{cases} 0, & 2\alpha \neq 2\beta - 1, \\ 1, & 2\alpha = 2\beta - 1. \end{cases}$ .
+
+Proof of Lemma 41. Let $S = n^{D}$ . Let $G_{2,S}(D_n) = \mathbb{E}_{(x_{n+1},y_{n+1})}(T_{2,S}(D_{n+1}) - T_{2,S}(D_n))$ . By Lemma 33, when $S > n^{\max\{1,\frac{-t}{(\alpha-1-2\tau)}\}}$ with probability of at least $1-3\delta$ we have that
+
+$$
+\begin{array}{l} \left| G _ {2} \left(D _ {n}\right) - G _ {2, S} \left(D _ {n}\right) \right| = \left| \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left[ T _ {2} \left(D _ {n + 1}\right) - T _ {2, S} \left(D _ {n + 1}\right) \right] - \left[ T _ {2} \left(D _ {n}\right) - T _ {2, S} \left(D _ {n}\right) \right] \right| \\ = \left| \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} (n + 1) S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) - \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) \right| \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) \tag {133} \\ \end{array}
+$$
+
+Let $\Lambda_{1:S} = \mathrm{diag}\{\lambda_1,\dots,\lambda_S\}$ , $\Phi_{1:S} = (\phi_1(\mathbf{x}),\phi_1(\mathbf{x}),\dots,\phi_S(\mathbf{x}))$ and $\pmb{\mu}_{1:S} = (\mu_1,\dots,\mu_S)$ . Since $\mu_0 = 0$ , we have $T_{2,S}(D_n) = \frac{1}{2\sigma^2}\pmb{\mu}_{1:S}^T\Phi_{1:S}^T (I + \frac{1}{\sigma^2}\Phi_{1:S}\Lambda_{1:S}\Phi_{1:S}^T)^{-1}\Phi_{1:S}\pmb{\mu}_{1:S}$ . Define $\eta_{1:S} = (\phi_1(x_{n+1}),\dots,\phi_S(x_{n+1}))^T$ and $\widetilde{\Phi}_{1:S} = (\Phi_{1:S}^T,\eta_{1:S})^T$ . In the proof of Lemma 34, we showed that
+
+$$
+\begin{array}{l} T _ {2, S} (D _ {n}) = \frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: S} ^ {T} \Phi_ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} \Lambda_ {1: S} \Phi_ {1: S} ^ {T}\right) ^ {- 1} \Phi_ {1: S} \boldsymbol {\mu} _ {1: S} \\ = \frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \boldsymbol {\mu} _ {1: S} - \frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S}. \\ \end{array}
+$$
+
+We have
+
+$$
+\begin{array}{l} G _ {2, S} (D _ {n}) = \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \left(T _ {2, S} (D _ {n + 1}) - T _ {2, S} (D _ {n})\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \boldsymbol {\mu} _ {1: S} - \frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \widetilde {\Phi} _ {S} ^ {T} \widetilde {\Phi} _ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S}\right) \\ \left. - \left(\frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \boldsymbol {\mu} _ {1: S} - \frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S}\right)\right) \\ = \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \left(\frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} (I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}) ^ {- 1} \boldsymbol {\mu} _ {1: S} - \frac {1}{2} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} (I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \widetilde {\Phi} _ {S} ^ {T} \widetilde {\Phi} _ {S}) ^ {- 1} \boldsymbol {\mu} _ {1: S}\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: S} ^ {T} \Lambda_ {1: S} ^ {- 1} \frac {\left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1 : S} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S}\right) ^ {- 1} \Lambda_ {1 : S} \eta_ {1 : S} \eta_ {1 : S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1 : S} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S}\right) ^ {- 1}}{1 + \frac {1}{\sigma^ {2}} \eta_ {1 : S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1 : S} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S}\right) ^ {- 1} \Lambda_ {1 : S} \eta_ {1 : S}} \boldsymbol {\mu} _ {1: S}\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{2 \sigma^ {2}} \frac {\boldsymbol {\mu} _ {1 : S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S} \Lambda_ {1 : S}\right) ^ {- 1} \eta_ {1 : S} \eta_ {1 : S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1 : S} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S}\right) ^ {- 1} \boldsymbol {\mu} _ {1 : S}}{1 + \frac {1}{\sigma^ {2}} \eta_ {1 : S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1 : S} \Phi_ {1 : S} ^ {T} \Phi_ {1 : S}\right) ^ {- 1} \Lambda_ {1 : S} \eta_ {1 : S}}\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1 + o (1)}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} ^ {T} \Phi_ {1: S} \Lambda_ {1: S}\right) ^ {- 1} \eta_ {1: S} \eta_ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S}\right) \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \boldsymbol {\mu} _ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} ^ {T} \Phi_ {1: S} \Lambda_ {1: S}\right) ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S} \| _ {2} ^ {2}, \tag {135} \\ \end{array}
+$$
+
+where in the fourth to last equality we used the Sherman-Morrison formula, in the third inequality we used (118), and in the last equality we used the fact that $\mathbb{E}_{(x_{n + 1},y_{n + 1})}\eta_{1:S}\eta_{1:S}^T = I$ .
+
+Let $\hat{\mu}_{1:R} = (\mu_1,\dots,\mu_R,0,\dots,0)\in \mathbb{R}^S$ . Then we have
+
+$$
+\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S} \| _ {2} \leq \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \| _ {2} + \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} (\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}) \| _ {2},
+$$
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \boldsymbol {\mu} _ {1: S} \right\| _ {2} \geq \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \right\| _ {2} - \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) \right\| _ {2}. \tag {136}
+$$
+
+Let $R = n^{\left(\frac{1}{\alpha} + \kappa\right)(1 - t)}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ . In Lemma 29, (62), we showed that with probability of at least $1 - \delta$ ,
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2}, \\ \end{array}
+$$
+
+where $k = \begin{cases} 0, & 2\alpha \neq 2\beta - 1, \\ 1, & 2\alpha = 2\beta - 1. \end{cases}$ . The same proof holds if we replace $\Phi_{1:R}$ with $\Phi_{1:S}$ , $\Lambda_{1:R}$ with $\Lambda_{1:S}$ , and $\pmb{\mu}_{1:R}$ with $\hat{\pmb{\mu}}_{1:R}$ . We have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \hat {\mu} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \tag {138} \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \| _ {2}. \\ \end{array}
+$$
+
+Next we bound $\| (I + \frac{1}{\sigma^2}\Lambda_{1:S}\Phi_{1:S}^T\Phi_{1:S})^{-1}(\pmb{\mu}_{1:S} - \hat{\pmb{\mu}}_{1:R})\| _2$ . By Assumption 5, we have that $\| \pmb{\mu}_{1:S} - \hat{\pmb{\mu}}_{1:R}\| _2 = O(R^{\frac{1 - 2\beta}{2}})$ . For any $\xi \in \mathbb{R}^S$ and $\| \xi \| _2 = 1$ , using the Woodbury matrix identity, with probability of at least $1 - 2\delta$ we have
+
+$$
+\begin{array}{l} \left| \xi^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) \right| \\ = \left| \xi^ {T} \left(I - \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} \Lambda_ {1: S} \Phi_ {1: S} ^ {T}\right) ^ {- 1} \Phi_ {1: S}\right) \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) \right| \\ = \left| \xi^ {T} \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) - \frac {1}{\sigma^ {2}} \xi^ {T} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} \Lambda_ {1: S} \Phi_ {1: S} ^ {T}\right) ^ {- 1} \Phi_ {1: S} \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) \right| \\ \leq \| \xi \| _ {2} \| \boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R} \| _ {2} + \frac {1}{\sigma^ {2}} | \xi^ {T} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} (I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} \Lambda_ {1: S} \Phi_ {1: S} ^ {T}) ^ {- 1} \Phi_ {1: S} (\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}) | \\ \leq O \left(R ^ {\frac {1 - 2 \beta}{2}}\right) + \frac {1}{\sigma^ {2}} \| \left(I + \frac {1}{\sigma^ {2}} \Phi_ {1: S} \Lambda_ {1: S} \Phi_ {1: S} ^ {T}\right) ^ {- 1} \Phi_ {1: S} \Lambda_ {1: S} \xi \| _ {2} \| \Phi_ {1: S} \left(\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}\right) \| _ {2} \\ = O (R ^ {\frac {1 - 2 \beta}{2}}) + \frac {1}{\sigma^ {2}} O (\sqrt {(\frac {1}{\delta} + 1) n} \cdot n ^ {- (1 - t)}) O (\sqrt {(\frac {1}{\delta} + 1) n} R ^ {\frac {1 - 2 \beta}{2}}) \\ = O \left(\left(\frac {1}{\delta} + 1\right) R ^ {\frac {1 - 2 \beta}{2}}\right), \\ \end{array}
+$$
+
+where in the second to last step we used Corollary 20 to show $\| \Phi_{1:S}(\pmb{\mu}_{1:S} - \hat{\pmb{\mu}}_{1:R})\|_2 = O(\sqrt{(\frac{1}{\delta} + 1)n} R^{\frac{1 - 2\beta}{2}})$ with probability of at least $1 - \delta$ , and Lemma 40 to show that $\| (I + \frac{1}{\sigma^2}\Phi_{1:S}\Lambda_{1:S}\Phi_{1:S}^T)^{-1}\Phi_{1:S}\Lambda_{1:S}\xi \|_2 = O(\sqrt{(\frac{1}{\delta} + 1)n} \cdot n^{-1})$ with probability of at least $1 - \delta$ . Since $R = n^{(\frac{1}{\alpha} + \kappa)(1 - t)}$ , we have
+
+$$
+| \xi^ {T} (I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}) ^ {- 1} (\boldsymbol {\mu} _ {1: S} - \hat {\boldsymbol {\mu}} _ {1: R}) | = O ((\frac {1}{\delta} + 1) n ^ {\frac {(1 - 2 \beta) (1 - t)}{2 \alpha} + \frac {(1 - 2 \beta) (1 - t) \kappa}{2}}).
+$$
+
+Since $\xi$ is arbitrary, we have $\| (I + \frac{1}{\sigma^2}\Lambda_{1:S}\Phi_{1:S}^T\Phi_{1:S})^{-1}(\pmb{\mu}_{1:S} - \hat{\pmb{\mu}}_{1:R})\|_2 = O((\frac{1}{\delta} + 1)n^{\frac{(1 - 2\beta)(1 - t)}{2\alpha} + \frac{(1 - 2\beta)(1 - t)\kappa}{2}})$ . Since $0 \leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ and $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ , we can choose $\kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ and $\kappa$ is arbitrarily close to $\kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ such that
+
+$0 \leq q < \frac{(2\beta - 1)(1 - t)\kappa}{2}$ . Then we have $\frac{(1 - 2\beta)(1 - t)\kappa}{2} + q < 0$ . From (136) and (138), we have
+
+$$
+\begin{array}{l} \| (I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}) ^ {- 1} \pmb {\mu} _ {1: S} \| _ {2} = \Theta (n ^ {\max \{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \}} \log^ {k / 2} n) + O ((\frac {1}{\delta} + 1) n ^ {\frac {(1 - 2 \beta) (1 - t)}{2 \alpha} + \frac {(1 - 2 \beta) (1 - t) \kappa}{2}}) \\ = \Theta (n ^ {\max \left\{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \right\}} \log^ {k / 2} n) + O ((n ^ {q + \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} + \frac {(1 - 2 \beta) (1 - t) \kappa}{2}}) \\ = \Theta (n ^ {\max \left\{- (1 - t), \frac {(1 - 2 \beta) (1 - t)}{2 \alpha} \right\}} \log^ {k / 2} n) \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \| _ {2} \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \| _ {2}. \tag {139} \\ \end{array}
+$$
+
+Hence $G_{2,S}(D_n) = \frac{1 + o(1)}{2\sigma^2}\| (I + \frac{1}{\sigma^2}\Lambda_{1:S}\Phi_{1:S}^T\Phi_{1:S})^{-1}\pmb{\mu}_{1:S}\|_2^2 = \frac{1}{\sigma^2}\Theta (n^{(1 - t)\max\{-2,\frac{1 - 2\beta}{\alpha}\}}\log^{k / 2}n).$ Then by (133), we have
+
+$$
+G _ {2} (D _ {n}) = \frac {1}{\sigma^ {2}} \Theta (n ^ {\max \{- 2 (1 - t), \frac {(1 - 2 \beta) (1 - t)}{\alpha} \}} \log^ {k / 2} n) + \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {n}{\sigma^ {2}} S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right).
+$$
+
+Choosing $S = n^{\max \left\{1, \frac{-t}{(\alpha - 1 - 2\tau)}, \left(\frac{1 + q + \min\{2, \frac{2\beta - 1}{\alpha}\}}{\min\{\beta - 1/2, \alpha - 1 - 2\tau\}} + 1\right)(1 - t)\right\}}$ , we get the result.
+
+
+
+Proof of Theorem 9. From Lemmas 39 and 41 and $\frac{1}{\alpha} - 1 > -2$ , we have that with probability of at least $1 - 7\tilde{\delta}$
+
+$$
+\begin{array}{l} \mathbb {E} _ {\boldsymbol {\epsilon}} G (D _ {n}) = \frac {1 + o (1)}{2 \sigma^ {2}} (\mathrm {T r} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \Lambda_ {R} - \| \Lambda_ {R} ^ {1 / 2} (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \| _ {F} ^ {2} + \| (I + \frac {n}{\sigma^ {2}} \Lambda_ {R}) ^ {- 1} \boldsymbol {\mu} _ {R} \| _ {2} ^ {2}) \\ = \frac {1}{\sigma^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) + \frac {1}{\sigma^ {2}} \Theta (n ^ {\max \{- 2 (1 - t), \frac {(1 - 2 \beta) (1 - t)}{\alpha} \}} \log^ {k / 2} n) \\ = \frac {1}{\sigma^ {2}} \Theta \left(n ^ {\max \left\{\frac {(1 - \alpha) (1 - t)}{\alpha}, \frac {(1 - 2 \beta) (1 - t)}{\alpha} \right\}}\right) \tag {140} \\ \end{array}
+$$
+
+where $k = \left\{ \begin{array}{ll}0, & 2\alpha \neq 2\beta -1\\ 1, & 2\alpha = 2\beta -1 \end{array} \right.$ and $R = n^{(\frac{1}{\alpha} +\kappa)(1 - t)}$ $\kappa >0$
+
+Furthermore, we have
+
+$$
+\begin{array}{l} \operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \Lambda - \operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} \\ = \sum_ {p = R + 1} ^ {\infty} \frac {\lambda_ {p}}{1 + \frac {n}{\sigma^ {2}} \lambda_ {p}} \leq \sum_ {p = R + 1} ^ {\infty} \frac {C _ {\lambda} p ^ {- \alpha}}{1 + \frac {n}{\sigma^ {2}} C _ {\lambda} p ^ {- \alpha}} \leq \sum_ {p = R + 1} ^ {\infty} C _ {\lambda} p ^ {- \alpha} = \frac {n}{\sigma^ {2}} O (R ^ {1 - \alpha}) \\ = O \left(n ^ {(1 - \alpha) (1 - t) \left(\frac {1}{\alpha} + \kappa\right)}\right) \\ = o \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right). \\ \end{array}
+$$
+
+Then we have
+
+$$
+\operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \Lambda_ {R} = \operatorname {T r} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \Lambda (1 + o (1)). \tag {141}
+$$
+
+Similarly we can prove
+
+$$
+\left\| \Lambda_ {R} ^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \right\| _ {F} ^ {2} = \left\| \Lambda^ {1 / 2} \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \right\| _ {F} ^ {2} (1 + o (1)) \tag {142}
+$$
+
+$$
+\left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {R}\right) ^ {- 1} \boldsymbol {\mu} _ {R} \right\| _ {2} ^ {2} = \left\| \left(I + \frac {n}{\sigma^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} \right\| _ {2} ^ {2} (1 + o (1)) \tag {143}
+$$
+
+Letting $\delta = 7\tilde{\delta}$ , the proof is complete.
+
+
+
+In the case of $\mu_0 > 0$ , we have the following lemma:
+
+Lemma 42. Let $\delta = n^{-q}$ where $0\leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ . Under Assumptions 4, 5 and 6, assume that $\mu_0 > 0$ . Then with probability of at least $1 - 6\delta$ over sample inputs $(x_{i})_{i = 1}^{n}$ , we have $G_{2}(D_{n}) = \frac{1}{2\sigma^{2}}\mu_{0}^{2} + o(1)$ .
+
+Proof of Lemma 42. Let $S = n^{D}$ . Let $G_{2,S}(D_n) = \mathbb{E}_{(x_{n+1},y_{n+1})}(T_{2,S}(D_{n+1}) - T_{2,S}(D_n))$ . By Lemma 33, when $S > n^{\max\{1,\frac{-t}{(\alpha-1-2\tau)}\}}$ , with probability of at least $1 - 3\delta$ we have that
+
+$$
+\begin{array}{l} \left| G _ {2} \left(D _ {n}\right) - G _ {2, S} \left(D _ {n}\right) \right| = \left| \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left[ T _ {2} \left(D _ {n + 1}\right) - T _ {2, S} \left(D _ {n + 1}\right) \right] - \left[ T _ {2} \left(D _ {n}\right) - T _ {2, S} \left(D _ {n}\right) \right] \right| \\ = \left| \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} (n + 1) S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) - \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) \right| \\ = \tilde {O} \left(\left(\frac {1}{\delta} + 1\right) \frac {1}{\sigma^ {2}} n S ^ {\max \{1 / 2 - \beta , 1 - \alpha + 2 \tau \}}\right) \\ \end{array}
+$$
+
+Let $\Lambda_S = \mathrm{diag}\{\lambda_1,\dots,\lambda_S\}$ , $\Phi_S = (\phi_1(\mathbf{x}),\phi_1(\mathbf{x}),\dots,\phi_S(\mathbf{x}))$ and $\pmb{\mu}_{S} = (\mu_{1},\dots,\mu_{S})$ . Define $\eta_S = (\phi_0(x_{n + 1}),\phi_1(x_{n + 1}),\dots,\phi_S(x_{n + 1}))^T$ and $\widetilde{\Phi}_S = (\Phi_S^T,\eta_S)^T$ . By the same technique as in the proof of Lemma 34, we replace $\Lambda_R$ by $\tilde{\Lambda}_{\epsilon ,R} = \mathrm{diag}\{\epsilon ,\lambda_1,\dots,\lambda_R\}$ , let $\epsilon \to 0$ and show the counterpart of the result (135) in the proof of Lemma 41:
+
+$$
+\begin{array}{l} G _ {2, S} (D _ {n}) = \mathbb {E} _ {(x _ {n + 1}, y _ {n + 1})} \left(T _ {2, S} (D _ {n + 1}) - T _ {2, S} (D _ {n})\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1}{2 \sigma^ {2}} \frac {\boldsymbol {\mu} _ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} ^ {T} \Phi_ {S} \Lambda_ {S}\right) ^ {- 1} \eta_ {S} \eta_ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S}}{1 + \frac {1}{\sigma^ {2}} \eta_ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \Lambda_ {S} \eta_ {S}}\right) \\ = \mathbb {E} _ {\left(x _ {n + 1}, y _ {n + 1}\right)} \left(\frac {1 + o (1)}{2 \sigma^ {2}} \boldsymbol {\mu} _ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} ^ {T} \Phi_ {S} \Lambda_ {S}\right) ^ {- 1} \eta_ {S} \eta_ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S}\right) \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \boldsymbol {\mu} _ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} ^ {T} \Phi_ {S} \Lambda_ {S}\right) ^ {- 1} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S} \\ = \frac {1 + o (1)}{2 \sigma^ {2}} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S} \| _ {2} ^ {2}, \tag {144} \\ \end{array}
+$$
+
+where in the fourth to last equality we used the Sherman-Morrison formula, in the third inequality we used (118), and in the last equality we used the fact that $\mathbb{E}_{(x_{n + 1},y_{n + 1})}\eta_{1:S}\eta_{1:S}^T = I$ .
+
+Let $\hat{\mu}_R = (\mu_0,\mu_1,\dots ,\mu_R,0,\dots ,0)\in \mathbb{R}^S$ . Then we have
+
+$$
+\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S} \| _ {2} \leq \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {R} \| _ {2} + \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} (\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}) \| _ {2},
+$$
+
+$$
+\left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S} \right\| _ {2} \geq \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {R} \right\| _ {2} - \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) \right\| _ {2}. \tag {145}
+$$
+
+Choose $R = n^{\left(\frac{1}{\alpha} + \kappa\right)(1 - t)}$ where $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{\alpha^2(1 - t)}$ . In Lemma 29, (62), we showed that with probability of at least $1 - \delta$ ,
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: R} \Phi_ {1: R} ^ {T} \Phi_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \tag {146} \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: R}\right) ^ {- 1} \boldsymbol {\mu} _ {1: R} \| _ {2}, \\ \end{array}
+$$
+
+where $k = \begin{cases} 0, & 2\alpha \neq 2\beta - 1, \\ 1, & 2\alpha = 2\beta - 1. \end{cases}$ . The same proof holds if we replace $\Phi_{1:R}$ with $\Phi_{1:S}$ , $\Lambda_{1:R}$ with $\Lambda_{1:S}$ , and $\pmb{\mu}_{1:R}$ with $\hat{\pmb{\mu}}_{1:R}$ . We have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {1: S} \Phi_ {1: S} ^ {T} \Phi_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \right\| _ {2} = \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \tag {147} \\ = (1 + o (1)) \| \left(I + \frac {n}{\sigma^ {2}} \Lambda_ {1: S}\right) ^ {- 1} \hat {\boldsymbol {\mu}} _ {1: R} \| _ {2}. \\ \end{array}
+$$
+
+So we have
+
+$$
+\begin{array}{l} \left\| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \hat {\mu} _ {R} \right\| _ {2} = \mu_ {0} + \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) \tag {148} \\ = \mu_ {0} + o (1). \\ \end{array}
+$$
+
+Next we bound $\| (I + \frac{1}{\sigma^2}\Lambda_S\Phi_S^T\Phi_S)^{-1}(\pmb {\mu}_S - \hat{\pmb{\mu}}_R)\| _2$ . By Assumption 5, we have that $\| \pmb {\mu}_S - \hat{\pmb{\mu}}_R\| _2 = O(R^{\frac{1 - 2\beta}{2}})$ . For any $\xi \in \mathbb{R}^S$ and $\| \xi \| _2 = 1$ , using the Woodbury matrix
+
+identity, with probability of at least $1 - 2\delta$ we have
+
+$$
+\begin{array}{l} \left| \xi^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) \right| \\ = \left| \xi^ {T} \left(I - \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}\right) ^ {- 1} \Phi_ {S}\right) \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) \right| \\ = \left| \xi^ {T} \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) - \frac {1}{\sigma^ {2}} \xi^ {T} \Lambda_ {S} \Phi_ {S} ^ {T} \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}\right) ^ {- 1} \Phi_ {S} \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) \right| \\ \leq \| \xi \| _ {2} \| \boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R} \| _ {2} + \frac {1}{\sigma^ {2}} | \xi^ {T} \Lambda_ {S} \Phi_ {S} ^ {T} (I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}) ^ {- 1} \Phi_ {S} (\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}) | \\ \leq O \left(R ^ {\frac {1 - 2 \beta}{2}}\right) + \frac {1}{\sigma^ {2}} \| \left(I + \frac {1}{\sigma^ {2}} \Phi_ {S} \Lambda_ {S} \Phi_ {S} ^ {T}\right) ^ {- 1} \Phi_ {S} \Lambda_ {S} \xi \| _ {2} \| \Phi_ {S} (\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}) \| _ {2} \\ = O \left(R ^ {\frac {1 - 2 \beta}{2}}\right) + \frac {1}{\sigma^ {2}} O \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} \cdot n ^ {- (1 - t)}\right) O \left(\sqrt {\left(\frac {1}{\delta} + 1\right) n} R ^ {\frac {1 - 2 \beta}{2}}\right) \\ = O \left(\left(\frac {1}{\delta} + 1\right) R ^ {\frac {1 - 2 \beta}{2}}\right), \\ \end{array}
+$$
+
+where in the second to last step we used Corollary 20 to show $\| \Phi_S(\pmb {\mu}_S - \hat{\pmb{\mu}}_R)\| _2 = O(\sqrt{(\frac{1}{\delta} + 1)n} R^{\frac{1 - 2\beta}{2}})$ with probability of at least $1 - \delta$ , and Lemma 40 to show that $\| (I + \frac{1}{\sigma^2}\Phi_S\Lambda_S\Phi_S^T)^{-1}\Phi_S\Lambda_S\xi \| _2 =$ $O(\sqrt{(\frac{1}{\delta} + 1)n}\cdot n^{-(1 - t)})$ with probability of at least $1 - \delta$ . Since $R = n^{(\frac{1}{\alpha} +\kappa)(1 - t)}$ , we have
+
+$$
+\left| \xi^ {T} \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \left(\boldsymbol {\mu} _ {S} - \hat {\boldsymbol {\mu}} _ {R}\right) \right| = O \left(\left(\frac {1}{\delta} + 1\right) n ^ {\frac {(1 - 2 \beta) (1 - t)}{2 \alpha} + \frac {(1 - 2 \beta) (1 - t) \kappa}{2}}\right).
+$$
+
+Since $\xi$ is arbitrary, we have $\| (I + \frac{1}{\sigma^2}\Lambda_S\Phi_S^T\Phi_S)^{-1}(\pmb {\mu}_S - \hat{\pmb{\mu}}_R)\| _2 = O((\frac{1}{\delta} + 1)n^{\frac{(1 - 2\beta)(1 - t)}{2\alpha} +\frac{(1 - 2\beta)(1 - t)\kappa}{2}})$ . Since $0\leq q < \frac{[\alpha - (1 + 2\tau)(1 - t)](2\beta - 1)}{4\alpha^2}$ and $0 < \kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ we can choose $\kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ and $\kappa$ is arbitrarily close to $\kappa < \frac{\alpha - 1 - 2\tau + (1 + 2\tau)t}{2\alpha^2(1 - t)}$ such that $0\leq q < \frac{(2\beta - 1)(1 - t)\kappa}{2}$ . Then we have $\frac{(1 - 2\beta)(1 - t)\kappa}{2} +q < 0$ . From (145) and (148), we have
+
+$$
+\begin{array}{l} \| \left(I + \frac {1}{\sigma^ {2}} \Lambda_ {S} \Phi_ {S} ^ {T} \Phi_ {S}\right) ^ {- 1} \boldsymbol {\mu} _ {S} \| _ {2} = \mu_ {0} + \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 \alpha} \}} \log^ {k / 2} n\right) + O \left(\left(\frac {1}{\delta} + 1\right) n ^ {\frac {(1 - 2 \beta) (1 - t)}{2 \alpha} + \frac {(1 - 2 \beta) (1 - t) \kappa}{2}}\right) \\ = \mu_ {0} + \Theta \left(n ^ {(1 - t) \max \{- 1, \frac {1 - 2 \beta}{2 _ {\alpha}} \}} \log^ {k / 2} n\right) \\ = \mu_ {0} + o (1). \\ \end{array}
+$$
+
+(149)
+
+Hence $G_{2,S}(D_n) = \frac{1 + o(1)}{2\sigma^2}\| (I + \frac{1}{\sigma^2}\Lambda_S\Phi_S^T\Phi_S)^{-1}\pmb {\mu}_S\| _2^2 = \frac{1}{2\sigma^2}\mu_0^2 +o(1).$ Then by (144), $G_{2}(D_{n}) = \frac{1}{2\sigma^{2}}\mu_{0}^{2} + o(1) + \tilde{O}\big((\frac{1}{\delta} +1)nS^{\max \{1 / 2 - \beta ,1 - \alpha \}}\big).$
+
+Choosing $S = n^{\max \left\{1,\frac{-t}{(\alpha - 1 - 2\tau)},\left(\frac{1 + q + \min\{2,\frac{2\beta - 1}{\alpha}}{\min\{\beta - 1 / 2,\alpha - 1 - 2\tau\}} + 1\right)(1 - t)\right)\right\}}$ we get the result.
+
+Proof of Theorem 11. According to Lemma 42, $G_{2}(D_{n}) = \frac{1}{2\sigma^{2}}\mu_{0}^{2} + o(1)$ . By Lemma 39, we have $G_{1}(D_{n}) = \Theta (n^{\frac{(1 - \alpha)(1 - t)}{\alpha}})$ . Then $\mathbb{E}_{\epsilon}G(D_n) = G_1(D_n) + G_2(D_n) = \frac{1}{2\sigma^2}\mu_0^2 +o(1)$ .
+
+# D.3 PROOFS RELATED TO THE EXCESS MEAN SQUARED GENERALIZATION ERROR
+
+Proof of Theorem 12. For $\mu_0 = 0$ , we can show that
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} M (D _ {n}) = \mathbb {E} _ {\epsilon} \mathbb {E} _ {x _ {n + 1}} [ \bar {m} (x _ {n + 1}) - f (x _ {n + 1}) ] ^ {2} \\ = \mathbb {E} _ {\epsilon} \mathbb {E} _ {x _ {n + 1}} \left[ K _ {x _ {n + 1} \mathbf {x}} \left(K _ {n} + \sigma_ {\mathrm {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} \mathbf {y} - f (x _ {n + 1}) \right] ^ {2} \\ = \mathbb {E} _ {\boldsymbol {\epsilon}} \mathbb {E} _ {x _ {n + 1}} \left[ \eta^ {T} \Lambda \Phi^ {T} \left[ \Phi \Lambda \Phi^ {T} + \sigma_ {\text {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} (\Phi \mu + \boldsymbol {\epsilon}) - \eta^ {T} \mu \right] ^ {2} \\ = \mathbb {E} _ {\epsilon} \mathbb {E} _ {x _ {n + 1}} \left[ \eta^ {T} \Lambda \Phi^ {T} \left(\Phi \Lambda \Phi^ {T} + \sigma_ {\text {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} \epsilon \right] ^ {2} \\ + \mathbb {E} _ {x _ {n + 1}} \left[ \eta^ {T} \left(\Lambda \Phi^ {T} \left(\Phi \Lambda \Phi^ {T} + \sigma_ {\mathrm {m o d e l}} ^ {2} I _ {n}\right) ^ {- 1} \Phi - I\right) \mu \right] ^ {2} \\ = \sigma_ {\text {t r u e}} ^ {2} \operatorname {T r} \Lambda \Phi^ {T} \left(\Phi \Lambda \Phi^ {T} + \sigma_ {\text {m o d e l}} ^ {2} I _ {n}\right) ^ {- 2} \Phi \Lambda \\ + \mu^ {T} \left(I + \frac {1}{\sigma_ {\text {m o d e l}} ^ {2}} \Phi^ {T} \Phi \Lambda\right) ^ {- 1} \left(I + \frac {1}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda \Phi^ {T} \Phi\right) ^ {- 1} \mu \\ = \frac {\sigma_ {\text {t r u e}} ^ {2}}{\sigma_ {\text {m o d e l}} ^ {2}} \operatorname {T r} (I + \frac {\Lambda \Phi^ {T} \Phi}{\sigma_ {\text {m o d e l}} ^ {2}}) ^ {- 1} \Lambda - \operatorname {T r} (I + \frac {\Lambda \Phi^ {T} \Phi}{\sigma_ {\text {m o d e l}} ^ {2}}) ^ {- 2} \Lambda + \| (I + \frac {1}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda \Phi^ {T} \Phi) ^ {- 1} \mu \| _ {2} ^ {2}. \\ \end{array}
+$$
+
+According to (139) from the proof of Lemma 41, the truncation procedure (133) and (143), with probability of at least $1 - \delta$ we have
+
+$$
+\| (I + \frac {1}{\sigma_ {\mathrm {m o d e l}} ^ {2}} \Lambda \Phi^ {T} \Phi) ^ {- 1} \mu \| _ {2} ^ {2} = \Theta (n ^ {\max \{- 2 (1 - t), \frac {(1 - 2 \beta) (1 - t)}{\alpha} \}} \log^ {k / 2} n) = (1 + o (1)) \| (I + \frac {n}{\sigma_ {\mathrm {m o d e l}} ^ {2}} \Lambda) ^ {- 1} \mu \| _ {2} ^ {2},
+$$
+
+where $k = \left\{ \begin{array}{ll}0, & 2\alpha \neq 2\beta -1,\\ 1, & 2\alpha = 2\beta -1. \end{array} \right.$
+
+According to (121) and (126) from the proof of Lemma 39, the truncation procedure (115), (141) and (142), with probability of at least $1 - \delta$ we have
+
+$$
+\begin{array}{l} \operatorname {T r} \left(I + \frac {\Lambda \Phi^ {T} \Phi}{\sigma_ {\text {m o d e l}} ^ {2}}\right) ^ {- 1} \Lambda - \operatorname {T r} \left(I + \frac {\Lambda \Phi^ {T} \Phi}{\sigma_ {\text {m o d e l}} ^ {2}}\right) ^ {- 2} \Lambda \\ = \left(\operatorname {T r} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \Lambda\right) (1 + o (1)) - \| \Lambda^ {1 / 2} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \| _ {F} ^ {2} (1 + o (1)) \\ = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right). \\ \end{array}
+$$
+
+Combining the above two equations we get
+
+$$
+\begin{array}{l} \mathbb {E} _ {\boldsymbol {\epsilon}} M (D _ {n}) = (1 + o (1)) \left(\frac {\sigma_ {\text {t r u e}} ^ {2}}{\sigma_ {\text {m o d e l}} ^ {2}} \left(\operatorname {T r} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \Lambda - \| \Lambda^ {1 / 2} \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \| _ {F} ^ {2}\right) + \| \left(I + \frac {n}{\sigma_ {\text {m o d e l}} ^ {2}} \Lambda\right) ^ {- 1} \boldsymbol {\mu} \| _ {2} ^ {2}\right) \\ = \frac {\sigma_ {\text {t r u e}} ^ {2}}{\sigma_ {\text {m o d e l}} ^ {2}} \Theta (n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}) + \Theta (n ^ {\max \{- 2 (1 - t), \frac {(1 - 2 \beta) (1 - t)}{\alpha} \}} \log^ {k / 2} n) \\ = \sigma_ {\text {t r u e}} ^ {2} \Theta \left(n ^ {\frac {1 - \alpha - t}{\alpha}}\right) + \Theta \left(n ^ {\max \{- 2 (1 - t), \frac {(1 - 2 \beta) (1 - t)}{\alpha} \}} \log^ {k / 2} n\right) \\ = \Theta \left(\max \left\{\sigma_ {\text {t r u e}} ^ {2} n ^ {\frac {1 - \alpha - t}{\alpha}}, n ^ {\frac {(1 - 2 \beta) (1 - t)}{\alpha}} \right\}\right) \\ \end{array}
+$$
+
+When $\mu_0 > 0$ , according to (149) in the proof of Lemma 42 and the truncation procedure (133), with probability of at least $1 - \delta$ we have
+
+$$
+\begin{array}{l} \mathbb {E} _ {\epsilon} M (D _ {n}) = \Theta \left(n ^ {\frac {(1 - \alpha) (1 - t)}{\alpha}}\right) + \mu_ {0} ^ {2} + o (1) \\ = \mu_ {0} ^ {2} + o (1). \\ \end{array}
+$$
+
+
\ No newline at end of file
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/images.zip b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..246cd44e1318cb2b73a0d425ae96bec522d6e2ab
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f687a01ebae050626f28fec6496bc72333bb710cbb0ba714da2450fa298ca09a
+size 5446361
diff --git a/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/layout.json b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..15a8377f4ab36495fc87e5490e19b2e12f214062
--- /dev/null
+++ b/learningcurvesforgaussianprocessregressionwithpowerlawpriorsandtargets/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:adafd45c82a344d2e07d393ace290d7c8fc8692093054493d49ef1a71161759e
+size 2241441
diff --git a/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_content_list.json b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7bd31a5715ee7bd5340be1f225f3fd313e1bb9e3
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1745315803d2ff5bf0723020d102767bac09c782c953844e19db8135e7bc28ac
+size 154200
diff --git a/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_model.json b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5ce12f5bd499bb85eacd47137cda0ebe79ab4515
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2efed18f259b17caaff46b3acd7f37de7cca32f5a3a917d5e72f796c72e25764
+size 185055
diff --git a/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_origin.pdf b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..39dc95e6c7a2dbb2f49eed547cf82e81f0931192
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/192d2dcd-2135-45c3-b677-35ee2647e345_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:61af8bcc6bbcf796318b1fa7e2c574da0775e12d6cecd8be57e5f54feffb763a
+size 1219066
diff --git a/learningcurvesforsgdonstructuredfeatures/full.md b/learningcurvesforsgdonstructuredfeatures/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..cc930fd8686d556cf07355c7105aa488d20c896c
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/full.md
@@ -0,0 +1,777 @@
+# LEARNING CURVES FOR STOCHASTIC GRADIENT DESCENT ON STRUCTURED FEATURES
+
+Blake Bordelon & Cengiz Pehlevan
+
+John A. Paulson School of Engineering and Applied Sciences
+
+Center for Brain Science
+
+Harvard University
+
+Cambridge, MA 02138, USA
+
+{blake_bordelon,cpehlevan}@g.harvard.edu
+
+# ABSTRACT
+
+The generalization performance of a machine learning algorithm such as a neural network depends in an intricate way on the structure of the data distribution. To analyze the influence of data structure on test loss dynamics, we study an exactly solvable model of stochastic gradient descent (SGD) which predicts test loss when training on features with arbitrary covariance structure. We solve the theory exactly for both Gaussian features and arbitrary features and we show that the simpler Gaussian model accurately predicts test loss of nonlinear random-feature models and deep neural networks trained with SGD on real datasets such as MNIST and CIFAR-10. We show that the optimal batch size at a fixed compute budget is typically small and depends on the feature correlation structure, demonstrating the computational benefits of SGD with small batch sizes. Lastly, we extend our theory to the more usual setting of stochastic gradient descent on a fixed subsampled training set, showing that both training and test error can be accurately predicted in our framework on real data.
+
+# 1 INTRODUCTION
+
+Understanding the dynamics of SGD on realistic learning problems is fundamental to learning theory. Due to the challenge of modeling the structure of realistic data, theoretical studies of generalization often attempt to derive data-agnostic generalization bounds or study the typical performance of the algorithm on high-dimensional, factorized data distributions (Engel & Van den Broeck, 2001). Realistic datasets, however, often lie on low dimensional structures embedded in high dimensional ambient spaces (Pope et al., 2021). For example, MNIST and CIFAR-10 lie on surfaces with intrinsic dimension of $\sim 14$ and $\sim 35$ respectively (Spigler et al., 2020). To understand the average-case performance of SGD in more realistic learning problems and its dependence on data, model and hyperparameters, incorporating structural information about the learning problem is necessary.
+
+In this paper, we calculate the average case performance of SGD on models of the form $f(\mathbf{x}) = \mathbf{w} \cdot \psi(\mathbf{x})$ for nonlinear feature map $\psi$ trained with MSE loss. We express test loss dynamics in terms of the induced second and fourth moments of $\psi$ . Under a regularity condition on the fourth moments, we show that the test error can be accurately predicted in terms of second moments alone. We demonstrate the accuracy of our theory on random feature models and wide neural networks trained on MNIST and CIFAR-10 and accurately predict test loss scalings on these datasets. We explore in detail the effect of minibatch size, $m$ , on learning dynamics. By varying $m$ , we can interpolate our theory between single sample SGD ( $m = 1$ ) and gradient descent on the population loss ( $m \to \infty$ ). To explore the computational advantages SGD compared to standard full batch gradient descent we analyze the loss achieved at a fixed compute budget $C = tm$ for different minibatch size $m$ and number of steps $t$ , trading off the number of parameter update steps for denoising through averaging. We show that generally, the optimal batch size is small, with the precise optimum dependent on the learning rate and structure of the features. Overall, our theory shows how learning rate, minibatch size and data structure interact with the structure of the learning problem to determine generalization dynamics. It provides a predictive account of training dynamics in wide neural networks.
+
+# 1.1 OUR CONTRIBUTIONS
+
+The novel contributions of this work are described below.
+
+- We calculate the exact expected test error for SGD on MSE loss for arbitrary feature structure in terms of second and fourth moments as we discuss in Section 4.2. We show how structured gradient noise induced by sampling alters the loss curve compared to vanilla GD.
+- For Gaussian features (or those with regular fourth moments), we compute the test error in Section 1. This theory is shown to be accurate in experiments with random feature models and wide networks in the kernel regime trained on MNIST and CIFAR-10.
+- We show that for fixed compute/sample budgets and structured features with power law spectral decays, optimal batch sizes are small. We study how optimal batch size depends on the structure of the feature correlations and learning rate.
+- We extend our exact theory to study multi-pass SGD on a fixed finite training set. Both test and training error can be accurately predicted for random feature models on MNIST.
+
+# 2 RELATED WORK
+
+The analysis of stochastic gradient descent has a long history dating back to seminal works of Polyak & Juditsky (1992) and Ruppert (1988), who analyzed time-averaged iterates in a noisy problem. Many more works have examined a similar setting, identifying how averaged and accelerated versions of SGD perform asymptotically when the target function is noisy (not a deterministic function of the input) (Flammarion & Bach, 2015; 2017; Shapiro, 1989; Robbins & Monro, 1951; Chung, 1954; Duchi & Ruan, 2021; Yu et al., 2020; Anastasiou et al., 2019; Gurbuzbalaban et al., 2021).
+
+Recent studies have also analyzed the asymptotics of noise-free MSE problems with arbitrary feature structure to see what stochasticity arises from sampling. Prior works have found exponential loss curves problems as an upper bound (Jain et al., 2018) or as typical case behavior for SGD on unstructured data (Werfel et al., 2004). A series of more recent works have considered the over-parameterized (possibly infinite dimension) setting for SGD, deriving power law test loss curves emerge with exponents which are better than the $O(t^{-1})$ rates which arise in the noisy problem (Berthier et al., 2020; Pillaud-Vivien et al., 2018; Dieuleveut et al., 2016; Varre et al., 2021; Dieuleveut & Bach, 2016; Ying & Pontil, 2008; Fischer & Steinwart, 2020; Zou et al., 2021). These works provide bounds of the form $O(t^{-\beta})$ for exponents $\beta$ which depend on the task and feature distribution.
+
+Several works have analyzed average case online learning in shallow and two-layer neural networks. Classical works often analyzed unstructured data (Heskes & Kappen, 1991; Biehl & Riegler, 1994; Mace & Coolen, 1998; Saad & Solla, 1999; LeCun et al., 1991; Goldt et al., 2019), but recently the hidden manifold model enabled characterization of learning dynamics in continuous time when trained on structured data, providing an equivalence with a Gaussian covariates model (Goldt et al., 2020; 2021). In the continuous time limit considered in these works, SGD converges to gradient flow on the population loss, where fluctuations due to sampling disappear and order parameters obey deterministic dynamics. Other recent works, however, have provided dynamical mean field frameworks which allow for fluctuations due to random sampling of data during a continuous time limit of SGD, though only on simple generative data models (Mignacco et al., 2020; 2021).
+
+Studies of fully trained linear (in trainable parameters) models also reveal striking dependence on data and feature structure. Analysis for models trained on MSE (Bartlett et al., 2020; Tsigler & Bartlett, 2020; Bordelon et al., 2020; Canatar et al., 2020), hinge loss (Chatterji & Long, 2021; Cao et al., 2021; Cao & Gu, 2019) and general convex loss functions (Loureiro et al., 2021) have now been performed, demonstrating the importance of data structure for offline generalization.
+
+Other works have studied the computational advantages of SGD at different batch sizes $m$ . Ma et al. (2018) study the tradeoff between taking many steps of SGD at small $m$ and taking a small number of steps at large $m$ . After a critical $m$ , they observe a saturation effect where increasing $m$ provides diminishing returns. Zhang et al. (2019) explore how this critical batch size depends on SGD and momentum hyperparameters in a noisy quadratic model. Since they stipulate constant gradient noise
+
+induced by sampling, their analysis results in steady state error rather than convergence at late times, which may not reflect the true noise structure induced by sampling.
+
+# 3 PROBLEM DEFINITION AND SETUP
+
+We study stochastic gradient descent on a linear model with parameters $\mathbf{w}$ and feature map $\psi (\mathbf{x})\in \mathbb{R}^N$ (with $N$ possibly infinite). Some interesting examples of linear models are random feature models, where $\psi (\mathbf{x}) = \phi (G\mathbf{x})$ for random matrix $\pmb{G}$ and point-wise nonlinearity $\phi$ (Rahimi & Recht, 2008; Mei & Montanari, 2020). Another interesting linearized setting is wide neural networks with neural tangent kernel (NTK) parameterization (Jacot et al., 2020; Lee et al., 2020). Here the features are parameter gradients of the neural network function $\psi (\mathbf{x}) = \nabla_{\theta}f(\mathbf{x},\theta)|_{\theta_0}$ at initialization. We will study both of these special cases in experiments.
+
+We optimize the set of parameters $\mathbf{w}$ by SGD to minimize a population loss of the form
+
+$$
+L (\mathbf {w}) = \left\langle \left(\mathbf {w} \cdot \psi (\mathbf {x}) - y (\mathbf {x})\right) ^ {2} \right\rangle_ {\mathbf {x} \sim p (\mathbf {x})}, \tag {1}
+$$
+
+where $\mathbf{x}$ are input data vectors associated with a probability distribution $p(\mathbf{x})$ , $\psi(\mathbf{x})$ is a nonlinear feature map and $y(\mathbf{x})$ is a target function which we can evaluate on training samples. We assume that the target function is square integrable $\left\langle y(\mathbf{x})^2 \right\rangle_{\mathbf{x}} < \infty$ over $p(\mathbf{x})$ . Our aim is to elucidate how this population loss evolves during stochastic gradient descent on $\mathbf{w}$ . We derive a formula in terms of the eigendecomposition of the feature correlation matrix and the target function
+
+$$
+\boldsymbol {\Sigma} = \left\langle \boldsymbol {\psi} (\mathbf {x}) \boldsymbol {\psi} (\mathbf {x}) ^ {\top} \right\rangle_ {\mathbf {x}} = \sum_ {k = 1} ^ {N} \lambda_ {k} \mathbf {u} _ {k} \mathbf {u} _ {k} ^ {\top}, \quad y (\mathbf {x}) = \sum_ {k} v _ {k} \mathbf {u} _ {k} ^ {\top} \boldsymbol {\psi} (\mathbf {x}) + y _ {\perp} (\mathbf {x}), \tag {2}
+$$
+
+where $\langle y_{\perp}(\mathbf{x})\psi (\mathbf{x})\rangle = 0$ . We justify this decomposition of $y(\mathbf{x})$ in the Appendix A using an eigendecomposition and show that it is general for target functions and features with finite variance.
+
+During learning, parameters $\mathbf{w}$ are updated to estimate a target function $y$ which, as discussed above, can generally be expressed as a linear combination of features $y = \mathbf{w}^{*} \cdot \boldsymbol{\psi} + y_{\perp}$ . At each time step $t$ , the weights are updated by taking a stochastic gradient step on a fresh mini-batch of $m$ examples
+
+$$
+\mathbf {w} _ {t + 1} = \mathbf {w} _ {t} - \frac {\eta}{m} \sum_ {\mu = 1} ^ {m} \psi_ {t, \mu} \left(\mathbf {w} _ {t} \cdot \psi_ {t, \mu} - y _ {t, \mu}\right), \tag {3}
+$$
+
+where each of the vectors $\psi_{t,\mu}$ are sampled independently and $y_{t,\mu} = \mathbf{w}^{*}\cdot \psi_{t,\mu}$ . The learning rate $\eta$ controls the gradient descent step size while the batch size $m$ gives a empirical estimate of the gradient at timestep $t$ . At each timestep, the test-loss, or generalization error, has the form
+
+$$
+L _ {t} = \left\langle \left(\mathbf {w} _ {t} \cdot \boldsymbol {\psi} (\mathbf {x}) - \mathbf {w} ^ {*} \cdot \boldsymbol {\psi} (\mathbf {x}) - y _ {\perp} (\mathbf {x})\right) ^ {2} \right\rangle_ {\mathbf {x}} = \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) ^ {\top} \boldsymbol {\Sigma} \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) + \left\langle y _ {\perp} (\mathbf {x}) ^ {2} \right\rangle , \tag {4}
+$$
+
+which quantifies exactly the test error of the vector $\mathbf{w}_t$ . Note, however, that $L_{t}$ is a random variable since $\mathbf{w}_t$ depends on the precise history of sampled feature vectors $\mathcal{D}_t = \{\psi_{t,\mu}\}$ . Our theory, which generalizes the recursive method of (Werfel et al., 2004) allows us to compute the expected test loss by averaging over all possible sequences to obtain $\langle L_t\rangle_{\mathcal{D}_t}$ . Our calculated learning curves are not limited to the one-pass setting, but rather can accommodate sampling minibatches from a finite training set with replacement and testing on a separate test set which we address in Section 4.4.
+
+In summary, we will develop a theory that predicts the expected test loss $\langle L_t\rangle_{\mathcal{D}_t}$ averaged over training sample sequences $\mathcal{D}_t$ in terms of the quantities $\{\lambda_k,v_k,\langle y_\perp (\mathbf{x})^2\rangle_{\mathbf{x}}\}$ . This will reveal how the structure in the data and the learning problem influence test error dynamics during SGD. This theory is a quite general analysis of linear models on square loss, analyzing the performance of linearized models on arbitrary data distributions, feature maps $\psi$ , and target functions $y(\mathbf{x})$ .
+
+# 4 ANALYTIC FORMULAE FOR LEARNING CURVES
+
+# 4.1 LEARNABLE AND NOISE FREE PROBLEMS
+
+Before studying the general case, we first analyze the setting where the target function is learnable, meaning that there exist weights $\mathbf{w}^*$ such that $y(\mathbf{x}) = \mathbf{w}^* \cdot \boldsymbol{\psi}(\mathbf{x})$ . For many cases of interest, this
+
+is a reasonable assumption, especially when applying our theory to real datasets by fitting an atomic measure on $P$ points $\frac{1}{P}\sum_{\mu}\delta (\mathbf{x} - \mathbf{x}^{\mu})$ . We will further assume that the induced feature distribution is Gaussian so that all moments of $\psi$ can be written in terms of the covariance $\boldsymbol{\Sigma}$ . We will remove these assumptions in later sections.
+
+Theorem 1. Suppose the features $\psi$ follow a Gaussian distribution $\psi \sim \mathcal{N}(0,\Sigma)$ and the target function is learnable in these features $y = \mathbf{w}^{*}\cdot \psi$ . After $t$ steps of SGD with minibatch size $m$ and learning rate $\eta$ , the expected (over possible sample sequences $\mathcal{D}_t$ ) test loss $\langle L_t\rangle_{\mathcal{D}_t}$ has the form
+
+$$
+\left\langle L _ {t} \right\rangle_ {\mathcal {D} _ {t}} = \boldsymbol {\lambda} ^ {\top} \mathbf {A} ^ {t} \mathbf {v} ^ {2}, \mathbf {A} = (\mathbf {I} - \eta \operatorname {d i a g} (\boldsymbol {\lambda})) ^ {2} + \frac {\eta^ {2}}{m} \operatorname {d i a g} \left(\boldsymbol {\lambda} ^ {2}\right) + \frac {\eta^ {2}}{m} \boldsymbol {\lambda} \boldsymbol {\lambda} ^ {\top} \tag {5}
+$$
+
+where $\pmb{\lambda}$ is a vector containing the eigenvalues of $\pmb{\Sigma}$ and $\mathbf{v}^2$ is a vector containing elements $(\mathbf{v}^2)_k = v_k^2 = (\mathbf{u}_k \cdot \mathbf{w}^*)^2$ for eigenvectors $\mathbf{u}_k$ of $\pmb{\Sigma}$ . The function $\mathrm{diag}(\cdot)$ constructs a diagonal matrix with the argument vector placed along the diagonal.
+
+Proof. See Appendix B for the full derivation. We will provide a brief sketch of the proof here. The strategy of the proof relies on the fact that $\langle L_t \rangle = \operatorname{Tr} \Sigma \mathbf{C}_t$ where $\mathbf{C}_t = \left\langle (\mathbf{w}_t - \mathbf{w}^*) (\mathbf{w}_t - \mathbf{w}^*)^\top \right\rangle_{\mathcal{D}_t}$ . We derive the following recursion relation for this error matrix
+
+$$
+\mathbf {C} _ {t + 1} = (\mathbf {I} - \eta \boldsymbol {\Sigma}) \mathbf {C} _ {t} (\mathbf {I} - \eta \boldsymbol {\Sigma}) + \frac {\eta^ {2}}{m} [ \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \boldsymbol {\Sigma} \operatorname {T r} (\boldsymbol {\Sigma} \mathbf {C} _ {t}) ] \tag {6}
+$$
+
+The loss only depends on $c_{k,t} = \mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k$ . Solving the recurrence, $\pmb{c}_{t} = \mathbf{A}^{t}\mathbf{v}^{2}$ and using $\langle L_t\rangle = \sum_k\lambda_k\mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k = \sum_kc_{k,t}\lambda_k = \pmb{\lambda}^\top \mathbf{A}^t\mathbf{v}^2$ , we obtain the desired result.
+
+Below we provide some immediate interpretations of this result.
+
+- The matrix $\mathbf{A}$ contains two components; a matrix $(\mathbf{I} - \eta \mathrm{diag}(\lambda))^2$ which represents the time-evolution of the loss under average gradient updates. The remaining matrix $\frac{\eta^2}{m}\left(\mathrm{diag}(\lambda^2) + \lambda \lambda^\top\right)$ arises due to fluctuations in the gradients, a consequence of the stochastic sampling process.
+- The test loss obtained when training directly on the population loss can be obtained by taking the minibatch size $m \to \infty$ . In this case, $\mathbf{A} \to (\mathbf{I} - \eta \operatorname{diag}(\boldsymbol{\lambda}))^2$ and one obtains the population loss $L_{t}^{pop} = \sum_{k} v_{k}^{2} \lambda_{k} (1 - \eta \lambda_{k})^{2t}$ . This population loss can also be obtained by considering small learning rates, i.e. the $\eta \to 0$ limit, where $\mathbf{A} = (\mathbf{I} - \eta \operatorname{diag}(\boldsymbol{\lambda}))^2 + O(\eta^2)$ .
+- For general $\lambda$ and $\eta^2 / m > 0$ , $\mathbf{A}$ is non-diagonal, indicating that the components $\{\mathbf{u}_1, \dots, \mathbf{u}_k\}$ are not learned independently as $t$ increases like for $L_t^{pop}$ , but rather interact during learning due to non-trivial coupling across eigenmodes at large $\eta^2 / m$ . This is unlike offline theory for learning in feature spaces (kernel regression), (Bordelon et al., 2020; Canatar et al., 2020), this observation of mixing across covariance eigenspaces agrees with a recent analysis of SGD, which introduced recursively defined "mixing terms" that couple each mode's evolution (Varre et al., 2021).
+- Though increasing $m$ always improves generalization at fixed time $t$ (proof given in Appendix D), learning with a fixed compute budget (number of gradient evaluations) $C = tm$ , can favor smaller batch sizes. We provide an example of this in the next sections and Figure 1 (d)-(f).
+- The lower bound $\langle L_t\rangle \geq \pmb{\lambda}^\top \pmb{v}^2\left[(1 - \eta)^2 +\frac{\eta^2}{m} |\pmb {\lambda}|^2\right]^t$ can be used to find necessary stability conditions on $m,\eta$ . This bound implies that $\langle L_t\rangle$ will diverge if $m < \frac{\eta}{2 - \eta} |\pmb {\lambda}|^2$ . The learning rate must be sufficiently small and the batch size sufficiently large to guarantee convergence. This stability condition depends on the features through $|\pmb {\lambda}|^2 = \sum_k\lambda_k^2$ . One can derive heuristic optimal batch sizes and optimal learning rates through this lower bound. See Figure 2 and Appendix C.
+
+# 4.1.1 SPECIAL CASE 1: UNSTRUCTURED ISOTROPIC FEATURES
+
+This special case was previously analyzed by Werfel et al. (2004) which takes $\pmb{\Sigma} = \mathbf{I}\in \mathbb{R}^{N\times N}$ and $m = 1$ . We extend their result for arbitrary $m$ , giving the following learning curve
+
+$$
+\langle L _ {t} \rangle_ {\mathcal {D} _ {t}} = \left((1 - \eta) ^ {2} + \frac {1 + N}{m} \eta^ {2}\right) ^ {t} | | \mathbf {w} ^ {*} | | ^ {2}, \quad \langle L _ {t} ^ {*} \rangle_ {\mathcal {D} _ {t}} = \left(1 - \frac {m}{m + N + 1}\right) ^ {t} | | \mathbf {w} ^ {*} | | ^ {2}, \quad (7)
+$$
+
+
+(a) Isotropic Features
+
+
+(b) Power Law Features
+
+
+(c) MNIST Random ReLU Features
+
+
+(d) Fixed Compute Isotropic
+
+
+(e) Fixed Compute Power Law
+
+
+(f) Fixed Compute ReLU MNIST
+Figure 1: Isotropic features generated as $\psi \sim \mathcal{N}(0,\mathbf{I})$ have qualitatively different learning curves than power-law features observed in real data. Black dashed lines are theory. (a) Online learning with $N$ -dimensional isotropic features gives a test loss which scales like $L_{t} \sim e^{-t / N}$ for any target function, indicating that learning requires $t \sim N$ steps of SGD, using the optimal learning rates $\eta^{*} = \frac{m}{N + m + 1}$ . (b) Power-law features $\psi \sim \mathcal{N}(0,\Lambda)$ with $\Lambda_{kl} = \delta_{k,l} k^{-2}$ have non-extensive give a power-law scaling $L_{t} \sim t^{-\beta}$ with exponent $\beta = O_{N}(1)$ . (c) Learning to discriminate MNIST 8's and 9's with $N = 4000$ dimensional random ReLU features (Rahimi & Recht, 2008), generates a power law scaling at large $t$ , which is both quantitatively and qualitatively different than the scaling predicted by isotropic features $e^{-t / N}$ . (d)-(f) The loss at a fixed compute budget $C = tm = 100$ for (d) isotropic features, (e) power law features and (f) MNIST ReLU random features with simulations (dots average and standard deviation for 30 runs). Intermediate batch sizes are preferable on real data.
+
+where the second expression has optimal $\eta$ . First, we note the strong dependence on the ambient dimension $N$ : as $N \gg m$ , learning happens at a rate $\langle L_t \rangle \sim e^{-tm / N}$ . Increasing the minibatch size $m$ improves the exponential rate by reducing the gradient noise variance. Second, we note that this feature model has the same rate of convergence for every learnable target function $y$ . At small $m$ , the convergence at any learning rate $\eta$ is much slower than the convergence of the $m \to \infty$ limit, $L_{pop} = (1 - \eta)^{2t}||\mathbf{w}^*||^2$ which does not suffer from a dimensionality dependence due to gradient noise. Lastly, for a fixed compute budget $C = tm$ , the optimal batch size is $m^* = 1$ ; see Figure 1 (d). This can be shown by differentiating $\langle L_{C / m} \rangle$ with respect to $m$ (see Appendix E). In Figure 1 (a) we show theoretical and simulated learning curves for this model for varying values of $N$ at the optimal learning rate and in Figure 1 (d), we show the loss as a function of minibatch size for a fixed compute budget $C = tm = 100$ . While fixed $C$ represents fixed sample complexity, we stress that it may not represent wall-clock run time when data parallelism is available (Shallue et al., 2018).
+
+# 4.1.2 SPECIAL CASE 2: POWER LAWS AND EFFECTIVE DIMENSIONALITY
+
+Realistic datasets such as natural images or audio tend to exhibit nontrivial correlation structure, which often results in power-law spectra when the data is projected into a feature space, such as a randomly initialized neural network (Spigler et al., 2020; Canatar et al., 2020; Bahri et al., 2021). In the $\frac{\eta^2}{m} \ll 1$ limit, if the feature spectra and task spectra follow power laws, $\lambda_k \sim k^{-b}$ and $\lambda_k v_k^2 \sim k^{-a}$ with $a, b > 1$ , then Theorem 1 implies that generalization error also falls with a power law: $\langle L_t \rangle \sim Ct^{-\beta}$ , $\beta = \frac{a - 1}{b}$ where $C$ is a constant. See Appendix G for a derivation with saddle point integration. Notably, these predicted exponents we recovered as a special case of our theory agree with prior work on SGD with power law spectra, which give exponents in terms of the
+
+
+(a) Power Law Exponents $b$
+
+
+Figure 2: Optimal batch size depends on feature structure and noise level. (a) For power law features $\lambda_{k} \sim k^{-b}$ , $\lambda_{k}v_{k}^{2} \sim k^{-a}$ , the $m$ dependence of the loss $L_{C / m}$ depends strongly on the feature exponent $b$ . Each color is a different $b$ value, evenly spaced in [0.6, 2.5] with $a = 2.5, C = 500$ . Solid lines show exact theory while dashed lines show the error predicted by approximating the mode coupling term $\frac{\eta^2}{m}\lambda\lambda^\top$ with decoupled $\frac{\eta^2}{m}\mathrm{diag}(\lambda^2)$ . Mode coupling is thus necessary to accurately predict optimal $m$ . (b) The optimal $m$ scales proportionally with $|\lambda|^2 \approx \frac{1}{2b - 1}$ . We plot the lower bound $m_{min}$ (black), the heuristic optimum ( $m$ which optimizes a lower bound for $L$ , green) and $\frac{2\eta}{2 - \eta} |\lambda|^2$ (red). (c) The loss at fixed compute $C = 150$ , $a = 2$ , $b = 0.85$ , optimal batchsize $m$ for each $\eta$ shown in dashed black. For sufficiently small $\eta$ , the optimal batchsize is $m = 1$ . For large $\eta$ , it is better to trade off update steps for denoised gradients resulting in $m^* > 1$ .
+
+
+(b) Optimal Batchsize vs $\lambda$
+(c) Hyper-parameter Dependence
+
+feature correlation structure (Berthier et al., 2020; Dieuleveut et al., 2016; Velikanov & Yarotsky, 2021; Varre et al., 2021). Further, our power law scaling appears to accurately match the qualitative behavior of wide neural networks trained on realistic data (Hestness et al., 2017; Bahri et al., 2021), which we study in Section 5.
+
+We show an example of such a power law scaling with synthetic features in Figure 1 (b). Since the total variance approaches a finite value as $N \to \infty$ , the learning curves are relatively insensitive to $N$ , and are rather sensitive to the eigenspectrum through terms like $|\lambda|^2$ and $\mathbf{1}^\top \lambda$ , etc. In Figure 1 (c), we see that the scaling of the loss is more similar to the power law setting than the isotropic features setting in a random features model of MNIST, agreeing excellently with our theory. For this model, we find that there can exist optimal batch sizes when the compute budget $C = tm$ is fixed (Figure 1 (e) and (f)). In Appendix C.1, we heuristically argue that the optimal batch size for power law features should scale as, $m^* \approx \frac{1}{(2b - 1)}$ . Figure 2 tests this result.
+
+We provide further evidence of the existence of power law structure on realistic data in Figure 3 (a)-(c), where we provide spectra and test loss learning curves for MNIST and CIFAR-10 on ReLU random features. The eigenvalues $\lambda_{k} \sim k^{-b}$ and the task power tail sums $\sum_{n=k}^{\infty} \lambda_{n} v_{n}^{2} \sim k^{-a+1}$ both follow power laws, generating power law test loss curves. These learning curves are contrasted with isotropically distributed data in $\mathbb{R}^{784}$ passed through the same ReLU random feature model and we see that structured data distributions allow much faster learning than the unstructured data. Our theory is predictive across variations in learning rate, batch size and noise (Figure 3).
+
+# 4.2 ARBITRARY INDUCED FEATURE DISTRIBUTIONS: THE GENERAL SOLUTION
+
+The result in the previous section was proven exactly for Gaussian vectors (see Appendix B). For arbitrary distributions, we obtain a slightly more involved result (see Appendix F).
+
+Theorem 2. Let $\psi (\mathbf{x})\in \mathbb{R}^N$ be an arbitrary feature map with covariance matrix $\boldsymbol{\Sigma} = \sum_{k}\lambda_{k}\mathbf{u}_{k}\mathbf{u}_{k}^{\top}$ . After diagonalizing the features $\phi_k(\mathbf{x}) = \mathbf{u}_k^\top \pmb {\psi}(\mathbf{x})$ , introduce the fourth moment tensor $\kappa_{ijkl}^{4} = \langle \phi_i\phi_j\phi_k\phi_l\rangle$ . The expected loss is exactly $\langle L_t\rangle = \sum_k\lambda_ka_c(\pmb {\lambda},\pmb {\kappa},\mathbf{v},t)$
+
+We provide an exact formula for $c_k$ in the Appendix F. We see that the test loss dynamics depends only on the second and fourth moments of the features through quantities $\lambda_k$ and $\kappa_{ijk\ell}$ respectively. We recover the Gaussian result as a special case when $\kappa_{ijkl}$ is a simple weighted sum of these three products of Kronecker tensors $\kappa_{ijkl}^{Gauss} = \lambda_i\lambda_j\delta_{ik}\delta_{jl} + \lambda_i\lambda_k\delta_{ij}\delta_{kl} + \lambda_i\lambda_j\delta_{il}\delta_{jk}$ . As an alternative to
+
+
+(a) Feature Spectra
+
+
+(b) Task Power Tail Sum
+
+
+(c) Learning Curves $m = 5$
+
+
+(d) Vary $\eta$ (20 trials)
+
+
+(e) Vary $m$ (20 Trials)
+
+
+(f) Vary $\sigma$ (20 Trials)
+Figure 3: Structure in the data distribution, nonlinearity, batchsize and learning rate all influence learning curves. (a) ReLU random feature embedding in $N = 4000$ dimensions of MNIST and CIFAR images have very different eigenvalue scalings than spherically isotropic vectors in 784 dimensions. (b) The task power spectrum decays much faster for MNIST than for random isotropic vectors. (c) Learning curves reveal the data-structure dependence of test error dynamics. Dashed lines are theory curves derived from equation. (d) Increasing the learning rate increases the initial speed of learning but induces large fluctuations in the loss and can be worse at large $t$ . Experiment curves averaged over 20 random trajectories of SGD. (e) Increasing the batch size alters both the average test loss $L_{t}$ and the variance. (f) Noise in the target values during training produces an asymptotic error $L_{\infty}$ which persists even as $t \to \infty$ .
+
+the above closed form expression for $\langle L_t\rangle$ , a recursive formula which tracks $N$ mixing coefficients has also been used to analyze the test loss dynamics for arbitrary distributions (Varre et al., 2021).
+
+Next we show that a regularity condition, similar to those assumed in other recent works (Jain et al., 2018; Berthier et al., 2020; Varre et al., 2021), on the fourth moment structure of the features allows derivation of an upper bound which is qualitatively similar to the Gaussian theory.
+
+Theorem 3. If the fourth moments satisfy $\langle \psi \psi^{\top}G\psi \psi^{\top}\rangle \preceq (\alpha +1)\Sigma G\Sigma +\alpha \Sigma Tr\Sigma G$ for any positive-semidefinite $G$ , then
+
+$$
+L _ {t} \leq \boldsymbol {\lambda} ^ {\top} \mathbf {A} ^ {t} \mathbf {v} ^ {2}, \mathbf {A} = (\mathbf {I} - \eta d i a g (\boldsymbol {\lambda})) ^ {2} + \frac {\alpha \eta^ {2}}{m} [ d i a g (\boldsymbol {\lambda} ^ {2}) + \boldsymbol {\lambda} \boldsymbol {\lambda} ^ {\top} ]. \tag {8}
+$$
+
+We provide this proof in Appendix F.1. We note that the assumed bound on the fourth moments is tight for Gaussian features with $\alpha = 1$ , recovering our previous theory. Thus, if this condition on the fourth moments is satisfied, then the loss for the non-Gaussian features is upper bounded by the Gaussian test loss theory with the batch size effectively altered $\tilde{m} = m / \alpha$ .
+
+The question remains whether the Gaussian approximation will provide an accurate model on realistic data. We do not provide a proof of this conjecture, but verify its accuracy in empirical experiments on MNIST and CIFAR-10 as shown in Figure 3. In Appendix Figure F.1, we show that the fourth moment matrix for a ReLU random feature model and its projection along the eigenbasis of the feature covariance is accurately approximated by the equivalent Gaussian model.
+
+# 4.3 UNLEARNABLE OR NOISE CORRUPTED PROBLEMS
+
+In general, the target function $y(\mathbf{x})$ may depend on features which cannot be expressed as linear combinations of features $\psi(\mathbf{x})$ , $y(\mathbf{x}) = \mathbf{w}^* \cdot \psi(\mathbf{x}) + y_\perp(\mathbf{x})$ . Let $\left\langle y_\perp(\mathbf{x})^2 \right\rangle_{\mathbf{x}} = \sigma^2$ . Note that $y_\perp$ need not be deterministic, but can also be a stochastic process which is uncorrelated with $\psi(\mathbf{x})$ .
+
+
+(a) MNIST Training Error
+
+
+(b) MNIST Test Error
+Figure 4: Training and test errors of a model trained on a training set of size $M$ can be computed with the $\mathbf{C}_t$ matrix. Dashed black lines are theory. (a) The training error for MNIST random feature model approaches zero asymptotically. (b) The test error saturates to a quantity dependent on $M$ .
+
+Theorem 4. For a target function with unlearnable variance $\langle y_{\perp}^2\rangle = \sigma^2$ trained on Gaussian $\psi$ , the expected test loss has the form
+
+$$
+\left\langle L _ {t} \right\rangle - \sigma^ {2} = \boldsymbol {\lambda} ^ {\top} \mathbf {A} ^ {t} \mathbf {v} ^ {2} + \frac {1}{m} \eta^ {2} \sigma^ {2} \boldsymbol {\lambda} ^ {\top} (\mathbf {I} - \mathbf {A}) ^ {- 1} (\mathbf {I} - \mathbf {A} ^ {t}) \boldsymbol {\lambda} \tag {9}
+$$
+
+which has an asymptotic, irreducible error $\langle L_{\infty}\rangle = \sigma^2 +\frac{1}{m}\eta^2\sigma^2\pmb{\lambda}^\top (\mathbf{I} - \mathbf{A})^{-1}\pmb {\lambda}$ as $t\to \infty$
+
+See Appendix H for the proof. The convergence to the asymptotic error takes the form $\langle L_t - L_\infty \rangle = \pmb{\lambda}^\top \mathbf{A}^t\left(\mathbf{v}^2 - \frac{1}{m}\eta^2\sigma^2 (\mathbf{I} - \mathbf{A})^{-1}\pmb {\lambda}\right)$ . We note that this quantity is not necessarily monotonic in $t$ and can exhibit local maxima for sufficiently large $\sigma^2$ , as in Figure 3 (f).
+
+# 4.4 TEST/TRAIN Splits
+
+Rather than interpreting our theory as a description of the average test loss during SGD in a one-pass setting, where data points are sampled from the a distribution at each step of SGD, our theory can be suitably modified to accommodate multiple random passes over a finite training set. To accomplish this, one must first recognize that the training and test distributions are different.
+
+Theorem 5. Let $\hat{p} (\mathbf{x}) = \frac{1}{M}\sum_{\mu}\delta (\mathbf{x} - \mathbf{x}^{\mu})$ be the empirical distribution on the $M$ training data points and let $\hat{\Sigma} = \left\langle \psi (\mathbf{x})\psi (\mathbf{x})^{\top}\right\rangle_{\mathbf{x}\sim \hat{p} (\mathbf{x})} = \sum_{k}\hat{\lambda}_{k}\mathbf{u}_{k}\mathbf{u}_{k}^{\top}$ be the feature correlation matrix on this training set. Let $p(\mathbf{x})$ be the test distribution $\boldsymbol{\Sigma}$ its corresponding feature correlation. Then we have
+
+$$
+\langle L _ {t r a i n, t} \rangle = T r \left[ \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t} \right], \quad \langle L _ {t e s t, t} \rangle = T r \left[ \boldsymbol {\Sigma} \mathbf {C} _ {t} \right]
+$$
+
+$$
+\mathbf {C} _ {t + 1} = (\mathbf {I} - \eta \hat {\boldsymbol {\Sigma}}) \mathbf {C} _ {t} (\mathbf {I} - \eta \hat {\boldsymbol {\Sigma}}) + \frac {\eta^ {2}}{m} \left[ \left\langle \boldsymbol {\psi} (\mathbf {x}) \boldsymbol {\psi} (\mathbf {x}) ^ {\top} \mathbf {C} _ {t} \boldsymbol {\psi} (\mathbf {x}) \boldsymbol {\psi} (\mathbf {x}) ^ {\top} \right\rangle_ {\mathbf {x} \sim \hat {p} (\mathbf {x})} - \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t} \hat {\boldsymbol {\Sigma}} \right] \tag {10}
+$$
+
+We provide the proof of this theorem in Appendix I. The interpretation of this result is that it provides the expected training and test loss if, at each step of SGD, $m$ points from the training set $\{\mathbf{x}^1, \dots, \mathbf{x}^M\}$ are sampled uniformly with replacement and used to calculate a stochastic gradient. Note that while $\boldsymbol{\Sigma}$ can be full rank, the rank of $\hat{\boldsymbol{\Sigma}}$ has rank upper bounded by $M$ , the number of training samples. The recurrence for $\mathbf{C}_t$ can again be more easily solved under a Gaussian approximation which we employ in Figure 4. Since learning will only occur along the $M$ dimensional subspace spanned by the data, the test error will have an irreducible component at large time, as evidenced in Figure 4. While the training errors continue to go to zero, the test errors saturate at a $M$ -dependent final loss. This result can also allow one to predict errors on other test distributions.
+
+# 5 COMPARING NEURAL NETWORK FEATURE MAPS
+
+We can utilize our theory to compare how wide neural networks of different depths generalize when trained with SGD on a real dataset. With a certain parameterization, large width NNs are approximately linear in their parameters (Lee et al., 2020). To predict test loss dynamics with our theory, it therefore suffices to characterize the geometry of the gradient features $\psi (\mathbf{x}) = \nabla_{\theta}f(\mathbf{x},\theta)$ . In
+
+
+(a) MNIST NTK Spectra
+
+
+(b) MNIST Task Spectra
+
+
+(c) Test Loss Scaling Laws
+
+
+(d) CIFAR-10 NTK Spectra
+
+
+(e) CIFAR-10 Task Spectra
+
+
+(f) Test Loss Scalings
+Figure 5: ReLU neural networks of depth $D$ and width 500 are trained with SGD on full MNIST. (a)-(b) Feature and spectra are estimated by diagonalizing the infinite width NTK matrix on the training data. We fit a simple power law to each of the curves $\lambda_{k} \sim k^{-b}$ and $v_{k}^{2} \sim k^{-a}$ . (c) Experimental test loss during SGD (color) compared to theoretical power-law scalings $t^{-\frac{a - 1}{b}}$ (dashed black). Deeper networks train faster due to their slower decay in their feature eigenspectra $\lambda_{k}$ , though they have similar task spectra. (d)-(f) The spectra and test loss for convolutional and fully connected networks on CIFAR-10. The CNN obtains a better convergence exponent due to its faster decaying task spectra. The predicted test loss scalings (dashed black) match experiments (color).
+
+Figure 5, we show the Neural Tangent Kernel (NTK) eigenspectra and task-power spectra for fully connected neural networks of varying depth, calculated with the Neural Tangents API (Novak et al., 2020). We compute the kernel on a subset of 10,000 randomly sampled MNIST images and estimate the power law exponents for the kernel and task spectra $\lambda_{k}$ and $v_{k}^{2}$ . Across architectures, the task spectra $v_{k}^{2}$ are highly similar, but that the kernel eigenvalues $\lambda_{k}$ decay more slowly for deeper models, corresponding to a smaller exponent $b$ . As a consequence, deeper neural network models train more quickly during stochastic gradient descent as we show in Figure 5 (c). After fitting power laws to the spectra $\lambda_{k} \sim k^{-b}$ and the task power $v_{k}^{2} \sim k^{-a}$ , we compared the true test loss dynamics (color) for a width-500 neural network model with the predicted power-law scalings $\beta = \frac{a - 1}{b}$ from the fit exponents $a, b$ . The predicted scalings from NTK regression accurately describe trained width-500 networks. On CIFAR-10, we compare the scalings of the CNN model and a standard MLP and find that the CNN obtains a better exponent due to its faster decaying tail $\sum_{n=k}^{\infty} \lambda_{n} v_{n}^{2}$ . We stress that the exponents $\beta$ were estimated from our one-pass theory, but were utilized experiments on a finite training set. This approximate and convenient version of our theory is quite accurate across these varying models, in line with recent conjectures about early training dynamics (Nakkiran et al., 2021).
+
+# 6 CONCLUSION
+
+Studying a simple model of SGD, we were able to uncover how the feature geometry governs the dynamics of the test loss. We derived average learning curves $\langle L_t\rangle$ for both Gaussian and general features and showed conditions under which the Gaussian approximation is accurate. The proposed model allowed us to explore the role of the data distribution and neural network architecture on the learning curves, and choice of hyperparameters on realistic learning problems. While our theory accurately describes networks in the lazy training regime, average case learning curves in the feature learning regime would be interesting future extension. Further extensions of this work could be used to calculate the expected loss throughout curriculum learning where the data distribution evolves over time as well as alternative optimization strategies such as SGD with momentum.
+
+# REPRODUCIBILITY STATEMENT
+
+The code to reproduce the experimental components of this paper can be found here https://github.com/Pehlevan-Group/sgd_structured_features, which contains jupyter notebook files which we ran in Google Colab. More details about the experiments can be found in Appendix J. Generally, detailed derivations of our theoretical results are provided in the Appendix.
+
+# ACKNOWLEDGEMENTS
+
+We thank the Harvard Data Science Initiative and Harvard Dean's Competitive Fund for Promising Scholarship for their support. We also thank Jacob Zavatone-Veth for useful discussions and comments on this manuscript.
+
+# REFERENCES
+
+Andreas Anastasiou, Krishnakumar Balasubramanian, and Murat A. Erdogdu. Normal approximation for stochastic gradient descent via non-asymptotic rates of martingale cht. In Alina Beygelzimer and Daniel Hsu (eds.), Proceedings of the Thirty-Second Conference on Learning Theory, volume 99 of Proceedings of Machine Learning Research, pp. 115-137, Phoenix, USA, 25-28 Jun 2019. PMLR. URL http://proceedings.mlr.press/v99/anastasiou19a.html.
+Yasaman Bahri, Ethan Dyer, Jared Kaplan, Jaehoon Lee, and Utkarsh Sharma. Explaining neural scaling laws. arXiv preprint arXiv:2102.06701, 2021.
+Peter L Bartlett, Philip M Long, Gábor Lugosi, and Alexander Tsigler. Benign overfitting in linear regression. Proceedings of the National Academy of Sciences, 117(48):30063-30070, 2020.
+Carl Bender and Steven Orszag. Advanced Mathematical Methods for Scientists and Engineers: Asymptotic Methods and Perturbation Theory, volume 1. 01 1999. ISBN 978-1-4419-3187-0. doi: 10.1007/978-1-4757-3069-2.
+Raphaël Berthier, Francis Bach, and Pierre Gaillard. Tight nonparametric convergence rates for stochastic gradient descent under the noiseless linear model, 2020.
+M Biehl and P Riegler. On-line learning with a perceptron. *Europhysics Letters* (EPL), 28(7):525-530, dec 1994. doi: 10.1209/0295-5075/28/7/012. URL https://doi.org/10.1209/0295-5075/28/7/012.
+Blake Bordelon, Abdulkadir Canatar, and Cengiz Pehlevan. Spectrum dependent learning curves in kernel regression and wide neural networks. In International Conference on Machine Learning, pp. 1024-1034. PMLR, 2020.
+Abdulkadir Canatar, B. Bordelon, and C. Pehlevan. Spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks. Nature Communications, 12:1-12, 2020.
+Yuan Cao and Quanquan Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. Advances in Neural Information Processing Systems, 32:10836-10846, 2019.
+Yuan Cao, Quanquan Gu, and Misha Belkin. Risk bounds for over-parameterized maximum margin classification on sub-gaussian mixtures. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=ChWylanEuow.
+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.
+K. L. Chung. On a Stochastic Approximation Method. The Annals of Mathematical Statistics, 25 (3):463-483, 1954. doi: 10.1214/aoms/1177728716. URL https://doi.org/10.1214/aoms/1177728716.
+
+Aymeric Dieuleveut and Francis Bach. Nonparametric stochastic approximation with large step-sizes. The Annals of Statistics, 44(4):1363 - 1399, 2016. doi: 10.1214/15-AOS1391. URL https://doi.org/10.1214/15-AOS1391.
+Aymeric Dieuleveut, Nicolas Flammarion, and Francis Bach. Harder, better, faster, stronger convergence rates for least-squares regression. Journal of Machine Learning Research, 18, 02 2016.
+John C. Duchi and Feng Ruan. Asymptotic optimality in stochastic optimization. The Annals of Statistics, 49(1):21 - 48, 2021. doi: 10.1214/19-AOS1831. URL https://doi.org/10.1214/19-AOS1831.
+A. Engel and C. Van den Broeck. Statistical Mechanics of Learning. Cambridge University Press, 2001. doi: 10.1017/CBO9781139164542.
+Simon Fischer and Ingo Steinwart. Sobolev norm learning rates for regularized least-squares algorithms. Journal of Machine Learning Research, 21(205):1-38, 2020. URL http://jmlr.org/papers/v21/19-734.html.
+Nicolas Flammarion and Francis Bach. From averaging to acceleration, there is only a step-size. In Conference on Learning Theory, pp. 658-695. PMLR, 2015.
+Nicolas Flammarion and Francis Bach. Stochastic composite least-squares regression with convergence rate $o(1/n)$ . In Satyen Kale and Ohad Shamir (eds.), Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pp. 831-875. PMLR, 07-10 Jul 2017. URL https://proceedings.mlr.press/v65/flammarion17a.html.
+Sebastian Goldt, Madhu Advani, Andrew M Saxe, Florent Krzakala, and Lenka Zdeborova. Dynamics of stochastic gradient descent for two-layer neural networks in the teacher-student setup. 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/cab070d53bd0d200746fb852a922064a-Paper.pdf.
+Sebastian Goldt, Marc Mészard, Florent Krzakala, and Lenka Zdeborova. Modeling the influence of data structure on learning in neural networks: The hidden manifold model. Phys. Rev. X, 10: 041044, Dec 2020. doi: 10.1103/PhysRevX.10.041044. URL https://link.aps.org/doi/10.1103/PhysRevX.10.041044.
+Sebastian Goldt, Bruno Loureiro, Galen Reeves, Florent Krzakala, Marc Mészard, and Lenka Zdeboróva. The gaussian equivalence of generative models for learning with shallow neural networks. Proceedings of Machine Learning Research, 145:1-46, 2021.
+Mert Gurbuzbalaban, Umut Simsekli, and Lingjiong Zhu. The heavy-tail phenomenon in sgd. In International Conference on Machine Learning, pp. 3964-3975. PMLR, 2021.
+Tom M. Heskes and Bert Kappen. Learning processes in neural networks. Phys. Rev. A, 44:2718-2726, Aug 1991. doi: 10.1103/PhysRevA.44.2718. URL https://link.aps.org/doi/10.1103/PhysRevA.44.2718.
+Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory Diamos, Heewoo Jun, Hassan Kianinejad, Md. Mostofa Ali Patwary, Yang Yang, and Yanqi Zhou. Deep learning scaling is predictable, empirically, 2017.
+Arthur Jacot, Berfin Simsek, Francesco Spadaro, Clément Hongler, and Franck Gabriel. Kernel alignment risk estimator: Risk prediction from training data. In NeurIPS, 2020. URL https://proceedings.neurips.cc/paper/2020/bit/ b367e525a7e574817c19ad24b7b35607-Abstract.html.
+Prateek Jain, Sham M Kakade, Rahul Kidambi, Praneeth Netrapalli, and Aaron Sidford. Accelerating stochastic gradient descent for least squares regression. In Conference On Learning Theory, pp. 545-604. PMLR, 2018.
+
+Yann LeCun, Ido Kanter, and Sara A. Solla. Eigenvalues of covariance matrices: Application to neural-network learning. Phys. Rev. Lett., 66:2396-2399, May 1991. doi: 10.1103/PhysRevLett.66.2396. URL https://link.aps.org/doi/10.1103/PhysRevLett.66.2396.
+Jaehoon Lee, Lechao Xiao, Samuel S Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. Journal of Statistical Mechanics: Theory and Experiment, 2020(12): 124002, Dec 2020. ISSN 1742-5468. doi: 10.1088/1742-5468/abc62b. URL http://dx. doi.org/10.1088/1742-5468/abc62b.
+Bruno Loureiro, Cédric Gerbelot, Hugo Cui, Sebastian Goldt, Florent Krzakala, Marc Mézard, and Lenka Zdeborová. Capturing the learning curves of generic features maps for realistic data sets with a teacher-student model, 2021.
+Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of sgd in modern over-parametrized learning. In ICML, pp. 3331-3340, 2018. URL http://proceedings.mlr.press/v80/ma18a.html.
+C. Mace and A. Coolen. Statistical mechanical analysis of the dynamics of learning in perceptrons. Statistics and Computing, 8:55-88, 1998.
+Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve, 2020.
+Francesca Mignacco, Florent Krzakala, Pierfrancesco Urbani, and Lenka Zdeborova. Dynamical mean-field theory for stochastic gradient descent in gaussian mixture classification, 2020.
+Francesca Mignacco, Pierfrancesco Urbani, and Lenka Zdeborova. Stochasticity helps to navigate rough landscapes: comparing gradient-descent-based algorithms in the phase retrieval problem, 2021.
+Preetum Nakkiran, Behnam Neyshabur, and Hanie Sedghi. The deep bootstrap framework: Good online learners are good offline generalizers. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=guetrIHLFGI.
+Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. In International Conference on Learning Representations, 2020. URL https://github.com/google/neural-tangents.
+Loucas Pillaud-Vivien, Alessandro Rudi, and Francis Bach. Statistical optimality of stochastic gradient descent on hard learning problems through multiple passes, 2018.
+B. Polyak and A. Juditsky. Acceleration of stochastic approximation by averaging. Siam Journal on Control and Optimization, 30:838-855, 1992.
+Phil Pope, Chen Zhu, Ahmed Abdelkader, Micah Goldblum, and Tom Goldstein. The intrinsic dimension of images and its impact on learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=XJk19XzGq2J.
+Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In J. Platt, D. Koller, Y. Singer, and S. Roweis (eds.), Advances in Neural Information Processing Systems, volume 20. Curran Associates, Inc., 2008. URL https://proceedings.neurips.cc/paper/2007/file/013a006f03dbc5392effeb8f18fda755-Paper.pdf.
+Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2005.
+Herbert Robbins and Sutton Monro. A Stochastic Approximation Method. The Annals of Mathematical Statistics, 22(3):400 - 407, 1951. doi: 10.1214/aoms/1177729586. URL https://doi.org/10.1214/aoms/1177729586.
+David Ruppert. Efficient estimations from a slowly convergent robbins-monro process. 02 1988.
+
+David Saad and Sara Solla. Dynamics of on-line gradient descent learning for multilayer neural networks. 04 1999.
+Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E Dahl. Measuring the effects of data parallelism on neural network training. arXiv preprint arXiv:1811.03600, 2018.
+Alexander Shapiro. Asymptotic Properties of Statistical Estimators in Stochastic Programming. The Annals of Statistics, 17(2):841 - 858, 1989. doi: 10.1214/aos/1176347146. URL https://doi.org/10.1214/aos/1176347146.
+Stefano Spigler, Mario Geiger, and Matthieu Wyart. Asymptotic learning curves of kernel methods: empirical data versus teacher-student paradigm. Journal of Statistical Mechanics: Theory and Experiment, 2020(12):124001, Dec 2020. ISSN 1742-5468. doi: 10.1088/1742-5468/abc61d. URL http://dx.doi.org/10.1088/1742-5468/abc61d.
+Alexander Tsigler and Peter L Bartlett. Benign overfitting in ridge regression. arXiv preprint arXiv:2009.14286, 2020.
+Aditya Varre, Loucas Pillaud-Vivien, and Nicolas Flammarion. Last iterate convergence of sgd for least-squares in the interpolation regime, 2021.
+Maksim Velikanov and Dmitry Yarotsky. Universal scaling laws in the gradient descent training of neural networks, 2021.
+Justin Werfel, Xiaohui Xie, and H. Seung. Learning curves for stochastic gradient descent in linear feedforward networks. In S. Thrun, L. Saul, and B. Schölkopf (eds.), Advances in Neural Information Processing Systems, volume 16. MIT Press, 2004. URL https://proceedings.neurips.cc/paper/2003/file/f8b932c70d0b2e6bf071729a4fa68dfc-Paper.pdf.
+Yiming Ying and Massimiliano Pontil. Online gradient descent learning algorithms. Found. Comput. Math., 8(5):561-596, October 2008. ISSN 1615-3375.
+Lu Yu, Krishnakumar Balasubramanian, Stanislav Volgushev, and Murat A. Erdogdu. An analysis of constant step size sgd in the non-convex regime: Asymptotic normality and bias, 2020.
+Guodong Zhang, Lala Li, Zachary Nado, James Martens, Sushant Sachdeva, George Dahl, Chris Shallue, and Roger B Grosse. Which algorithmic choices matter at which batch sizes? insights from a noisy quadratic model. Advances in neural information processing systems, 32:8196-8207, 2019.
+Difan Zou, Jingfeng Wu, Vladimir Braverman, Quanquan Gu, and Sham M Kakade. Benign overfitting of constant-stepsize sgd for linear regression. arXiv preprint arXiv:2103.12692, 2021.
+
+# A DECOMPOSITION OF THE FEATURES AND TARGET FUNCTION
+
+Let $y(\mathbf{x})$ be a square integrable target function with $\langle y(\mathbf{x})^2\rangle < \infty$ . Define the following integral operator $T_K$ for kernel $K(\mathbf{x},\mathbf{x}^{\prime}) = \psi (\mathbf{x})\cdot \psi (\mathbf{x}^{\prime})$ :
+
+$$
+T _ {K} [ \phi ] (\mathbf {x} ^ {\prime}) = \int p (\mathbf {x}) K (\mathbf {x}, \mathbf {x} ^ {\prime}) \phi (\mathbf {x}) d \mathbf {x} \tag {11}
+$$
+
+We are interested in eigenfunctions of this operator, function $\phi_{k}$ for which $T_{K}[\phi_{k}] = \lambda_{k}\phi_{k}$ . For kernels with finite trace $\int K(\mathbf{x},\mathbf{x})p(\mathbf{x})d\mathbf{x} < \infty$ , Mercer's theorem (Rasmussen & Williams, 2005) guarantees the existence of a set of orthonormal eigenfunctions. Since $\psi (\mathbf{x})$ spans an $N$ dimensional function space, only $N$ of the kernel eigenfunctions will have non-zero eigenvalue. Since the basis of kernel eigenfunctions (including the zero eigenvalue functions) is complete over the space of square integrable functions. After ordering the eigenvalues $\lambda_1 > \lambda_2 > \ldots >\lambda_N$ with $\lambda_{N + \ell} = 0$ , we obtain the expansion
+
+$$
+y (\mathbf {x}) = \sum_ {k} \left\langle y (\mathbf {x}) \phi_ {k} (\mathbf {x}) \right\rangle_ {\mathbf {x}} \phi_ {k} (\mathbf {x}) = \sum_ {k \leq N} v _ {k} \phi_ {k} (\mathbf {x}) + y _ {\perp} (\mathbf {x}), y _ {\perp} (\mathbf {x}) = \sum_ {k > N} \left\langle y (\mathbf {x}) \phi_ {k} (\mathbf {x}) \right\rangle \phi_ {k} (\mathbf {x}) \tag {12}
+$$
+
+Further, we can decompose the feature map in this basis $\psi (\mathbf{x}) = \sum_{k = 1}^{N}\sqrt{\lambda_k}\pmb {u}_k\phi_k(\mathbf{x})$ . We recognize through these decompositions the coefficients $v_{k}$ can be computed uniquely as $v_{k} =$ $\lambda_k^{-1 / 2}\pmb {u}_k^\top \langle \psi (\mathbf{x})y(\mathbf{x})\rangle$ . This provides a recipe for determining the necessary spectral quantities for our theory. We see that the feature map's decomposition above reveals that $\lambda_{k}$ are also the eigenvalues of the feature correlation matrix $\boldsymbol{\Sigma}$ since
+
+$$
+\boldsymbol {\Sigma} = \left\langle \boldsymbol {\psi} (\mathbf {x}) \boldsymbol {\psi} (\mathbf {x}) ^ {\top} \right\rangle = \sum_ {k \ell} \sqrt {\lambda_ {k} \lambda_ {\ell}} \mathbf {u} _ {k} \mathbf {u} _ {\ell} ^ {\top} \left\langle \phi_ {k} (\mathbf {x}) \phi_ {\ell} (\mathbf {x}) \right\rangle = \sum_ {k} \lambda_ {k} \mathbf {u} _ {k} \mathbf {u} _ {k} ^ {\top}. \tag {13}
+$$
+
+# A.1 FINITE SAMPLE SPACES
+
+When we discuss experiments on MNIST or CIFAR, we use this technology for an atomic data distribution $p(\mathbf{x}) = \frac{1}{M}\sum_{\mu = 1}^{M}\delta (\mathbf{x} - \mathbf{x}^{\prime})$ . Plugging this into the integral operator gives
+
+$$
+T _ {K} [ \phi ] (\mathbf {x}) = \frac {1}{M} \sum_ {\mu} K (\mathbf {x}, \mathbf {x} ^ {\mu}) \phi (\mathbf {x} ^ {\mu}) \tag {14}
+$$
+
+We see that, restricting the domain to the set of points $\{\mathbf{x}_1,\dots ,\mathbf{x}_M\}$ , this amounts to solving a matrix eigenvalue problem $\frac{1}{M} K\phi_k = \lambda_k\phi_k$ where $K\in \mathbb{R}^{M\times M}$ is the kernel gram matrix with entries $K_{\mu \nu} = K(\mathbf{x}^{\mu},\mathbf{x}^{\nu})$ and $\phi_{k}$ has entries $\phi_{k,\mu} = \phi_k(\mathbf{x}^\mu)$ .
+
+# B PROOF OF THEOREM 1
+
+Let $\Delta_t = \mathbf{w}_t - \mathbf{w}^*$ represent the difference between the current and optimal weights and define the correlation matrix for this difference
+
+$$
+\mathbf {C} _ {t} = \left\langle \boldsymbol {\Delta} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle_ {\mathcal {D} _ {t - 1}}. \tag {15}
+$$
+
+Using stochastic gradient descent, $\mathbf{w}_{t + 1} = \mathbf{w}_t - \eta \mathbf{g}_t$ with gradient vector $\mathbf{g}_t = \frac{1}{m}\sum_{i = 1}^{m}\pmb {\psi}_i\pmb{\psi}_i^\top \pmb {\Delta}_t$ the $\mathbf{C}_t$ matrix satisfies the recursion
+
+$$
+\mathbf {C} _ {t + 1} = \left\langle \left(\boldsymbol {\Delta} _ {t} - \eta \mathbf {g} _ {t}\right) \left(\boldsymbol {\Delta} _ {t} - \eta \mathbf {g} _ {t}\right) ^ {\top} \right\rangle_ {\mathcal {D} _ {t}} = \mathbf {C} _ {t} - \eta \left\langle \mathbf {g} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle - \eta \left\langle \boldsymbol {\Delta} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle + \eta^ {2} \left\langle \mathbf {g} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle . \tag {16}
+$$
+
+First, note that since $\psi_{i}$ are all independently sampled at timestep $t$ , we can break up the average into the fresh batch of $m$ samples and an average over $\mathcal{D}_{t-1}$
+
+$$
+\left\langle \mathbf {g} _ {t} \boldsymbol {\Delta} _ {t} \right\rangle_ {\mathcal {D} _ {t}} = \frac {1}{m} \sum_ {i = 1} ^ {m} \left\langle \boldsymbol {\psi} _ {i} \boldsymbol {\psi} _ {i} ^ {\top} \right\rangle_ {\boldsymbol {\psi} _ {i}} \left\langle \boldsymbol {\Delta} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle_ {\mathcal {D} _ {t - 1}} = \boldsymbol {\Sigma} \mathbf {C} _ {t}. \tag {17}
+$$
+
+The last term requires computation of fourth moments
+
+$$
+\begin{array}{l} \left\langle \mathbf {g} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle = \frac {1}{m ^ {2}} \sum_ {i, j} \left\langle \boldsymbol {\psi} _ {i} \boldsymbol {\psi} _ {i} ^ {\top} \left\langle \boldsymbol {\Delta} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle_ {\mathcal {D} _ {t - 1}} \boldsymbol {\psi} _ {j} \boldsymbol {\psi} _ {j} ^ {\top} \right\rangle_ {\boldsymbol {\psi} _ {i}, \boldsymbol {\psi} _ {j}} (18) \\ = \frac {1}{m ^ {2}} \sum_ {i, j} \left\langle \boldsymbol {\psi} _ {i} \boldsymbol {\psi} _ {i} ^ {\top} \mathbf {C} _ {t} \boldsymbol {\psi} _ {j} \boldsymbol {\psi} _ {j} ^ {\top} \right\rangle_ {\boldsymbol {\psi} _ {i}, \boldsymbol {\psi} _ {j}}. (19) \\ \end{array}
+$$
+
+First, consider the case where $i = j$ . Letting $\psi = \psi_{i}$ , we need to compute terms of the form
+
+$$
+\sum_ {k, \ell} C _ {k, \ell} \left\langle \psi_ {j} \psi_ {k} \psi_ {\ell} \psi_ {n} \right\rangle . \tag {20}
+$$
+
+For Gaussian random vectors, we resort to Wick-Isserlis theorem for the fourth moment
+
+$$
+\langle \psi_ {j} \psi_ {k} \psi_ {l} \psi_ {n} \rangle = \langle \psi_ {j} \psi_ {k} \rangle \langle \psi_ {\ell} \psi_ {n} \rangle + \langle \psi_ {j} \psi_ {\ell} \rangle \langle \psi_ {k} \psi_ {n} \rangle + \langle \psi_ {j} \psi_ {n} \rangle \langle \psi_ {\ell} \psi_ {k} \rangle \tag {21}
+$$
+
+giving
+
+$$
+\left\langle \mathbf {g} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle = \frac {m + 1}{m} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {1}{m} \boldsymbol {\Sigma} \operatorname {T r} \left(\boldsymbol {\Sigma} \mathbf {C} _ {t}\right). \tag {22}
+$$
+
+This correlation structure for $\mathbf{g}_t$ implies that its covariance has the form
+
+$$
+\left\langle \operatorname {C o v} _ {\psi} \left(\mathbf {g} _ {t}\right) \right\rangle_ {\mathcal {D} _ {t}} = \frac {1}{m} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {1}{m} \boldsymbol {\Sigma} \operatorname {T r} \left(\boldsymbol {\Sigma} \mathbf {C} _ {t}\right). \tag {23}
+$$
+
+Using the formula for $\langle \mathbf{g}_t\mathbf{g}_t^\top \rangle$ , we arrive at the following recursion relation for $\mathbf{C}_t$
+
+$$
+\mathbf {C} _ {t + 1} = \mathbf {C} _ {t} - \eta \mathbf {C} _ {t} \boldsymbol {\Sigma} - \eta \boldsymbol {\Sigma} \mathbf {C} _ {t} + \eta^ {2} \frac {m + 1}{m} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {1}{m} \eta^ {2} \boldsymbol {\Sigma} \operatorname {T r} \left(\boldsymbol {\Sigma} \mathbf {C} _ {t}\right). \tag {24}
+$$
+
+Since we are ultimately interested in the generalization error $\langle L_t\rangle = \left\langle \pmb {\Delta}_t^\top \pmb {\Sigma}\pmb {\Delta}_t\right\rangle = \mathrm{Tr}\pmb {\Sigma}\mathbf{C}_t = \sum_k\lambda_k\mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k$ , it suffices to track the evolution of $c_{t,k} = \mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k$
+
+$$
+c _ {t + 1, k} = \left(1 - 2 \eta \lambda_ {k} + \eta^ {2} \frac {m + 1}{m} \lambda_ {k} ^ {2}\right) c _ {t, k} + \frac {1}{m} \eta^ {2} \lambda_ {k} \sum_ {j} \lambda_ {j} c _ {t, j}. \tag {25}
+$$
+
+Vectorizing this equation for $\mathbf{c}$ generates the following solution
+
+$$
+\mathbf {c} _ {t} = \mathbf {A} ^ {t} \mathbf {c} _ {0}, \mathbf {A} = \mathbf {I} - 2 \eta \operatorname {d i a g} (\boldsymbol {\lambda}) + \frac {m + 1}{m} \eta^ {2} \operatorname {d i a g} \left(\boldsymbol {\lambda} ^ {2}\right) + \frac {\eta^ {2}}{m} \boldsymbol {\lambda} \boldsymbol {\lambda} ^ {\top}. \tag {26}
+$$
+
+The coefficient $c_{0,k} = v_k^2 = \left(\mathbf{u}_k^\top \mathbf{w}^*\right)^2$ . To get the generalization error, we merely compute $\langle L_t \rangle = \lambda^\top \mathbf{a}_t = \lambda^\top \mathbf{A}^t \mathbf{v}^2$ as desired.
+
+# C PROOF OF STABILITY CONDITIONS
+
+We will first establish the following lower bound on the loss, where without loss of generality we assumed the maximum correlation is 1:
+
+$$
+L _ {t} \geq \boldsymbol {\lambda} ^ {\top} \mathbf {v} ^ {2} \left[ (1 - \eta) ^ {2} + \frac {\eta^ {2}}{m} | \boldsymbol {\lambda} | ^ {2} \right] ^ {t}. \tag {27}
+$$
+
+We will then use this lower bound to provide necessary conditions on the learning rate and batch size for stability of the loss evolution. First, note that the following inequality holds elementwise
+
+$$
+\mathbf {A} \boldsymbol {\lambda} = \left[ \left(\boldsymbol {I} - \eta \operatorname {d i a g} (\boldsymbol {\lambda})\right) ^ {2} + \frac {\eta^ {2}}{m} \operatorname {d i a g} (\boldsymbol {\lambda} ^ {2}) + \frac {\eta^ {2}}{m} \boldsymbol {\lambda} \right] \boldsymbol {\lambda} \geq \left[ (1 - \eta) ^ {2} + \frac {\eta^ {2}}{m} | \boldsymbol {\lambda} | ^ {2} \right] \boldsymbol {\lambda} \tag {28}
+$$
+
+Repeating this inequality $t$ times gives $\pmb{A}^{t}\pmb{\lambda} \geq \left[(1 - \eta)^{2} + \frac{\eta^{2}}{m}|\pmb{\lambda}|^{2}\right]^{t}\pmb{\lambda}$ . Using the fact that $L_{t} = \pmb{\lambda}^{\top}\pmb{A}^{t}\pmb{v}^{2}$ gives the desired inequality. Note that this inequality is very close to the true result for
+
+isotropic features $\lambda = 1$ which gives $L_{t} \propto \left[(1 - \eta)^{2} + \frac{\eta^{2}}{m} (|\lambda|^{2} + 1)\right]^{t}$ . For anisotropic features with small learning rate, this bound becomes less tight. For the loss to converge to zero at large time, the quantity in brackets must necessarily be less than one. This implies the following necessary condition on the batchsize and learning rate
+
+$$
+\eta < \frac {2 m}{m + | \boldsymbol {\lambda} | ^ {2}} \Longleftrightarrow m > m _ {\min } = \frac {\eta | \boldsymbol {\lambda} | ^ {2}}{2 - \eta} \tag {29}
+$$
+
+where $m_{min}$ is the minimal batch size for learning rate $\eta$ and feature covariance eigenvalues $\lambda$ .
+
+# C.1 HEURISTIC BATCH SIZE AND LEARNING RATE
+
+We can derive heuristic optimal choices of the learning rate and batch size hyperparameters $\eta, m$ at a fixed compute budget which optimize the lower bound derived above.
+
+# C.1.1 FIXED LEARNING RATE
+
+We will first consider optimizing only the batch size at a fixed learning rate $\eta$ before discussing the optimal $m$ when $\eta$ is chosen optimally. The loss at a fixed compute budget $C = tm$ is lower bounded by
+
+$$
+L _ {C / m} \geq \boldsymbol {\lambda} ^ {\top} \boldsymbol {v} ^ {2} \left[ (1 - \eta) ^ {2} + \frac {\eta^ {2}}{m} | \boldsymbol {\lambda} | ^ {2} \right] ^ {C / m} \tag {30}
+$$
+
+For the purposes of optimization, we introduce $x = 1 / m$ and consider optimizing
+
+$$
+f (x) = x \ln [ A + B x ], A = (1 - \eta) ^ {2}, B = \eta^ {2} | \boldsymbol {\lambda} | ^ {2} \tag {31}
+$$
+
+The first order optimality condition $f'(x) = 0$ implies that $\ln (A + Bx) + \frac{Bx}{A + Bx} = 0$ . Letting $z = A + Bx$ , this is equivalent to $z \ln z + z - A = 0$ . This equation has solutions for all valid $A \in (0,1)$ giving solutions $z \in (e^{-1},1)$ . Letting $z(\eta)$ , represent the solution to $z + z \ln z - (1 - \eta)^2 = 0$ , the optimal batchsize has the form
+
+$$
+m ^ {*} (\eta) = \frac {B}{z (A) - A} = \frac {\eta^ {2} | \boldsymbol {\lambda} | ^ {2}}{z (\eta) - (1 - \eta) ^ {2}} \tag {32}
+$$
+
+We can gain intuition for this result by considering the limit of $\eta \to 0$ and $\eta \to 1$ . First, in the $\eta \to 0$ limit, we find that $z \sim \frac{A + 1}{2}$ so $m^{*} \sim \frac{2\eta|\lambda|^{2}}{2 - \eta} = 2m_{min}$ , making contact with the stability bound derived in Appendix Section C. Thus for small learning rates, this heuristic optimum suggests doubling the minimal stable batchsize for optimal convergence. At large learning rates, $\eta \sim 1$ with $A \sim 0$ , we find $z \sim e^{-1}$ so $m^{*}(\eta) \sim e\eta^{2}|\lambda|^{2}$ . Thus for small $\eta$ , we expect $m^{*}$ to scale linearly with $\eta$ while for large $\eta$ , we expect a scaling of the form $\eta^2$ . In either case, the optimal batchsize scales with feature eigenvalues through the sum of the squares $|\lambda|^{2} = \sum_{k} \lambda_{k}^{2}$ .
+
+# C.1.2 HEURISTIC OPTIMAL LEARNING RATE AND BATCH SIZE
+
+We will now examine what happens when one first optimizes loss bounmd with respect to the the learning rate at any value of $m$ and then subsequently optimizes over the batch size $m$ . We can easily find the $\eta$ which minimizes the lower bound.
+
+$$
+\frac {\partial}{\partial \eta} \left[ (1 - \eta) ^ {2} + \frac {\eta^ {2} | \boldsymbol {\lambda} | ^ {2}}{m} \right] = 0 \Longrightarrow \eta^ {*} = \frac {m}{m + | \boldsymbol {\lambda} | ^ {2}} \tag {33}
+$$
+
+Note that this heuristic optimal learning rate is very close to the true optimum in the isotropic data setting $\eta_{true} = \frac{m}{m + N + 1} \approx \frac{m}{m + N}$ . Plugging this back into the loss bound, we find that at fixed compute $C = tm$ , the loss scales like
+
+$$
+L _ {C / m} \geq \boldsymbol {\lambda} ^ {\top} \boldsymbol {v} ^ {2} \left[ \frac {| \boldsymbol {\lambda} | ^ {2}}{m + | \boldsymbol {\lambda} | ^ {2}} \right] ^ {C / m} \tag {34}
+$$
+
+With the optimal choice of learning rate, the loss at fixed compute monotonically increases with batch size, giving an optimal batchsize of $m = 1$ . This shows that if the learning rate is chosen optimally then small batch sizes give the best performance per unit of computation. This corresponds to the hyperparameter choices $(\eta, m) = \left( \frac{1}{1 + |\lambda|^2}, 1 \right)$ .
+
+# D INCREASING $m$ REDUCES THE LOSS AT FIXED $t$
+
+We will show that for a fixed number of steps $t$ , increasing the minibatch size $m$ can only decrease the expected error. To do this, we will simply show that the derivative of the expected loss with respect to $m$ ,
+
+$$
+\frac {\partial \left\langle L _ {t} \right\rangle}{\partial m} = \boldsymbol {\lambda} ^ {\top} \frac {\partial \mathbf {A} ^ {t}}{\partial m} \mathbf {v} ^ {2}, \tag {35}
+$$
+
+is always non-positive. The derivative of the $t$ -th power of $\mathbf{A}$ can be identified with the chain rule
+
+$$
+\frac {\partial \mathbf {A} ^ {t}}{\partial m} = \frac {\partial \mathbf {A}}{\partial m} \mathbf {A} ^ {t - 1} + \mathbf {A} \frac {\partial \mathbf {A}}{\partial m} \mathbf {A} ^ {t - 2} + \mathbf {A} ^ {2} \frac {\partial \mathbf {A}}{\partial m} \mathbf {A} ^ {t - 3} + \dots + \mathbf {A} ^ {t - 1} \frac {\partial \mathbf {A}}{\partial m}. \tag {36}
+$$
+
+Note that the matrix
+
+$$
+\frac {\partial \mathbf {A}}{\partial m} = - \frac {\eta^ {2}}{m ^ {2}} \left[ \operatorname {d i a g} \left(\boldsymbol {\lambda} ^ {2}\right) + \boldsymbol {\lambda} \boldsymbol {\lambda} ^ {\top} \right] \tag {37}
+$$
+
+has all non-positive entries. Thus we find that
+
+$$
+\frac {\partial \langle L _ {t} \rangle}{\partial m} = \sum_ {n = 0} ^ {t - 1} \boldsymbol {\lambda} ^ {\top} \mathbf {A} ^ {n} \frac {\partial \mathbf {A}}{\partial m} \mathbf {A} ^ {t - n - 1} \mathbf {v} ^ {2}. \tag {38}
+$$
+
+Note that since all entries in $\mathbf{v}_k^2$ and $\mathbf{A}^{t - n - 1}$ are non-negative, the vector $z_{n} = \mathbf{A}^{t - n - 1}\mathbf{v}^{2}$ has non-negative entries. By the same argument, the vector $q_{n} = \mathbf{A}^{n}\pmb{\lambda}$ is also non-negative in each entry. Therefore, each of the terms in $\frac{\partial\langle L_t\rangle}{\partial m}$ above must be non-positive
+
+$$
+\frac {\partial \left\langle L _ {t} \right\rangle}{\partial m} = \sum_ {n = 0} ^ {t - 1} z _ {n} ^ {\top} \frac {\partial \mathbf {A}}{\partial m} q _ {n} = - \frac {\eta^ {2}}{m} \sum_ {n} \sum_ {k, \ell} z _ {n, k} \left[ \delta_ {k, \ell} \lambda_ {k} ^ {2} + \lambda_ {k} \lambda_ {\ell} \right] q _ {n, \ell} \leq 0. \tag {39}
+$$
+
+Thus we find $\frac{\partial\langle L_t\rangle}{\partial m}\leq 0$ implying that optimal $\langle L_t\rangle$ is always obtained (possibly non-uniquely) at $m\to \infty$
+
+# E INCREASING $m$ INCREASES THE LOSS AT FIXED $C = tm$ ON ISOTROPIC FEATURES
+
+Unlike the previous section, which considered fixed $t$ and varying $m$ , in this section we consider fixing the total number of samples (or gradient evaluations) which we call the compute budget $C = tm$ . For a fixed compute budget $C = tm$ , and unstructured $N$ dimensional Gaussian features and optimal learning rate $\eta^{*} = \frac{m}{m + N + 1}$ , we have
+
+$$
+\left\langle L _ {C / m} \right\rangle = \left(\frac {N + 1}{m + N + 1}\right) ^ {C / m} \left\| \mathbf {w} ^ {*} \right\| ^ {2}. \tag {40}
+$$
+
+Taking a derivative with respect to the batch size we get
+
+$$
+\begin{array}{l} \frac {\partial}{\partial m} \log \left\langle L _ {C / m} \right\rangle = \frac {\partial}{\partial m} \frac {C}{m} \log \left(\frac {N + 1}{m + N + 1}\right) \\ = \frac {C}{m ^ {2}} \log \left(\frac {m + N + 1}{N + 1}\right) + \frac {C}{m (m + N + 1)} > 0. \tag {41} \\ \end{array}
+$$
+
+This exercise demonstrates that, for the isotropic features, smaller batch-sizes are preferred at a fixed compute budget $C$ . This result does not hold for arbitrary spectra $\lambda_{k}$ . In the general case, optimal minibatch sizes can exist as we show in Figure 1 (e)-(f) for power law and MNIST spectra.
+
+# F PROOF OF THEOREM 2
+
+Let $\mathrm{Vec}(\cdot)$ denote a flattening of an $N\times N$ matrix into a vector of length $N^2$ and let $\mathrm{Mat}(\cdot)$ represent a flattening of a 4D tensor into a $N^2\times N^2$ two-dimensional matrix. We will show that the expected loss (over $\mathcal{D}_t$ ) is
+
+$$
+\left\langle L _ {t} \right\rangle = \sum_ {k} \lambda_ {k} c _ {t, k k}, \mathbf {c} _ {t} = \left(\mathbf {G} + \frac {\eta^ {2}}{m} \operatorname {M a t} (\boldsymbol {\kappa})\right) ^ {t} \operatorname {V e c} \left(\mathbf {v v} ^ {\top}\right) \in \mathbb {R} ^ {N ^ {2}} \tag {42}
+$$
+
+where $[\mathbf{G}]_{ij,kl} = \delta_{ik}\delta_{jl}\left(1 - \eta (\lambda_i + \lambda_j) + \frac{\eta^2(m - 1)}{m}\lambda_i\lambda_j\right)$ and $[\mathbf{v}]_k = \mathbf{u}_k\cdot \mathbf{w}^*$ .
+
+We rotate all of the feature vectors into the eigenbasis of the covariance, generating diagonalized features $\phi_{k} = \mathbf{u}_{k}^{\top}\boldsymbol{\psi}$ and introduce the following fourth moment tensor
+
+$$
+\kappa_ {i j k l} = \left\langle \phi_ {i} \phi_ {j} \phi_ {k} \phi_ {\ell} \right\rangle . \tag {43}
+$$
+
+We redefine $\mathbf{C}_t$ in the appropriate (rotated) basis by projecting onto the eigenvectors of the covariance
+
+$$
+\mathbf {C} _ {t} = \mathbf {U} ^ {\top} \left\langle \boldsymbol {\Delta} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle \mathbf {U}, \tag {44}
+$$
+
+where $\mathbf{U} = [\mathbf{u}_1, \mathbf{u}_2, \dots, \mathbf{u}_N]$ . With this definition, $\mathbf{C}$ 's dynamics take the form
+
+$$
+\mathbf {C} _ {t + 1} = \mathbf {C} _ {t} - \boldsymbol {\Lambda} \mathbf {C} _ {t} - \mathbf {C} _ {t} \boldsymbol {\Lambda} + \frac {\eta^ {2} (m - 1)}{m} \boldsymbol {\Lambda} \mathbf {C} _ {t} \boldsymbol {\Lambda} + \left\langle \phi \phi^ {\top} \mathbf {C} _ {t} \phi \phi^ {\top} \right\rangle . \tag {45}
+$$
+
+The elements of the matrix can be expressed with the fourth moment tensor
+
+$$
+\sum_ {k \ell} \left\langle \phi_ {i} \phi_ {j} \phi_ {k} \phi_ {\ell} \right\rangle C _ {k \ell} = \sum_ {k \ell} \kappa_ {i j k l} C _ {k, \ell}. \tag {46}
+$$
+
+We thus generate the following dynamics for $C_{ij}^{t}$
+
+$$
+C _ {i j} ^ {t + 1} = \left(1 - \eta \left(\lambda_ {i} + \lambda_ {j}\right) + \frac {\eta^ {2} (m - 1)}{m} \lambda_ {i} \lambda_ {j}\right) C _ {i j} ^ {t} + \frac {\eta^ {2}}{m} \sum_ {k l} \kappa_ {i j k l} C _ {k l} ^ {t}. \tag {47}
+$$
+
+Let $\mathbf{c}_t = \operatorname {Vec}(\mathbf{C}_t)$ , then we have
+
+$$
+\mathbf {c} _ {t + 1} = \left(\mathbf {G} _ {0} + \frac {\eta^ {2}}{m} \operatorname {M a t} (\boldsymbol {\kappa})\right) \mathbf {c} _ {t}, [ \mathbf {G} _ {0} ] _ {i j, k \ell} = \delta_ {i k} \delta_ {j \ell} \left[ 1 - \eta \left(\lambda_ {i} + \lambda_ {j}\right) + \frac {\eta^ {2} (m - 1)}{m} \lambda_ {i} \lambda_ {j} \right]. \tag {48}
+$$
+
+Solving these dynamics for $\mathbf{c}$ , recognizing that $\mathbf{c}_0 = \mathrm{Vec}(\mathbf{v}\mathbf{v}^\top)$ , and computing $\langle L_t\rangle = \mathrm{Tr}\pmb{\Sigma}\mathbf{C}_t = \sum_k C_{kk}\lambda_k$ gives the desired result.
+
+# F.1 PROOF OF THEOREM 3
+
+Suppose that the features satisfy the regularity condition
+
+$$
+\left\langle \psi \psi^ {\top} G \psi \psi^ {\top} \right\rangle \preceq (\alpha + 1) \Sigma G \Sigma + \alpha \Sigma \operatorname {T r} (\Sigma G) \tag {49}
+$$
+
+Recalling the recursion relation for $C_t$
+
+$$
+\begin{array}{l} \mathbf {C} _ {t + 1} = \mathbf {C} _ {t} - \eta \boldsymbol {\Sigma} \mathbf {C} _ {t} - \eta \mathbf {C} _ {t} \boldsymbol {\Sigma} + \eta^ {2} \frac {m ^ {2} - m}{m ^ {2}} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {\eta^ {2}}{m} \left\langle \psi \psi^ {\top} \mathbf {C} _ {t} \psi \psi^ {\top} \right\rangle \\ \succcurlyeq \boldsymbol {C} _ {t} - \eta \boldsymbol {\Sigma} \mathbf {C} _ {t} - \eta \mathbf {C} _ {t} \boldsymbol {\Sigma} + \eta^ {2} \frac {m ^ {2} - m}{m ^ {2}} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {\eta^ {2}}{m} [ (\alpha + 1) \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \alpha \boldsymbol {\Sigma} \mathrm {T r} \mathbf {C} _ {t} \boldsymbol {\Sigma} ] (50) \\ = (\mathbf {I} - \eta \boldsymbol {\Sigma}) \mathbf {C} _ {t} (\mathbf {I} - \eta \boldsymbol {\Sigma}) + \frac {\alpha \eta^ {2}}{m} [ \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \boldsymbol {\Sigma} \operatorname {T r} \boldsymbol {\Sigma} \mathbf {C} _ {t} ] (51) \\ \end{array}
+$$
+
+Defining that $c_{k,t} = \pmb{u}_k^\top \mathbf{C}_t\pmb{u}_k$ , we note $\pmb{c}_{t + 1}\leq \left((\pmb {I} - \eta \operatorname {diag}(\pmb {\lambda}))^2 +\frac{\eta^2\alpha}{m}\left[\operatorname {diag}(\pmb {\lambda}^2) + \pmb {\lambda}\pmb {\lambda}^\top \right]\right)\pmb {c}_t$ Using the fact that $L_{t} = c_{t}^{\top}\lambda$ , we find
+
+$$
+L _ {t} \leq \boldsymbol {\lambda} ^ {\top} \left(\left(\boldsymbol {I} - \eta \operatorname {d i a g} (\boldsymbol {\lambda})\right) ^ {2} + \frac {\eta^ {2} \alpha}{m} \left[ \operatorname {d i a g} \left(\boldsymbol {\lambda} ^ {2}\right) + \boldsymbol {\lambda} \boldsymbol {\lambda} ^ {\top} \right]\right) ^ {t} \boldsymbol {v} ^ {2} \tag {52}
+$$
+
+which proves the desired bound.
+
+# G POWER LAW SCALINGS IN SMALL LEARNING RATE LIMIT
+
+By either taking a small learning rate $\eta$ or a large batch size, the test loss dynamics reduce to the test loss obtained from gradient descent on the population loss. In this section, we consider the small learning rate limit $\eta \to 0$ , where the average test loss follows
+
+$$
+\langle L _ {t} \rangle \sim \sum_ {k = 1} ^ {\infty} \lambda_ {k} v _ {k} ^ {2} (1 - \eta \lambda_ {k}) ^ {2 t}. \tag {53}
+$$
+
+
+(a) Non-Gaussian Effects on MNIST
+
+
+(b) Non-Gaussian Effects on CIFAR
+Figure F.1: Non-Gaussian effects are small on random feature models. (a)-(b) The first 20-dimensions of the summed fourth moment matrix $\kappa_{ij}^{4} = \mathbf{u}_{i}^{\top}\left\langle \psi \psi^{\top}\psi \psi^{\top}\right\rangle \mathbf{u}_{j}$ are plotted for the Gaussian approximation and the empirical fourth moment. Differences between the Gaussian approximation and true fourth moment matrices on this example are visible, but are only on the order of $\sim 5\%$ of the size of the entries in $\kappa_{4}$ .
+
+Under the assumption that the eigenvalue and target function power spectra both follow power laws $\lambda_{k}\sim k^{-b}$ and $v_{k}^{2}\lambda_{k}\sim k^{-a}$ , the loss can be approximated by an integral over all modes $k$
+
+$$
+\left\langle L _ {t} \right\rangle = \sum_ {k} k ^ {- a} \left(1 - \eta k ^ {- b}\right) ^ {2 t} \sim \int_ {1} ^ {\infty} \exp \left(2 \eta \ln \left(1 - \eta k ^ {- b}\right) t - a \ln k\right) d k \tag {54}
+$$
+
+$$
+\sim \int_ {1} ^ {\infty} \exp \left(- 2 \eta \eta k ^ {- b} t - a \ln k\right) d k, \eta \rightarrow 0 \tag {55}
+$$
+
+We identify the function $f(k) = 2\eta k^{-b} + \frac{1}{t}\ln k$ and proceed with Laplace's method (Bender & Orszag, 1999). This consists of Taylor expanding $f(k)$ around its minimum to second order and computing a Gaussian integral
+
+$$
+\int \exp (- t f (k)) d k \sim \int \exp \left(- t f \left(k ^ {*}\right) - \frac {t}{2} f ^ {\prime \prime} \left(k ^ {*}\right) \left(k - k ^ {*}\right) ^ {2}\right) \sim \exp (- t f \left(k ^ {*}\right)) \sqrt {\frac {2 \pi}{t f ^ {\prime \prime} \left(k ^ {*}\right)}}. \tag {56}
+$$
+
+We must identify the $k^*$ which minimizes $f(k)$ . The interpretation of this value is that it indexes the mode which dominates the error at a large time $t$ . The first order condition gives
+
+$$
+f ^ {\prime} (k) = - 2 b \eta k ^ {- b - 1} + \frac {a}{t k} = 0 \Longrightarrow k ^ {*} = \left(2 b \eta t / a\right) ^ {1 / b}. \tag {57}
+$$
+
+The second derivative has the form
+
+$$
+f ^ {\prime \prime} (k ^ {*}) = 2 b ^ {2} \eta k ^ {- b - 2} - \frac {1}{t k ^ {2}} | _ {k ^ {*}} = 2 b ^ {2} \eta (2 b \eta t / a) ^ {- (b + 2) / b} - \frac {1}{t} (2 b \eta t / a) ^ {- 2 / b} \sim t ^ {- 1 - 2 / b}. \tag {58}
+$$
+
+Thus we are left with a scaling of the form
+
+$$
+\langle L _ {t} \rangle \sim \exp (- a / b \ln t) t ^ {1 / b} \sim t ^ {- \frac {a - 1}{b}}. \tag {59}
+$$
+
+# H PROOF OF THEOREM 4
+
+Let $\langle y_{\perp}^2\rangle = \sigma^2$ and $\langle y_{\perp}\rangle = 0$ , $\langle y_{\perp}\psi \rangle = 0$ . The gradient descent updates take the following form $\Delta_{t + 1} = \Delta_t - \eta \mathbf{g}_t$ with
+
+$$
+\mathbf {g} _ {t} = \frac {1}{m} \sum_ {i = 1} ^ {m} \psi_ {i} \left[ \psi_ {i} ^ {\top} \boldsymbol {\Delta} _ {t} + y _ {\perp , i} \right]. \tag {60}
+$$
+
+Again, defining $\mathbf{C}_t = \left\langle \pmb{\Delta}_t \pmb{\Delta}_t^\top \right\rangle$ we perform the average over each of the $\psi_i$ vectors to obtain the following recursion relation
+
+$$
+\begin{array}{l} \mathbf {C} _ {t + 1} = \left\langle \boldsymbol {\Delta} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle - \eta \left\langle \boldsymbol {\Delta} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle - \eta \left\langle \mathbf {g} _ {t} \boldsymbol {\Delta} _ {t} ^ {\top} \right\rangle + \eta^ {2} \left\langle \mathbf {g} _ {t} \mathbf {g} _ {t} ^ {\top} \right\rangle \\ = \mathbf {C} _ {t} - \eta \boldsymbol {\Sigma} \mathbf {C} _ {t} - \eta \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {m + 1}{m} \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \frac {1}{m} \boldsymbol {\Sigma} \operatorname {T r} \left(\mathbf {C} _ {t} \boldsymbol {\Sigma}\right) + \eta^ {2} \sigma^ {2} \boldsymbol {\Sigma}. \tag {61} \\ \end{array}
+$$
+
+Again, analyzing $c_{t,k} = \mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k$ we find
+
+$$
+c _ {t + 1, k} = \left(1 - 2 \eta \lambda_ {k} + \eta^ {2} \frac {m + 1}{m} \lambda_ {k} ^ {2}\right) c _ {t, k} + \frac {1}{m} \sum_ {\ell} \lambda_ {\ell} c _ {t, \ell} + \eta^ {2} \sigma^ {2} \lambda_ {k}. \tag {62}
+$$
+
+The vector $c_{t}$ follows the linear evolution
+
+$$
+\boldsymbol {c} _ {t + 1} = \mathbf {A} \boldsymbol {c} _ {t} + \eta^ {2} \sigma^ {2} \boldsymbol {\lambda}. \tag {63}
+$$
+
+Let $\pmb{b} = \eta^2\sigma^2\pmb{\lambda}$ . Writing out the first few steps, we identify a pattern
+
+$$
+\boldsymbol {c} _ {1} = \mathbf {A} \boldsymbol {c} _ {0} + \boldsymbol {b}
+$$
+
+$$
+\mathbf {c} _ {2} = \mathbf {A} \mathbf {c} _ {1} + \mathbf {b} = \mathbf {A} ^ {2} \mathbf {c} _ {0} + \mathbf {A} \mathbf {b} + \mathbf {b}
+$$
+
+$$
+\mathbf {c} _ {3} = \mathbf {A} \mathbf {c} _ {2} + \mathbf {b} = \mathbf {A} ^ {3} \mathbf {c} _ {0} + \mathbf {A} ^ {2} \mathbf {b} + \mathbf {A} \mathbf {b} + \mathbf {b}
+$$
+
+··
+
+$$
+\boldsymbol {c} _ {t} = \mathbf {A} ^ {t} \boldsymbol {c} _ {0} + \left(\sum_ {n = 0} ^ {t - 1} \mathbf {A} ^ {n}\right) \boldsymbol {b}. \tag {64}
+$$
+
+The geometric sum $\left(\sum_{n=0}^{t-1} \mathbf{A}^n\right)$ can be computed exactly under the assumption that $(\mathbf{I} - \mathbf{A})$ is invertible which holds provided all of $\mathbf{A}$ 's eigenvalues are less than unity, which necessarily holds provided the system is stable. The geometric sum yields
+
+$$
+\left(\sum_ {n = 0} ^ {t - 1} \mathbf {A} ^ {n}\right) = (\mathbf {I} - \mathbf {A}) ^ {- 1} \left(\mathbf {I} - \mathbf {A} ^ {t}\right). \tag {65}
+$$
+
+Recalling the definition of $\pmb{b} = \sigma^2\eta^2\pmb{\lambda}$ and the definition of the average loss $\langle L_t\rangle = \pmb{\lambda}^\top \pmb{c}_t$ , we have
+
+$$
+\left\langle L _ {t} \right\rangle = \sigma^ {2} + \boldsymbol {\lambda} ^ {\top} \mathbf {A} ^ {t} \boldsymbol {c} _ {0} + \eta^ {2} \sigma^ {2} \boldsymbol {\lambda} ^ {\top} \left(\mathbf {I} - \mathbf {A}\right) ^ {- 1} \left(\mathbf {I} - \mathbf {A} ^ {t}\right) \boldsymbol {\lambda}. \tag {66}
+$$
+
+Recognizing $c_0 = \mathbf{v}^2$ gives the desired result.
+
+# I PROOF OF THEOREM 5
+
+We will now prove that if the training $\hat{p}(\mathbf{x})$ and test distributions $p(\mathbf{x})$ are different and have feature correlation matrices $\hat{\Sigma}$ and $\boldsymbol{\Sigma}$ respectively, then the average training and test losses have the form
+
+$$
+L _ {\text {t r a i n}} = \operatorname {T r} \left[ \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t} \right] L _ {\text {t e s t}} = \operatorname {T r} \left[ \boldsymbol {\Sigma} \mathbf {C} _ {t} \right]. \tag {67}
+$$
+
+As before, we will assume that there exist weights $\mathbf{w}^*$ which satisfy $y = \mathbf{w}^{*}\cdot \boldsymbol{\psi}$ . We start by noticing that the update rule for gradient descent
+
+$$
+\mathbf {w} _ {t} = \mathbf {w} _ {t} - \eta \mathbf {g} _ {t}, \mathbf {g} _ {t} = \frac {1}{m} \sum_ {\mu = 1} ^ {m} \psi_ {t, \mu} \psi_ {t, \mu} ^ {\top} [ \mathbf {w} _ {t} - \mathbf {w} ^ {*} ] \tag {68}
+$$
+
+generates the following dynamics for the weight discrepancy correlation $\mathbf{C}_t = \left\langle (\mathbf{w}_t - \mathbf{w}^*)(\mathbf{w}_t - \mathbf{w}^*)^\top \right\rangle_{\mathcal{D}_t}$ .
+
+$$
+\mathbf {C} _ {t + 1} = \mathbf {C} _ {t} - \eta \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t} - \eta \mathbf {C} _ {t} \hat {\boldsymbol {\Sigma}} + \eta^ {2} \left(1 - \frac {1}{m}\right) \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t} \hat {\boldsymbol {\Sigma}} + \frac {\eta^ {2}}{m} \left\langle \psi \psi^ {\top} \mathbf {C} _ {t} \psi \psi^ {\top} \right\rangle \tag {69}
+$$
+
+This formula can be obtained through the simple averaging procedure shown in B. Under the Gaussian approximation, we can obtain a simplification
+
+$$
+\mathbf {C} _ {t + 1} = (\mathbf {I} - \eta \boldsymbol {\Sigma}) \mathbf {C} _ {t} (\mathbf {I} - \eta \boldsymbol {\Sigma}) + \frac {\eta^ {2}}{m} \left[ \boldsymbol {\Sigma} \mathbf {C} _ {t} \boldsymbol {\Sigma} + \boldsymbol {\Sigma} \mathrm {T r} \boldsymbol {\Sigma} \mathbf {C} _ {t} \right] \tag {70}
+$$
+
+We can solve for the evolution of the diagonal and off-diagonal entries in this matrix giving
+
+$$
+\mathbf {u} _ {k} ^ {\top} \mathbf {C} _ {t} \mathbf {u} _ {k} = \left[ \mathbf {A} ^ {t} \boldsymbol {v} ^ {2} \right] _ {k}, \mathbf {u} _ {k} ^ {\top} \mathbf {C} _ {t} \mathbf {u} _ {\ell} = \left(1 - \eta \hat {\lambda} _ {k} - \eta \hat {\lambda} _ {\ell} + \eta^ {2} \left(1 + \frac {1}{m}\right) \hat {\lambda} _ {k} \hat {\lambda} _ {\ell}\right) ^ {t} v _ {k} v _ {\ell} \tag {71}
+$$
+
+To calculate the training and test error, we have
+
+$$
+\begin{array}{l} \left\langle L _ {\text {t e s t}} \right\rangle = \left\langle \left(\boldsymbol {\psi} (\mathbf {x}) \cdot \mathbf {w} _ {t} - \boldsymbol {\psi} (\mathbf {x}) \cdot \boldsymbol {w} ^ {*}\right) ^ {2} \right\rangle_ {\mathbf {x} \sim p (\mathbf {x}), \mathcal {D} _ {t}} = \left\langle \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) \boldsymbol {\Sigma} \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) \right\rangle = \operatorname {T r} \boldsymbol {\Sigma} \mathbf {C} _ {t}. \\ \left\langle L _ {\text {t r a i n}} \right\rangle = \left\langle \left(\boldsymbol {\psi} (\mathbf {x}) \cdot \mathbf {w} _ {t} - \boldsymbol {\psi} (\mathbf {x}) \cdot \boldsymbol {w} ^ {*}\right) ^ {2} \right\rangle_ {\mathbf {x} \sim \hat {p} (\mathbf {x}), \mathcal {D} _ {t}} = \left\langle \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) \hat {\boldsymbol {\Sigma}} \left(\mathbf {w} _ {t} - \mathbf {w} ^ {*}\right) \right\rangle = \operatorname {T r} \hat {\boldsymbol {\Sigma}} \mathbf {C} _ {t}. \tag {72} \\ \end{array}
+$$
+
+Note that in the training error formula, since $\hat{\Sigma}$ has eigenvectors $\mathbf{u}_k$ only the diagonal terms $\mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_k$ enter into the formula for $L_{train}$ , but off-diagonal components $\mathbf{u}_k^\top \mathbf{C}_t\mathbf{u}_\ell$ do enter into the formula for $L_{test}$
+
+# J EXPERIMENTAL DETAILS
+
+For Figures 3, we use the last two classes of MNIST and CIFAR-10. We encode the target values as binary $y \in \{+1, -1\}$ . For Figure 5, we use 6000 random training points drawn from entire MNIST and CIFAR-10 datasets to calculate the spectrum of the Fisher information matrix. We train with SGD on these training data, using one-hot label vectors for each training example and plot the error on the test set. We train our models on a Google Colab GPU and include code to reproduce all experimental results in the supplementary materials. To match our theory, we use fixed learning rate SGD. Both evaluation of the infinite width kernels and training were performed with the Neural Tangents API (Novak et al., 2020).
\ No newline at end of file
diff --git a/learningcurvesforsgdonstructuredfeatures/images.zip b/learningcurvesforsgdonstructuredfeatures/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..f38c748a07f32859eb1e23956df22da782679948
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:65c5a6c07a5c67dd4c2f5a0bb4a202e5207037c2c24b06e420b5123cb370a657
+size 854902
diff --git a/learningcurvesforsgdonstructuredfeatures/layout.json b/learningcurvesforsgdonstructuredfeatures/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a85527a05e1ae2d0a7623d33cc3a067b7d247c36
--- /dev/null
+++ b/learningcurvesforsgdonstructuredfeatures/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:64faeeace3e39bd040d7a871e7eb2e4f748af706072747f935ff4ecebca64951
+size 988017
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_content_list.json b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1f9f210455c80bedd00a13045dba31d398d65dbb
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f3e898d348447a64fd66c90a35056f1c038267bc5d3083299f9d4225fe7c322
+size 116927
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_model.json b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7631e76c5e4569a6352484fec3f7c4e9a484b5de
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0ca97c647765c7f387758c02f93bd3ed6bdf5c150608185a523708acae032c7
+size 140251
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_origin.pdf b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ca199c4139775cd7b5ec4f455ac7165cbc2123f8
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/4a0c1e5f-5b3e-487a-872c-f172e4bcbb16_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2070a9acc776e3d013b4f3868db95ae9ea2e8b8e6f289babe7674cca0597e372
+size 991731
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/full.md b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..e2ef80d0bc3eca53b7d8b6e7da3b31d3cf389df8
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/full.md
@@ -0,0 +1,519 @@
+# LEARNING DISCRETE STRUCTURED VARIATIONAL AUTO-ENCODER USING NATURAL EVOLUTION STRATEGIES
+
+Alon Berliner
+
+Technion, IIT
+
+alon.berliner@gmail.com
+
+Guy Rotman
+
+Technion, IIT
+
+rotmanguy@gmail.com
+
+Yossi Adi
+
+Meta AI Research
+
+adiyoss@fb.com
+
+Roi Reichart
+
+Technion, IIT
+
+roiri@technion.ac.il
+
+Tamir Hazan
+
+Technion, IIT
+
+tamir.hazan@technion.ac.il
+
+# ABSTRACT
+
+Discrete variational auto-encoders (VAEs) are able to represent semantic latent spaces in generative learning. In many real-life settings, the discrete latent space consists of high-dimensional structures, and propagating gradients through the relevant structures often requires enumerating over an exponentially large latent space. Recently, various approaches were devised to propagate approximated gradients without enumerating over the space of possible structures. In this work, we use Natural Evolution Strategies (NES), a class of gradient-free black-box optimization algorithms, to learn discrete structured VAEs. The NES algorithms are computationally appealing as they estimate gradients with forward pass evaluations only, thus they do not require to propagate gradients through their discrete structures. We demonstrate empirically that optimizing discrete structured VAEs using NES is as effective as gradient-based approximations. Lastly, we prove NES converges for non-Lipschitz functions as appear in discrete structured VAEs.
+
+# 1 INTRODUCTION
+
+Discrete variational auto-encoders (VAEs) are able to represent structured latent spaces in generative learning. Consequently VAEs drive extensive research in machine learning applications, including language classification and generation [60, 17, 54, 9, 13], molecular synthesis [28, 15, 48], speech and visual understanding [36, 55, 3]. Compared to their continuous counterparts, they can improve interpretability by illustrating which terms contributed to the solution [48, 40], and they can facilitate the encoding of inductive biases in the learning process, such as images consisting of a small number of objects [12] or tasks requiring intermediate alignments [36, 42, 1, 2].
+
+Learning VAEs with discrete $n$ -dimensional latent variables is computationally challenging since the size of the support of the posterior distribution may be exponential in $n$ . This is particularly common under the structured settings, when the latent variables represent complex structures such as trees or graphs. The Gumbel-max reparametrization trick trades enumeration with optimization using efficient dynamic programming algorithms and enables a computation of the model value. Unfortunately, the resulting mapping remains non-differentiable due to the presence of arg max operations. In order to propagate gradients efficiently, Jang et al. [19], Maddison et al. [34] proposed the Gumbel-softmax reformulation that uses a smooth relaxation of the reparametrized objective, replacing the arg max operation with a softmax operation. Following such an approach may bring back the need for enumerating over a large search space. This is due to the partition function of the softmax operator, which relies on a summation over all possible latent assignments, which may be exponential in $n$ . To better deal with the computational complexity in the structured setting, sophisticated stochastic softmax tricks were devised to learn discrete structured VAEs [48] (e.g., perturb-and-parse for dependency parsing by [9], Gumbel-Sinkhorn for bi-partite matching [36]).
+
+In this work we propose to use the Natural Evolution Strategy (NES) [57, 58] algorithm for learning discrete structured VAEs. The NES algorithm is a gradient-free black-box optimization method that does not need to propagate gradients through discrete structures. Instead, the NES algorithm estimates gradients by forward-pass evaluations only. We experimentally show that gradient-free methods are as effective as sophisticated gradient based methods, such as perturb-and-parse. NES is conceptually appealing when considering discrete structured VAEs since NES does not require to construct complex solutions to propagate gradients through the arg max operation, as it only requires to evaluate the model. Moreover, the proposed approach is highly parallelizable, hence computationally appealing.
+
+Our contributions: (1) We suggest using black-box, gradient-free based optimization methods, specifically NES, to optimize discrete structured VAEs. (2) We experimentally demonstrate that NES, which uses the models' output in a black-box manner, is as effective as gradient based approximations although being more general and simpler to use. (3) We rigorously describe the connection between NES and previous gradient based optimization methods (i.e, REINFORCE) as well as prove that the NES algorithm converges for non-Lipschitz functions.
+
+# 2 BACKGROUND
+
+Discrete Structured Variational Auto-Encoders (VAEs) learn a generative model $p_{\theta}(x)$ using a training set $S = \{x_1, \ldots, x_m\}$ , derived from an unknown distribution $p(x)$ by minimizing its negative log-likelihood. VAEs rely on latent variable models of the form $p_{\theta}(x) = \sum_{z \in \mathcal{Z}} p_{\theta}(z) p_{\theta}(x|z)$ , where $z$ is a realization of the latent variable and $\mathcal{Z}$ is the discrete set of its possible assignments. We focus on discrete structures such as spanning trees in a graph $G = (V, E)$ , i.e., $z = (z_1, \dots, z_{|E|})$ represents a spanning tree $T$ for which $z_e = 1$ if the edge $e \in T$ belongs to the spanning tree $T$ and zero otherwise. In this case, $\mathcal{Z}$ is the spanning trees space which is typically exponential in the size of the input, as there are $|V|^{|V| - 2}$ spanning trees for a complete graph with $|V|$ vertices.
+
+VAEs rely on an auxiliary distribution $q_{\phi}(z|x)$ that is used to upper bound the negative log-likelihood of the observed data points: $\sum_{x \in S} -\log p_{\theta}(x) \leq \sum_{x \in S} L(\theta, \phi, x)$ , where: $L(\theta, \phi, x) = -\mathbb{E}_{z \sim q_{\phi}(\cdot|x)}[\log p_{\theta}(x|z)] + KL(q_{\phi}(\cdot|x)||p_{\theta}(\cdot))$ . This formulation is known as the negative Evidence Lower Bound (ELBO) [20], where the KL-divergence measures the similarity of two distributions $q_{\phi}$ and $p_{\theta}$ , and is defined as: $KL(q_{\phi}(\cdot|x)||p_{\theta}(\cdot)) = \mathbb{E}_{z \sim q_{\phi}(\cdot|x)}[\log (q_{\phi}(z|x)/p_{\theta}(z))]$ .
+
+Parameter estimation is generally carried out by performing gradient descent on $\sum_{x\in S}L(\theta ,\phi ,x)$ In the discrete VAE setting, the first term admits an analytical closed form gradient:
+
+$$
+\frac {\partial \mathbb {E} _ {z \sim q _ {\phi} (\cdot | x)} [ \log p _ {\theta} (x | z) ]}{\partial \phi} = \mathbb {E} _ {z \sim q _ {\phi} (\cdot | x)} \left[ \log p _ {\theta} (x | z) \frac {\partial \log q _ {\phi} (z | x)}{\partial \phi} \right]. \tag {1}
+$$
+
+An exact computation of the expectation requires enumeration over all possible latent assignments since $\mathbb{E}_{z\sim q_{\phi}(\cdot |x)}[\log p_{\theta}(x|z)] = \sum_{z\in \mathcal{Z}}q_{\phi}(z|x)\log p_{\theta}(x|z)$ . Unfortunately, in the structured setting, the number of possible latent assignments is exponential. Instead, one can rely on the score function estimator (REINFORCE) to generate an unbiased estimate of the gradient by sampling from the distribution over the latent space. In many cases of interest, such as sampling spanning trees, the sampling algorithm is computationally unfavorable and suffers from high variance, leading to slow training and poor performance [46].
+
+The Gumbel-Max reparametrization trick can trade summation with optimization. This approach is computationally appealing when considering spanning trees, since finding a maximal spanning tree is more efficient than sampling a spanning tree. Consider i.i.d. zero-location Gumbel random variables $\gamma \sim \mathcal{G}(0)$ , e.g., in the case of spanning trees $\gamma = (\gamma_{1},\dots,\gamma_{|E|})$ consists of an independent random variable for each edge in the graph. Let $q_{\phi}(z|x) = e^{z^\top h_{\phi}(x)}$ where $h_\phi (x)$ is a parametric encoder that learns edge scores and $p_{\theta}(x|z) = e^{f_{\theta}(x,z)}$ , where $f_{\theta}(x,z)$ denotes the log-probability learned by a parametric decoder. Then, the summation $\sum_{z\in \mathcal{Z}} - q_{\phi}(z|x)\log p_{\theta}(x|z)$ can be approximated by the expectation
+
+$$
+\mathbb {E} _ {\gamma \sim \mathcal {G} \left(h _ {\phi} (x)\right)} \left[ - f _ {\theta} \left(x, \arg \max _ {z \in \mathcal {Z}} \left\{z ^ {\top} \gamma \right\}\right) \right]. \tag {2}
+$$
+
+We provide the derivation in Appendix C. This formulation is a key to our proposed approach, as in some cases, estimating the above equation is easier. Computing the arg max can be accomplished
+
+efficiently even when the latent space is exponentially large. It is performed by utilizing sophisticated MAP solvers. For instance, finding the maximum spanning tree can be achieved in polynomial run time using Kruskal's algorithm [27]. Sampling by perturbing the input and feeding it to a MAP solver is called perturb-and-map [47]. The gradient of Eq. 2 can be estimated using REINFORCE without needing to relax the arg max operator. By reparametrizing the Gumbel distribution, we get:
+
+$$
+\frac {\partial \mathbb {E} _ {\gamma \sim \mathcal {G} (h _ {\phi} (x))} \left[ f _ {\theta} \left(x , \arg \max _ {z \in \mathcal {Z}} \left\{z ^ {\top} \gamma \right\}\right) \right]}{\partial \phi} = \mathbb {E} _ {\gamma \sim \mathcal {G} (h _ {\phi} (x))} \left[ f _ {\theta} (x, \arg \max _ {z \in \mathcal {Z}} \left\{z ^ {\top} \gamma \right\}) \frac {\partial \log \mathcal {G} (h _ {\phi} (x)) (\gamma)}{\partial \phi} \right]. \tag {3}
+$$
+
+Where $\mathcal{G}(h_{\phi}(x))$ denotes the probability density function (PDF) of the Gumbel distribution with a location parameter of $h_\phi (x)$ . The exponential summation in Eq. 1 is replaced with optimization, and now samples can be derived efficiently by applying the perturb-and-map technique. On the other hand, the disadvantages of REINFORCE remain as they were.
+
+The Gumbel-Softmax trick is a popular approach to reparameterize and optimize Eq. 2. Since $\mathbb{E}_{\gamma \sim \mathcal{G}(h_{\phi}(x))}\left[f_{\theta}(x,\arg \max_{z\in \mathcal{Z}}\{z^{\top}\gamma\})\right] = \mathbb{E}_{\gamma \sim \mathcal{G}(0)}\left[f_{\theta}(x,\arg \max_{z\in \mathcal{Z}}\{z^{\top}(h_{\phi}(x) + \gamma)\})\right]$ , one can apply the Softmax to replace the non-differential arg max function. Hence, the Gumbel-Softmax trick replaces the function $\arg \max_{z\in \mathcal{Z}}\{z^{\top}(h_{\phi}(x) + \gamma)\}$ with the differential softmax function $\frac{e^{z^{\top}(h_{\phi}(x) + \gamma)}}{\sum_{z\in\mathcal{Z}}e^{z^{\top}(h_{\phi}(x) + \gamma)}}$ , cf. Jang et al. [19], Maddison et al. [34]. Under the structured setting, sophisticated extensions avoid the exponential summation in the partition function of the softmax operator [9, 36, 48]. For instance, in dependency parsing, Corro & Titov [9] construct the differentiable perturb-and-parse (DPP) method that exploits a differentiable surrogate of the Eisner algorithm [11] for finding the highest-scoring dependency parsing by replacing each local arg max operation with a softmax operation. Alternatively, Paulus et al. [48] utilize the Matrix-Tree theorem [24] for propagating approximated gradients through the space of undirected spanning trees.
+
+Natural Evolution Strategies (NES) is a class of gradient-free optimization algorithms. NES optimizes its objective function, by evaluating it at certain points in the parameter space. Consider a function $k(\mu)$ , may it be non-differentiable nor continuous, instead of optimizing $k(\mu)$ using a gradient method, NES optimizes a smooth version using the expected parameters of the function:
+
+$$
+g (\mu) = \mathbb {E} _ {w \sim \mathcal {N} (\mu , \sigma^ {2} I)} [ k (w) ] = \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi \sigma^ {2}) ^ {\frac {d}{2}}} e ^ {- \frac {\| w - \mu \| ^ {2}}{2 \sigma^ {2}}} k (w) d w. \tag {4}
+$$
+
+Here $\mathcal{N}(\mu, \sigma^2 I)$ is a Gaussian distribution with mean $\mu$ and covariance $\sigma^2 I$ . The expectation with respect to the Gaussian ensures the function $g(\mu)$ is differentiable, since $e^{-\frac{\|w - \mu\|^2}{2\sigma^2}}$ is differentiable of any order, although $k(\mu)$ may not be differentiable. Following the chain-rule, the score function estimator for the Gaussian distribution determines the gradient:
+
+$$
+\frac {\partial g (\mu)}{\partial \mu} = \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi \sigma^ {2}) ^ {\frac {d}{2}}} e ^ {- \frac {\| w - \mu \| ^ {2}}{2 \sigma^ {2}}} \left(\frac {w - \mu}{\sigma^ {2}}\right) k (w) d w. \tag {5}
+$$
+
+That is, NES is an instance of REINFORCE, which optimizes a smoothed version of $k(\mu)$ by sampling from a distribution over parameter space rather than latent space. The reparameterization trick allows to further simplify the gradient estimator, with respect to a standard normal distribution:
+
+$$
+\frac {\partial g (\mu)}{\partial \mu} = \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} \left(\frac {w}{\sigma}\right) k (\mu + \sigma w) d w = \mathbb {E} _ {w \sim \mathcal {N} (0, I)} \left[ \frac {w}{\sigma} k (\mu + \sigma w) \right]. \tag {6}
+$$
+
+The gradient can be estimated by sampling $w$ repeatedly from a standard Gaussian: $\frac{\partial g(\mu)}{\partial \mu} \approx \frac{1}{N} \sum_{i=1}^{N} \frac{w_i}{\sigma} k(\mu + \sigma w_i)$ . The obtained estimator is biased when $\sigma > 0$ . However, the bias approaches 0 as $\sigma \to 0$ . In practice, $\sigma$ is assigned a small value, treated as a hyper-parameter.
+
+This algorithm is computationally appealing as it only uses the evaluations of $k(\cdot)$ to compute the gradient of $g(\cdot)$ . Moreover, NES is highly parallelizable, i.e., one can compute the gradient $\nabla g(\mu)$ at the time of evaluating a single $k(\mu + \sigma w_i)$ , in parallel for all $i = 1, \dots, N$ , and then average these parallel computations [52]. Figure 1 depicts the parallel forward passes and the update rule according to NES.
+
+Theoretical guarantees regarding the convergence of gradient-free methods such as NES, were established for Lipschitz functions by Nesterov & Spokoiny [41]. In Section 3, we extend the current zero-order optimization theory by presenting a convergence bound for NES over non-Lipschitz and bounded functions.
+
+
+Figure 1: NES perturbs the parameters of a black-box model $k(\mu)$ for $N$ times via $w$ , $\sigma$ and performs parallel forward passes. Then, the model parameters are updated given the gradient estimation.
+
+# 3 STRUCTURED VAE OPTIMIZATION USING NES
+
+In this work we suggest using gradient-free based method for learning discrete structured VAEs. Specifically, we propose using NES to optimize discrete structured VAEs without the need to propagate gradients through their latent discrete structures. For readability, we consider a concatenation of both $\theta$ and $\phi$ as $\mu = [\theta ;\phi ]$ where $^{\ddagger}$ is the concatenation operation. For notational convenience, we refer $\theta$ as $\mu_{1}$ and $\phi$ as $\mu_{2}$ .
+
+Combining the discrete VAE objective function in Eq. 2, which is a non-continuous function due to the arg max operation and hence, non-Lipschitz, together with the NES objective in Eq. 4 (i.e., setting $k(\mu) = L(\mu, x)$ ) we get the following smooth approximation by setting $g(\mu)$ to be:
+
+$$
+\mathbb {E} _ {w \sim \mathcal {N} \left(\mu , \sigma^ {2} I\right)} \mathbb {E} _ {\gamma \sim \mathcal {G} \left(h _ {w _ {2}} (x)\right)} \left[ - f _ {w _ {1}} \left(x, \arg \max _ {z \in \mathcal {Z}} \left\{z ^ {\top} \gamma \right\}\right) \right], \tag {7}
+$$
+
+where $w = [w_{1};w_{2}]$ is the concatenation of vectors $w_{1},w_{2}$ that denotes the decoder and encoder parameters respectively. Our goal is to minimize Eq. 7. Following the NES setup, we use Eq. 6 with a simplified notation to better emphasize the smoothing of $\mu$ . Overall its gradient takes the form of:
+
+$$
+\mathbb {E} _ {w \sim \mathcal {N} (0, I)} \mathbb {E} _ {\gamma \sim \mathcal {G} \left(h _ {\mu_ {2} + \sigma w _ {2}} (x)\right)} \left[ - \frac {w}{\sigma} f _ {\mu_ {1} + \sigma w _ {1}} \left(x, \arg \max _ {z \in \mathcal {Z}} \left\{z ^ {\top} \gamma \right\}\right) \right]. \tag {8}
+$$
+
+We provide the pseudo code for using the NES algorithm to optimize discrete VAEs, together with their gradient update rule on Algorithm 1. We estimate the NES gradient in Eq. 8 by sampling $w \sim N(0, I)$ and $\gamma \sim \mathcal{G}(h_{\mu_2 + \sigma w_2}(x))$ , which in turn induces a sampling of discrete structures $\arg \max_{z \in \mathcal{Z}} \{ z^\top \gamma \}$ . This sampling procedure differs from that of the REINFORCE instances described in Eq. 1 and Eq. 3, as the samples of NES are tied to the sensitivity of the scoring function $h_{\mu_2 + \sigma w_2}(x)$ , i.e., to a random perturbation of its parameters $\mu_2$ by $\sigma w_2$ . In contrast, the samples of REINFORCE are proportional to the scoring function $h_{\mu_2}(x)$ itself. In our experimental validation, we empirically demonstrate that NES has a lower variance.
+
+Theoretical Guarantees. Next, we prove NES converges for a non-Lipschitz function $k(\cdot)$ , which appears in reparameterized discrete VAEs in Eq. 2. In particular, we show that the norm of the parameters' gradient can be arbitrarily small as training progresses. More formally, when the NES algorithm performs $T$ update rules to the parameters $\mu$ , it generates the sequence $\mu^{(1)}, \mu^{(2)}, \dots, \mu^{(T)}$ and for a sufficiently large $T$ , there exists $t \in \{1, \dots, T\}$ for which $\| \nabla g(\mu^{(t)}) \|$ is arbitrarily small.
+
+For mathematical simplicity, we prove our convergence theorem on the expected gradient, as described in Eq. 8: $\mu^{(t + 1)}\gets \mu^{(t)} - \eta \nabla g(\mu^{(t)})$ . To easily address $\| \nabla g(\mu^{(t)})\|$ one usually considers the difference $\mu^{(t + 1)} - \mu^{(t)}$ using the remainder of the Taylor series: $g(\mu^{(t + 1)}) - g(\mu^{(t)}) = \nabla g(\mu^{(t)})^{\top}(\mu^{(t + 1)} - \mu^{(t)}) + \frac{1}{2} (\mu^{(t + 1)} - \mu^{(t)})^{\top}\nabla^{2}g(\hat{\mu})(\mu^{(t + 1)} - \mu^{(t)})$ , where $\hat{\mu}\in [\mu^{(t)},\mu^{(t + 1)}]$ . Here we denote by $\nabla^2 g(\hat{\mu})$ the Hessian of $g(\hat{\mu})$ . Applying the gradient update rule, we obtain the following equation:
+
+$$
+g \left(\mu^ {(t + 1)}\right) - g \left(\mu^ {(t)}\right) = - \eta \| \nabla g \left(\mu^ {(t)}\right) \| ^ {2} + \frac {\eta^ {2}}{2} \nabla g \left(\mu^ {(t)}\right) ^ {\top} \nabla^ {2} g (\hat {\mu}) \nabla g \left(\mu^ {(t)}\right). \tag {9}
+$$
+
+A bound for $\nabla g(\mu^{(t)})^\top \nabla^2 g(\hat{\mu})\nabla g(\mu^{(t)})$ is a key to our convergence theorem. Our bound relies on the fact that the discrete VAE objective, which is given in Eq. 2, is a non-negative function that is continuous almost everywhere.
+
+Algorithm 1 Natural Evolution Strategies for discrete VAEs
+Input: Initial parameters $\mu$
+repeat
+for all $i = 1$ to $N$ do Sample $\tilde{w}_i\sim \mathcal{N}(0,I_{|\mu |})$ Evaluate $u_{i} = \mathbb{E}_{\gamma \sim \mathcal{G}(h_{\mu_{2} + \sigma}\bar{w}_{2,i}(x))}\Big[-f_{\mu_{1} + \sigma}\bar{w}_{1,i}(x,\arg \max_{z\in \mathcal{Z}}\{z^{\top}\gamma \})\Big]$
+end for Update $\mu \gets \mu -\eta \cdot \frac{1}{N}\sum_{i = 1}^{N}\frac{\tilde{w}_i}{\sigma} u_i$
+until a stopping condition is met
+
+Lemma 1. Let $k: \mathbb{R}^d \to [0, M]$ be a non-negative function that is continuous almost everywhere and let $g(\mu) = \mathbb{E}_{w \sim \mathcal{N}(\mu, \sigma^2 I)}[k(w)]$ . Then for any $\mu_1, \mu_2$ there holds:
+
+$$
+\nabla g \left(\mu_ {1}\right) ^ {\top} \left(\nabla^ {2} g \left(\mu_ {2}\right)\right) \nabla g \left(\mu_ {1}\right) \leq \frac {d M ^ {3}}{\sigma^ {4}}. \tag {10}
+$$
+
+Proof can be found in Appendix A.1. The above lemma together with Eq. 9 imply the following bound: $g(\mu^{(t + 1)}) - g(\mu^{(t)}) \leq -\eta \| \nabla g(\mu^{(t)})\| ^2 + \eta^2\frac{dM^3}{2\sigma^4}$ . By summing over all algorithm steps $t = 1,\dots,T$ we show that the average norm of the gradient can be arbitrarily small for a sufficiently large $T$ .
+
+Theorem 1. Under the conditions of Lemma 1 there holds:
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla g \left(\mu^ {(t)}\right) \| ^ {2} \leq \frac {M}{\eta T} + \frac {\eta d M ^ {3}}{2 \sigma^ {4}}. \tag {11}
+$$
+
+Moreover, when setting $\eta = \sqrt{\frac{2\sigma^4}{TdM^2}}$ then: $\frac{1}{T}\sum_{t=1}^{T}\|\nabla g(\mu^{(t)})\|^2 \leq \sqrt{\frac{2dM^4}{T\sigma^4}}$ .
+
+Therefore, there exists $t$ for which $\| \nabla g(\mu^{(t)})\| ^2\leq \sqrt{\frac{2dM^4}{T\sigma^4}}$
+
+Proof is given in Appendix A.2. Intuitively, the above theorem proves that the NES algorithm converges on discrete VAE to a stationary point, even when the original function $k(\cdot)$ is non-continuous and hence non-Lipschitz. This is in contrast to the contemporary trend that relies on Lipschitz functions [41]. Instead, we rely on the non-negativity of the discrete VAE objective. We note that a stationary point of $g(\mu) = \mathbb{E}_{w\sim \mathcal{N}(\mu ,\sigma^2 I)}[k(w)]$ is not necessarily a stationary point of $k(\mu)$ . Nevertheless, since $\lim_{\sigma \to 0}g(\mu) = k(\mu)$ almost everywhere, except perhaps for non-continuous points, a low value of $g(\mu)$ is correlated with a low value of $k(\mu)$ .
+
+# 4 EXPERIMENTS
+
+We start by experimentally validating our approach by learning discrete structured VAEs for latent structure recovery in Section 4.1 and dependency parsing in Section 4.2. Next, in Section 4.3 we analyze how NES scales with the latent space dimension and neural network size. We additionally provide an analysis for non-Lipschitz functions in Appendix B, together with analyzing the results concerning the theoretical guarantees as presented in Section 3.
+
+In our experiments, we use a variance reduction technique called mirrored sampling [14, 4]: that is, on each NES iteration, we use a single Gaussian noise vector $w$ to create two parameter sets, one by adding and the other by subtracting the noise vector. Thus, on each iteration, we sample $\frac{N}{2}$ Gaussian noise vectors where $N$ is the number of the VAE parameter sets utilized for estimating the NES update direction. Additionally, to make NES more robust and scale-invariant, we transform the outputs of the perturbed forward passes into standard scores by subtracting their mean and dividing them by the standard deviation. All reported values are measured on a test set, and the models were selected using early stopping on the validation set. All the following experiments were conducted using an internal cluster with 4 Tesla-K80 NVIDIA GPUs.
+
+# 4.1 LATENT STRUCTURE RECOVERY
+
+We begin by demonstrating the capability of NES to learn the internal structure of an interacting system based on graphs in an unsupervised fashion. The interplay of group components, e.g., basketball players on the court or a flock of birds during migration, can often be explained using a
+
+Table 1: The mean and standard deviation of the ELBO and structure recovery metrics. NES outperforms the five different baselines in terms of structure recovery and presents a negligible standard deviation, which reflects its robustness.
+
+| Method | Spanning Tree | n-1 Individual Edges |
| ELBO ↑ | Edge F1-Score ↑ | ELBO ↑ | Edge F1-Score ↑ |
| REINFORCE (Batch) | -2260 ± 0 | 41 ± 1 | -2180 ± 0 | 39 ± 1 |
| REINFORCE (EMA) | -2250 ± 20 | 40 ± 7 | -2170 ± 10 | 42 ± 1 |
| REINFORCE (Multi-sample) | -2230 ± 20 | 42 ± 1 | -2150 ± 10 | 40 ± 0 |
| NVIL | -1570 ± 300 | 83 ± 20 | -2110 ± 10 | 42 ± 2 |
| SST | -1080 ± 110 | 91 ± 3 | -2100 ± 20 | 41 ± 1 |
| NES (Ours) | -1117 ± 45 | 92 ± 0.2 | -2150 ± 10 | 44 ± 0.6 |
+
+simple structure. However, frequently, we only have access to individual trajectories without knowledge of the underlying interactions. The Neural Relational Inference (NRI) model [23], which we base on, is designed to infer these interactions purely from observational data. NRI takes the form of a VAE, where the encoder produces a distribution over the space of interaction structures given the component trajectories, and the reconstruction is based on graph neural networks.
+
+In our experiments, we utilize the dataset developed by Paulus et al. [48], where the target structure is a spanning tree over 10 vertices (each vertex represents an individual component). The model attempts to learn the true tree structure that defines the interplay among the group by only observing the locations of the 10 components during several timesteps. We focus on two cases, as suggested by Paulus et al. [48]. In the first case, we use our prior knowledge regarding the true structures and define the latent space as the space of spanning trees over a 10-nodes undirected graph, which consists of $10^{8}$ possible spanning trees. In the second more challenging case, we remove the tree constraint and consider all possible $n - 1$ unique edge combinations as the latent space, where $n$ denotes the number of vertices. The ability to recover the underlying structure is measured as the edge F1-score against the target spanning tree.
+
+In each of the two cases, we compare NES with the corresponding Stochastic Softmax Trick (SST) [48]. SSTs are the generalization of the Gumbel-Softmax Trick (GSM) for combinatorial discrete distributions. That is, in contrast to GSM, SSTs are designed to optimize over exponentially large discrete spaces. We run our experiments with the same set of parameters as in Paulus et al. [48], except that during decoding we use teacher-forcing every 3 steps instead of 9 steps. We fix NES parameters to be $\sigma = 0.01$ and $N = 600$ . We additionally compared our method against four instances of REINFORCE. Each utilizes a different variance reduction technique. The first is NVIL [39], which uses two control variates. The remaining three reduce variance by subtracting the following control variate from the learning signal: EMA uses the exponential moving average of the ELBO, Batch uses the mean ELBO of the current mini-batch, and lastly, Multi-sample, which is especially well suited for structured prediction [25, 26], uses the mean ELBO over $r$ multiple samples per data point. Paulus et al. [48] tuned $r$ on the set of $\{2, 4, 8\}$ . Results are listed in Table 1.
+
+In terms of structure recovery, the gradient-free NES outperforms all REINFORCE instances. Moreover, when considering SST, NES achieves superior edge F1-score with slightly worse ELBO values. This is surprising since SST is a gradient-based method that generalizes the effective GSM estimator to combinatorial spaces. Also, unlike SST, which requires a carefully tailored solution for each structure, NES is simple and generic. For a fair comparison with NES, we also ran the Multi-sample method with 400 Monte Carlo samples per data point and a mini-batch size of 4 (as using larger $r$ or larger mini-batch size has exceeded the GPU memory limit). However, the results were inferior to those achieved by tuning $r$ on $\{2, 4, 8\}$ . This is in line with the results obtained by Kool et al. [25], where larger values of $r$ led to inferior results. Thus, it can be concluded that even with an equal computational cost, the REINFORCE instances are inferior to NES.
+
+# 4.2 DEPENDENCYPARSING
+
+Next, we evaluate the capability of NES in learning latent projective and non-projective dependency parse trees as part of an unsupervised domain adaptation task. Unlike Section 4.1, where we focused on structures over undirected edges, here we focus on dependency trees which are rooted directed spanning trees. Our model is based on a VAE architecture similar to that of differentiable perturb-and-parse (DPP) [9]. The encoder is comprised of a graph-based parser [22] that decomposes the
+
+Table 2: Unlabeled attachment scores for unsupervised domain adaptation. The column name represents the setup where the treebank is set to be the target domain. For each of the two tasks, NES achieves the best UAS performance on 5 out of the 6 target domains.
+
+| Method | GL_CTG | GL_TREEGAL | ID_CSUI | ID_GSD | RU_GSD | RU_TAIGA | Projective |
| DPP | 68.72 | 71.39 | 68.23 | 71.71 | 71.46 | 69.94 | ✓ |
| NES (Ours) | 68.92 | 71.64 | 68.28 | 71.41 | 71.82 | 70.52 | ✓ |
| SparseMAP | 68.57 | 70.61 | 68.23 | 70.56 | 70.99 | 69.96 | ✗ |
| NES (Ours) | 68.67 | 70.98 | 68.28 | 70.47 | 71.01 | 69.96 | ✗ |
+
+score of a tree to the sum of the scores of its arcs and produces a distribution over the space of dependency trees. Sampling from the latent space is performed using the "perturb-and-map" technique, where each arc score is perturbed independently with a noise derived from a Gumbel distribution. Then, the perturbed arc scores are fed into a MAP solver, which outputs the highest-scoring tree (the resulting sample). For projective dependency parsing, we utilize the Eisner algorithm [11] as the MAP solver. Similarly, for non-projective dependency parsing, we use the Chu-Liu-Edmonds (CLE) algorithm [6, 10]. The decoder is modeled as a language model, that given a latent dependency tree, attempts to reconstruct the input sentence.
+
+We compare NES with two strong baselines. For projective dependency parsing, we consider the DPP model. DPP optimizes the VAE by utilizing a differentiable surrogate of the Eisner algorithm. In that manner, it tackles both the differentiability and exponential enumeration issues. In fact, DPP can be seen as a Stochastic Softmax Trick (SST). For non-projective dependency parsing, we consider SparseMAP [43] as a baseline by replacing the CLE algorithm with a SparseMAP layer. SparseMAP uses the active set method that performs sequential calls to a MAP solver and returns a sparse linear combination of several high-scoring structures. This procedure is differentiable almost everywhere but computationally inefficient due to its sequential nature. Unlike these methods, NES does not require any modification to the architecture.
+
+We perform extensive experiments on the task of unsupervised domain adaptation for dependency parsing. We consider the Universal Dependencies (UD) dataset [35, 44, 45]. UD is a multilingual corpus annotated with dependency trees in more than 180 treebanks of over 100 languages. We follow the setup of Rotman & Reichart [50] and choose 3 distinct languages, considering 2 distinct treebanks from different domains for each: Galician (GL_CTG: science and legal, GL_TREEGAL: news), Indonesian (ID_CSUI: news, ID_GSD: general) and Russian (RU_GSD: general, RU_TAIGA: social media, poetry, and fiction). We conduct 6 domain adaptation experiments, where we alternate between the source and target domain in each language. We consider the training set of our source domain as our labeled dataset and the training set of the target domain as the unlabeled dataset.
+
+At first, we train the VAE components separately on the labeled set (source domain) for 30 epochs. Then, we optimize the pretrained VAE on the unlabeled set (target domain) for 10 additional epochs using the NES algorithm. For a fair comparison, we perform the same training procedure for the above-mentioned baselines. We set the hyper-parameters to those of the original implementation of Kiperwasser & Goldberg [22] and feed the models with the multilingual FastText word embeddings [16]. We perform a grid-search for each of the methods separately over learning rates in $[5 \cdot 10^{-4}, 1 \cdot 10^{-5}]$ and set the mini-batch size to 128. We fix NES parameters to be $\sigma = 0.1$ and $N = 400$ . Adam optimizer [21] is used to optimize all methods. The models we selected were those who obtained the best unlabeled attachment score (UAS) on the source domain validation set.
+
+Table 2 summarizes the results on the UD treebanks in terms of unlabeled attachment score (UAS). The scores under each treebank name reflect performances on the setup where the treebank is set to be the target domain. Results suggest that NES reaches comparable performance (with a minor improvement) to SparseMAP and DPP while being simpler and more flexible to use. Note that unlike SparseMAP and DPP, which use sequentially complex methods to either infer the highest-scoring tree structure or to propagate gradients through a bottleneck dynamic programming algorithm, NES can optimize the model in parallel without the necessity of gradient computations.
+
+# 4.3 SCALABILITY ANALYSIS
+
+Latent space size. In the following set of experiments, we further investigate the properties of NES and the several methods it was compared to in Section 4.1 and 4.2. Specifically, we examine how
+
+
+Figure 2: Wall-clock time as a function of model input size. Experiments are conducted on the NRI model (Left), projective parsing model (Center), and non-projective parsing model (Right). We observe that NES scales well with the latent space size in contrast to most of its competitors.
+
+
+
+
+
+the latent space size affects the method's run-time by measuring the methods wall-clock time of a forward and backward pass as a function of the input dimension (denoted by $n$ ). Note that the latent space size grows exponentially with the model input dimension, e.g., for a sentence of length $n$ , the latent space of the VAE architecture presented in Section 4.2 is the space of all possible dependency trees over an $n$ -nodes directed graph.
+
+For each $n \in \{10, 20, \dots, 250\}$ we create a random dataset. Specifically, for the NRI model (Section 4.1), the input is $n$ trajectories of 10 timesteps derived from a standard Gaussian distribution. We compare the run-time of NES with that of SST and a REINFORCE instance that relies on Eq. 1, where sampling is performed using a Markov chain Monte Carlo (MCMC) algorithm. For the parsing model (Section 4.2), we derive 32 random sentences of length $n$ by randomly sampling words from a vocabulary of size 10000. As DPP utilizes a differentiable surrogate of the Eisner algorithm, it is compared to NES with the Eisner algorithm as the MAP solver. Similarly, SparseMAP is compared to NES with the CLE algorithm. Since our internal cluster consists of 4 GPUs, we utilize NES with $N = 4$ for a fair comparison with the gradient-based methods. Finally, we run the experiments over various random seeds and average the wall-clock time. Figure 2 depicts the results.
+
+As can be seen, the run-times of DPP and SparseMAP heavily rely on the input dimension and grow at a much higher rate than the run-time of NES. NES also scales better than SST and REINFORCE on the NRI model. However, in this case, the gap is smaller as enlarging the input dimension of the latent structure also enlarges the model size which NES updates depend on. Overall, it can be seen that NES scales well with the latent space size in contrast to most of its competitors.
+
+Neural network size. Next, we conduct a study that examines how the enlargement of a neural network affects the number of NES samples needed to optimize it. We begin by optimizing a VAE of 25K parameters, then we enlarge its parameter size by a factor of 2 and optimize the resulting model. We repeat this process several times up to a model of 800K parameters. We utilize SST with a fixed temperature of 1 as a baseline. For each model size, we examine how many NES samples are needed to achieve test ELBO as lower as the one achieved by the SST. Results are depicted in Table 3. A detailed description of the experimental setup can be found on Section B in the Appendix.
+
+We observe that enlarging the neural network by a factor of 2 does not necessarily mean that we should enlarge $N$ in the same manner. To be precise, in all our experiments, we do not need to enlarge $N$ with more than $50\%$ samples when optimizing the two times larger network. These observations are positive and suggest that NES can scale well with the network size.
+
+# 5 RELATED WORK
+
+Jang et al. [19], Maddison et al. [34] proposed the GSM estimator that replaces the non-differentiable arg max operation with a differentiable softmax operation. However, structured latent spaces can be exponentially large and the softmax operation becomes computationally intractable. Other works proposed tailor-maid solutions for specific structures. For instance, Corro & Titov [9] focused on latent projective dependency trees and propagated gradients through a differentiable surrogate of Eisner algorithm [11]. Mena et al. [36] extended the Gumbel-Softmax estimator [19] and proposed the Gumbel-Sinkhorn method for learning latent permutations. Paulus et al. [48] took these ideas one step further and proposed a unified framework for designing structured relaxations of combinatorial
+
+Table 3: ELBO as a function of the neural network size and $N$ . The values in the "Growth in $N$ " column express the percent of additional NES samples (with respect to the preceding step) needed to achieve the baseline performance.
+
+| # Parameters | SST | NES | N | Growth in N |
| 25K | -240.48 | -239.40 | 60 | - |
| 50K | -239.49 | -231.02 | 60 | + 0.00% |
| 100K | -233.13 | -232.40 | 90 | + 50.00% |
| 200K | -233.92 | -233.99 | 100 | + 11.11% |
| 400K | -239.02 | -234.29 | 100 | + 0.00% |
| 800K | -241.03 | -234.86 | 100 | + 0.00% |
+
+distributions. Unlike these methods, our approach is generic and as such, it can be applied to general structures with no additional effort, since it obviates the need for a differentiable surrogate of the linear maximization oracle. Mensch & Blondel [37] proposed a framework for turning dynamic programming algorithms differentiable.
+
+Others have taken a more generic approach. For example, SparseMAP [43, 42, 8] is a framework for training deep networks with sparse structured hidden layers, solved by sequential calls to a MAP oracle. In a similar sense, Itkina et al. [18] suggest using evidential theory to perform post hoc latent space sparsification and thus reducing the discrete latent sample space at test time. Chen et al. [5] generalized this method to a sparse normalization function which can be applied during both training and test time. Moreover, a recent line of works propagates gradients through the non-differentiable arg max operation, Lorberbom et al. [33] use the difference of two maximization operations, and the method of Berthet et al. [1] is based on integration by parts. Contrarily, our approach does not require constructing sophisticated solutions to propagate gradients through discrete operations, which makes it both simple and flexible.
+
+The Vector Quantized Variational Auto-Encoder (VQ-VAE) [56, 49] introduces an alternative approach to learning discrete latent representation. However, VQ-VAE differs from our discrete structured VAEs in an important aspect. In our setting, we know the structure of the latent space, e.g., the space of all possible spanning trees in a given graph. Hence we do not perform unsupervised vector quantization as in VQ-VAE but rather use a predetermined quantization over the set of possible structures. In this work, we rather focus on an alternative optimization method for learning discrete latent structures.
+
+Recently, black-box optimization methods have been applied to neural networks [32, 52, 31, 61, 30, 53, 38]. Salimans et al. [52] showed that NES is a competitive alternative to popular RL techniques. Moreover, they utilized the fact that NES is highly parallelizable and proposed a generic distributed version of NES that scales well with the number of CPUs. Lenc et al. [31] proposed a hybrid method that alternates between NES and SGD for training large sparse models. Finally, Zhang et al. [61], Lehman et al. [30] compare the relation between the SGD gradients and NES updates. To our knowledge, we are the first to apply NES to structured VAEs.
+
+# 6 CONCLUSION
+
+We suggested using NES, a class of gradient-free black-box algorithms, as an alternative for learning discrete structured VAEs. We have demonstrated empirically that NES performs substantially better than various REINFORCE instances and even better than SST on the structure recovery task while being simpler and more robust. Moreover, NES achieves better or comparable performance to DPP and sparseMAP when considering dependency tree latent structure. However, as opposed to the aforementioned methods, NES does not require complex solutions for propagating gradients through the discrete structures, which makes it more generic, flexible, and simple to implement. Additionally, we showed that NES scales well with the latent space dimension and neural network size. To establish the theoretical soundness of our approach, we proved that NES converges for non-Lipschitz functions such as the objective function of a discrete VAE.
+
+In this study, we have limited the expressive power of the NES method by fixing the covariance matrix of the Gaussian search distribution. For future work, we would like to explore the effect of jointly optimizing the covariance and mean of the distribution of parameters.
+
+# REFERENCES
+
+[1] Quentin Berthet, Mathieu Blondel, Olivier Teboul, Marco Cuturi, Jean-Philippe Vert, and Francis R Bach. Learning with differentiable perturbed optimizers. In Advances in Neural Information Processing Systems, 2020.
+[2] Mathieu Blondel, Olivier Teboul, Quentin Berthet, and Josip Djolonga. Fast differentiable sorting and ranking. In International Conference on Machine Learning, pp. 950-959. PMLR, 2020.
+[3] Gilles Boulianne. A study of inductive biases for unsupervised speech representation learning. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 28:2781-2795, 2020.
+[4] Dimo Brockhoff, Anne Auger, Nikolaus Hansen, Dirk V Arnold, and Tim Hohm. Mirrored sampling and sequential selection for evolution strategies. In International Conference on Parallel Problem Solving from Nature, pp. 11-21. Springer, 2010.
+[5] Phil Chen, Masha Itkina, Ransalu Senanayake, and Mykel J Kochenderfer. Evidential softmax for sparse multimodal distributions in deep generative models. Advances in Neural Information Processing Systems, 34, 2021.
+[6] Yoeng-Jin Chu. On the shortest arborescence of a directed graph. Scientia Sinica, 14:1396-1400, 1965.
+[7] Tarin Clanuwat, Mikel Bober-Irizar, Asanobu Kitamoto, Alex Lamb, Kazuaki Yamamoto, and David Ha. Deep learning for classical japanese literature, 2018.
+[8] Gonçalo Correia, Vlad Niculae, Wilker Aziz, and André Martins. Efficient marginalization of discrete and structured latent variables via sparsity. Advances in Neural Information Processing Systems, 33, 2020.
+[9] Caio Corro and Ivan Titov. Differentiable perturb-and-parse: Semi-supervised parsing with a structured variational autoencoder. In International Conference on Learning Representations, 2018.
+[10] Jack Edmonds. Optimum branchings. Journal of Research of the National Bureau of Standards, B, 71:233-240, 1967.
+[11] Jason M Eisner. Three new probabilistic models for dependency parsing: an exploration. In Proceedings of the 16th conference on Computational linguistics-Volume 1, pp. 340-345, 1996.
+[12] SM Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, Geoffrey E Hinton, et al. Attend, infer, repeat: Fast scene understanding with generative models. In Advances in Neural Information Processing Systems, pp. 3225-3233, 2016.
+[13] Xianghong Fang, Haoli Bai, Jian Li, Zenglin Xu, Michael Lyu, and Irwin King. Discrete auto-regressive variational attention models for text modeling. In 2021 International Joint Conference on Neural Networks (IJCNN), pp. 1-8. IEEE, 2021.
+[14] John Geweke. Antithetic acceleration of monte carlo integration in bayesian inference. Journal of Econometrics, 38(1-2):73-89, 1988.
+[15] Alex Glushkovsky. Ai discovering a coordinate system of chemical elements: dual representation by variational autoencoders. arXiv preprint arXiv:2011.12090, 2020.
+[16] Édouard Grave, Piotr Bojanowski, Prakhar Gupta, Armand Joulin, and Tomáš Mikolov. Learning word vectors for 157 languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), 2018.
+[17] Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In International Conference on Machine Learning, pp. 1587-1596, 2017.
+
+[18] Masha Itkina, Boris Ivanovic, Ransalu Senanayake, Mykel J Kochenderfer, and Marco Pavone. Evidential sparsification of multimodal latent spaces in conditional variational autoencoders. Advances in Neural Information Processing Systems, 33, 2020.
+[19] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. International Conference on Learning Representations, 2017.
+[20] Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183-233, 1999.
+[21] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
+[22] Eliyahu Kiperwasser and Yoav Goldberg. Simple and accurate dependency parsing using bidirectional lstm feature representations. Transactions of the Association for Computational Linguistics, 4:313-327, 2016.
+[23] Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. In International Conference on Machine Learning, pp. 2688-2697. PMLR, 2018.
+[24] Terry Koo, Amir Globerson, Xavier Carreras, and Michael Collins. Structured prediction models via the matrix-tree theorem. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), pp. 141-150, 2007.
+[25] Wouter Kool, Herke van Hoof, and Max Welling. Buy 4 reinforce samples, get a baseline for free! 2019.
+[26] Wouter Kool, Herke van Hoof, and Max Welling. Estimating gradients for discrete random variables by sampling without replacement. In International Conference on Learning Representations, 2019.
+[27] Joseph B Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, 7(1):48-50, 1956.
+[28] Matt J Kusner, Brooks Paige, and José Miguel Hernández-Lobato. Grammar variational autoencoder. In International Conference on Machine Learning, pp. 1945-1954. PMLR, 2017.
+[29] Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332-1338, 2015.
+[30] Joel Lehman, Jay Chen, Jeff Clune, and Kenneth O Stanley. Es is more than just a traditional finite-difference approximator. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 450-457, 2018.
+[31] Karel Lenc, Erich Olsen, Tom Schaul, and Karen Simonyan. Non-differentiable supervised learning with evolution strategies and hybrid methods. arXiv preprint arXiv:1906.03139, 2019.
+[32] Jialin Liu, Antoine Moreau, Mike Preuss, Jeremy Rapin, Baptiste Roziere, Fabien Teytaud, and Olivier Teytaud. Versatile black-box optimization. In Proceedings of the 2020 Genetic and Evolutionary Computation Conference, pp. 620-628, 2020.
+[33] Guy Lorberbom, Andreea Gane, Tommi Jaakkola, and Tamir Hazan. Direct optimization through argmax for discrete variational auto-encoder. In Advances in Neural Information Processing Systems, pp. 6203–6214, 2019.
+[34] Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. In International Conference on Learning Representations, 2017.
+
+[35] Ryan McDonald, Joakim Nivre, Yvonne Quirmbach-Brundage, Yoav Goldberg, Dipanjan Das, Kuzman Ganchev, Keith Hall, Slav Petrov, Hao Zhang, Oscar Täckström, Claudia Bedini, Núria Bertomeu Castelló, and Jungmee Lee. Universal dependency annotation for multilingual parsing. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 92–97, 2013.
+[36] Gonzalo Mena, Jasper Snoek, Scott Linderman, and David Belanger. Learning latent permutations with gumbel-sinkhorn networks. In ICLR 2018 Conference Track, volume 2018, 2018.
+[37] Arthur Mensch and Mathieu Blondel. Differentiable dynamic programming for structured prediction and attention. In International Conference on Machine Learning, pp. 3462-3471. PMLR, 2018.
+[38] Laurent Meunier, Herilalaina Rakotoarison, Pak Kan Wong, Baptiste Roziere, Jeremy Rapin, Olivier Teytaud, Antoine Moreau, and Carola Doerr. Black-box optimization revisited: Improving algorithm selection wizards through massive benchmarking. IEEE Transactions on Evolutionary Computation, 2021.
+[39] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In International Conference on Machine Learning, pp. 1791-1799. PMLR, 2014.
+[40] Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multiagent populations. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+[41] Yurii Nesterov and Vladimir Spokoiny. Random gradient-free minimization of convex functions. Foundations of Computational Mathematics, 17(2):527-566, 2017.
+[42] Vlad Niculae and Andre Martins. Lp-sparsemap: Differentiable relaxed optimization for sparse structured prediction. In International Conference on Machine Learning, pp. 7348-7359. PMLR, 2020.
+[43] Vlad Niculae, Andre Martins, Mathieu Blondel, and Claire Cardie. Sparsemap: Differentiable sparse structured inference. In International Conference on Machine Learning, pp. 3799-3808. PMLR, 2018.
+[44] Joakim Nivre, Marie-Catherine De Marneffe, Filip Ginter, Yoav Goldberg, Jan Hajic, Christopher D. Manning, Ryan McDonald, Slav Petrov, Sampo Pyysalo, Natalia Silveira, Reut Tsarfaty, and Daniel Zeman. Universal dependencies v1: A multilingual treebank collection. In LREC, 2016.
+[45] Joakim Nivre, Mitchell Abrams, Željko Agić, Lars Ahrenberg, Lene Antonsen, Maria Jesus Aranzabe, Gashaw Arutie, Masayuki Asahara, Luma Ateyah, Mohammed Attia, et al. Universal dependencies 2.2. 2018.
+[46] John Paisley, David Blei, and Michael Jordan. Variational bayesian inference with stochastic search. Proceedings of the 29th International Conference on Machine Learning, 2012.
+[47] George Papandreou and Alan L Yuille. Perturb-and-map random fields: Using discrete optimization to learn and sample from energy models. In 2011 International Conference on Computer Vision, pp. 193-200. IEEE, 2011.
+[48] Max B Paulus, Dami Choi, Daniel Tarlow, Andreas Krause, and Chris J Maddison. Gradient estimation with stochastic softmax tricks. Advances in Neural Information Processing Systems, 2020.
+[49] Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. In Advances in neural information processing systems, pp. 14866–14876, 2019.
+[50] Guy Rotman and Roi Reichart. Deep contextualized self-training for low resource dependency parsing. Transactions of the Association for Computational Linguistics, 7:695–713, 2019.
+[51] Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pp. 872-879, 2008.
+
+[52] Tim Salimans, Jonathan Ho, Xi Chen, Szymon Sidor, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864, 2017.
+[53] Elad Sarafian, Mor Sinay, Yoram Louzoun, Noa Agmon, and Sarit Kraus. Explicit gradient learning for black-box optimization. In International Conference on Machine Learning, pp. 8480-8490. PMLR, 2020.
+[54] Dinghan Shen, Qinliang Su, Paidamoyo Chapfuwa, Wenlin Wang, Guoyin Wang, Ricardo Henao, and Lawrence Carin. Nash: Toward end-to-end neural architecture for generative semantic hashing. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2041-2050, 2018.
+[55] Arash Vahdat, William Macready, Zhengbing Bian, Amir Khoshaman, and Evgeny Andriyash. Dvae++: Discrete variational autoencoders with overlapping transformations. In International Conference on Machine Learning, pp. 5035-5044. PMLR, 2018.
+[56] Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6309-6318, 2017.
+[57] Daan Wierstra, Tom Schaul, Jan Peters, and Juergen Schmidhuber. Natural evolution strategies. In 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), pp. 3381-3387. IEEE, 2008.
+[58] Daan Wierstra, Tom Schaul, Tobias Glasmachers, Yi Sun, Jan Peters, and Jürgen Schmidhuber. Natural evolution strategies. The Journal of Machine Learning Research, 15(1):949-980, 2014.
+[59] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
+[60] Dani Yogatama, Phil Blunsom, Chris Dyer, Edward Grefenstette, and Wang Ling. Learning to compose words into sentences with reinforcement learning. In 5th International Conference on Learning Representations (ICLR 2017). International Conference on Learning Representations, 2017.
+[61] Xingwen Zhang, Jeff Clune, and Kenneth O Stanley. On the relationship between the openai evolution strategy and stochastic gradient descent. arXiv preprint arXiv:1712.06564, 2017.
+
+# A PROOFS OF NES CONVERGENCE FOR NON-LIPSCHITZ FUNCTIONS
+
+# A.1 PROOF OF LEMMA 1
+
+Proof. The proof follows two main steps: (i) the spectral norm of $\nabla^2 g$ is at most $M / \sigma^2$ and (ii) $\| \nabla g(\mu_1)\|^2\leq dM^2 /\sigma^2$
+
+Since the Hessian matrix is symmetric, we can use Rayleigh quotient and obtain:
+
+$$
+\nabla g \left(\mu_ {1}\right) ^ {\top} \left(\nabla^ {2} g \left(\mu_ {2}\right)\right) \nabla g \left(\mu_ {1}\right) \leq \left| \lambda_ {\max } \right| \cdot \| \nabla g \left(\mu_ {1}\right) \| ^ {2}, \tag {12}
+$$
+
+where $\lambda_{max}$ is the largest eigenvalue of $\nabla^2 g(\mu_2)$ . Since $\nabla^2 g(\mu_2)$ is symmetric it can also be shown that:
+
+$$
+\left| \lambda_ {m a x} \right| = \left\| \nabla^ {2} g \left(\mu_ {2}\right) \right\| = \max _ {\| s \| = 1} \left| s ^ {\top} \nabla^ {2} g \left(\mu_ {2}\right) s \right|. \tag {13}
+$$
+
+Applying the log derivative trick on Eq. 6, we obtain
+
+$$
+\nabla^ {2} g (\mu_ {2}) = \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} \left(\frac {1}{\sigma^ {2}} w w ^ {\top}\right) k (\mu_ {2} + \sigma w) d w. \tag {14}
+$$
+
+Therefore:
+
+$$
+\begin{array}{l} \max _ {\| s \| = 1} | s ^ {\top} \nabla^ {2} g (\mu_ {2}) s | = \max _ {\| s \| = 1} \left| \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} \left(\frac {1}{\sigma^ {2}} s ^ {\top} w w ^ {\top} s\right) k (\mu_ {2} + \sigma w) d w \right| \\ \leq \frac {M}{\sigma^ {2}} \max _ {\| s \| = 1} \left| \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} (s ^ {\top} w) ^ {2} d w \right| \tag {15} \\ = \frac {M}{\sigma^ {2}} \max _ {\| s \| = 1} \| s \| ^ {2} = \frac {M}{\sigma^ {2}}. \\ \end{array}
+$$
+
+Since $k(\cdot)$ is bounded by $M$ and $w$ are i.i.d. normal Gaussian random variables, therefore for any $s$ the random $s^\top w$ is a Gaussian with zero mean and variance $\| s \|^2$ . By combining Eq. 13 with Ineq. 15 we get:
+
+$$
+\left\| \nabla^ {2} g \left(\mu_ {2}\right) \right\| \leq \frac {M}{\sigma^ {2}}, \tag {16}
+$$
+
+which concludes step (i). Next, we bound the squared norm of the gradient:
+
+$$
+\begin{array}{l} \| \nabla g (\mu_ {1}) \| ^ {2} = \| \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} \left(\frac {w}{\sigma}\right) k (\mu_ {1} + \sigma w) d w \| ^ {2} \\ = \frac {1}{\sigma^ {2}} \| \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} w k \left(\mu_ {1} + \sigma w\right) d w \| ^ {2} (17) \\ \leq \frac {1}{\sigma^ {2}} \int_ {\mathbb {R} ^ {d}} \| \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} w k \left(\mu_ {1} + \sigma w\right) \| ^ {2} d w (17) \\ \leq \frac {M ^ {2}}{\sigma^ {2}} \int_ {\mathbb {R} ^ {d}} \frac {1}{(2 \pi) ^ {\frac {d}{2}}} e ^ {- \frac {\| w \| ^ {2}}{2}} \| w \| ^ {2} d w = \frac {d M ^ {2}}{\sigma^ {2}}, \\ \end{array}
+$$
+
+where the first inequality is obtained using the Cauchy-Schwarz inequality and the second inequality by bounding $k(\cdot)$ with $M$ . Thus, overall we have showed that:
+
+$$
+\begin{array}{l} \nabla g \left(\mu_ {1}\right) ^ {\top} \nabla^ {2} g \left(\mu_ {2}\right) \nabla g \left(\mu_ {1}\right) \leq \frac {M}{\sigma^ {2}} \cdot \| \nabla g \left(\mu_ {1}\right) \| ^ {2} \\ \leq \frac {d M ^ {3}}{\sigma^ {4}}. \\ \end{array}
+$$
+
+
+
+# A.2 PROOF OF THEOREM 1
+
+Proof. Rearranging Eq. 9, we obtain:
+
+$$
+\eta \| \nabla g \left(\mu^ {t}\right) \| ^ {2} \leq g \left(\mu^ {(t)}\right) - g \left(\mu^ {(t + 1)}\right) + \eta^ {2} \frac {d M ^ {3}}{2 \sigma^ {4}}. \tag {23}
+$$
+
+Summing over all algorithm steps $t = 1,\dots ,T$ we have:
+
+$$
+\eta \sum_ {t = 1} ^ {T} \| \nabla g \left(\mu^ {t}\right) \| ^ {2} \leq \sum_ {t = 1} ^ {T} \left[ g \left(\mu^ {(t)}\right) - g \left(\mu^ {(t + 1)}\right) \right] + \eta^ {2} \frac {d M ^ {3} T}{2 \sigma^ {4}}. \tag {24}
+$$
+
+Opening the telescopic sum:
+
+$$
+\eta \sum_ {t = 1} ^ {T} \| \nabla g \left(\mu^ {t}\right) \| ^ {2} \leq g \left(\mu^ {(1)}\right) - g \left(\mu^ {(T + 1)}\right) + \eta^ {2} \frac {d M ^ {3} T}{2 \sigma^ {4}}. \tag {25}
+$$
+
+Since $k(\cdot)$ is non-negative and bounded, the difference between $g(\mu^{(1)})$ and $g(\mu^{(T + 1)})$ is bounded from above by $M$ :
+
+$$
+\eta \sum_ {t = 1} ^ {T} \| \nabla g \left(\mu^ {t}\right) \| ^ {2} \leq M + \eta^ {2} \frac {d M ^ {3} T}{2 \sigma^ {4}}. \tag {26}
+$$
+
+We multiply both sides of the inequality by $\frac{1}{\eta T}$ :
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla g (\mu^ {t}) \| ^ {2} \leq \frac {1}{\eta T} \left[ M + \eta^ {2} \frac {d M ^ {3} T}{2 \sigma^ {4}} \right] \leq \frac {M}{\eta T} + \eta \frac {d M ^ {3}}{2 \sigma^ {4}}. \tag {27}
+$$
+
+Next, we minimize the right-hand size of the inequality in $\eta$ :
+
+$$
+\eta^ {*} = \sqrt {\frac {2 \sigma^ {4}}{T d M ^ {2}}}, \tag {28}
+$$
+
+and plug it back to Ineq. 27:
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla g (\mu^ {t}) \| ^ {2} \leq \sqrt {\frac {2 d M ^ {4}}{T \sigma^ {4}}}, \tag {29}
+$$
+
+Then, for arbitrarily small $\delta > 0$ such that:
+
+$$
+\frac {1}{T} \sum_ {t = 1} ^ {T} \| \nabla g (\mu^ {t}) \| ^ {2} \leq \delta \leq \sqrt {\frac {2 d M ^ {4}}{T \sigma^ {4}}}, \tag {30}
+$$
+
+there exists $t$ for which:
+
+$$
+\left\| \nabla g \left(\mu^ {t}\right) \right\| ^ {2} \leq \delta , \tag {31}
+$$
+
+after at most
+
+$$
+T \leq \frac {2 d M ^ {4}}{\delta^ {2} \sigma^ {4}}, \tag {32}
+$$
+
+steps.
+
+
+
+# B ADDITIONAL RESULTS
+
+In the following experiments, we define the encoder as input $\Rightarrow MLP(\alpha) \Rightarrow ReLU \Rightarrow MLP(10) \Rightarrow \text{argmax}$ , and the decoder as $MLP(\alpha) \Rightarrow ReLU \Rightarrow MLP(\beta) \Rightarrow output$ , where $\beta$ is the input dimension. Unless otherwise stated, $\alpha = 300$ .
+
+# B.1 NEURAL NETWORK SIZE
+
+The experiments were conducted on the FashionMNIST dataset [59] with fixed binarization [51]. We tune $\alpha$ for enlarging the VAE. Particularly, $\alpha$ is picked from the set [16, 32, 64, 128, 256, 512]. All models were trained using the ADAM optimizer [21] over 300 epochs with a constant learning rate of $10^{-3}$ and a batch size of 128.
+
+# B.2 RELATIONCBETWEEN $g(\cdot)$ AND $k(\cdot)$
+
+In section 3, we prove that under the conditions of Lemma 1, NES converges to a stationary point of $g(\mu)$ for non-Lipschitz functions. To empirically explore the relation between $g(\mu)$ and $k(\mu)$ , we conduct a set of experiments in which we demonstrate that a low value of $g(\mu)$ is correlated with a low value of the objective function $k(\mu)$ by estimating the average absolute distance between them.
+
+
+Figure 3: Left: The average absolute distance between the negative ELBO $k(\mu)$ and its Gaussian approximation $g(\mu)$ as a function of the training epoch. The smaller $\sigma$ is, the further the proximity between the two functions. Right: Negative ELBO as a function of the training epoch. Performance improves as the ELBO upper bound $M$ increases. Result suggests that bounding a discrete VAE loss with a large enough $M$ guarantees the convergence of NES within a finite number of iterations on the one hand, and on the other hand, does not impair performance.
+
+
+
+
+Figure 4: Negative ELBO as a function of the training epoch. Experiments are conducted on the binarized FashionMNIST (Left), KMNIST (Center), and Omniglot (Right) datasets. NES does not rely on computing gradients and yet achieves comparable performance with the unbiased and GSM methods. On the KMNIST benchmark NES even performs substantially better than GSM.
+
+
+
+
+
+First, we estimate the Gaussian approximation $g(\mu)$ for each sample in the test set by perturbing the current model parameters 1000 times, computing the ELBO for each perturbed parameter vector and average. Then, we calculate the absolute difference between the ELBO, serving as the objective function, and the estimated Gaussian approximation and average over the tested samples. We experiment with three different NES configurations: $N = 300$ and $\sigma \in \{0.01, 0.5, 0.1\}$ on the FashionMNIST dataset [59]. The results presented on the left image in Figure 3 indicate that the smaller $\sigma$ is, the further the proximity between $k(\mu)$ and $g(\mu)$ . It can also be seen that the average distance converges and stabilizes as the learning progresses towards saturation.
+
+# B.3 BOUNDNESS ASSUMPTION
+
+In the general case, the objective function of discrete VAEs is not bounded from above in contrast to Theorem 1 assumption. However, it can be upper bounded by bounding each log probability component with a constant. For ease of explanation, we scale the ELBO by dividing it with the VAE output dimension. Then, we upper bound it with $M = \{1,3,9\}$ during training and compare the test ELBO with that of a model trained with an unbounded ELBO, denoted by UNBOUNDED. We train the three models with $N = 300$ and $\sigma = 0.1$ on the FashionMNIST dataset. Results are depicted on the right image in Figure 3. It can be seen that bounding the loss has a minimal effect on model performance when $M$ is big enough. Increasing $M$ improves the performance, while using a relatively small $M$ value may cause the model to diverge. Surprisingly, bounding the loss with $M = 9$ leads to a slightly lower loss compared to the UNBOUNDED baseline. We hypothesize this is due to a regularization effect.
+
+# B.4 UNSTRUCTURED TASKS.
+
+Unlike structured VAEs, where the latent spaces are often exponentially large, here we explore a latent space that consists of only 10 different assignments. Therefore, an unbiased gradient of the objective with respect to the VAE parameters can be analytically computed by enumerating over all possible latent assignments (Eq. 1). We denote this method as UNBIASED and consider the loss of a model trained with this method as a lower bound for the loss of the same model trained with NES. Due to the relatively small latent space, we can also compare with a Gumbel-Softmax (GSM) biased estimator. For NES, the VAE is trained with $\sigma = 0.1$ and $N = 300$ . For GSM, we use the annealing schedule of Jang et al. [19].
+
+Experiments are conducted on the FashionMNIST [59], KMNIST [7], and Omniglot [29] datasets with fixed binarization [51]. All models are trained using the ADAM optimizer [21] with a constant learning rate of $10^{-3}$ and a mini-batch size of 128. Figure 4 depicts the negative ELBO of NES and its competitors.
+
+Surprisingly, NES achieves competitive results compared to the UNBIASED method on all of the three benchmarks. On KMNIST, NES significantly outperforms GSM, and on the FashionMNIST and Omniglot benchmarks, it achieves comparable results. This is despite the fact that NES optimizes the VAE parameters by only evaluating the model at certain points in parameter space.
+
+# C DERIVING EQUATION 2
+
+Let $\gamma$ be a random function that associates an independent random variable $\gamma(z)$ for each input $z \in \mathcal{Z}$ . When the random variables follow the Gumbel distribution law with mean $h_{\phi}(x,z)$ , which we denote by $\mathcal{G}(h_{\phi}(x,z))$ and whose probability density function is $g_z(\gamma) = e^{-(\gamma(z) + c - h_{\phi}(x,z) + e^{-(\gamma(z) + c - h_{\phi}(x,z))})}$ for the Euler constant $c \approx 0.57$ . Then for $g(t) = \prod_{z=1}^{k} g_z(t)$ we obtain the following identity:
+
+$$
+e ^ {h _ {\phi} (x, z)} = \mathbb {P} _ {\gamma \sim g} [ z ^ {*} = z ], \text {w h e r e} z ^ {*} \triangleq \arg \max _ {\hat {z} \in \mathcal {Z}} \left\{\gamma (\hat {z}) \right\}. \tag {33}
+$$
+
+Proof. Let $G_{z}(t) = e^{-e^{-(t + c - h_{\phi}(x,z))}}$ be the Gumbel cumulative distribution function. Then
+
+$$
+\begin{array}{l} \mathbb {P} _ {\gamma \sim g} [ z ^ {*} = z ] = \mathbb {P} _ {\gamma \sim g} [ z = \arg \max _ {\hat {z} = 1, \dots , k} \{\gamma (\hat {z}) \} ] \\ = \int g _ {z} (t) \prod_ {\hat {z} \neq z} G _ {\hat {z}} (t)) d t. \tag {34} \\ \end{array}
+$$
+
+Since $g_{z}(t) = e^{-(t + c - h_{\phi}(x,z))}G_{z}(t)$ it holds that
+
+$$
+\begin{array}{l} \int g _ {z} (t) \prod_ {\hat {z} \neq z} G _ {\hat {z}} (t) d t = \int e ^ {- (t - h _ {\phi} (x, z) + c)} G _ {z} (t) \prod_ {\hat {z} \neq z} G _ {\hat {z}} (t) d t \tag {35} \\ = \frac {e ^ {h _ {\phi} (x , z)}}{Z}, \\ \end{array}
+$$
+
+where $\frac{1}{Z} = \int e^{-(t + c)}\prod_{\hat{z} = 1}^{k}G_{\hat{z}}(t)dt$ is independent of $z$ . Since $\mathbb{P}_{\gamma \sim g}[z = z^*]$ is a distribution then $Z$ must equal to $\sum_{\hat{z} = 1}^{k}e^{h_{\phi}(x,\hat{z})}$ .
+
+Next, we use the Gumbel-Max trick to rewrite the expected log-likelihood in the ELBO in the following form:
+
+$$
+\mathbb {E} _ {z \sim q _ {\phi}} \log p _ {\theta} (x | z) = \sum_ {z \in \mathcal {Z}} \mathbb {P} _ {\gamma \sim g} [ z ^ {*} = z ] f _ {\phi} (x, z) = \mathbb {E} _ {\gamma \sim g} [ f _ {\theta} (x, z ^ {*}) ]. \tag {36}
+$$
+
+The equality results from the identity $\mathbb{P}_{\gamma \sim g}[z^{*} = z] = \mathbb{E}_{\gamma \sim g}[1_{z^{*} = z}]$ , the linearity of expectation $\sum_{z\in \mathcal{Z}}\mathbb{E}_{\gamma \sim g}[1_{z^{*} = z}]f_{\phi}(x,z) = \mathbb{E}_{\gamma \sim g}[\sum_{z\in \mathcal{Z}}1_{z^{*} = z}f_{\phi}(x,z^{*})]$ and the fact that $\sum_{z\in \mathcal{Z}}1_{z^{*} = z} = 1$
+
+When $z = (z_{1},\dots,z_{|E|})$ is a spanning tree, or more generally, belongs to the a structured space, one cannot assign an i.i.d. random variable to each $z \in \mathcal{Z}$ . Instead we relate a random variable $\gamma = (\gamma_{1},\dots,\gamma_{|E|})$ and set $\gamma(z) = z^{\top}\gamma$ .
+
+# D THE FULL OBJECTIVE FUNCTION
+
+In Eq. 7 we didn't include the KL-divergence term for the sake of simplicity. In practice, the NES algorithm optimizes both terms. Thus, for completeness we provide the full NES objective. For the avoidance of doubt, in our experiments, we optimized both terms.
+
+Assuming that $p_{\theta}(\cdot)$ is the uniform distribution over the space of structures, the Gumbel-Max reparameterization trick let us derive the following approximation:
+
+$$
+K L (q _ {\phi} (\cdot | x) | | p _ {\theta} (\cdot)) = \mathbb {E} _ {z \sim q _ {\phi} (\cdot | x)} \left[ \log \frac {q _ {\phi} (z | x)}{p _ {\theta} (z)} \right] \approx \mathbb {E} _ {\gamma \sim \mathcal {G} (h _ {\phi} (x))} [ z ^ {* \top} h _ {\phi} (x) - \log \frac {1}{| \mathcal {Z} |} ], \tag {37}
+$$
+
+where $z^{*} = \arg \max_{z\in \mathcal{Z}}\{z^{\top}\gamma \}$ . The resulting NES objective is:
+
+$$
+\mathbb {E} _ {w \sim N \left(\mu , \sigma^ {2} I\right)} \mathbb {E} _ {\gamma \sim \mathcal {G} \left(h _ {w _ {2}} (x)\right)} \left[ - f _ {w _ {1}} \left(x, z ^ {*}\right) + z ^ {*} ^ {\top} h _ {w _ {2}} (x) - \log \frac {1}{| \mathcal {Z} |} \right]. \tag {38}
+$$
+
+And its gradient takes the form of:
+
+$$
+\mathbb {E} _ {w \sim N (0, I)} \mathbb {E} _ {\gamma \sim \mathcal {G} \left(h _ {\mu_ {2} + \sigma w _ {2}} (x)\right)} \left[ \frac {w}{\sigma} \left(- f _ {\mu_ {1} + \sigma w _ {1}} (x, z ^ {*}) + z ^ {*} ^ {\top} h _ {\mu_ {2} + \sigma w _ {2}} (x) - \log \frac {1}{| \mathcal {Z} |}\right) \right], \tag {39}
+$$
+
+where $w = [w_{1};w_{2}]$ is the concatenation of the two vectors $w_{1},w_{2}$ .
\ No newline at end of file
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/images.zip b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9ca298c1d74d11cd16a941dc9ddae25f0813e4a7
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b392104b8239d3a9b625591ace89da8859f786e0a1f5d46424230409437d0f6d
+size 488639
diff --git a/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/layout.json b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..6c5d0a57bb3ee4a3be376815b9bedea83900b1cc
--- /dev/null
+++ b/learningdiscretestructuredvariationalautoencoderusingnaturalevolutionstrategies/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d25ab6fe7bd339b1d340f9e32ef28a10ee1ad5401f881f20ff3507e2cfe53df9
+size 643219
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_content_list.json b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6c091cd6b355791e94f3dacb71b5ab70fcb051b8
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d615876e04dadaa9c5f64239b6a5ac1b8724507109a389dbc1ea1918ca5202d
+size 166809
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_model.json b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..de79ab9e2aa216a2275475e0fbdc5368d54b64e0
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c5beeeb71eeca28c079d543c75853212448afa375af388136efbbf2de03de140
+size 203994
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_origin.pdf b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4dd0494edb2d31aca7c8a6261f88903bb2e77a9b
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/59a485aa-3072-43d3-902d-0c2d900a47fe_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e393ee52caf94624b02813026176c654442c453f33340de81431aa5bc5848a5d
+size 47981203
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/full.md b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..e60e27b789322a95fb3c365f44152f8a222b824b
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/full.md
@@ -0,0 +1,764 @@
+# LEARNING DISENTANGLED REPRESENTATION BY EXPLOITING PRETRAINED GENERATIVE MODELS: A CONTRASTIVE LEARNING VIEW
+
+Xuanchi Ren $^{1*}$ , Yang Tao $^{2*}$ , Yuwang Wang $^{3\dagger}$ , Wenjun Zeng $^{4}$
+
+$^{1}$ HKUST, $^{2}$ Xi'an Jiaotong University, $^{3}$ Microsoft Research Asia, $^{4}$ EIT
+
+$^{1}$ xrenaa@connect.ust.hk $^{2}$ yt14212@stu.xjtu.edu.cn
+
+yuwwan@microsoft.com 4 wenjunzeng@eias.ac.cn
+
+# ABSTRACT
+
+From the intuitive notion of disentanglement, the image variations corresponding to different factors should be distinct from each other, and the disentangled representation should reflect those variations with separate dimensions. To discover the factors and learn disentangled representation, previous methods typically leverage an extra regularization term when learning to generate realistic images. However, the term usually results in a trade-off between disentanglement and generation quality. For the generative models pretrained without any disentanglement term, the generated images show semantically meaningful variations when traversing along different directions in the latent space. Based on this observation, we argue that it is possible to mitigate the trade-off by $(i)$ leveraging the pretrained generative models with high generation quality, $(ii)$ focusing on discovering the traversal directions as factors for disentangled representation learning. To achieve this, we propose Disentaglement via Contrast (DisCo) as a framework to model the variations based on the target disentangled representations, and contrast the variations to jointly discover disentangled directions and learn disentangled representations. DisCo achieves the state-of-the-art disentangled representation learning and distinct direction discovering, given pretrained non-disentangled generative models including GAN, VAE, and Flow. Source code is at https://github.com/xrenaa/Disco.
+
+# 1 INTRODUCTION
+
+Disentangled representation learning aims to identify and decompose the underlying explanatory factors hidden in the observed data, which is believed by many to be the only way to understand the world for AI fundamentally (Bengio & LeCun, 2007). To achieve the goal, as shown in Figure 1 (a), we need an encoder and a generator. The encoder to extract representations from images with each dimension corresponds to one factor individually. The generator (decoder) decodes the changing of each factor into different kinds of image variations.
+
+With supervision, we can constrain each dimension of the representation only sensitive to one kind of image variation caused by changing one factor respectively. However, this kind of exhaustive supervision is often not available in real-world data. The typical unsupervised methods are based on a generative model to build the above encoder and generator framework, e.g., VAE (Kingma & Welling, 2014) provides encoder and generator, and GAN (Goodfellow et al., 2014; Miyato et al., 2018; Karras et al., 2019) provides generator. During the training process of the encoder and generator, to achieve disentangled representation, the typical methods rely on an additional disentanglement regularization term, e.g., the total correlation for VAE-based methods (Higgins et al., 2017; Burgess et al., 2018; Kumar et al., 2017; Kim & Mnih, 2018; Chen et al., 2018) or mutual information for InfoGAN-based methods (Chen et al., 2016; Lin et al., 2020).
+
+
+(a)
+
+
+(b)
+Figure 1: (a) The encoder and generator framework for learning disentangled representation. (b) Our alternative route to learn disentangle representation with fixed generator.
+
+However, the extra terms usually result in a trade-off between disentanglement and generation quality (Burgess et al., 2018; Khrulkov et al., 2021). Furthermore, those unsupervised methods have been proved to have an infinite number of entangled solutions without introducing inductive bias (Locatello et al., 2019). Recent works (Shen & Zhou, 2021; Khrulkov et al., 2021; Karras et al., 2019; Härkonen et al., 2020; Voynov & Babenko, 2020) show that, for GANs purely trained for image generation, traversing along different directions in the latent space causes different variations of the generated image. This phenomenon indicates that there is some disentanglement property embedded in the latent space of the pretrained GAN. The above observations indicate that training the encoder and generator simultaneous may not be the best choice.
+
+We provide an alternative route to learn disentangled representation: fix the pretrained generator, jointly discover the factors in the latent space of the generator and train the encoder to extract disentangled representation, as shown in Figure 1(b). From the intuitive notion of disentangled representation, similar image variations should be caused by changing the same factor, and different image variations should be caused by changing different factors. This provide a novel contrastive learning view for disentangled representation learning and inspires us to propose a framework: Disentanglement via Contrast (DisCo) for disentangled representation learning.
+
+In DisCo, changing a factor is implemented by traversing one discovered direction in the latent space. For discovering the factors, DisCo adopts a typical network module, Navigator, to provide candidate traversal directions in the latent space (Voynov & Babenko, 2020; Jahanian et al., 2020; Shen et al., 2020). For disentangled representation learning, to model the various image variations, we propose a novel $\Delta$ -Contrastor to build a Variation Space where we apply the contrastive loss. In addition to the above architecture innovations, we propose two key techniques for DisCo: $(i)$ an entropy-based domination loss to encourage the encoded representations to be more disentangled, $(ii)$ a hard negatives flipping strategy for better optimization of Contrastive Loss.
+
+We evaluate DisCo on three major generative models (GAN, VAE, and Flow) on three popular disentanglement datasets. DisCo achieves the state-of-the-art (SOTA) disentanglement performance compared to all the previous discovering-based methods and typical (VAE/InfoGAN-based) methods. Furthermore, we evaluate DisCo on the real-world dataset FFHQ (Karras et al., 2019) to demonstrate that it can discover SOTA disentangled directions in the latent space of pretrained generative models.
+
+Our main contributions can be summarized as: (i) To our best knowledge, DisCo is the first unified framework for jointly learning disentangled representation and discovering the latent space of pretrained generative models by contrasting the image variations. (ii) We propose a novel $\Delta$ -Contrastor to model image variations based on the disentangled representations for utilizing Contrastive Learning. (iii) DisCo is an unsupervised and model-agnostic method that endows non-disentangled VAE, GAN, or Flow models with the SOTA disentangled representation learning and latent space discovering. (iv) We propose two key techniques for DisCo: an entropy-based domination loss and a hard negatives flipping strategy.
+
+# 2 RELATED WORK
+
+Typical unsupervised disentanglement. There have been a lot of studies on unsupervised disentangled representation learning based on VAE (Higgins et al., 2017; Burgess et al., 2018; Kumar et al., 2017; Kim & Mnih, 2018; Chen et al., 2018) or InfoGAN (Chen et al., 2016; Lin et al., 2020). These methods achieve disentanglement via an extra regularization, which often sacrifices the generation quality (Burgess et al., 2018; Khrulkov et al., 2021). VAE-based methods disentangle the variations by factorizing aggregated posterior, and InfoGAN-based methods maximize the mutual
+
+information between latent factors and related observations. VAE-based methods achieve relatively good disentanglement performance but have low-quality generation. InfoGAN-based methods have a relatively high quality of generation but poor disentanglement performance. Our method supplements generative models pretrained without disentanglement regularization term with contrastive learning in the Variation Space to achieve both high-fidelity image generation and SOTA disentanglement.
+
+Interpretable directions in the latent space. Recently, researchers have been interested in discovering the interpretable directions in the latent space of generative models without supervision, especially for GAN (Goodfellow et al., 2014; Miyato et al., 2018; Karras et al., 2020). Based on the fact that the GAN latent space often possesses semantically meaningful directions (Radford et al., 2015; Shen et al., 2020; Jahanian et al., 2020), Voynov & Babenko (2020) propose a regression-based method to explore interpretable directions in the latent space of a pretrained GAN. The subsequent works focus on extracting the directions from a specific layer of GANs. Härkönen et al. (2020) search for important and meaningful directions by performing PCA in the style space of StyleGAN (Karras et al., 2019; 2020). Shen & Zhou (2021) propose to use the singular vectors of the first layer of a generator as the interpretable directions, and Khrulkov et al. (2021) extend this method to the intermediate layers by Jacobian matrix. All the above methods only discover the interpretable directions in the latent space, except for Khrulkov et al. (2021) which also learns disentangled representation of generated images by training an extra encoder in an extra stage. However, all these methods can not outperform the typical disentanglement methods. Our method is the first to jointly learn the disentangled representation and discover the directions in the latent spaces.
+
+Contrastive Learning. Contrastive Learning gains popularity due to its effectiveness in representation learning (He et al., 2020; Grill et al., 2020; van den Oord et al., 2018; Henaff, 2020; Li et al., 2020; Chen et al., 2020). Typically, contrastive approaches bring representations of different views of the same image (positive pairs) closer, and push representations of views from different images (negative pairs) apart using instance-level classification with Contrastive Loss. Recently, Contrastive Learning is extended to various tasks, such as image translation (Liu et al., 2021; Park et al., 2020) and controllable generation (Deng et al., 2020). In this work, we focus on the variations of representations and achieve SOTA disentanglement with Contrastive Learning in the Variation Space. Contrastive Learning is suitable for disentanglement due to: $(i)$ the actual number of disentangled directions is usually unknown, which is similar to Contrastive Learning for retrieval (Le-Khac et al., 2020), $(ii)$ it works in the representation space directly without any extra layers for classification or regression.
+
+# 3 DISENTANGLEMENT VIA CONTRAST
+
+# 3.1 OVERVIEW OF DISCO
+
+From the contrastive view of the intuitive notion of disentangled representation learning, we propose a DisCo to leverage pretrained generative models to jointly discover the factors embedded as directions in the latent space of the generative models and learn to extract disentangled representation. The benefits of leveraging a pretrained generative model are two-fold: $(i)$ the pretrained models with high-quality image generation are readily available, which is important for reflecting detailed image variations and downstream tasks like controllable generation; $(ii)$ the factors are embedded in the pretrained model, severing as an inductive bias for unsupervised disentangled representation learning.
+
+DisCo consists of a Navigator to provide candidate traversal directions in the latent space and a $\Delta$ -Contrastor to extract the representation of image variations and build a Variation Space based on the target disentangled representations. More specifically, $\Delta$ -Contrastor is composed of two shared-weight Disentangling Encoders. The variation between two images is modeled as the difference of their corresponding encoded representations extracted by the Disentangling Encoders.
+
+In the Variation Space, by pulling together the variation samples resulted from traversing the same direction and pushing away the ones resulted from traversing different directions, the Navigator learns to discover disentangled directions as factors, and Disentangling Encoder learns to extract disentangled representations from images. Thus, traversing along the discovered directions causes distinct image variations, which causes separated dimensions of disentangled representations respond.
+
+Different from VAE-based or InfoGAN-based methods, our disentangled representations and factors are in two separate spaces, which actually does not affect the applications. Similar to the typical
+
+
+Figure 2: Overview of DisCo. DisCo consists of: (i) a Navigator exploring traversal directions in the latent space of a given pretrained generative model, (ii) a $\Delta$ -Contrastor encoding traversed images into the Variation Space, where we utilize Contrastive Learning. Samples in the Variation Space correspond to the image variations along the directions provided by the Navigator labeled with different colors, respectively. $\Delta$ -Contrastor includes two shared-weight Disentangling Encoders to extract disentangled representations respectively, and outputs the difference between the disentangled representations as variation representation. The Generative Model is fixed, and the Navigator and Disentangling Encoders marked with grey color are learnable.
+
+methods, the Disentangling Encoder can extract disentangled representations from images, and the pretrained generative model with discovered factors can be applied to controllable generation. Moreover, DisCo can be applied to different types of generative models.
+
+Here we provide a detailed workflow of DisCo. As Figure 2 shows, given a pretrained generative model $G$ : $\mathcal{Z} \to \mathcal{I}$ , where $\mathcal{Z} \in \mathbb{R}^L$ denotes the latent space, and $\mathcal{I}$ denotes the image space, the workflow is: 1) A Navigator $A$ provides a total of $D$ candidate traversal directions in the latent space $\mathcal{Z}$ , e.g., in the linear case, $A \in \mathbb{R}^{L \times D}$ is a learnable matrix, and each column is regarded as a candidate direction. 2) Image pairs $G(z)$ , $G(z')$ are generated. $z$ is sampled from $\mathcal{Z}$ and $z' = z + A(d, \varepsilon)$ , where $d \in \{1, \dots, D\}$ and $\varepsilon \in \mathbb{R}$ , and $A(d, \varepsilon)$ denotes the shift along the $d$ -th direction with $\varepsilon$ scalar. 3) The $\Delta$ -Contrastor, composed of two shared-weight Disentangling Encoders $E$ , encodes the image pair to a sample $v \in V$ as
+
+$$
+\boldsymbol {v} (\boldsymbol {z}, d, \varepsilon) = | \boldsymbol {E} (\boldsymbol {G} (\boldsymbol {z} + \boldsymbol {A} (d, \varepsilon))) - \boldsymbol {E} (\boldsymbol {G} (\boldsymbol {z})) |, \tag {1}
+$$
+
+where $\mathcal{V} \in \mathbb{R}_+^J$ denotes the Variation Space. Then we apply Contrastive Learning in $\mathcal{V}$ to optimize the Disentangling Encoder $\pmb{E}$ to extract disentangled representations and simultaneously enable Navigator $\pmb{A}$ to find the disentangled directions in the latent space $\mathcal{Z}$ .
+
+# 3.2 DESIGN OF DISCO
+
+We present the design details of DisCo, which include: (i) the collection of query set $\mathcal{Q} = \{\pmb{q}_i\}_{i=1}^B$ , positive key set $\mathcal{K}^{+} = \{\pmb{k}_i^{+}\}_{i=1}^N$ and negative key set $\mathcal{K}^{-} = \{\pmb{k}_i^{-}\}_{i=1}^M$ , which are three subsets of the Variation Space $\mathcal{V}$ , (ii) the formulation of the Contrastive Loss.
+
+According to our goal of contrasting the variations, the samples from $\mathcal{Q}$ and $\kappa^{+}$ share the same traversal direction and should be pulled together, while the samples from $\mathcal{Q}$ and $\kappa^{-}$ have different directions and should be pushed away. Recall that each sample $\pmb{v}$ in $\nu$ is determined as $\pmb{v}(\pmb{z},d,\varepsilon)$ . To achieve the contrastive learning process, we construct the query sample $\pmb{q}_i = \pmb{v}(\pmb{z}_i,d_i,\varepsilon_i)$ , the key sample $\pmb{k}_i^+ = \pmb{v}(\pmb{z}_i^+,d_i^+, \varepsilon_i^+)$ and the negative sample $\pmb{k}_i^- = \pmb{v}(\pmb{z}_i^-,d_i^-, \varepsilon_i^-)$ . Specifically, we randomly sample a direction index $\hat{d}$ from a discrete uniform distribution $\mathcal{U}\{1,D\}$ for $\{d_i\}_{i=1}^B$ and $\{d_i^+\}_{i=1}^N$ to guarantee they are the same. We randomly sample $\{d_i^-\}_{i=1}^M$ from the set of the rest of the directions $\mathcal{U}\{1,D\} \setminus \{\hat{d}\}$ individually and independently to cover the rest of directions in Navigator A. Note that the discovered direction should be independent with the starting point and the scale of variation, which is in line with the disentangled factors. Therefore, $\{\pmb{z}_i\}_{i=1}^B$ , $\{\pmb{z}_i^+\}_{i=1}^N$ , $\{\pmb{z}_i^-\}_{i=1}^M$ are all sampled from latent space $\mathcal{Z}$ , and $\{\varepsilon_i\}_{i=1}^B$ , $\{\varepsilon_i^+\}_{i=1}^N$ , $\{\varepsilon_i^-\}_{i=1}^M$ are all sampled from a shared continuous uniform distribution $\mathcal{U}[-\epsilon, \epsilon]$ individually and independently. We normalize each sample in $\mathcal{Q}$ , $\kappa^{+}$ , and $\kappa^{-}$ to a unit vector to eliminate the impact caused by different shift scalars.
+
+For the design of Contrastive Loss, a well-known form of Contrastive Loss is InfoNCE (van den Oord et al., 2018):
+
+$$
+\mathcal {L} _ {N C E} = - \frac {1}{| B |} \sum_ {i = 1} ^ {B} \sum_ {j = 1} ^ {N} \log \frac {\exp \left(\boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j} ^ {+} / \tau\right)}{\sum_ {s = 1} ^ {N + M} \exp \left(\boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {s} / \tau\right)}, \tag {2}
+$$
+
+where $\tau$ is a temperature hyper-parameter and $\{\pmb{k}_i\}_{i=1}^{N+M} = \{\pmb{k}_i^+\}_{i=1}^N \cup \{\pmb{k}_i^-\}_{i=1}^M$ . The InfoNCE is originate from BCELoss (Gutmann & Hyvärinen, 2010). BCELoss has been used to achieve contrastive learning (Wu et al., 2018; Le-Khac et al., 2020; Mnih & Kavukcuoglu, 2013; Mnih & Teh, 2012). We choose to follow them to use BCELoss $\mathcal{L}_{\text{logits}}$ for reducing computational cost:
+
+$$
+\mathcal {L} _ {\text {l o g i t s}} = - \frac {1}{| B |} \sum_ {i = 1} ^ {B} \left(l _ {i} ^ {-} + l _ {i} ^ {+}\right), \tag {3}
+$$
+
+$$
+l _ {i} ^ {+} = \sum_ {j = 1} ^ {N} \log \sigma \left(\boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j} ^ {+} / \tau\right), \quad l _ {i} ^ {-} = \sum_ {m = 1} ^ {M} \log \left(1 - \sigma \left(\boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {m} ^ {-} / \tau\right)\right), \tag {4}
+$$
+
+where $\sigma$ denotes the sigmoid function, $l_{i}^{+}$ denotes the part for positive samples, and $l_{i}^{-}$ denotes the part for the negative ones. Note that we use a shared positive set for $B$ different queries to reduce the computational cost.
+
+# 3.3 KEY TECHNIQUES FOR DISCO
+
+Entropy-based domination loss. By optimizing the Contrastive Loss, Navigator $\mathbf{A}$ is optimized to find the disentangled directions in the latent space, and Disentangling Encoder $\mathbf{E}$ is optimized to extract disentangled representations from images. To further make the encoded representations more disentangled, i.e., when traversing along one disentangled direction, only one dimension of the encoded representation should respond, we thus propose an entropy-based domination loss to encourage the corresponding samples in the Variation Space to be one-hot. To implement the entropy-based domination loss, we first get the mean $c$ of $\mathcal{Q}$ and $\mathcal{K}^+$ as
+
+$$
+\boldsymbol {c} = \frac {1}{| B + N |} \left(\sum_ {i = 1} ^ {B} \boldsymbol {q} _ {i} + \sum_ {i = 1} ^ {N} \boldsymbol {k} _ {i} ^ {+}\right). \tag {5}
+$$
+
+We then compute the probability as $p_i = \exp c(i) / \sum_{j=1}^{J} \exp c(j)$ , where $c(i)$ is the $i$ -th element of $c$ and $J$ is the number of dimensions of $c$ . The entropy-based domination loss $\mathcal{L}_{ed}$ is calculated as
+
+$$
+\mathcal {L} _ {e d} = - \frac {1}{J} \sum_ {j = 1} ^ {J} p _ {j} \log \left(p _ {j}\right). \tag {6}
+$$
+
+Hard negatives flipping. Since the latent space of the generative models is a high-dimension complex manifold, many different directions carry the same semantic meaning. These directions with the same semantic meaning result in hard negatives during the optimization of Contrastive Loss. The hard negatives here are different from the hard negatives in the works of self-supervised representation learning (He et al., 2020; Coskun et al., 2018), where they have reliable annotations of the samples. Here, our hard negatives are more likely to be "false" negatives, and we choose to flip these hard negatives into positives. Specifically, we use a threshold $T$ to identify the hard negative samples, and use their similarity to the queries as the pseudo-labels for them:
+
+$$
+\hat {l} _ {i} ^ {-} = \sum_ {\alpha_ {i j} < T} \log (1 - \sigma \left(\alpha_ {i j}\right)) + \sum_ {\alpha_ {i j} \geq T} \alpha_ {i j} \log \left(\sigma \left(\alpha_ {i j}\right)\right), \tag {7}
+$$
+
+where $\hat{l}_i^-$ denotes the modified $l_i^-$ , and $\alpha_{ij} = \pmb{q}_i \cdot \pmb{k}_j^-$ / $\tau$ . Therefore, the modified final BCELoss is:
+
+$$
+\mathcal {L} _ {\text {l o g i t s - f}} = \frac {1}{| B |} \sum_ {i = 1} ^ {B} \left(l _ {i} ^ {+} + \hat {l} _ {i} ^ {-}\right). \tag {8}
+$$
+
+| Method | Cars3D | Shapes3D | MPI3D |
| MIG | DCI | MIG | DCI | MIG | DCI |
| Typical disentanglement baselines: |
| FactorVAE | 0.142 ± 0.023 | 0.161 ± 0.019 | 0.434 ± 0.143 | 0.611 ± 0.101 | 0.099 ± 0.029 | 0.240 ± 0.051 |
| β-TCVAE | 0.080 ± 0.023 | 0.140 ± 0.019 | 0.406 ± 0.175 | 0.613 ± 0.114 | 0.114 ± 0.042 | 0.237 ± 0.056 |
| InfoGAN-CR | 0.011 ± 0.009 | 0.020 ± 0.011 | 0.297 ± 0.124 | 0.478 ± 0.055 | 0.163 ± 0.076 | 0.241 ± 0.075 |
| Methods on pretrained GAN: |
| LD | 0.086 ± 0.029 | 0.216 ± 0.072 | 0.168 ± 0.056 | 0.380 ± 0.062 | 0.097 ± 0.057 | 0.196 ± 0.038 |
| CF | 0.083 ± 0.024 | 0.243 ± 0.048 | 0.307 ± 0.124 | 0.525 ± 0.078 | 0.183 ± 0.081 | 0.318 ± 0.014 |
| GS | 0.136 ± 0.006 | 0.209 ± 0.031 | 0.121 ± 0.048 | 0.284 ± 0.034 | 0.163 ± 0.065 | 0.229 ± 0.042 |
| DS | 0.118 ± 0.044 | 0.222 ± 0.044 | 0.356 ± 0.090 | 0.513 ± 0.075 | 0.093 ± 0.035 | 0.248 ± 0.038 |
| DisCo (ours) | 0.179 ± 0.037 | 0.271 ± 0.037 | 0.512 ± 0.068 | 0.708 ± 0.048 | 0.222 ± 0.027 | 0.292 ± 0.024 |
| Methods on pretrained VAE: |
| LD | 0.030 ± 0.025 | 0.068 ± 0.030 | 0.040 ± 0.035 | 0.068 ± 0.075 | 0.024 ± 0.026 | 0.035 ± 0.014 |
| DisCo (ours) | 0.103 ± 0.028 | 0.211 ± 0.041 | 0.331 ± 0.161 | 0.844 ± 0.033 | 0.068 ± 0.030 | 0.288 ± 0.021 |
| Methods on pretrained Flow: |
| LD | 0.015 ± 0.000 | 0.029 ± 0.000 | 0.067 ± 0.000 | 0.211 ± 0.000 | 0.025 ± 0.000 | 0.035 ± 0.000 |
| DisCo (ours) | 0.060 ± 0.000 | 0.199 ± 0.000 | 0.150 ± 0.000 | 0.525 ± 0.000 | 0.076 ± 0.000 | 0.264 ± 0.000 |
+
+Table 1: Comparisons of the MIG and DCI disentanglement metrics (mean ± std). A higher mean indicates a better performance. DisCo can extract disentangled representations from all three generative models, and DisCo on GAN achieves the highest score in almost all the cases, compared to all the baselines. All the cells except for Flow are results over 25 runs.
+
+
+Figure 3: Violin plots on three datasets (1: $\beta$ -TCVAE, 2: FactorVAE, 3: InfoGAN-CR, 4: CF, 5: LD, 6: GS, 7: DS, 8: DisCo (ours)). DisCo on pretrained GAN consistently achieves the best performance. Each method has 25 runs, and the variance is due to randomness.
+
+
+
+
+
+Full objective. With the above two techniques, the full objective is:
+
+$$
+\mathcal {L} = \mathcal {L} _ {\text {l o g i t s} - f} + \lambda \mathcal {L} _ {\text {e d}}, \tag {9}
+$$
+
+where $\lambda$ is the weighting hyper-parameter for entropy-based domination loss $\mathcal{L}_{ed}$ .
+
+# 4 EXPERIMENT
+
+In this section, we first follow the well-accepted protocol (Locatello et al., 2019; Khrulkov et al., 2021) to evaluate the learned disentangled representation, which also reflects the performance of discovered directions implicitly (Lin et al., 2020) (Section 4.1). Secondly, we follow Li et al. (2021a) to directly evaluate the discovered directions (Section 4.2). Finally, we conduct ablation study (Section 4.3).
+
+# 4.1 EVALUATIONS ON DISENTANGLED REPRESENTATION
+
+# 4.1.1 EXPERIMENTAL SETUP
+
+Datasets. We consider the following popular datasets in the disentanglement areas: Shapes3D (Kim & Mnih, 2018) with 6 ground truth factors, MPI3D (Gondal et al., 2019) with 7 ground truth factors,
+
+
+Figure 4: Comparison of discovered directions. DisCo can better manipulate desirable attributes while keeping others intact. Please refer to Appendix C for more qualitative results.
+
+
+
+
+Figure 5: Visualization of the variation of the encoded disentangled representations caused by the change of a single ground truth factor.
+
+
+Table 2: Ablation on Contrast v.s. Classification and Concatenation (Concat) v.s. Variation.
+
+| Concat | Variation | Contrast | Classification | MIG | DCI |
| ✓ | | ✓ | | 0.023 | 0.225 |
| ✓ | ✓ | | 0.562 | 0.736 |
| ✓ | | | ✓ | 0.012 | 0.138 |
| ✓ | | ✓ | 0.002 | 0.452 |
+
+and Cars3D (Reed et al., 2015) with 3 ground truth factors. In the experiments of the above datasets, images are resized to the 64x64 resolution.
+
+Pretrained generative models. For GAN, we use the StyleGAN2 model (Karras et al., 2020). For VAE, we use a common structure with convolutions (Locatello et al., 2019). For Flow, we use Glow (Kingma & Dhariwal, 2018).
+
+Baseline. For the typical disentanglement baselines, we choose FactorVAE (Kim & Mnih, 2018), $\beta$ -TCVAE (Chen et al., 2018) and InfoGAN-CR (Lin et al., 2020). For discovering-based methods, we consider serveral recent methods: GANspace (GS) (Härkönen et al., 2020), LatentDiscovery (LD) (Voynov & Babenko, 2020), ClosedForm (CF) (Shen & Zhou, 2021) and DeepSpectral (DS) (Khrulkov et al., 2021). For these methods, we follow Khrulkov et al. (2021) to train an additional encoder to extract disentangled representation. We are the first to extract disentangled representations from pretrained VAE and Flow, so we extend LD to VAE and Flow as a baseline.
+
+Disentanglement metrics. We mainly consider two representative ones: the Mutual Information Gap (MIG) (Chen et al., 2018) and the Disentanglement metric (DCI) (Eastwood & Williams, 2018). MIG requires each factor to be only perturbed by changes of a single dimension of representation. DCI requires each dimension only to encode the information of a single dominant factor. We evaluate the disentanglement in terms of both representation and factors. We also provide results for $\beta$ -VAE score (Higgins et al., 2017) and FactorVAE score (Kim & Mnih, 2018) in Appendix B.3.
+
+Randomness. We consider the randomness caused by random seeds and the strength of the regularization term (Locatello et al., 2019). For random seeds, we follow the same setting as the baselines. Since DisCo does not have a regularization term, we consider the randomness of the pretrained generative models. For all methods, we ensure there are 25 runs, except that Glow only has one run, limited by GPU resources. More details are presented in Appendix A.
+
+# 4.1.2 EXPERIMENTAL RESULTS
+
+The quantitative results are summarized in Table 1 and Figure 3. More details about the experimental settings and results are presented in Appendix A & C.
+
+DisCo vs. typical baselines. Our DisCo achieves the SOTA performance consistently in terms of MIG and DCI scores. The variance due to randomness of DisCo tends to be smaller than those typical baselines. We demonstrate that the method, which extracts disentangled representation from pretrained non-disentangled models, can outperform typical disentanglement baselines.
+
+DisCo vs. discovering-based methods. Among the baselines based on discovering pretrained GAN, CF achieves the best performance. DisCo outperforms CF in almost all the cases by a large margin. Besides, these baselines need an extra stage (Khrulkov et al., 2021) to get disentangled representation, while our Disentangling Encoder can directly extract disentangled representation.
+
+# 4.2 EVALUATIONS ON DISCOVERED DIRECTIONS
+
+To evaluate the discovered directions, we compare DisCo on StyleGAN2 with GS, LD, CF and DS on the real-world dataset FFHQ (Karras et al., 2019). and adopt the comprehensive Manipulation Disentanglement Score (MDS) (Li et al., 2021a) as a metric. To calculate MDS, we use 40 CelebaHQ-Attributes predictors released by StyleGAN. Among them, we select Young, Smile, Bald and Blonde Hair, as they are attributes with an available predictor and commonly found by all methods at the same
+
+| Method | Young | MDS on CelebAHQ-Attributes |
| Smile | Bald | Blonde Hair | Overall |
| DS | 0.518 | 0.570 | 0.524 | 0.511 | 0.531 |
| CF | 0.518 | 0.553 | 0.504 | 0.560 | 0.534 |
| GS | 0.502 | 0.534 | 0.494 | 0.538 | 0.517 |
| LD | 0.627 | 0.531 | 0.524 | 0.514 | 0.549 |
| DisCo | 0.516 | 0.688 | 0.568 | 0.592 | 0.591 |
+
+time. The results are summarized in Table 3. DisCo has shown better overall performance compared to other baselines, which verifies our assumption that learning disentangled representation benefits latent space discovering. We also provide qualitative comparisons in Figure 4.
+
+Finally, we provide an intuitive analysis in Appendix D for why DisCo can find those disentangled directions.
+
+# 4.3 ABLATION STUDY
+
+In this section, we perform ablation study of DisCo only on GAN, limited by the space. For the experiments, we use the Shapes3D dataset, and the random seed is fixed.
+
+Choice of latent space. For style-based GANs (Karras et al., 2019; 2020), there is a style space $\mathcal{W}$ which is the output of style network (MLP) whose input is a random latent space $\mathcal{Z}$ . As demonstrated in Karras et al. (2019), $\mathcal{W}$ is more interpretable than $\mathcal{Z}$ . We conduct experiments on $\mathcal{W}$ and $\mathcal{Z}$ respectively to see how the latent space influences the performance. As shown in Table 4, DisCo on $\mathcal{W}$ is better, indicating that the better the latent space is organized, the better disentanglement DisCo can achieve.
+
+Choices of $\mathbf{A}$ . Following the setting of Voynov & Babenko (2020), we mainly consider three options of $\mathbf{A}$ : a linear operator with all matrix columns having a unit length, a linear operator with orthonormal matrix columns, or a nonlinear operator of 3 fully-connected layers.
+
+The results are shown in Table 4. For latent spaces $\mathcal{W}$ and $\mathcal{Z}$ , $\mathbf{A}$ with unit-norm columns achieves nearly the best performance in terms of MIG and DCI scores. Compared to $\mathbf{A}$ with orthonormal matrix columns, using $\mathbf{A}$ with unit-norm columns is more expressive with less constraints. Another possible reason is that $\mathbf{A}$ is global without conditioned on the latent code $z$ . A non-linear operator is more suitable for a
+
+local navigator $\pmb{A}$ . For such a much more complex local and non-linear setting, more inductive bias or supervision should be introduced.
+
+Table 3: MDS comparison on facial attribute editing. Our DisCo shows the best overall score for the latent discovering task on FFHQ dataset.
+
+| Method | MIG | DCI |
| Z + Unit length matrix | 0.242 | 0.673 |
| Z + Orthonormal matrix | 0.183 | 0.578 |
| Z + 3 fully-connected layers | 0.169 | 0.504 |
| W + Unit length matrix | 0.547 | 0.730 |
| W + Orthonormal matrix | 0.551 | 0.709 |
| W + 3 fully-connected layers | 0.340 | 0.665 |
| Llogits | 0.134 | 0.632 |
| Llogits + Led | 0.296 | 0.627 |
| Llogits-f | 0.134 | 0.681 |
| Llogits-f + Led | 0.547 | 0.730 |
+
+Table 4: Ablation study of DisCo on the latent spaces, types of $A$ , and our proposed techniques.
+
+Entropy-based domination loss. Here, we verify the effectiveness of entropy-based domination loss $\mathcal{L}_{ed}$ for disentanglement. For a desirable disentangled representation, one semantic meaning corresponds to one dimension. As shown in Table 4, $\mathcal{L}_{ed}$ can improve the performance by a large
+
+
+(a) Impact of $N:M$ with a fixed sum
+
+
+(b) Impact of $N + M$ with a fixed ratio $1:2$
+Figure 6: Study on numbers of positive (N) and negative samples (M). The balance between positive and negative samples is crucial for DisCo.
+
+margin. We also visualize the Variation Space to further demonstrate the effectiveness of our proposed loss in Figure 5. Adding the domination loss makes the samples in the Variation Space to be one-hot, which is desirable for disentanglement.
+
+Hard negatives flipping. We run our DisCo with or without the hard negatives flipping strategy to study its influence. As shown in Table 4, flipping hard negatives can improve the disentanglement ability of DisCo. The reason is that the hard negatives have the same semantics as the positive samples. In this case, treating them as the hard negatives does not make sense. Flipping them with pseudo-labels can make the optimization of Contrastive Learning easier.
+
+Hyperparameter N & M. We run DisCo with different ratios of $N:M$ with a fixed sum of 96, and different sum of $N + M$ with a fixed ratio $1:2$ to study their impacts. As shown in Figure 6 (a), the best ratio is $N:M = 32:64 = 1:2$ , as the red line (MIG) and blue line (DCI) in the figure show that larger or smaller ratios will hurt DisCo, which indicates DisCo requires a balance between $N$ and $M$ . As shown in Figure 6 (b), the sum of $N + M$ has slight impact on DisCo. For other hyperparameters, we set them empirically, and more details are presented in Appendix A.
+
+Contrast vs. Classification. To verify the effectiveness of Contrast, we substitute it with classification by adopting an additional linear layer to recover the corresponding direction index and the shift along this direction. As Table 2 shows, Contrastive Learning outperforms Classification significantly.
+
+Concatenation vs. Variation. We further demonstrate that the Variation Space is crucial for DisCo. By replacing the difference operator with concatenation, the performance drops significantly (Table 2), indicating that the encoded representation is not well disentangled. On the other hand, the disentangled representations of images are achieved by Contrastive Learning in the Variation Space.
+
+# 4.4 ANALYSIS OF DIFFERENT GENERATIVE MODELS
+
+As shown in Table 1, DisCo can be well generalized to different generative models (GAN, VAE, and Flow). DisCo on GAN and VAE can achieve relative good performance, while DisCo on Flow is not as good. The possible reason is similar to the choice of latent space of GAN. We assume the disentangled directions are global linear and thus use a linear navigator. In contrast to GAN and VAE, we suspect that Flow may not conform to this assumption well. Furthermore, Flow has the problems of high GPU cost and unstable training, which limit us to do further exploration.
+
+# 5 CONCLUSION
+
+In this paper, we present an unsupervised and model-agnostic method DisCo, which is a Contrastive Learning framework to learn disentangled representation by exploiting pretrained generative models. We propose an entropy-based domination loss and a hard negatives flipping strategy to achieve better disentanglement. DisCo outperforms typical unsupervised disentanglement methods while maintaining high image quality. We pinpoint a new direction that Contrastive Learning can be well applied to extract disentangled representation from pretrained generative models. There may be some specific complex generative models, for which the global linear assumption of disentangled directions in the latent space could be a limitation. For future work, extending DisCo to the existing VAE-based disentanglement framework is an exciting direction.
+
+# REFERENCES
+
+Yoshua Bengio and Yann LeCun. Scaling learning algorithms towards AI. In Large Scale Kernel Machines. MIT Press, 2007.
+Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthew, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in beta-vae. arXiv:1804.03599, 2018.
+Ricky TQ Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In NeurPIS, 2018.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020.
+Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: interpretable representation learning by information maximizing generative adversarial nets. In NeurPIS, 2016.
+Huseyin Coskun, David Joseph Tan, Sailesh Conjeti, Nassir Navab, and Federico Tombari. Human motion analysis with deep metric learning. In ECCV, 2018.
+Yu Deng, Jiaolong Yang, Dong Chen, Fang Wen, and Xin Tong. Disentangled and controllable face image generation via 3d imitative-contrastive learning. In CVPR, 2020.
+Cian Eastwood and Christopher K. I. Williams. A framework for the quantitative evaluation of disentangled representations. In *ICLR*, 2018.
+Muhammad Waleed Gondal, Manuel Wuthrich, Djordje Miladinovic, Francesco Locatello, Martin Breidt, Valentin Volchkov, Joel Akpo, Olivier Bachem, Bernhard Scholkopf, and Stefan Bauer. On the transfer of inductive bias from simulation to the real world: a new disentanglement dataset. In NeurIPS, 2019.
+Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial networks. CoRR, abs/1406.2661, 2014. URL http://arxiv.org/abs/1406.2661.
+Jean-Bastien Grill, Florian Strub, Florent Alché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Ávila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent - A new approach to self-supervised learning. In NeurPIS, 2020.
+Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In AISTATS. JMLR Workshop and Conference Proceedings, 2010.
+Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering interpretable GAN controls. In NeurIPS, 2020.
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
+Olivier J. Henaff. Data-efficient image recognition with contrastive predictive coding. In ICML, 2020.
+Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
+Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017.
+Ali Jahanian, Lucy Chai, and Phillip Isola. On the "steerability" of generative adversarial networks. In ICLR, 2020.
+
+Y Jin, J Zhang, M Li, Y Tian, and H Zhu. Towards the high-quality anime characters generation with generative adversarial networks. In Proceedings of the Machine Learning for Creativity and Design Workshop at NeurIPS, 2017.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019.
+Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In CVPR, 2020.
+Valentin Khrulkov, Leyla Mirvakhabova, Ivan V. Oseledets, and Artem Babenko. Disentangled representations from non-disentangled models. CoRR, abs/2102.06204, 2021.
+Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In ICML, 2018.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
+Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NeurIPS, 2018.
+Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. arXiv preprint arXiv:1711.00848, 2017.
+Phuc H Le-Khac, Graham Healy, and Alan F Smeaton. Contrastive representation learning: A framework and review. IEEE Access, 2020.
+Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
+Wonkwang Lee, Donggyun Kim, Seunghoon Hong, and Honglak Lee. High-fidelity synthesis with disentangled representation. In ECCV, 2020.
+Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven C. H. Hoi. Prototypical contrastive learning of unsupervised representations. CoRR, abs/2005.04966, 2020. URL https://arxiv.org/abs/2005.04966.
+Minjun Li, Yanghua Jin, and Huachun Zhu. Surrogate gradient field for latent space manipulation. In CVPR, 2021a.
+Suichan Li, Dongdong Chen, Yinpeng Chen, Lu Yuan, Lei Zhang, Qi Chu, Bin Liu, and Nenghai Yu. Improve unsupervised pretraining for few-label transfer. ICCV, 2021b.
+Zinan Lin, Kiran Thekumparampil, Giulia Fanti, and Sewoong Oh. Infogan-cr and modelcentrality: Self-supervised model training and selection for disentangling gans. In ICML, 2020.
+Rui Liu, Yixiao Ge, Ching Lam Choi, Xiaogang Wang, and Hongsheng Li. Divco: Diverse conditional image synthesis via contrastive generative adversarial network. In CVPR, 2021.
+Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Ratsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In ICML, 2019.
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018.
+Andriy Mnih and Koray Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estimation. In NeurIPS, 2013.
+Andriy Mnih and Yee Whye Teh. A fast and simple algorithm for training neural probabilistic language models. ICML, 2012.
+Taesung Park, Alexei A. Efros, Richard Zhang, and Jun-Yan Zhu. Contrastive learning for unpaired image-to-image translation. In ECCV, 2020.
+
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2015.
+Scott E. Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In NeurlPS, 2015.
+Yujun Shen and Bolei Zhou. Closed-form factorization of latent semantics in gans. In CVPR, 2021.
+Yujun Shen, Jinjin Gu, Xiaou Tang, and Bolei Zhou. Interpreting the latent space of gans for semantic face editing. In CVPR, 2020.
+Akash Srivastava, Yamini Bansal, Yukun Ding, Cole L. Hurwitz, Kai Xu, Bernhard Egger, Prasanna Sattigeri, Josh Tenenbaum, David D. Cox, and Dan Gutfreund. Improving the reconstruction of disentangled representation learners via multi-stage modelling. CoRR, abs/2010.13187, 2020.
+Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018. URL http://arxiv.org/abs/1807.03748.
+Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the GAN latent space. In ICML, 2020.
+Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, pp. 9929-9939. PMLR, 2020.
+Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018.
+
+# A IMPLEMENTATION DETAILS
+
+# A.1 SETTING FOR DISCo
+
+For the hyperparameters, we empirically set the temperature $\tau$ to 1, threshold $T$ to 0.95, batch size $B$ to 32, the number of positives $N$ to 32, the number of negatives $K$ to 64, the loss weight $\lambda$ for $\mathcal{L}_{ed}$ to 1, the number of directions $D$ to 64 and the dimension of the representation $J$ to 32. We use an Adam optimizer (Kingma & Ba, 2015) in the training process, as shown in Table 5. Besides $N$ and $M$ , we empirically find that DisCo is not sensitive to threshold $T \geq 0.9$ and other hyperparameters.
+
+For the randomness, there is no regularization term for DisCo, thus the disentanglement performance is mainly influenced by the pretrained generative models. We follow Khrulkov et al. (2021) to run 5 random seeds to pretrain the GAN and 5 random seeds for training DisCo. We have the same setting for DisCo on GAN and VAE on all three datasets. For Flow, we only use one random seed to pretrain the Glow and use one random seed for DisCo. Compare with the baselines, for DisCo on StyleGAN, our modification happens globally on all layers in the $W$ space without any manual selection.
+
+| Parameter | Values |
| Optimizer | Adam |
| Adam: beta1 | 0.9 |
| Adam: beta2 | 0.999 |
| Adam: epsilon | 1.00e-08 |
| Adam: learning rate | 0.00001 |
| Iteration: | 100,000 |
+
+Table 5: Optimizer for DisCo.
+
+ | T=0.7 | T=0.8 | T=0.9 | T=0.95 | T=0.98 |
| MIG | 0.157 | 0.244 | 0.508 | 0.547 | 0.408 |
| DCI | 0.396 | 0.576 | 0.710 | 0.730 | 0.703 |
+
+Table 6: Ablation study on hyperparameter $T$ . DisCo is not sensitive to $T$ when $T \geq 0.9$ . For $T < 0.9$ , we may flip true hard negative and thus lead the optimization of Contrastive Loss collapse.
+
+# A.2 SETTING FOR BASELINES
+
+In this section, we introduce the implementation setting for the baselines (including randomness).
+
+VAE-based methods. We choose FactorVAE and $\beta$ -TCVAE as the SOTA VAE-based methods, we follow Locatello et al. (2019) to use the same architecture of encoder and decoder. For the hyper-parameters, we use the best settings by grid search. We set the latent dimension of representation to 10. For FactorVAE, we set the hyperparameter $\gamma$ to 10. For $\beta$ -TCVAE, we set the hyperparameter $\beta$ to 6. For the random seeds, considering our method has 25 run, we run 25 times with different random seeds for each model to make the comparison fair.
+
+InfoGAN-based methods. We choose InfoGAN-CR as a baseline. We use the official implementation 2 with the best hyperparameter settings by grid search. For the random seeds, we run 25 times with different random seeds
+
+Discovering-based methods. We follow Khrulkov et al. (2021) to use the same settings for the following four baselines: LD (GAN), CF, GS, and DS. Similar to our method (DisCo), discovering-based methods do not have a regularization term. Thus, for the randomness, we adopt the same strategy with DisCo. We take the top-10 directions for 5 different random seeds for GAN and 5 different random seeds for the additional encoder to learn disentangled representations.
+
+LD (VAE) & LD (Flow). We follow LD (GAN) to use the same settings and substitute the GAN with VAE / Glow. The only exception is the randomness for LD (Flow). We only run one random seed to pretrain the Glow and use one random seed for the encoder.
+
+# A.3 MANIPULATION DISENTANGLEMENT SCORE
+
+As claimed in Li et al. (2021a), it is difficult to evaluate the performance on discovering the latent space among different methods, which often use model-specific hyper-parameters to control the editing strength. Thus, Li et al. (2021a) propose a comprehensive metric called Manipulation Disentanglement Score (MDS), which takes both the accuracy and the disentanglement of manipulation into consideration. For more details, please refer to Li et al. (2021a).
+
+# A.4 DOMAIN GAP PROBLEM
+
+Please note that there exists a domain gap between the generated images of pretrained generative models and the real images. However, the good performance on disentanglement metrics shows that the domain gap has limited influence on DisCo.
+
+# A.5 ARCHITECTURE
+
+Here, we provide the model architectures in our work. For the architecture of StyleGAN2, we follow Khrulkov et al. (2021). For the architecture of Glow, we use the open-source implementation $^{3}$ .
+
+| Conv 7 × 7 × 3 × 64, stride = 1 |
| ReLU |
| Conv 4 × 4 × 64 × 128, stride = 2 |
| ReLU |
| Conv 4 × 4 × 128 × 256, stride = 2 |
| ReLU |
| Conv 4 × 4 × 256 × 256, stride = 2 |
| ReLU |
| Conv 4 × 4 × 256 × 256, stride = 2 |
| ReLU |
| FC 4096 × 256 |
| ReLU |
| FC 256 × 256 |
| ReLU |
| FC 256 × J |
+
+Table 7: Encoder $E$ architecture used in DisCo. $J$ is 32 for Shapes3D, MPI3D and Car3D.
+
+| FC J × 256 |
| ReLU |
| FC 256 × 256 |
| ReLU |
| FC 256 × 4096 |
| ConvTranspose 4 × 4 × 256 × 256, stride = 2 |
| ReLU |
| ConvTranspose 4 × 4 × 256 × 256, stride = 2 |
| ReLU |
| ConvTranspose 4 × 4 × 256 × 128, stride = 2 |
| ReLU |
| ConvTranspose 4 × 4 × 128 × 64, stride = 2 |
| ReLU |
| ConvTranspose 7 × 7 × 64 × 3, stride = 1 |
+
+Table 8: VAE's decoder architecture. Its encoder is the same as the encoder in DisCo.
+
+# B MORE EXPERIMENTS
+
+# B.1 MORE QUALITATIVE COMPARISON
+
+We provide some examples for qualitative comparison. We first demonstrate the trade-off problem of the VAE-based methods. As shown in Figure 7, DisCo leverages the pretrained generative model and does not have the trade-off between disentanglement and generation quality.
+
+
+$\beta$ -TCVAE
+
+
+DisCo
+Figure 7: Demonstration of the trade-off problem of the VAE-based method. $\beta$ -TCVAE has bad generation quality, especially on the real-world dataset. DisCo lerversages pretrained generative model that can synthesize high-quality images.
+
+Furthermore, as shown in Figure 8 and Figure 9, VAE-based methods suffer from poor image quality. When changing one attribute, the results of discovering-based methods tend to also change other attributes.
+
+
+Figure 8: Comparison with baselines on Shapes3D dataset with Pose attribute.
+
+
+LD
+
+
+CF
+
+
+
+
+GS
+
+
+DS
+FactorVAE
+
+
+
+
+$\beta$ -TCVAE
+DisCo (GAN)
+Figure 9: Comparison with baselines on Shapes3D dataset with Wall Color attribute. VAE-based methods suffer from poor image quality. Discovering-based methods tend to entangle Wall Color with other attributes.
+
+We also provide qualitative comparisons between DisCo and InfoGAN-CR. Note that the latent space of InfoGAN-CR is not aligned with the pretrained StyleGAN2. InfoGAN-CR also suffers from the trade-off problem, and its disentanglement ability is worse than DisCo.
+
+
+Figure 10: Comparison with baselines on Shapes3D dataset with Wall Color attribute. InfoGAN-CR entangles Wall Color with Object Color and Pose.
+
+
+Figure 11: Comparison with baselines on Shapes3D dataset with Floor Color attribute. InfoGAN-CR entangles Floor Color with Object Color.
+
+We explain the comparison in the main paper and show more manipulation comparisons here.
+
+
+Figure 12: Manipulation comparison with discovering-based pipeline with Smile attribute. We explain the left column here. For GS, the manipulation also changes age. For LD, the manipulation also changes pose and skin tone. For CF, the manipulation also change identity.
+
+
+Figure 13: Manipulation comparison with discovering-based pipeline with Bald attribute. We explain the left column here. For GS and LD, the manipulations also change age. For CF, the manipulation also changes skin tone.
+
+
+Figure 14: Manipulation comparison with discovering-based pipeline with Pose attribute. LD does not find the direction of pose attribute. GS, CF and DisCo can manipulate pose successfully.
+
+# B.2 ANALYSIS OF THE LEARNED DISENTANGLED REPRESENTATIONS
+
+We feed the images traversing the three most significant factors (wall color, floor color, and object color) of Shapes3D into the Disentangling Encoders and plot the corresponding dimensions of the encoded representations to visualize the learned disentangled space. The location of each point is the disentangled representation of the corresponding image. An ideal result is that all the points form a cube, and color variation is continuous. We consider three baselines that have relatively higher MIG and DCI: CF, DS, LD. As the figures below show, the points in the latent space of CF and DS are not well organized, and the latent space of all the three baselines are not well aligned with the axes, especially for LD. DisCo learns a well-aligned and well-organized latent space, which signifies a better disentanglement.
+
+
+CF
+
+
+DS
+
+
+LD
+
+
+Ours
+
+# B.3 MORE QUANTITATIVE COMPARISON
+
+We provide additional quantitative comparisons in terms of $\beta$ -VAE score and FactorVAE score. DisCo on pretrained GAN is comparable to discovering-based baselines in terms of $\beta$ -VAE score and FactorVAE score, suggesting that some disagreement between these two scores and MIG/ DCI. However, note that the qualitative evaluation in Figure 8, Figure 9 and Section B.2 shows that the disentanglement ability of DisCo is better than all the baselines on Shapes3D dataset.
+
+| Method | Cars3D | Shapes3D | MPI3D |
| β-VAE score | FactorVAE score | β-VAE score | FactorVAE score | β-VAE score | FactorVAE score |
| Typical disentanglement baselines: |
| FactorVAE | 1.00 ± 0.00 | 0.906 ± 0.052 | 0.892 ± 0.064 | 0.840 ± 0.066 | 0.339 ± 0.029 | 0.152 ± 0.025 |
| β-TCVAE | 0.999 ± 1.0e-4 | 0.855 ± 0.082 | 0.978 ± 0.036 | 0.873 ± 0.074 | 0.348 ± 0.012 | 0.179 ± 0.017 |
| InfoGAN-CR | 0.450 ± 0.022 | 0.411 ± 0.013 | 0.837 ± 0.039 | 0.587 ± 0.058 | 0.672 ± 0.101 | 0.439 ± 0.061 |
| Methods on pretrained GAN: |
| LD | 0.999 ± 2.54e-4 | 0.852 ± 0.039 | 0.913 ± 0.063 | 0.805 ± 0.064 | 0.535 ± 0.057 | 0.391 ± 0.039 |
| CF | 1.00 ± 0.00 | 0.873 ± 0.036 | 0.999 ± 0.001 | 0.951 ± 0.021 | 0.669 ± 0.033 | 0.523 ± 0.056 |
| GS | 1.00 ± 0.00 | 0.932 ± 0.018 | 0.944 ± 0.044 | 0.788 ± 0.091 | 0.605 ± 0.061 | 0.465 ± 0.036 |
| DS | 1.00 ± 0.00 | 0.871 ± 0.047 | 0.991 ± 0.022 | 0.929 ± 0.065 | 0.651 ± 0.043 | 0.502 ± 0.042 |
| DisCo (ours) | 0.999 ± 6.86e-5 | 0.855 ± 0.074 | 0.987 ± 0.028 | 0.877 ± 0.031 | 0.530 ± 0.015 | 0.371 ± 0.030 |
| Methods on pretrained VAE: |
| LD | 0.951 ± 0.074 | 0.711 ± 0.085 | 0.602 ± 0.196 | 0.437 ± 0.188 | 0.266 ± 0.068 | 0.242 ± 0.010 |
| DisCo (ours) | 0.999 ± 5.42e-5 | 0.761 ± 0.114 | 0.999 ± 8.9e-4 | 0.956 ± 0.041 | 0.411 ± 0.034 | 0.391 ± 0.075 |
| Methods on pretrained Flow: |
| LD | 0.922 ± 0.000 | 0.633 ± 0.000 | 0.699 ± 0.000 | 0.597 ± 0.000 | 0.266 ± 0.000 | 0.242 ± 0.000 |
| DisCo (ours) | 1.00 ± 0.000 | 0.880 ± 0.000 | 0.860 ± 0.000 | 0.854 ± 0.000 | 0.538 ± 0.000 | 0.486 ± 0.000 |
+
+We also provide an additional experiment on Noisy-DSprites dataset. We compare DisCo with $\beta$ -TCVAE (the best typical method) and CF (the best discovering-based method) in terms of MIG and DCI metrics.
+
+Table 9: Comparisons of the $\beta$ -VAE and FactorVAE scores on the Shapes3D dataset (mean $\pm$ variance). A higher mean indicates a better performance.
+
+| Method | β-TCVAE | CF | DisCo (GAN) |
| DCI | 0.088 ± 0.049 | 0.027 ± 0.016 | 0.120 ± 0.059 |
| MIG | 0.046 ± 0.031 | 0.020 ± 0.015 | 0.104 ± 0.030 |
+
+Table 10: Comparisons on Noisy-DSprites.
+
+# C LATENT TRIVERSALS
+
+In this section, we visualize the disentangled directions of the latent space discovered by DisCo on each dataset. For Cars3D, Shapes3D, Anime and MNIST, the iamage resolution is $64 \times 64$ . For FFHQ, LSUN cat and LSUN church, the image resolution is $256 \times 256$ . Besides StyleGAN2, we also provide results of Spectral Norm GAN (Miyato et al., 2018) on MNIST (LeCun et al., 2010) and Anime Face (Jin et al., 2017) to demonstrate that DisCo can be well generalized to other types of GAN.
+
+
+(c) StyleGAN2 Cars3D - Type
+Figure 15: Examples of disentangled directions for StyleGAN2 on Cars3D discovered by DisCo.
+
+
+
+
+(a) StyleGAN2 Shapes3D - Wall Color
+
+
+(b) StyleGAN2 Shapes3D - Floor Color
+
+
+(c) StyleGAN2 Shapes3D - Object Color
+(d) StyleGAN2 Shapes3D - Pose
+Figure 16: Examples of disentangled directions for StyleGAN2 on Shapes3D discovered by DisCo. As shown in (b), the latent space has local semantic.
+
+
+
+
+(a) StyleGAN2 LSUN Cat - Black
+
+
+(b) StyleGAN2 LSUN Cat - Eye
+(c) StyleGAN2 LSUN Cat-Hair
+Figure 17: Examples of disentangled directions for StyleGAN2 on LSUN Cat discovered by DisCo.
+
+
+
+
+(a) StyleGAN2 LSUN Church - Hue
+
+
+(b) StyleGAN2 LSUN Church - Background Removal
+(c) StyleGAN2 LSUN Church - Sky
+Figure 18: Examples of disentangled directions for StyleGAN2 on LSUN Church discovered by DisCo.
+
+
+(a) StyleGAN2 FFHQ - Oldness
+
+
+
+
+(b) StyleGAN2 FFHQ - Hair
+(c) StyleGAN2 FFHQ - Race
+Figure 19: Examples of disentangled directions for StyleGAN2 on FFHQ discovered by DisCo.
+
+
+(d) StyleGAN2 FFHQ - Overexpose
+
+
+
+
+(e) StyleGAN2 FFHQ - Pose
+(f) StyleGAN2 FFHQ - Smile
+Figure 20: Examples of disentangled directions for StyleGAN2 on FFHQ discovered by DisCo.
+
+
+
+
+(a) SNGAN Anime - Tone
+
+
+(b) SNGAN Anime - Skin
+(c) SNGAN Anime - Pose
+Figure 21: Examples of disentangled directions for SNGAN on Anime discoverb by DisCo.
+
+
+(d) SNGAN Anime - Naturalness
+
+
+
+
+(e) SNGAN Anime - Glass
+(f) SNGAN Anime - Whiteness
+Figure 22: Examples of disentangled directions for SNGAN on Anime discovered by DisCo.
+
+
+
+
+(a) SNGAN MNIST - Angle
+
+
+(b) SNGAN MNIST - Width
+(c) SNGAN MNIST - Thickness
+Figure 23: Examples of disentangled directions for SNGAN on MNIST discovered by DisCo.
+
+
+
+
+(a) VAE Shapes3D - Wall Color
+
+
+(b) VAE Shapes3D - Floor Color
+(c) VAE Shapes3D - Object Color
+Figure 24: Examples of disentangled directions for VAE on Shapes3D discovered by DisCo.
+
+
+
+
+(d) VAE Shapes3D - Pose
+
+
+(e) VAE Shapes3D - Height
+(f) VAE Shapes3D - Object Shape
+Figure 25: Examples of disentangled directions for VAE on Shapes3D discovered by DisCo.
+
+
+
+
+(a) Glow Shapes3D - Wall Color
+
+
+(b) Glow Shapes3D - Floor Color
+(c) Glow Shapes3D - Object Color
+Figure 26: Examples of disentangled directions for Glow on Shapes3D discovered by DisCo.
+
+# D AN INTUITIVE ANALYSIS FOR DISCO
+
+DisCo works by contrasting the variations resulted from traversing along the directions provided by the Navigator. Is the method sufficient to converge to the disentangled solution? Note that it is very challenging to answer this question. To our best knowledge, for unsupervised disentangled representation learning, there is no sufficient theoretical constraint to guarantee the convergence to a disentangled solution Locatello et al. (2019). Here we provide an intuitive analysis for DisCo and try to provide our thoughts on how DisCo find the disentangled direction in the latent space, which is supported by our observations on pretrained GAN both quantitatively and qualitatively. The intuitive analysis consists of two parts: $(i)$ The directions that can be discovered by DisCo have different variation patterns compared to random directions. $(ii)$ DisCo hardly converges to the an entangled solution.
+
+# D.1 WHAT KIND OF DIRECTIONS DISCO CAN CONVERGE TO?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Traversal images
+
+
+Floor color
+
+
+Wall color
+Figure 27: Visualization of the latent space of GAN on Shapes3D with discovered directions from DisCo or random sampled directions. We traverse the latent space with a range of $[-25, 25]$ and a step of 0.5, which results in 10,000 $(100 \times 100)$ samples.
+
+First, we visualize the latent space and show that there are some variation patterns in the latent space for disentangled factors. We design the following visualization method. Given a pretrained GAN and two directions in the latent space, we traverse along the plane expanded by the two directions to generate a grid of images. The range is large enough to include all values of these disentangled factors, and the step is small enough to obtain a dense grid. Then, we input these images into an encoder that trained with ground truth factors labels. We get a heatmap of each factor (the value is the response value corresponding dimension of the factor). In this way, we can observe the variation pattern that emerged in the latent space.
+
+We take the pretrained StyleGAN on Shapes3D (synthetic) and FFHQ (real-world). For Shapes3D, we take background color and floor color as the two factors (since they refer to different areas in the image, these two factors are disentangled). For FFHQ, we take smile (mouth) and bald (hair) as the two factors (disentangled for referring to different areas). We then choose random directions and the directions discovered by DisCo. The results are shown in Figure 27 and Figure 28.
+
+We find a clear difference between random directions and directions discovered by DisCo. This is because DisCo can learn the directions by separating the variations resulted from traversing along with them. However, not all directions can be separated. For those directions in which the variations are not able to be recognized or clustered by the encoder $\pmb{E}$ , it is nearly impossible for DisCo to converge to them. Conversely, for those directions that can be easily recognized and clustered, DisCo will converge to them with a higher probability. From the following observations, we find that the variation patterns resulting from the directions corresponding to disentangled factors are easily recognized and clustered.
+
+
+Figure 28: Visualization of the latent space of GAN on FFHQ with discovered directions from DisCo or random sampled directions. We traverse the latent space with a range of $[-15, 15]$ and a step of 0.3, which results in $1,0000(100 \times 100)$ samples. For better visualization, we only present the traversal results with a step of $5(10 \times 10)$ .
+
+# D.2 WHY DISCO HARDLY CONVERGES TO THE ENTANGLED CASES?
+
+In the previous section, we show that DisCo can discover the directions with distinct variation patterns and exclude random directions. Here we discuss why DisCo can hardly converge to the following entangled case (trivial solution based on disentangled one). For example, suppose there is an entangled direction of factors A and B (A and B change with the same rate when traversing along with it) in the latent space of generative models, and DisCo can separate the variations resulting
+
+
+Figure 29: Sketch map of latent space of generative models.
+
+
+
+from the direction of A and the entangled direction. In that case, DisCo has no additional bias to update these directions to converge to disentangled ones.
+
+In the following text, for ease of referring to, we denote the entangled direction of factors A and B (A and B change with the same rate when traversing along with it) as $\mathrm{A + B}$ direction, and direction of factor A (only A change when we traverse along with it). The reasons for why DisCo is hardly converged to the case of A and $\mathrm{A + B}$ are two-fold:
+
+(i) Our encoder is a lightweight network (5 CNN layers + 3 FC layers). It is nearly impossible for it to separate the A and $\mathrm{A} + \mathrm{B}$ directions.
+$(ii)$ In the latent space of the pretrained generative models, the disentangled directions (A, B) are consistent at different locations. In contrast, the entangled directions $(\mathrm{A} + \mathrm{B})$ are not, as shown in Figure 29.
+
+We conduct the following experiments to verify them. For $(i)$ , we replace our encoder in DisCo with a ResNet-50 and train DisCo from scratch on the Shapes3D dataset. The loss, MIG, and DCI are presented in Table 11. The trivial solution is possible when the encoder is powerful enough to fit the A and A+B directions to "become orthogonal". With this consideration, in DisCo we adopt a lightweight encoder to avoid this issue.
+
+ | Our Encoder | ResNet-50 |
| Param | 4M | 25.5M |
| Loss (↓) | 0.550 | 0.725 |
| MIG (↑) | 0.562 | 0.03 |
| DCI (↑) | 0.736 | 0.07 |
+
+Table 11: Ablation study on encoder of DisCo.
+
+For $(ii)$ , as the sketch Figure 29 demonstrates, the disentangled directions ("A"-blue color or "B"-green color) are consistent, which is invariant to the location in the latent space, while the entangled directions ("A+B"-red color) is not consistent on different locations. The fundamental reason is that: the directions of the disentangled variations are invariant with the position in the latent space. However, the "rate" of the variation is not. E.g., at any point in the latent space, going "up" constantly changes the camera's pose. However, at point a, going "up" with step 1 means rotating 10 degrees. At point b, going "up" with step 1 means rotating 5 degrees. When the variation "rate" of "A" and "B" are different, the "A+B" directions at different locations are not consistent.
+
+Based on the different properties of disentangled and entangled directions in the latent space, DisCo can discover the disentangled directions with contrastive loss. The contrastive loss can be understood from the clustered view (Wang & Isola, 2020; Li et al., 2021b). The variations from the disentangled directions are more consistent and can be better clustered compared to the variations from the
+
+entangled ones. Thus, DisCo can discover the disentangled directions in the latent space and learn disentangled representations from images. We further provide the following experiments to support our above analysis.
+
+# D.2.1 QUANTITATIVE EXPERIMENT
+
+We compare the losses of three different settings:
+
+- $A$ : For a navigator with disentangled directions, we fix the navigator and train the encoder until convergence.
+- $A + B$ : For a navigator with entangled directions (we use the linear combination of the disentangled directions to initialize the navigator), we fix it and train the encoder until convergence.
+- $A + B \to A$ : After $\mathrm{A} + \mathrm{B}$ is convergent, we update both the encoder and the navigator until convergence.
+
+The Contrastive loss after convergence is presented in Table 12.
+
+ | A | A+B | A+B→A |
| Loss | 0.5501 | 0.7252 | 0.5264 |
+
+Table 12: Loss comparison on different settings.
+
+The results show that: (i) The disentangled directions (A) can lead to lower loss and better performance than entangled directions $(\mathrm{A} + \mathrm{B})$ , indicating no trivial solution. (ii) Even though the encoder with $\mathrm{A} + \mathrm{B}$ is converged, when we optimize the navigator, gradients will still backpropagate to the navigator and converge to A.
+
+# D.2.2 QUALITATIVE EXPERIMENT
+
+We visualize the latent space of GAN in Figure 30 to verify the variation "rate" in the following way: in the latent space, we select two ground truth disentangled directions: floor color (A) and background color (B) obtained by supervision with InterFaceGAN (Shen et al., 2020), we conduct equally spaced sampling along the two disentangled directions: A (labeled with green color variation), B (labeled with gradient blue color) and composite direction $(\mathrm{A} + \mathrm{B})$ , labeled with gradient red color) as shown in Figure 30 (a).
+
+Then we generate the images (also include other images on the grid as shown in Figure 30 (b)), and feed the images in the bounding boxes into a "ground truth" encoder (trained with ground truth disentangled factors) to regress the "ground truth" disentangled representations of the images.
+
+
+(a) Sampling points
+
+
+(b) Generated images
+
+
+(c) Representation of GT encoder
+Figure 30: Visualization of GAN latent space.
+
+In Figure 30 (c), the points labeled with green color are well aligned with the x-axis indicating only floor color change, points labeled with blue variation are well aligned with the y-axis indicating only
+
+background color change. However, the points labeled with red color are NOT aligned with any line, which indicates the directions of $\mathrm{A} + \mathrm{B}$ are not consistent. Further, the variation "rate" is relevant to the latent space locations for the two disentangled directions. This observation well supports our idea shown in Figure 29. The different properties between disentangled and entangled directions enable DisCo to discover the disentangled directions in the latent space.
+
+# E EXTENSION: BRIDGE THE PRETRAINED VAE AND PRETRAINED GAN
+
+Researchers are recently interested in improving image quality given the disentangled representation generated by typical disentanglement methods. Lee et al.(Lee et al., 2020) propose a post-processing stage using a GAN based on disentangled representations learned by VAE-based disentanglement models. This method scarifies a little generation ability due to an additional constraint. Similarly, Srivastava et al. (Srivastava et al., 2020) propose to use a deep generative model with AdaIN (Huang & Belongie, 2017) as a post-processing stage to improve the reconstruction ability. Following this setting, we can replace the encoder in DisCo (GAN) with an encoder pretrained by VAE-based disentangled baselines. In this way, we can bridge the pretrained disentangled VAE and pretrained GAN, as shown in Figure 31. Compared to previous methods, our method can fully utilize the state-of-the-art GAN and the state-of-the-art VAE-based method and does not need to train a deep generative model from scratch.
+
+
+
+
+$\beta$ -TCVAE
+DisCo (with a pretrained encoder)
+Figure 31: DisCo with a pretrained encoder allows synthesizing high-quality images by bridging pretrained $\beta$ -TCVAE and pretrained StyleGAN2.
+
+# F DISCUSSION ON RELATION BETWEEN BCELOSS AND NCELOSS
+
+We would like to present a deep discussion on the relation between the BCELoss $\mathcal{L}_{\text{logits}}$ and NCELoss $\mathcal{L}_{NCE}$ . This discussion is related to the NCE paper Gutmann & Hyvärinen (2010), and InfoNCE paper van den Oord et al. (2018). The discussion is as following: (i) we first provide a formulation of a general problem and get two objectives, $\mathcal{L}_1$ and $\mathcal{L}_2$ , and $\mathcal{L}_1$ is the upper bound of $\mathcal{L}_2$ . (ii) Following Gutmann & Hyvärinen (2010), we show that $\mathcal{L}_1$ is aligned with $\mathcal{L}_{BCE}$ under the setting of Gutmann & Hyvärinen (2010). (iii) Following van den Oord et al. (2018), we prove $\mathcal{L}_2$ is aligned with $\mathcal{L}_{NCE}$ under the setting of van den Oord et al. (2018). (iii) We discuss the relation between these objectives and the loss in our paper.
+
+Part I. Assume we have $S$ observations $\{x_{i}\}_{i = 1}^{S}$ from a data distribution $p(x)$ , each with a label $C_i\in \{0,1\}$ . The we denote the posterior probabilities as $p^+ (x) = p(x|C = 1)$ and $p^{-}(x) = p(x|C = 0)$ .
+
+We define two objectives as follow:
+
+$$
+\mathcal {L} _ {1} = - \sum_ {i = 1} ^ {S} C _ {i} \log P \left(C _ {i} = 1 \mid x _ {i}\right) + \left(1 - C _ {i}\right) \log P \left(C _ {i} = 0 \mid x _ {i}\right), \tag {10}
+$$
+
+and
+
+$$
+\mathcal {L} _ {2} = - \sum_ {i = 1} ^ {S} C _ {i} \log P \left(C _ {i} = 1 \mid x _ {i}\right) \tag {11}
+$$
+
+Since $-\sum_{i=1}^{S}(1 - C_i)\log p(C_i = 0|x_i) \geq 0$ , we have
+
+$$
+\mathcal {L} _ {1} \geq \mathcal {L} _ {2}. \tag {12}
+$$
+
+$\mathcal{L}_1$ is the upper bound of $\mathcal{L}_2$ .
+
+This a general formulation of a binary classification problem. In the context of our paper, we have a paired observation $x_{i}:(q,k_{i})$ , with $q$ as the query, and the key $k_{i}$ is either from a positive key set $\{k_j^+\}_{j = 1}^N$ or as negative key set $\{k_m^-\}_{m = 1}^M$ (i.e., $\{k_i\}_{i = 1}^{N + M} = \{k_j^+\}_{j = 1}^N\bigcup \{k_m^-\}_{m = 1}^M$ ), where $M = S - N$ . And $C_i$ is assigned as:
+
+$$
+C _ {i} = \left\{ \begin{array}{l l} 1, & k _ {i} \in \left\{k _ {j} ^ {+} \right\} _ {j = 1} ^ {N} \\ 0, & k _ {i} \in \left\{k _ {m} ^ {-} \right\} _ {m = 1} ^ {M} \end{array} \right. \tag {13}
+$$
+
+In our paper, we have $h(x) = \exp (q\cdot k / \tau)$ .
+
+Part II. In this part, following Gutmann & Hyvarinen (2010), we show that $\mathcal{L}_1$ is aligned with $\mathcal{L}_{\mathrm{logits}}$ (Equation 3 in the main paper) under the setting of Gutmann & Hyvarinen (2010). Following Gutmann & Hyvarinen (2010), we assume the prior distribution $P(C = 0) = P(C = 1) = 1 / 2$ , according to the Bayes rule, we have
+
+$$
+P (C = 1 | x) = \frac {p (x \mid C = 1) P (C = 1)}{p (x \mid C = 1) P (C = 1) + p (x \mid C = 0) P (C = 0)} = \frac {1}{1 + \frac {p ^ {-} (x)}{p ^ {+} (x)}}. \tag {14}
+$$
+
+And $P(C = 0|x) = 1 - P(C = 1|x)$ .
+
+On the other hand, we have a general form of BCELoss, as
+
+$$
+\mathcal {L} _ {B C E} = - \sum_ {i = 1} ^ {S} C _ {i} \log \sigma \left(q \cdot k _ {i} / \tau\right) + \left(1 - C _ {i}\right) \log \left(1 - \sigma \left(q \cdot k _ {i} / \tau\right)\right), \tag {15}
+$$
+
+where $\sigma (\cdot)$ is the sigmoid function. We have
+
+$$
+\sigma (q \cdot k / \tau) = \frac {1}{1 + \exp (- q \cdot k / \tau)} = \frac {1}{1 + \frac {1}{\exp (q \cdot k / \tau)}} = \frac {1}{1 + \frac {1}{h (x)}}, \tag {16}
+$$
+
+From Gutmann & Hyvarinen (2010) Theorem 1, we know that when $\mathcal{L}_{BCE}$ is minimized, we have
+
+$$
+h (x) = \frac {p ^ {+} (x)}{p ^ {-} (x)}. \tag {17}
+$$
+
+Thus, we know the BCELoss $\mathcal{L}_{BCE}$ is a approximation of the objective $\mathcal{L}_1$ .
+
+Part. III Following van den Oord et al. (2018), we prove $\mathcal{L}_2$ is aligned with $\mathcal{L}_{NCE}$ (Equation 2 in the main paper) under the setting of van den Oord et al. (2018)
+
+From the typical contrastive setting (one positive sample, others are negative samples, following van den Oord et al. (2018)), we assume there is only one positive sample, others are negatives in $\{x_{i}\}_{i = 1}^{S}$ . Then, the probability of $x_{i}$ sample from $p^+ (x)$ rather than $p^{-}(x)$ is as follows,
+
+$$
+P \left(C _ {i} = 1 \mid x _ {i}\right) = \frac {p ^ {+} \left(x _ {i}\right) \Pi_ {l \neq i} p ^ {-} \left(x _ {l}\right)}{\sum_ {j = 1} ^ {S} p ^ {+} \left(x _ {j}\right) \Pi_ {l \neq i} p ^ {-} \left(x _ {l}\right)} = \frac {\frac {p ^ {+} \left(x _ {i}\right)}{p ^ {-} \left(x _ {i}\right)}}{\sum_ {j = 1} ^ {S} \frac {p ^ {+} \left(x _ {j}\right)}{p ^ {-} \left(x _ {j}\right)}} \tag {18}
+$$
+
+From van den Oord et al. (2018), we know that when minimize Equation 11, we have $h(x) = \exp(q \cdot k / \tau) \propto \frac{p_{+}(x)}{p_{-}(x)}$ . In this case, we get the form of $\mathcal{L}_{NCE}$ as
+
+$$
+\mathcal {L} _ {N C E} = - \sum_ {i = 1} ^ {S} C _ {i} \log \frac {\exp \left(q \cdot k _ {i} / \tau\right)}{\sum_ {j = 1} ^ {S} \exp \left(q \cdot k _ {j} / \tau\right)} \tag {19}
+$$
+
+$\mathcal{L}_{NCE}$ is a approximate of $\mathcal{L}_2$
+
+Part. IV When generalize the contrastive loss into our setting ( $N$ positive samples, $M$ negative samples). The BCELoss (Equation 15) can be reformulated as
+
+The BCELoss (Equation 15) can be reformulated as
+
+$$
+\hat {\mathcal {L}} _ {B C E} = - \sum_ {j = 1} ^ {N} \log \sigma \left(q \cdot k _ {j} ^ {+} / \tau\right) - \sum_ {m = 1} ^ {M} \log \left(1 - \sigma \left(q \cdot k _ {m} ^ {-} / \tau\right)\right). \tag {20}
+$$
+
+Similarly, the NCEloss (Equation 19) can be reformulated as
+
+$$
+\hat {\mathcal {L}} _ {N C E} = - \sum_ {j = 1} ^ {N} \log \frac {\exp \left(q \cdot k _ {j} ^ {+} / \tau\right)}{\sum_ {s = 1} ^ {M + N} \exp \left(q \cdot k _ {s} / \tau\right)} \tag {21}
+$$
+
+$\hat{\mathcal{L}}_{BCE}$ is aligned with $\mathcal{L}_{\mathrm{logits}}$ (Equation 3 in our main paper), and $\hat{\mathcal{L}}_{NCE}$ is aligned with $\mathcal{L}_{NCE}$ (Equation 2 in the main paper).
+
+Now we have $\mathcal{L}_1$ (approximated by $\mathcal{L}_{BCE}$ ) is the upper bound of $\mathcal{L}_2$ (approximated by $\mathcal{L}_{NCE}$ ). However, as you may notice, the assumptions we made in Part II and Part III are different, one is $P(C = 0) = P(C = 1)$ , the other one is only one positive sample, others are negative. Also the extent to our situation is more general case ( $N$ positives, others are negatives).
+
+However, they have the same objective, which is by contrasting positives and negatives, we can use $h(x) = \exp (q\cdot k / \tau)$ to estimate $p^+ /p^-$ . We can think the $h(x)$ as a similarity score, i.e. if $q$ and $k$ are from a positive pair (they have the same direction in our paper), $h(x)$ should be as large as possible $(p^{+} / p^{-} > 1)$ and vice versa. From this way, we can learn the representations $(q,k)$ to reflect the image variation, i.e., similar variations have higher score $h(x)$ , while different kinds of variation have lower score $h(x)$ . Then with this meaningful representation, in the latent space, can help to discover the directions carrying different kinds of image variation. This is an understanding, from a contrastive learning view, of how our method works.
\ No newline at end of file
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/images.zip b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..7845214ffda7cb8240d43f945cb1760d6fc0fdc4
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d3366040e1d9a240059762a384818243673dbdf4904fdb82b87f4d279bde333a
+size 4374387
diff --git a/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/layout.json b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..24f238afe7669411f1f44b9ad9072d23db90c459
--- /dev/null
+++ b/learningdisentangledrepresentationbyexploitingpretrainedgenerativemodelsacontrastivelearningview/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:14978b89525d3e2e78b15aee3e5a441cc2ec5b1c8ee44314d94644c198d6ab39
+size 1021372
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_content_list.json b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..edd861258aee3a66ee00a5f06cb78a91ddc8fd04
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b14eb14d753980980ad8ee968caf9a2a74e620cb4565b8a6aba16674cb23e4ec
+size 186884
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_model.json b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..882729ec93e47d050cbd33901eeb70effdd04de1
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f2cb039523da8daa4de92f8446a24c3b1c6d5646cd8a8dbc9aa8315010b1a91
+size 222178
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_origin.pdf b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9103f017d0cd970fc54871783edc1e8fbf2e13ea
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/485e4291-8224-45e8-b95b-2cfbf6cafe5d_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54479943948483a926b7e1a8645592f83ad7a83eda6efafaafbe40038a8c4376
+size 938959
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/full.md b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..54e7357346f8595b4a39e5024c108e92d6b78ffa
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/full.md
@@ -0,0 +1,948 @@
+# LEARNING DISTRIBUTIONALLY ROBUST MODELS AT SCALE VIA COMPOSITE OPTIMIZATION
+
+# Farzin Haddadpour
+
+Yale Institute for Network Science Yale University
+
+farzin.haddadpour@yale.edu
+
+# Mohammad Mahdi Kamani
+
+Wyze Labs Inc.
+
+mmkamani@alumni.psu.edu
+
+# Mehrdad Mahdavi
+
+Department of Computer Science & Engineering
+
+The Pennsylvania State University
+
+mzm616@psu.edu
+
+# Amin Karbasi
+
+Yale Institute for Network Science
+
+Yale University
+
+amin.karbasi@yale.edu
+
+# ABSTRACT
+
+To train machine learning models that are robust to distribution shifts in the data, distributionally robust optimization (DRO) has been proven very effective. However, the existing approaches to learning a distributionally robust model either require solving complex optimization problems such as semidefinite programming or a first-order method whose convergence scales linearly with the number of data samples-- which hinders their scalability to large datasets. In this paper, we show how different variants of DRO are simply instances of a finite-sum composite optimization for which we provide scalable methods. We also provide empirical results that demonstrate the effectiveness of our proposed algorithm with respect to the prior art in order to learn robust models from very large datasets.
+
+# 1 INTRODUCTION
+
+Conventional machine learning problem aims at learning a model based on the assumption that training data and test data come from same data distribution. However, this assumption may not hold in various practical learning problems where there is label shift (Zhang et al., 2020a), distribution shift (Sagawa et al., 2019), fairness constraints (Hashimoto et al., 2018), and adversarial examples (Sinha et al., 2017), to name a few. Distributionally robust optimization (DRO), which has recently attracted remarkable attention from the machine learning community, is a common approach to deal with the aforementioned uncertainties (Chen et al., 2017; Duchi & Namkoong, 2016; Rahimian & Mehrotra, 2019). Defining the empirical distribution of the training data of size $m$ by $\hat{\mathbb{P}}_m \triangleq \frac{1}{m} \sum_{i=1}^{m} \delta_{\hat{\xi}_i}$ where $\delta$ is the Dirac delta function, the goal of DRO is to solve the following optimization problem
+
+$$
+\inf _ {\boldsymbol {x}} \left[ \Psi (\boldsymbol {x}) \triangleq \sup _ {\xi \in Q} \mathbb {E} _ {Q} [ \ell (\boldsymbol {x}; \xi) ] \right], \tag {1}
+$$
+
+where $\xi$ is a data sample randomly drawn from distribution $Q$ , $\ell(\boldsymbol{x};\xi)$ is the corresponding loss function and $\mathbb{E}_Q[\ell(\boldsymbol{x},\xi)]$ is the expected loss over distribution $Q$ which belongs to uncertainty set $\mathcal{U}_m$ . The uncertainty set $\mathcal{U}_m$ is defined as $\mathcal{U}_m \triangleq \{Q : d(Q, \hat{\mathbb{P}}_m) \leq \epsilon\}$ indicates the ball of a distribution with center $\hat{\mathbb{P}}_m$ and also $d(P, Q)$ is a distance measure between probability distribution $P$ and $Q$ . We note this uncertainty set captures the distribution shift hence Eq. (1) minimizes the worse data distribution. Prior studies (Ben-Tal et al., 2013; Bertsimas et al., 2018; Blanchet et al., 2019; Esfahani & Kuhn, 2018; Pourbabae, 2020) considered different uncertainty sets (see Definition 3.1 in Esfahani & Kuhn (2018)) for which they proposed equivalent reformulations of Eq. (1) based on the specific choice of $\mathcal{U}_m$ .
+
+To solve the above min-max optimization problems, majority of prior studies heavily rely on either semidefinite programming (Esfahani & Kuhn, 2018) or stochastic primal-dual methods both for convex (Deng et al., 2021; Nemirovski et al., 2009; Juditsky et al., 2011; Yan et al., 2019; 2020; Namkoong & Duchi, 2016) and non-convex (deep learning) objectives (Yan et al., 2020). While
+
+primal-dual methods can be used as an approach to solve min-max optimization problems, it suffers from a few downsides. First and foremost, they need to store a probability distribution of constrained violation of dimension $m$ corresponding to dual variables. Additionally, available primal-dual methods often demand data sampling that corresponds to the probability distribution over $m$ data samples which introduces additional cost over uniform sampling. Finally, while majority of prior studies are limited to DRO problems with convex objectives, establishing tight convergence rate for DRO problems with penalty with non-convex objectives is still lacking.
+
+To overcome these issues, we consider three different reformulations of Eq. (1), corresponding to three different choices of uncertainty sets $\mathcal{U}_m$ namely, (1) DRO with Wasserstein metrics, (2) DRO with $\chi^2$ divergence metrics, and (3) DRO with regularized entropy metrics (also known as KL) and show in Section 2 that all aforementioned DRO notions are indeed different instances of a deterministic composite optimization and can be solved by reducing to an instance of the following problem:
+
+$$
+\min _ {\boldsymbol {x}} \left[ \Psi (\boldsymbol {x}) \triangleq r (\boldsymbol {x}) + \frac {1}{m} \sum_ {i = 1} ^ {m} h _ {i} (\boldsymbol {x}) + f \left(\frac {1}{m} \sum_ {i = 1} ^ {m} g _ {i} (\boldsymbol {x})\right) \right], \tag {2}
+$$
+
+where we suppose $r(\pmb{x})$ is convex and a relatively simple function, $f(\pmb{x}): \mathbb{R}^p \to \mathbb{R}$ and $h_i(\pmb{x}): \mathbb{R}^d \to \mathbb{R}$ for $1 \leq i \leq m$ are scalar-valued functions, and $g_i(\pmb{x}): \mathbb{R}^d \to \mathbb{R}^p$ for $1 \leq i \leq m$ are vector-valued functions. On the road to solve problem (2) at scale, we also develop a novel algorithm for heavily constrained optimization problems (Narasimhan et al., 2020b; Wang & Bertsekas, 2015; 2016) that rather surprisingly invokes a single projection through the course of optimization. This algorithm is of independent interest and addresses the scalability issues raised in applications such as fairness (Donini et al., 2018; Zafar et al., 2019).
+
+We summarize the main contributions of our paper below:
+
+- We provide a large-scale analysis of DRO with Wasserstein distance and heavily constrained reformulation when the objective function is strongly-convex. Our result relies on a novel mini-batch constraint sampling for handling heavily-constrained optimization problems. As summarized in Table 1, our convergence analysis improves the state-of-the-art both in terms of the dependence on the convergence error $\epsilon$ as well as the number of constraints $m$ .
+- We represent a large-scale analysis of DRO with non-convex objectives and $\chi^2$ or KL divergences and propose a distributed variant to further improve scalability of DRO problems.
+- We verify our theoretical results through various extensive experiments on different datasets. In particular, we show that our proposed method outperforms recent methods in DRO for heavily constrained problems with a great reduction in time complexity over them.
+
+The proofs of all the theorems are provided in the appendix.
+
+# 1.1 RELATED WORK
+
+DRO and connections to heavily constrained optimization. As mentioned earlier, DRO has many different formulations, depending on the divergence metrics used (e.g., Wasserstein, $\chi^2$ or KL). While Duchi & Namkoong (2021); Namkoong & Duchi (2016); Shapiro (2017) consider constrained or penalized DRO formulation, Levy et al. (2020); Sinha et al. (2017) formulate the underlying optimization problem as unconstrained. One of the contributions of our paper is to provide a unifying framework through the language of composite optimization and treat all these variants similarly.
+
+In particular, when the objective function is convex, Levy et al. (2020) recently proposed scalable algorithms for different variants of the DRO problems with, e.g., $\chi^2$ or KL divergence metrics. Our unifying approach readily extends those results to the more challenging non-convex setting for which we are unaware of any prior work with convergence guarantees (for instance, Hashimoto et al. (2018) studied DRO with $\chi^2$ -divergence but did not provide any convergence guarantee). Similarly, Esfahani & Kuhn (2018); Kuhn et al. (2019) formulated DRO with Wasserstein distance as an instance of constrained optimization. Notably, they require ti impose one constraint per training data point and to solve such a constrained problem they proposed a semi-definite program. Even though the formulation is very novel, it cannot scale. We, in contrast, consider such a heavily constrained optimization as an instance of a composite optimization for which we provide a scalable solution. What is rather surprising about our method is that it only checks a batch of constraints per iteration, inspired by Cotter et al. (2016), and performs a single projection at the final stage of the algorithm in order to provide an $\epsilon$ -optimal solution in the case of strongly convex objectives. Moreover, in
+
+contrast to Cotter et al. (2016), we do not keep a probability distribution over the set of constraints. We should also remark that our convergence guarantees achieve the known lower bounds in terms of accuracy $\epsilon$ and the number of constraints $m$ . Finally, we should highlight the difference of our algorithm and Frank-Wolfe (FW) (Frank et al., 1956; Jaggi, 2013; Zhang et al., 2020b). While FW does not require a projection oracle, it performs a linear program over the set of constraints at each iteration. In contrast, our heavily- constrained optimization solution performs a single projection without the overhead of running a linear program at each iteration.
+
+Stochastic composite optimization. The general stochastic composite optimization $\min_{\pmb{x}}\left[\Psi (\pmb {x})\triangleq r(\pmb {x}) + f\left(\mathbb{E}_{\xi}\left[g_{\xi}(\pmb {x})\right]\right)\right]$ has recently received a lot of attentions (Qi et al., 2020b;a; Wang et al., 2017; Kalogerias & Powell, 2019). Our reformulation of DRO variants is a finite-sum instance of this general problem. More concretely, Huo et al. (2018); Lian et al. (2017); Zhang & Xiao (2019a) aimed to solve the following finite-sum problem $\min_{\pmb{x}}\left[\Psi (\pmb {x})\triangleq r(\pmb {x}) + \frac{1}{n}\sum_{j = 1}^{n}f_{j}\left(\frac{1}{m}\sum_{i = 1}^{m}g_{i}(\pmb {x})\right)\right]$ , using SVRG or SAGA (Defazio et al., 2014). In contrast, our proposed algorithm is inspired by Zhang & Xiao (2019a) and generalizes their method to the case where the extra terms $h_i(\pmb {x})$ in Eq. (2) are non-zero. We should also note that Qi et al. (2020a) proposed a similar idea in the context of online learning for DRO problems with KL divergence. Our work in contrast provides guarantees for DRO with both constraints or penalty terms.
+
+# 2 DRO VIA FINITE-SUM COMPOSITE OPTIMIZATION
+
+In this section, we discuss in detail how a finite-sum composite optimization (2) can unify various notions of distributionally robust learning, where some of which rely on heavily constrained optimization subroutines. While much research effort has been devoted to develop a specialized algorithm for each notion, our reduction paves the way to developing a scalable algorithm, discussed in Section 3.
+
+DRO with Wasserstein distance. An equivalent and tractable reformulation of Eq. (1) is provided in Esfahani & Kuhn (2018); Kuhn et al. (2019), which can be regarded as a heavily constrained optimization problem as follows:
+
+$$
+\min _ {\boldsymbol {x}} r (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\boldsymbol {x}) \quad \text {s u b j e c t} \quad \tilde {g} _ {i} (\boldsymbol {x}) \leq 0, \forall i \in [ m ]. \tag {3}
+$$
+
+where $\tilde{g}_i(\pmb{x})$ are functions related to loss function as well as slack variables (please see Appendix A for more details). Naively solving optimization problem (3) suffers from the computational complexity due to the large number of constraints $m$ . To efficiently solve the optimization problem (3), inspired by Mahdavi et al. (2012) and Cotter et al. (2016), we pursue the smoothed constrained reduction approach and introduce the augmented optimization problem (see Appendix B) of the form $\min_{\pmb{x}} \Psi(\pmb{x}) \triangleq [r(\pmb{x}) + \gamma \ln(g(\pmb{x}))]$ where $g_i(\pmb{x}) \triangleq \exp\left(\frac{\alpha \tilde{g}_i(\pmb{x})}{\gamma}\right)$ and $g(\pmb{x}) = \frac{1}{m+1} [1 + \sum_{i=1}^{m} g_i(\pmb{x})]$ . We can see that this optimization problem is a special case of the optimization problem Eq. (2) where $r(\pmb{x}) = f(\pmb{x})$ , $f\left(\frac{1}{m} \sum_{i=1}^{m} g_i(\pmb{x})\right) = \gamma \ln g(\pmb{x})$ , and $h(\pmb{x}) = 0$ . In contrast to Cotter et al. (2016) that requires an extra storage cost of probability distribution of dimension $m$ , and relatively poor convergence rate in terms of $m$ and accuracy $\epsilon$ , we propose an algorithm that simply checks a batch of constraints and achieves the optimum dependency in terms of $m$ and $\epsilon$ .
+
+DRO with $\chi^2$ -divergence. The second type of DRO problem we consider utilizes the $\chi^2$ -divergence metric as follows:
+
+$$
+\min _ {\boldsymbol {x}} \quad \max _ {0 \leq p _ {i} \leq 1, \sum_ {i = 1} ^ {m} p _ {i} = 1} \sum_ {i = 1} ^ {m} p _ {i} f _ {i} \left(\boldsymbol {x} _ {i}\right) - \gamma D _ {\chi^ {2}} (\boldsymbol {p}). \tag {4}
+$$
+
+where the $\chi^2$ divergence is defined as the distance between the uniform distribution and an arbitrary probability distribution $\pmb{p}$ , i.e., $D_{\chi^2}(\pmb{p}) \triangleq \frac{m}{2} \sum_{i=1}^{m} \left(p_i - \frac{1}{m}\right)^2$ . Levy et al. (2020) studied this problem only for the case of convex objectives. In this paper, we allow objective functions $f_i$ for $1 \leq i \leq m$ to be both non-convex or strongly-convex. The following claim derives the equivalent finite-sum composite optimization.
+
+| Reference | DRO type | # Constraint/Sample Checks to achieve ε error | objective |
| Midtouch Cotter et al. (2016) | Wasserstein | O( ln m/ε + m1.5(ln m)1.5/ε4 + m(ln m)2/3/ε4 + m2 log m/√ε) | Strongly convex |
| SEVR Yu et al. (2021) | General Linearized Wasserstein | O(m ln (1/ε) + Dk/ε + (ε+κ+1)2Dk/ε2) | Strongly convex-concave min-max |
| Theorem 4.1 | Wasserstein | O((m + κ√m) ln 1/ε) | Optimally strongly convex |
| Theorem 4.3 | χ2 or KL | O(min{√m/ε, 1/ε1.5}) | Non-convex |
| Theorem D.1 | χ2 or KL | O((m + κ√m) ln 1/ε) | Optimally strongly convex |
+
+Table 1: Comparison of our results with prior approached. All three approaches are using variance reduction techniques. $D_{u}$ and $D_{L}$ respectively denotes the upper bound on the distance of initial model from optimal model and initial optimality gap. Please see Yu et al. (2021) for more details. Finally, we note that while Midtouch approach in Cotter et al. (2016) requires additional storage of probability distribution of dimension $m$ , our approach does not.
+
+Claim 2.1. The optimization problem (4) is equivalent to the following composite problem:
+
+$$
+\min _ {\boldsymbol {x}} \quad \left[ \Psi (\boldsymbol {x}) \triangleq 1 - \frac {1}{2 \gamma m} \sum_ {i = 1} ^ {m} \left[ f _ {i} (\boldsymbol {x}) \right] ^ {2} + \frac {1}{2 \gamma} \left[ \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\boldsymbol {x}) \right] ^ {2} \right] \tag {5}
+$$
+
+We note that the optimization problem (5) fits into the formulation of finite-sum composite optimization (2) by choosing $r(\pmb{x}) = 1$ , $h(\pmb{x}) = \frac{1}{m}\sum_{i=1}^{m} -\frac{(f_i(\pmb{x}))^2}{2\gamma}$ and $f(g(\pmb{x})) = \frac{1}{2\gamma}\left[\frac{1}{m}\sum_{i=1}^{m}f_i(\pmb{x})\right]^2$ with $h_i(\pmb{x}) = -\frac{f_i^2(\pmb{x})}{2\gamma}$ , $g_i(\pmb{x}) = f_i(\pmb{x})$ and $f(x) = \frac{x^2}{2\gamma}$ .
+
+DRO with KL divergence. Finally, for DRO with KL-divergence, usually considered in online settings (Qi et al., 2020a), we consider solving the following optimization problem:
+
+$$
+\min _ {\boldsymbol {x}} \quad \max _ {0 \leq p _ {i} \leq 1, \sum_ {i = 1} ^ {m} p _ {i} = 1} \left[ \sum_ {i = 1} ^ {m} p _ {i} f _ {i} \left(\boldsymbol {x} _ {i}\right) + \gamma H \left(p _ {1}, \dots , p _ {m}\right) \right], \tag {6}
+$$
+
+where $H(p_{1},\ldots ,p_{m}) = -\sum_{i = 1}^{m}p_{i}\log p_{i}$ is the entropy function. To solve problem (6), it is straightforward to convert it to the following equivalent stochastic composite optimization problem:
+
+$$
+\min _ {\boldsymbol {x}} \left[ \Psi (\boldsymbol {x}) \triangleq \ln \left(\frac {1}{m} \sum_ {i = 1} ^ {m} \exp \left(\frac {f _ {i} (\boldsymbol {x})}{\gamma}\right)\right) \right]. \tag {7}
+$$
+
+As it can be seen, the optimization problem (7) fits into the composite optimization (2) by choosing $r(\pmb{x}) = h(\pmb{x}) = 0$ and $f(g(\pmb{x})) = \ln \left(\frac{1}{m}\sum_{i=1}^{m}\exp\left(\frac{f_i(\pmb{x})}{\gamma}\right)\right)$ .
+
+# 3 OUR PROPOSED ALGORITHM
+
+Having reduced the different notions of DRO to an instance of the composite optimization, in this section we describe our scalable approach for minimizing the objective $\Psi(\pmb{x}) = r(\pmb{x}) + \Phi(\pmb{x})$ where $\Phi(\pmb{x}) = \frac{1}{m}\sum_{i=1}^{m}h_i(\pmb{x}) + f\left(\frac{1}{m}\sum_{i=1}^{m}g_i(\pmb{x})\right)$ . We note that the compositional structure in $\Phi(\cdot)$ leads to more challenges in optimization compared with the non-compositional finite-sum problem, since the stochastic gradient of the loss function is not an unbiased estimation of the full gradient. To overcome this issue, and by building on incremental variance reduction (Zhang & Xiao, 2019b), we propose a more general algorithm with a new ingredient in which we also employ variance reduction on the extra term $h(\pmb{x}) = (1/m)\sum_{i=1}^{m}h_i(\pmb{x})$ . To handle $r(\cdot)$ , similar to Zhang & Xiao (2019b), we assume $r$ is convex and a relatively simple function. We follow the proximal gradient iterates (Beck, 2017; Nesterov, 2013) as follows:
+
+$$
+\boldsymbol {x} ^ {(t + 1)} = \Pi_ {r} ^ {\eta} \left(\boldsymbol {x} ^ {(t)} - \eta \nabla \Phi (\boldsymbol {x} ^ {(t)})\right) \tag {8}
+$$
+
+where we apply the proximal operator of $r(\pmb{x})$ with the learning rate $\eta$ as $\Pi_r^\eta (\pmb {x})\triangleq \arg \min_{\pmb{y}}\left[r(\pmb {y}) + \frac{1}{2\eta}\| \pmb {y} - \pmb {x}\| ^2\right]$ . By defining the proximal gradient mapping of $\Psi$ as $\mathcal{G}_{\eta}(\pmb {x})\triangleq$
+
+Algorithm 1: Generalized Composite Incremental Variance Reduction (GCVR $(x^{(0)})$ )
+
+Inputs: Number of iterations $t = 1, \dots, T$ , learning rate $\eta$ , initial global model $\boldsymbol{x}^{(0)}$ , the size of epoch length $\tau_{t}$ , and mini-batch sizes of $B_{t}$ and $S_{t}$ at time $t$ .
+
+for $t = 1,\dots ,T$ do
+
+Sample a mini-batch $\mathcal{B}^{(t)}$ with size $B_{t}$ uniformly over $[m]$ and compute
+
+$$
+\boldsymbol {y} _ {0} ^ {(t)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t)}} g (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi), \boldsymbol {z} _ {0} ^ {(t)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t)}} \nabla g (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi), \boldsymbol {w} _ {0} ^ {(t)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t)}} \nabla h (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi)
+$$
+
+Compute $\tilde{\nabla}\Phi (\pmb{x}_0^{(t)}) = \left(\pmb{z}_0^{(t)}\right)^\top \left(f'(\pmb{y}_0^{(t)})\right) + \pmb{w}_0^{(t)}$
+
+Update the model as follows: $\pmb{x}_1^{(t)} = \Pi_r^\eta \left(\pmb{x}_0^{(t)} - \tilde{\nabla}\Phi (\pmb{x}_0^{(t)}))\right)$
+
+for $j = 1,\dots ,\tau_{t} - 1$ do in parallel
+
+Sample a mini-batch $S_{j}^{(t)}$ with size $S_{t}$ uniformly over $[m]$ , and form the estimates
+
+$$
+\boldsymbol {y} _ {j} ^ {(t)} = \boldsymbol {y} _ {j - 1} ^ {(t)} + \frac {1}{S _ {t}} \sum_ {\xi \in S _ {j} ^ {(t)}} \left[ g \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - g \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {9}
+$$
+
+$$
+\boldsymbol {z} _ {j} ^ {(t)} = \boldsymbol {z} _ {j - 1} ^ {(t)} + \frac {1}{S _ {t}} \sum_ {\xi \in S _ {j} ^ {(t)}} \left[ \nabla g \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - \nabla g \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {10}
+$$
+
+$$
+\boldsymbol {w} _ {j} ^ {(t)} = \boldsymbol {w} _ {j - 1} ^ {(t)} + \frac {1}{S _ {t}} \sum_ {\xi \in S _ {j} ^ {(t)}} \left[ \nabla h \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - \nabla h \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {11}
+$$
+
+Compute $\tilde{\nabla}\Phi (\pmb{x}_j^{(t)}) = \left(\pmb{z}_j^{(t)}\right)^\top \left(f'(\pmb{y}_j^{(t)})\right) + \pmb{w}_j^{(t)}$
+
+Update the model as follows: $\pmb{x}_{j + 1}^{(t)} = \Pi_r^\eta \left(\pmb{x}_j^{(t)} - \tilde{\nabla}\Phi (\pmb{x}_j^{(t)})\right)$
+
+end
+
+end
+
+Output: Return a randomly selected solution from $\{x_{j}^{t}\}_{j = 0,\dots ,\tau_{t}}^{t = 1,\dots ,T}$
+
+$\frac{1}{\eta} \left[ \pmb{x} - \Pi_r^\eta (\pmb{x} - \eta \nabla \Phi(\pmb{x})) \right]$ , the updating rule in Eq. (8) can be equivalently written as $\pmb{x}^{(t+1)} = \pmb{x}^{(t)} - \eta \mathcal{G}_\eta(\pmb{x}^{(t)})$ . Given any $\pmb{y}$ as an output of randomized algorithm, we say $\pmb{y}$ achieves the stationary point of problem in Eq. (2) in expectation if $\mathbb{E}\left[\| \mathcal{G}_\eta(\pmb{y}) \|^2\right] \leq \epsilon$ holds. Our goal is to achieve an $\epsilon$ stationary point with the least number of calls to a (mini-batch) stochastic oracle.
+
+Focusing on $\Phi(\cdot)$ , as detailed in Algorithm 1, we apply three time-scale variance-reduced estimators for $g_{i}(\pmb{x})$ and its gradient $\nabla g_{i}(\pmb{x})$ , as well as $h_{i}(\pmb{x})$ . For DRO with Wasserstein divergence metric with optimally strongly objective, at the beginning of each epoch $t$ we compute a full-batch gradient over the entire data samples $B_{t} = m$ , i.e., $\pmb{y}_{0}^{(t)} = \frac{1}{m}\sum_{i=1}^{m}g_{i}(\pmb{x}_{\tau_{t}}^{(t)})$ , $\pmb{z}_{0}^{(t)} = \frac{1}{m}\sum_{i=1}^{m}\nabla g_{i}(\pmb{x}_{\tau_{t}}^{(t)})$ , $\pmb{w}_{0}^{(t)} = \frac{1}{m}\sum_{i=1}^{m}\nabla h_{i}(\pmb{x}_{\tau_{t}}^{(t)})$ . In contrast, for the case of DRO with $\chi^2$ or KL divergence metrics and nonconvex objectives we incrementally increase the size of the mini-batch $B_{t} \leq m$ at the beginning of each epoch until it reaches the point where we need to compute the full-batch of samples. We should also highlight that a mini-batch in case of Wasserstein DRO indicates a batch of constraints and in DRO with $\chi^2$ or KL divergence metrics represents the number of data sample accessed. We denote the length of each epoch and the mini-batch size within each epoch with $\tau_{t}$ and $S_{t}$ , respectively. In each epoch $t$ and iteration $j$ , we estimate mini-batch gradients from Eqs. (9), (10), and (11) in Algorithm 1, with some corrections term applied from the previous iteration. We note that the variance-reduced term corresponding to the correction is inspired by SARAH (Nguyen et al., 2017) and SPIDER (Fang et al., 2018). Finally, the algorithm returns a randomly selected solution from the iterates.
+
+Distributed variant of Algorithm 1. As mentioned before, efficient training of the stochastic composite optimization problem has attracted increasing attention in recent years. Despite much progress, all of existing methods including Algorithm 1 only focus on the single-machine setting. To employ Algorithm 1 in a distributed setting with $p$ machines, in Appendix E we propose a distributed variant of proposed algorithm and establish its convergence rate for convex and non-convex objectives which enjoys a speedup in terms of number of machines.
+
+# 4 CONVERGENCE ANALYSIS
+
+In this section we establish the convergence of proposed algorithm for different DRO notions discussed in Section 2. We start by stating the general assumptions and then discuss the obtained rates. Due to lack of space we only include the rates on the convergence of DRO with Wasserstein metric for strongly convex, and $\chi^2$ and KL divergence metrics for non-convex objectives. We defer the analysis of $\chi^2$ and KL divergence metrics with strongly objectives to Appendix D. To establish the convergence rates, we first introduce some standard assumptions.
+
+Assumption 1. We make the following assumptions on the components of objective $\Psi (\pmb {x}) = r(\pmb {x}) + \frac{1}{m}\sum_{i = 1}^{m}h_{i}(\pmb {x}) + f(\frac{1}{m}\sum_{i = 1}^{m}g_{i}(\pmb {x}))$ :
+
+1) $\| \nabla h(\pmb{x}_1) - \nabla h(\pmb{x}_2)\| \leq L_h\| \pmb{x}_1 - \pmb{x}_2\|$ where $\pmb{x}_1,\pmb{x}_2\in \mathbb{R}^d$ . We also assume that $\| h(\pmb {x}_1) - h(\pmb {x}_2)\| \leq \ell_h\| \pmb {x}_1 - \pmb {x}_2\|$
+2) $\| f'(x_1) - f'(x_2) \| \leq L_f \| x_1 - x_2 \|$ where $x_1, x_2 \in \mathbb{R}$ . We also assume that $\| f(x_1) - f(x_2) \| \leq \ell_f \| x_1 - x_2 \|$ .
+3) $\| \nabla g(\pmb{x}_1;\xi) - \nabla g(\pmb{x}_2;\xi)\| \leq L_g\| \pmb{x}_1 - \pmb{x}_2\|$ and $\| g(\pmb{x}_1;\xi) - g(\pmb{x}_2;\xi)\| \leq \ell_g\| \pmb{x}_1 - \pmb{x}_2\|$ for $\forall \pmb{x}_1, \pmb{x}_2 \in \mathbb{R}^d$ .
+4) We suppose that $\Psi (\pmb {x})$ in Eq. (2) is bounded from below that $\Psi^{*} = \inf_{\pmb{x}}\Psi (\pmb {x}) > - \infty$
+5) We assume $r(\pmb{x}) \in \mathbb{R} \cup \{\infty\}$ is a convex and lower-semicontinues function.
+
+An immediate implication of above assumption is that $f(g(\pmb{x})) \triangleq f\left(\frac{1}{m}\sum_{i=1}^{m}g_i(\pmb{x})\right)$ is smooth with module $\left(\ell_g^2 L_f + \ell_f L_g\right)$ , hence $\Psi(\pmb{x})$ is smooth with module $L_\Phi \triangleq \left[\left(\ell_g^2 L_f + \ell_f L_g\right) + L_h\right]$ (Wang et al., 2016; Zhang & Xiao, 2019b).
+
+Assumption 2 (Unbiased estimation). We assume that the mini-batch of samples $\xi$ over functions $g_{i}$ for $i = 1,2,\ldots ,m$ is unbiased, that is $\mathbb{E}[g(\pmb {x};\xi)] = g(\pmb {x})$ and $\mathbb{E}[\nabla g(\pmb {x};\xi)] = \nabla g(\pmb {x})$
+
+# 4.1 OPTIMALLY STRONGLY CONVEX OBJECTIVES
+
+We here establish the convergence for optimally strongly convex objectives under Wasserstein metric.
+
+Definition 1 (Optimally strongly convex). We say that the objective function $\Psi(\pmb{x})$ is optimally strongly convex objective with module $\mu$ if $\Psi(\pmb{x}) - \Psi(\mathcal{P}_{\pmb{x}^*}(\pmb{x})) \geq \mu \| \pmb{x} - \mathcal{P}_{\pmb{x}^*}(\pmb{x}) \|^2$ .
+
+According to Definition 4 of Necoara et al. (2019) optimally strong objectives or quadratic functional growth property is the generalization of strongly convex condition. According to Karimi et al. (2016) below, the PL condition implies an optimally strongly convex condition but not vice versa. Therefore, optimally strongly convex generalizes PL condition as well.
+
+Following Cotter et al. (2016) and Mahdavi et al. (2012), we make the following assumption.
+
+Assumption 3. There exists a constant $\rho$ such that if we define $g(\pmb{x}) = \max_{1\leq i\leq m}\tilde{g}_i(\pmb{x})$ we have $\min_{g(\pmb{x}) = 0}\| \nabla g(\pmb{x})\|_2 \geq \rho$ .
+
+Assumption 4. Function $r(\pmb{x})$ is smooth with module $G$ .
+
+Theorem 4.1. Assume $\Psi$ is $\mu$ -optimally strongly convex and set $\tau_t = S_t = \sqrt{B_t} = \sqrt{m}$ , $T = \frac{5}{\sqrt{m}\mu\eta}$ , $\eta < \frac{2}{L_{\Phi} + \sqrt{L_{\Phi}^2 + 36G_0}}$ where $G_0 \triangleq 3(\ell_g^4 L_f^2 + \ell_f^2 L_g^2 + \ell_h^2)$ , $\alpha > \frac{G}{\rho}$ , and $\gamma = \frac{\exp(-K)}{\ln(m+1)}$ . Let us denote $\pmb{x}^{(k+1)} = \mathbf{GCIVR}(\pmb{x}^{(k)})$ for $k = 0, \dots, K-1$ (using Algorithm 1). Under Assumptions 1-4 and by letting $K = \ln(1/\epsilon)$ , the solution of DRO with Wasserstein divergence is obtained by projecting $\pmb{x}^{(K)}$ onto the constraint set $\mathcal{K} = \{\pmb{x}|g_i(\pmb{x}) \leq 0, i = 1, 2, \dots, m\}$ , i.e., $\bar{\pmb{x}}^{(K)} = \Pi_{\mathcal{K}}(\pmb{x}^{(K)})$ . In order to achieve $r(\bar{\pmb{x}}^{(K)}) - r(\pmb{x}^{(*)}) \leq \epsilon$ , we require an $O((m + \kappa\sqrt{m})\ln\frac{1}{\epsilon})$ calls to the stochastic oracle.
+
+Comparison with previous results. Compared to the MidTouch approach by Cotter et al. (2016), our obtained rate improves both on the dependency on the number of constraints $m$ , as well as convergence error $\epsilon$ . To better understand the intuition behind achieving such a double folded improvement in terms of $m$ and $\epsilon$ , we note that unlike Cotter et al. (2016) which utilizes a primal-dual approach in order to obtain an approximate to the optimal distribution over the constraints, we directly find the optimal distribution exactly. Second, while Cotter et al. (2016) does not apply any variance reduction technique to primal variable $x$ , our algorithm benefits from variance reduction over $x$ too.
+
+Furthermore, Theorem 4.1 entails tighter rate in terms of final accuracy compared to Yu et al. (2021). These results are summarized in Table. 1.
+
+In Algorithm 1 for optimally strongly convex objectives, we need to do a single projection at the end. The following corollary bounds the error between the solution before and after the projection.
+
+Corollary 4.2. Under the assumptions made in Theorem 4.1, the error between the solution with and without projection is bounded by
+
+$$
+r \left(\bar {\boldsymbol {x}} ^ {(K)}\right) - r \left(\boldsymbol {x} ^ {(K)}\right) \leq G \left[ \frac {\gamma \ln (m + 1)}{\alpha \rho - G} + \frac {1}{\alpha \rho - G} O \left(\exp (- K)\right) \right] + \gamma \ln (m + 1). \tag {12}
+$$
+
+Therefore, with a proper choice of $\gamma$ we can establish convergence rate obtained in Theorem 4.1.
+
+Remark 1. It is worthy to highlight that through reduction of heavily-constrained optimization to composite optimization, GCIVR algorithm can be considered as an alternative method to solving constrained optimization problems via mini-batch sampling of constraints. In particular, Theorem 4.1 shows that under certain conditions, we can solve any heavily-constrained optimization problem with sampling a mini-batch of constraints and achieve similar guarantees compared to projection-based counterparts while avoiding the heavy dependency on the number of constraints. Another implication of Theorem 4.1 is that we can solve heavily-constrained optimization with the sample complexity similar to that of an unconstrained optimization problem.
+
+Remark 2. To understand the tightness of our obtained rate, consider $\min_{\pmb{x}}\left[\Psi (\pmb {x})\triangleq r(\pmb {x}) + \frac{1}{m}\sum_{i = 1}^{m}g_{i}(\pmb {x})\right]$ which is an instance of our general optimization problem (2). Clearly, any lower bound to solve this instance also holds for the original optimization problem (2). Xie et al. (2019) provides a lower-bound of $O((m + \sqrt{\kappa m})\ln (1 / \epsilon))$ for above instance, matching our upper bound in terms of the dependency on the number of data samples, while the dependency on $\kappa$ can still be improved. Furthermore, for the DRO problem with Wasserstein divergence metric, rather than solving constrained optimization problem we solve unconstrained compositional optimization problem. Thus, since solving constrained optimization is more complex than unconstrained optimization problem, we do not expect to obtain any better bound regarding $m$ even for DRO with Wasserstein metric.
+
+Remark 3. In a distributed setting, we are able to improve the sample complexity to $O\left(\left(m + \frac{m}{p} + \kappa \sqrt{m}\right) \ln \frac{1}{\epsilon}\right)$ with $p$ devices. The proof can be found in Appendix F.3.
+
+# 4.2 NON-CONVEX OBJECTIVES
+
+We now turn to establishing the convergence of DRO problems with $\chi^2$ and KL divergence metrics for non-convex objectives by making an additional assumption on the variance of stochastic mini-batches.
+
+Assumption 5 (Bounded variance). The mini-batch sampling has bounded variance that is $\mathbb{E}\big[\| \nabla g(\pmb {x};\xi) - \nabla g(\pmb {x})\| ^2\big]\leq \frac{\sigma^2}{B}$ , where $B$ indicates the batch size.
+
+Theorem 4.3. Under Assumptions 1,2, and 5 using Algorithm 1 for some positive constants $\beta$ and $0\leq \zeta < \sqrt{m}$ , denote $T_0\triangleq \frac{\sqrt{m} - \zeta}{\beta} = O(\sqrt{m})$ . For $t\leq T_0$ , let us set $\tau_{t} = S_{t} = \sqrt{B_{t}} = \beta t + \zeta$ and for $t > T_0$ set $\tau_{t} = S_{t} = \sqrt{m}$ . Then, if $\eta < \frac{4}{L_{\Phi} + \sqrt{L_{\Phi}^2 + 12G_0}}$ , after $T = \tilde{O}$ ( $\min(1/\sqrt{\epsilon}, 1/\sqrt{m}\epsilon)$ ) iterations, with $\tilde{O}$ ( $\min\{\sqrt{m}/\epsilon, 1/\epsilon^{1.5}\}$ ) number of calls to the stochastic oracle it holds that $\mathbb{E}\big[\| \mathcal{G}_{\eta}(\pmb{x}^{(T)})\|^2\big] \leq \epsilon$ , where we used $\tilde{O}(.)$ notation to hide terms with logarithmic dependency.
+
+We also remark that Assumption 5 is only needed for convergence until $T_0 = \frac{\sqrt{m} - \zeta}{\beta}$ and after $t > T_0$ we will not need this assumption. We also note that this assumption is not required in optimally strongly convex setting as we utilize a full batch at the beginning of each epoch.
+
+Discussion on lower bound. As we discussed in Remark 2, any impossibility result for optimizing $\min_{\boldsymbol{x}}\left[\Psi (\boldsymbol {x})\triangleq r(\boldsymbol {x}) + \frac{1}{m}\sum_{i = 1}^{m}g_{i}(\boldsymbol {x})\right]$ also holds for general compositional optimization problem in Eq. (2). For former problem, Fang et al. (2018) shows that to achieve the stationary point with error $\epsilon$ we require at least $\tilde{O}\left(\min \{\frac{\sqrt{m}}{\epsilon},\frac{1}{\epsilon^{1.5}}\}\right)$ (almost optimal) gradient oracle calls for strongly optimal objectives. As a consequence, for the DRO with $\chi^2$ or KL divergence metrics we do not expect less number of constraint checks or sample complexity, respectively.
+
+Remark 4. In distributed setting with $p$ devices, we can improve the convergence rate of DRO with $\chi^2$ and KL metrics to $\tilde{O}\left(\min\{\frac{\sqrt{m}}{p\epsilon} + \frac{\sqrt{m}}{\epsilon}, \frac{1}{p\epsilon^{1.5}} + \frac{1}{\epsilon^{1.5}}\}\right)$ . For details, please refer to Appendix F.3.
+
+# 5 EXPERIMENTS
+
+In this section, we empirically examine the efficacy of the proposed algorithm in different use cases. The main algorithm that we compare against is Heavily-Constrained algorithm that uses a parametric multiplier model proposed in Narasimhan et al. (2020b). We call this algorithm Heavily-constrained, where they learn the Lagrange multiplier values using a parametric model such as a neural network. The tasks we apply the algorithms are mainly focused on fairness constraints since they fit greatly to the problem definition in this paper due to the large number of constraints they add to the main learning problem. In addition, similar to distribution robust optimization approaches, the main goal of fairness constraint is to find a solution that is agnostic to the distribution of protected groups. The code for the experiments is available at this repository.
+
+Distributionally robust optimization for fairness constraints. The first experiment is based on Narasimhan et al. (2020b); Wang et al. (2020), where we want to enforce equality of opportunity (Hardt et al., 2016) constraints for different groups while the group membership is noisy and changing during the training. Hence, the problem is to make the solution distributionally robust among different protected groups in the problem. Based on the setup in Narasimhan et al. (2020b), we assume we have access to the marginal probability of the true groups $(\mathbb{P}(g_i = j|\hat{g}_i = k)$ , where $g_{i}$ is the true group membership and $\hat{g}_i$ is the noisy group membership). Hence, to enforce fairness constraints, we consider all possible proxy groups using this marginal probability, which can increase the number of constraints greatly. The goal in this case for equal opportunity is to have the true positive rate of each group in the vicinity of the true positive rate (tpr) of the overall data, that is: $\mathrm{tpr}(g = j)\geq \mathrm{tpr}(ALL) - \epsilon$ for every proxy group we define.
+
+In this experiment, we use the Adult dataset (Dua & Graff, 2017), and consider race groups of "white", "black", and "other" as protected groups. We train a linear classifier with logistic regression, and report the overall error rate of the classifier, as well as the maximum violation of the fairness constraints (equal opportunity) over true group memberships. We set $\epsilon = 0.05$ and the noise level to 0.3. Again, we compare with unconstrained optimization and heavily-constrained algorithm with a linear model as its multiplier model. First row of Figure 1 shows the results for this experiment, where the proposed GCIVR algorithm can achieve the same level of constraint violation on true group memberships as the heavily constraint while outperforms it in terms of overall error rate. Hence, the solution found by the GCIVR dominates heavily-constrained solution. In terms of runtime speed, the first row of Figure 1(c) clearly shows the advantage of GCIVR over heavily-constrained with much lower overhead to the unconstrained optimization.
+
+Fairness Constraints on intersectional groups. In this task we ought to learn a linear classifier with logistic regression to predict the crime rate for a community on Communities and Crime dataset (Dua & Graff, 2017). This dataset contains 1994 instances of communities each with 128 features to predict the per capita crime rate for each community in the US. The labels are high and low crime rates to represent if a community is above the 70th percentile of the data or not. To add fairness constraints, we first determine different communities based on the percentages of the Black, Hispanic and Asian population in each community, as discussed in Cotter et al. (2019); Narasimhan et al. (2020b). Similar to Narasimhan et al. (2020b), we generate 1000 thresholds of the form $(\tau_{1},\tau_{2},\tau_{3})\in [0,1]^{3}$ to define each group. Consider the population of each race as $(p_1,p_2,p_3)$ then a community belongs to group $g_{\tau_1,\tau_2,\tau_3}$ if $p_i\geq \tau_i\forall i\in [3]$ . Then the fairness constraints enforce that the error rate of each group should be in the neighborhood of the overall error by margin of $\epsilon$ . That is $\operatorname{err}(g_{\tau_1,\tau_2,\tau_3})\leq \operatorname{err}(\mathrm{ALL}) + \epsilon$ . Similar to Narasimhan et al. (2020b), we set $\epsilon = 0.01$ and not consider groups with less than $1\%$ of data.
+
+We compare with the unconstrained optimization and Heavily-constrained algorithm with a 2-layer neural network, each with 100 nodes as their Lagrange model, as described in their paper. We compare the trade-off between the error rate and maximum violation of fairness constraints among groups. The second row of Figure 1 portrays this comparison for the test dataset. As it can be inferred, the proposed GCIVR algorithm achieves the same error rate as Heavily-constrained, but both higher than the unconstrained optimization. However, comparing the maximum violation of constraints, it is clear that GCIVR outperforms both optimization methods. Also, the third figure shows the runtime of different algorithms. It is clear that GCIVR adding a minimal overhead to the unconstrained optimization, while heavily-constrained increases the runtime more than 100 times.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(a) Error Rate
+
+
+(b) Max Constraint Violation
+
+
+(c) Error Rate (Runtime)
+Figure 1: Comparison of the proposed GCIVR algorithm with unconstrained optimization and heavily-constrained algorithm Narasimhan et al. (2020b) in three different tasks of fairness and DRO. Each row shows the result for one task based on the error rate, max constraint violations and the runtime of the codes. In all the cases solutions learned by GCIVR dominates the heavily-constrained solution and it converges way faster.
+
+Per-query fairness constraints in ranking. In the third problem we evaluate our algorithm on the fairness in the ranking problem, where we intend to impose per-query constraints on the learning to rank problem as defined in Narasimhan et al. (2020a;b). We divide document-query pairs into two groups based on the 40th percentile of the their QualityScore features. Hence, in this problem, we want to learn a ranking function $f: \mathcal{D} \times \mathcal{Q} \to \mathbb{R}$ , which maps a pair of document-query features to a real number as the score. Consider the groups of $g_0$ and $g_1$ as mentioned before, we want the error rate for these groups to be close to each other. In other terms, if the pairwise error rate is defined as: $\mathrm{err}_{i,j}(q) = \mathbb{E}\left[\mathbf{1}\left\{f(d,q) < f(d',q)\right\} \mid y > y', d \in g_i, d' \in g_j\right]$ , where $y$ and $y'$ are the respective binary labels. Then, the fairness constraints can be satisfied as $|\mathrm{err}_{0,1}(q) - \mathrm{err}_{1,0}(q)| \leq \epsilon \forall q \in \mathcal{Q}$ .
+
+For this experiment, we use Microsoft Learning to Rank Dataset (MSLR-WEB10K) (Qin & Liu, 2013), which contains 10K queries and 136 features. For this experiment we use a non-convex objective, where the model is a two-layer neural network each with 128 nodes and cross-entropy as the loss function. We compare against the unconstrained optimization and the heavily-constrained algorithm with an one-layer neural network with 64 nodes as its multiplier model. We use 1000 queries in the training and 100 queries in the test datasets. The third row in Figure 1 shows the error rate and maximum violation of groups constraints. As it is clear GCIVR outperforms heavily-constrained in both error rate and maximum violations of groups by a large margin. In terms of runtime, GCIVR is very close to the unconstrained optimization, and about $2 \times$ faster than heavily-constrained.
+
+# 6 CONCLUSION
+
+In this paper, we showed that many DRO problems or heavily constrained optimization problems can be cast into a general framework based on finite-sum composite optimization. To solve this composite finite-sum optimization, we introduced centralized and distributed algorithms. We theoretically illustrated that our algorithm converges with an almost optimal number of constraint checks (for Wasserstein distance) or gradient calls (for $\chi^2$ or KL divergence metrics). Finally, we validated our theory with a number of experiments.
+
+# ACKNOWLEDGEMENTS
+
+Amin Karbasi acknowledges funding in direct support of this work from NSF (IIS-1845032) and ONR (N00014-19-1-2406). The work of Mehrdad Mahdavi was supported in part by NSF (CNS-1956276).
+
+# REFERENCES
+
+Amir Beck. First-order methods in optimization. SIAM, 2017.
+Aharon Ben-Tal, Dick Den Hertog, Anja De Waegenaere, Bertrand Melenberg, and Gijs Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science, 59(2):341-357, 2013.
+Dimitris Bertsimas, Vishal Gupta, and Nathan Kallus. Data-driven robust optimization. Mathematical Programming, 167(2):235-292, 2018.
+Jose Blanchet, Yang Kang, and Karthyek Murthy. Robust wasserstein profile inference and applications to machine learning. Journal of Applied Probability, 56(3):830-857, 2019.
+Robert Chen, Brendan Lucier, Yaron Singer, and Vasilis Syrgkanis. Robust optimization for nonconvex objectives. arXiv preprint arXiv:1707.01047, 2017.
+Andrew Cotter, Maya Gupta, and Jan Pfeifer. A light touch for heavily constrained sgd. In Conference on Learning Theory, pp. 729-771. PMLR, 2016.
+Andrew Cotter, Heinrich Jiang, and Karthik Sridharan. Two-player games for efficient non-convex constrained optimization. In Algorithmic Learning Theory, pp. 300–332. PMLR, 2019.
+Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances in neural information processing systems, pp. 1646-1654, 2014.
+Yuyang Deng, Mohammad Mahdi Kamani, and Mehrdad Mahdavi. Adaptive personalized federated learning. arXiv preprint arXiv:2003.13461, 2020.
+Yuyang Deng, Mohammad Mahdi Kamani, and Mehrdad Mahdavi. Distributionally robust federated averaging. arXiv preprint arXiv:2102.12660, 2021.
+Michele Donini, Luca Oneto, Shai Ben-David, John Shawe-Taylor, and Massimiliano Pontil. Empirical risk minimization under fairness constraints. arXiv preprint arXiv:1802.08626, 2018.
+Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml.
+John Duchi and Hongseok Namkoong. Variance-based regularization with convex objectives. arXiv preprint arXiv:1610.02581, 2016.
+John C Duchi and Hongseok Namkoong. Learning models with uniform performance via distributionally robust optimization. The Annals of Statistics, 49(3):1378-1406, 2021.
+Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven distributionally robust optimization using the wasserstein metric: Performance guarantees and tractable reformulations. *Mathematical Programming*, 171(1):115–166, 2018.
+Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang. Spider: Near-optimal non-convex optimization via stochastic path integrated differential estimator. arXiv preprint arXiv:1807.01695, 2018.
+Marguerite Frank, Philip Wolfe, et al. An algorithm for quadratic programming. *Naval research logistics quarterly*, 3(1-2):95-110, 1956.
+Farzin Haddadpour and Mehrdad Mahdavi. On the convergence of local descent methods in federated learning. arXiv preprint arXiv:1910.14425, 2019.
+
+Farzin Haddadpour, Mohammad Mahdi Kamani, Mehrdad Mahdavi, and Viveck Cadambe. Local sgd with periodic averaging: Tighter analysis and adaptive synchronization. Advances in Neural Information Processing Systems, 2019a.
+Farzin Haddadpour, Mohammad Mahdi Kamani, Mehrdad Mahdavi, and Viveck Cadambe. Trading redundancy for communication: Speeding up distributed sgd for non-convex optimization. In ICML, pp. 2545-2554, 2019b.
+Farzin Haddadpour, Mohammad Mahdi Kamani, Aryan Mokhtari, and Mehrdad Mahdavi. Federated learning with compression: Unified analysis and sharp guarantees. arXiv preprint arXiv:2007.01154, 2020.
+Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. Advances in neural information processing systems, 29:3315-3323, 2016.
+Tatsunori Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness without demographics in repeated loss minimization. In International Conference on Machine Learning, pp. 1929-1938. PMLR, 2018.
+Zhouyuan Huo, Bin Gu, Ji Liu, and Heng Huang. Accelerated method for stochastic composition optimization with nonsmooth regularization. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+Martin Jaggi. Revisiting frank-wolfe: Projection-free sparse convex optimization. In International Conference on Machine Learning, pp. 427-435. PMLR, 2013.
+Anatoli Juditsky, Arkadi Nemirovski, and Claire Tauvel. Solving variational inequalities with stochastic mirror-prox algorithm. Stochastic Systems, 1(1):17-58, 2011.
+Dionysios S Kalogerias and Warren B Powell. Zeroth-order stochastic compositional algorithms for risk-aware learning. arXiv preprint arXiv:1912.09484, 2019.
+Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear convergence of gradient and proximal-gradient methods under the polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 795–811. Springer, 2016.
+Daniel Kuhn, Peyman Mohajerin Esfahani, Viet Anh Nguyen, and Soroosh Shafieezadeh-Abadeh. Wasserstein distributionally robust optimization: Theory and applications in machine learning. In *Operations Research & Management Science in the Age of Analytics*, pp. 130–166. INFORMS, 2019.
+Daniel Levy, Yair Carmon, John C Duchi, and Aaron Sidford. Large-scale methods for distributionally robust optimization. arXiv preprint arXiv:2010.05893, 2020.
+Xiangru Lian, Mengdi Wang, and Ji Liu. Finite-sum composition optimization via variance reduced gradient descent. In Artificial Intelligence and Statistics, pp. 1159-1167. PMLR, 2017.
+Mehrdad Mahdavi, Tianbao Yang, Rong Jin, Shenghuo Zhu, and Jinfeng Yi. Stochastic gradient descent with only one projection. In Advances in Neural Information Processing Systems 25 (NIPS), 2012.
+H Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, et al. Communication-efficient learning of deep networks from decentralized data. arXiv preprint arXiv:1602.05629, 2016.
+Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. Agnostic federated learning. arXiv preprint arXiv:1902.00146, 2019.
+Hongseok Namkoong and John C Duchi. Stochastic gradient methods for distributionally robust optimization with f-divergences. In NIPS, volume 29, pp. 2208-2216, 2016.
+Harikrishna Narasimhan, Andrew Cotter, Maya Gupta, and Serena Wang. Pairwise fairness for ranking and regression. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 5248-5255, 2020a.
+
+Harikrishna Narasimhan, Andrew Cotter, Yichen Zhou, Serena Wang, and Wenshuo Guo. Approximate heavily-constrained learning with lagrange multiplier models. Advances in Neural Information Processing Systems, 33, 2020b.
+Ion Necoara, Yu Nesterov, and Francois Glineur. Linear convergence of first order methods for non-strongly convex optimization. Mathematical Programming, 175(1):69-107, 2019.
+Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on optimization, 19(4):1574-1609, 2009.
+Yu Nesterov. Gradient methods for minimizing composite functions. Mathematical Programming, 140(1):125-161, 2013.
+Lam M Nguyen, Jie Liu, Katya Scheinberg, and Martin Takáč. Sarah: A novel method for machine learning problems using stochastic recursive gradient. In International Conference on Machine Learning, pp. 2613-2621. PMLR, 2017.
+Farzad Pourbabaaee. Robust experimentation in the continuous time bandit problem. *Economic Theory*, pp. 1-31, 2020.
+Qi Qi, Zhishuai Guo, Yi Xu, Rong Jin, and Tianbao Yang. A practical online method for distributionally deep robust optimization. arXiv preprint arXiv:2006.10138, 2020a.
+Qi Qi, Yan Yan, Zixuan Wu, Xiaoyu Wang, and Tianbao Yang. A simple and effective framework for pairwise deep metric learning. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXVII 16, pp. 375-391. Springer, 2020b.
+Tao Qin and Tie-Yan Liu. Introducing letor 4.0 datasets. arXiv preprint arXiv:1306.2597, 2013.
+Hamed Rahimian and Sanjay Mehrotra. Distributionally robust optimization: A review. arXiv preprint arXiv:1908.05659, 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.
+Soroosh Shafieezadeh-Abadeh, Peyman Mohajerin Esfahani, and Daniel Kuhn. Distributionally robust logistic regression. arXiv preprint arXiv:1509.09259, 2015.
+Alexander Shapiro. Distributionally robust stochastic programming. SIAM Journal on Optimization, 27(4):2258-2275, 2017.
+Aman Sinha, Hongseok Namkoong, Riccardo Volpi, and John Duchi. Certifying some distributional robustness with principled adversarial training. arXiv preprint arXiv:1710.10571, 2017.
+Mengdi Wang and Dimitri P Bertsekas. Incremental constraint projection methods for variational inequalities. Mathematical Programming, 150(2):321-363, 2015.
+Mengdi Wang and Dimitri P Bertsekas. Stochastic first-order methods with random constraint projection. SIAM Journal on Optimization, 26(1):681-717, 2016.
+Mengdi Wang, Ji Liu, and Ethan X Fang. Accelerating stochastic composition optimization. arXiv preprint arXiv:1607.07329, 2016.
+Mengdi Wang, Ethan X Fang, and Han Liu. Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions. Mathematical Programming, 161(1-2): 419-449, 2017.
+Serena Wang, Wenshuo Guo, Harikrishna Narasimhan, Andrew Cotter, Maya Gupta, and Michael I Jordan. Robust optimization for fairness with noisy protected groups. arXiv preprint arXiv:2002.09343, 2020.
+Guangzeng Xie, Luo Luo, and Zhihua Zhang. A general analysis framework of lower complexity bounds for finite-sum optimization. arXiv preprint arXiv:1908.08394, 2019.
+
+Yan Yan, Yi Xu, Qihang Lin, Lijun Zhang, and Tianbao Yang. Stochastic primal-dual algorithms with faster convergence than $o(1 / \sqrt{T})$ for problems without bilinear structure. arXiv preprint arXiv:1904.10112, 2019.
+Yan Yan, Yi Xu, Qihang Lin, Wei Liu, and Tianbao Yang. Sharp analysis of epoch stochastic gradient descent ascent methods for min-max optimization. 2020.
+Yaodong Yu, Tianyi Lin, Eric Mazumdar, and Michael I Jordan. Fast distributionally robust learning with variance reduced min-max optimization. arXiv preprint arXiv:2104.13326, 2021.
+Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez-Rodriguez, and Krishna P Gummadi. Fairness constraints: A flexible approach for fair classification. The Journal of Machine Learning Research, 20(1):2737-2778, 2019.
+Jingzhao Zhang, Aditya Menon, Andreas Veit, Srinadh Bhojanapalli, Sanjiv Kumar, and Suvrit Sra. Coping with label shift via distributionally robust optimisation. arXiv preprint arXiv:2010.12230, 2020a.
+Junyu Zhang and Lin Xiao. A composite randomized incremental gradient method. In International Conference on Machine Learning, pp. 7454-7462. PMLR, 2019a.
+Junyu Zhang and Lin Xiao. A stochastic composite gradient method with incremental variance reduction. arXiv preprint arXiv:1906.10186, 2019b.
+Mingrui Zhang, Zebang Shen, Aryan Mokhtari, Hamed Hassani, and Amin Karbasi. One sample stochastic frank-wolfe. In International Conference on Artificial Intelligence and Statistics, pp. 4012-4023. PMLR, 2020b.
+
+# Appendix
+
+In the appendix, we provide the missing proofs and derivations from the main manuscript, as well as proposing the distributed version of Algorithm 1 to further improve the convergence speed.
+
+# TABLE OF CONTENTS
+
+A Example of Equivalent Wessterstein Reformulation 15
+B Obtaining Augmented Optimization Problem 15
+C Proof of Claim 2.1 15
+D Strongly-convex convergence for DRO with KL and $\chi^2$ metrics 16
+E Distributed Stochastic Composite Algorithm 16
+
+F Proof of Theorems 4.1 and F.2 17
+
+F.1 Computational complexity of Theorem 4.1 and Theorem D.1 19
+F.2 Computational Complexity of strongly-convex objectives Corresponding to Theorems 4.3 20
+F.3 Convergence analysis 20
+
+G Proof of the Distributed Algorithm 22
+G.1 General Lemmas 22
+H Approximate Approach For DRO with Wesserstein Metric with Non-convex Objectives 25
+
+# A EXAMPLE OF EQUIVALENT WESSTERSTEIN REFORMULATION
+
+A tractable reformulation of distributionally robust logistic regression problem by reduction to a constrained optimization problem is provided in Shafieezadeh-Abadeh et al. (2015) as follows:
+
+$$
+\min _ {\boldsymbol {x}} \quad r (\boldsymbol {x}) \triangleq \lambda \epsilon + \frac {1}{m} \sum_ {i = 1} ^ {m} s _ {i}
+$$
+
+subject to $g_{i}(\pmb {x}) = (\ell_{\beta}(\pmb {z},y) - s_{i})\leq 0,\forall i\in [1:m]$
+
+$$
+g _ {j} (\boldsymbol {x}) = \left(\ell_ {\beta} (\boldsymbol {z}, - y) - \lambda \kappa - s _ {j}\right) \leq 0, \forall j \in [ 1: m ]
+$$
+
+$$
+g _ {\ell} (\boldsymbol {x}) = \left(\| \boldsymbol {\beta} \| _ {*} ^ {2} - \lambda^ {2}\right) \leq 0 \tag {13}
+$$
+
+where $\ell_{\beta}(z,y) = \log (1 + \exp (-y\langle \beta ,z\rangle))$ is the associate loss with parameter $\beta$ and the data sample $(z,y)$ and we define $\pmb {x} = (z,s_1,\dots ,s_m,\lambda ,\beta)$
+
+# B OBTAINING AUGMENTED OPTIMIZATION PROBLEM
+
+To derive the smoothed constrained variant of original optimization problem we follow the reduction method originally introduced in Mahdavi et al. (2012) to get:
+
+$$
+\begin{array}{l} \min _ {\boldsymbol {x}} \bar {\Psi} (\boldsymbol {x}) = \min _ {\boldsymbol {x}} \left[ r (\boldsymbol {x}) + \max _ {0 \leq p _ {i} \leq \alpha , \sum_ {i = 1} ^ {m + 1} p _ {i} = \alpha} \left[ \sum_ {i = 1} ^ {m} p _ {i} \tilde {g} _ {i} (\boldsymbol {x}) + \gamma H \left(\frac {p _ {1}}{\alpha}, \frac {p _ {2}}{\alpha}, \dots , \frac {p _ {m}}{\alpha}, \frac {p _ {m + 1}}{\alpha}, \frac {1}{m + 1}\right) \right] \right] \\ = \min _ {\boldsymbol {x}} \left[ r (\boldsymbol {x}) + \gamma \ln \left(1 + \sum_ {i = 1} ^ {m} \exp \left(\frac {\alpha \tilde {g} _ {i} (\boldsymbol {x})}{\gamma}\right)\right) \right] \\ = \min _ {\boldsymbol {x}} \left[ r (\boldsymbol {x}) + \gamma \ln \left(\frac {1}{m + 1} \left[ 1 + \sum_ {i = 1} ^ {m} \exp \left(\frac {\alpha \tilde {g} _ {i} (\boldsymbol {x})}{\gamma}\right) \right]\right) + \gamma \ln (m + 1) \right] \\ = \min _ {\boldsymbol {x}} \left[ \Psi (\boldsymbol {x}) + \underbrace {\gamma \ln (m + 1)} _ {\text {C o n s t a n t}} \right], \tag {14} \\ \end{array}
+$$
+
+where in Eq. (14) we used the definitions $\Psi(\pmb{x}) = r(\pmb{x}) + \gamma \ln(g(\pmb{x}))$ , $g_i(\pmb{x}) \triangleq \exp\left(\frac{\alpha \tilde{g}_i(\pmb{x})}{\gamma}\right)$ and $g(\pmb{x}) = \frac{1}{m+1} [1 + \sum_{i=1}^{m} g_i(\pmb{x})]$ . Since $\gamma \ln(m+1)$ is a constant, the minimizer of both $\bar{\Psi}(\pmb{x})$ and $\Psi(\pmb{x})$ is the same, and consequently we can solve the optimization problem for $\Psi$ via finite-sum composite optimization.
+
+# C PROOF OF CLAIM 2.1
+
+We use Lagrangian multiplier for the purpose of the proof. The Lagrangian of the optimization problem in Eq. (4) is
+
+$$
+L (\boldsymbol {x}, \gamma ; \lambda) = \max _ {0 \leq p _ {i} \leq 1, \sum_ {i = 1} ^ {m} p _ {i} = 1} \left[ \sum_ {i = 1} ^ {m} p _ {i} f _ {i} \left(\boldsymbol {x} _ {i}\right) - \gamma \frac {1}{2 m} \sum_ {i = 1} ^ {m} \left(m p _ {i} - 1\right) ^ {2} - \lambda \left(\sum_ {i = 1} ^ {m} p _ {i} - 1\right) \right] \tag {15}
+$$
+
+By setting $\nabla_{p_i}L = 0$ we obtain
+
+$$
+p _ {i} = \frac {1}{m} \left(\frac {f _ {i} (\boldsymbol {x}) - \lambda}{\gamma} + 1\right). \tag {16}
+$$
+
+Then from the condition $\sum_{i}p_{i} = 1$ , it follows that:
+
+$$
+\lambda = \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\boldsymbol {x}) \tag {17}
+$$
+
+Plugging the obtained values for $\lambda$ and $p_i$ into Eq. (4) yields
+
+$$
+\begin{array}{l} \Psi (\pmb {x}; \gamma) = 1 + \sum_ {i = 1} ^ {m} \frac {1}{\gamma m} \left[ \left(f _ {i} (\pmb {x}) - \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\pmb {x})\right) - \frac {1}{2} \left(f _ {i} - \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\pmb {x})\right) ^ {2} \right] \\ = 1 - \frac {1}{2 \gamma \times m} \sum_ {i = 1} ^ {m} \left(f _ {i} (\boldsymbol {x}) - \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\boldsymbol {x})\right) ^ {2} \\ = 1 - \frac {1}{2 \gamma m} \sum_ {i = 1} ^ {m} \left[ f _ {i} (\boldsymbol {x}) \right] ^ {2} + \frac {1}{2 \gamma} \left[ \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} (\boldsymbol {x}) \right] ^ {2} \tag {18} \\ \end{array}
+$$
+
+which completes the proof.
+
+# D STRONGLY-CONVEX CONVERGENCE FOR DRO WITH KL AND $\chi^2$ METRICS
+
+Theorem D.1. Suppose Assumptions 1 and 2 hold, and also assume $\Psi$ is $\mu$ -optimally strongly convex. If we set $\tau_{t} = S_{t} = B_{t} = \sqrt{m}$ and $T = \frac{5}{\sqrt{m}\mu\eta}$ , letting $\eta < \frac{2}{L_{\Phi} + \sqrt{L_{\Phi}^2 + 36G_0}}$ , by letting $\pmb{x}^{(k+1)} = \mathbf{GCIVR}(\pmb{x}^{(k)})$ for $k = 0,\dots,K-1$ using Algorithm 1 after $K = \ln (1/\epsilon)$ repetition solves the optimization problem in Eq. (2) with convergence error $\Psi(\bar{\pmb{x}}^{(T)}) - \Psi(\pmb{x}^{(*)}) \leq \epsilon$ with $O((m + \kappa\sqrt{m})\ln \frac{1}{\epsilon})$ number of gradient calls. Therefore, depending on the objective function $\Psi$ , this sample complexity corresponds to both DRO problem with $\chi^2$ and regularized KL metrics.
+
+Based on Theorem D.1, for DRO problem with $\chi^2$ divergence metric, we can achieve $\Psi(\bar{\pmb{x}}^{(K)})|_{\gamma=1} - \Psi(\pmb{x}^{(*)})|_{\gamma=1} \leq \gamma \epsilon$ and $\Psi(\bar{\pmb{x}}^{(K)})|_{\gamma>1} - \Psi(\pmb{x}^{(*)})|_{\gamma>1} \leq \epsilon$ with $O\left((m + \kappa \sqrt{m}) \ln \frac{1}{\epsilon}\right)$ number of gradient oracle calls.
+
+# E DISTRIBUTED STOCHASTIC COMPOSITE ALGORITHM
+
+In the main body, we mainly focused on studying the sample complexity of solving DRO problems in a centralized setting. The question we are interested is that "Can we further improve the sample complexity?" In this section, we give an affirmative answer to this question via studying distributed version of DRO problem. We suppose data samples are distributed among $p$ clients1. For distributionally robust optimization problem via Wasserstein, $\chi^2$ and KL divergence metrics in the distributed fashion like federated learning setups McMahan et al. (2016); Mohri et al. (2019); Haddadpour et al. (2019b); Haddadpour & Mahdavi (2019); Haddadpour et al. (2019a); Deng et al. (2020); Haddadpour et al. (2020).
+
+We first introduce our distributed finite-sum compositional algorithm as detailed in Algorithm 2.
+
+```txt
+Algorithm 2: Distributed Generalized Composite Incremental Variance Reduction (DistGCIVR(x(0)))
+```
+
+Inputs: Number of iterations $t = 1, \dots, T$ , learning rate $\eta$ , initial global model $\boldsymbol{x}^{(0)}$ , and a set of triples $\{\tau_t, B_t, S_t\}$ where $\tau_t$ indicating the size of epoch length and mini-batch sizes of $B_t$ and $S_t$ at time $t$ .
+
+```latex
+for $t = 1,\dots ,T$ do $\begin{array}{rl}{\mathbf{\Phi}}&{}\\{\mid}&{\mathbf{\Phi}}\end{array}$ for $i = 1,\ldots ,p$ do in parallel
+```
+
+Sample minibatches $\mathcal{B}^{(t,i)}$ with size $B_{t}$ uniformly over $[m]$ and compute
+
+$$
+\boldsymbol {y} _ {0} ^ {(t, i)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t, i)}} g _ {i} (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi), \quad \boldsymbol {z} _ {0} ^ {(t, i)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t, i)}} \nabla g _ {i} (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi), \quad \boldsymbol {w} _ {0} ^ {(t, i)} = \frac {1}{B _ {t}} \sum_ {\xi \in \mathcal {B} ^ {(t, i)}} \nabla h _ {i} (\boldsymbol {x} _ {\tau_ {t}} ^ {(t)}; \xi)
+$$
+
+Server computes $\pmb{y}_0^{(t)} = \frac{1}{p}\sum_{i=1}^p\pmb{y}_0^{(t,i)}$ , $\pmb{z}_0^{(t)} = \frac{1}{p}\sum_{i=1}^p\pmb{z}_0^{(t,i)}$ and $\pmb{w}_0^{(t)} = \frac{1}{p}\sum_{i=1}^p\pmb{w}_0^{(t,i)}$
+
+Server computes $\tilde{\nabla}\Phi (\pmb{x}_0^{(t)}) = \left(\pmb{z}_0^{(t)}\right)^T\left(f'(\pmb{y}_0^{(t)})\right) + \pmb{w}_0^{(t)}$
+
+Update the model as follows and broadcasts it to devices
+
+$$
+\boldsymbol {x} _ {1} ^ {(t)} = \Pi_ {r} ^ {\eta} \left(\boldsymbol {x} _ {0} ^ {(t)} - \tilde {\nabla} \Phi (\boldsymbol {x} _ {0} ^ {(t)}))\right)
+$$
+
+```txt
+for $j = 1,\ldots ,\tau_t - 1$ do in parallel
+```
+
+Sample a set $S_{j}^{(t,i)}$ with size $S_{t}$ over $[m]$ , and form the estimates
+
+$$
+\boldsymbol {y} _ {j} ^ {(t, i)} = \boldsymbol {y} _ {j - 1} ^ {(t, i)} + \frac {1}{S _ {t}} \sum_ {\xi \in \mathcal {S} _ {j} ^ {(t, i)}} \left[ g _ {i} \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - g _ {i} \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right]
+$$
+
+$$
+\boldsymbol {z} _ {j} ^ {(t, i)} = \boldsymbol {z} _ {j - 1} ^ {(t, i)} + \frac {1}{S _ {t}} \sum_ {\xi \in \mathcal {S} _ {j} ^ {(t, i)}} \left[ \nabla g _ {i} \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - \nabla g _ {i} \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {19}
+$$
+
+$$
+\boldsymbol {w} _ {j} ^ {(t, i)} = \boldsymbol {w} _ {j - 1} ^ {(t, i)} + \frac {1}{S _ {t}} \sum_ {\xi \in \mathcal {S} _ {j} ^ {(t, i)}} \left[ \nabla h _ {i} \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - \nabla h _ {i} \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {20}
+$$
+
+and send $\pmb{y}^{(t,i)}$ and $\pmb{z}^{(t,i)}$ back to server
+
+Server computes $\pmb{y}_j^{(t)} = \frac{1}{p}\sum_{i = 1}^p\pmb{y}_j^{(t,i)},\pmb{z}_j^{(t)} = \frac{1}{p}\sum_{i = 1}^p\pmb{z}_j^{(t,i)}$ and
+
+$$
+\boldsymbol {w} _ {j} ^ {(t)} = \frac {1}{p} \sum_ {i = 1} ^ {p} \boldsymbol {w} _ {j} ^ {(t, i)}
+$$
+
+Compute $\tilde{\nabla}\Phi (\pmb{x}_j^{(t)}) = \left(\pmb{z}_j^{(t)}\right)^T\left(\pmb{f}'(\pmb{y}_j^{(t)})\right) + \pmb{w}_j^{(t)}$
+
+Update the model as follows: $\pmb{x}_{j + 1}^{(t)} = \Pi_r^\eta \left(\pmb{x}_j^{(t)} - \tilde{\nabla}\Phi (\pmb{x}_j^{(t)})\right)$
+
+end
+
+end
+
+Output: Return a randomly selected solution from $\{x_j^t\}_{j = 0,\dots ,\tau_t}^{t = 1,\dots,T}$
+
+We emphasize that our algorithm is developed based on Algorithm 1, so we only describe the main differences. In the distributed setting, in epoch $t$ , $i$ -th device has local version of global model, i.e., $\pmb{y}_j^{(t,i)}, \pmb{z}_j^{(t,i)}, \pmb{w}_j^{(t,i)}$ and at the beginning and during the epochs all devices send back their local models back to the server to be averaged and global model $x$ to be updated. Then, server broadcast global model to the devices.
+
+# F PROOF OF THEOREMS 4.1 AND F.2
+
+Before proceeding to the proof of this theorem, we need to mention that for Wasserstein DRO problem the main objective $r(\pmb{x})$ is an affine function of input data. This property naturally satisfies condition (5) in Assumption 1 and will be useful in distributed setting. For an illustrative example please see Appendix A.
+
+Proof of Theorem 4.1: Suppose that $\pmb{x}^{(*)}$ is the solution for the following optimization problem:
+
+$$
+\underset {\boldsymbol {x}} {\text {m i n i m i z e}} \quad r (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} \left(\boldsymbol {x} _ {i}\right) \tag {21}
+$$
+
+subject to $\tilde{g}_i(\pmb {x})\leq 0,\forall i\in \{1,\dots ,m\} .$
+
+Defining $\Psi (\pmb {x})\triangleq r(\pmb {x}) + \gamma \ln \left(\frac{1}{m + 1}\left[1 + \sum_{i = 1}^{m}\exp \left(\frac{\alpha\tilde{g}_i(\pmb{x})}{\gamma}\right)\right]\right)$ , we have
+
+$$
+\bar {\Psi} (\boldsymbol {x}) \triangleq \Psi (\boldsymbol {x}) + \gamma \ln (m + 1).
+$$
+
+Noting that $\bar{\pmb{x}}^{(K)}$ and $\pmb{x}^{(K)}$ are the output of algorithm with and without projection to the constraints set
+
+$$
+\mathcal {K} = \left\{\boldsymbol {x}: \tilde {g} _ {i} (\boldsymbol {x}) \leq 0, \forall i \in [ 1: m ] \right\} \tag {22}
+$$
+
+respectively. Our proof is based on following two steps:
+
+(1) We first show that $\mathbb{E}\left[\Psi (\pmb{x}^{(K)})\right]\leq \Psi (\pmb{x}^{(*)}) + O(\exp (-aK))$ , which indicates the convergence rate of stochastic compositional optimization problem depends on used algorithm without any projection.
+(2) Second step involves showing that $\mathbb{E}\left[r(\bar{\pmb{x}}^{(K)})\right] \leq r(\pmb{x}^{(*)}) + O(\exp(-aK))$ ; in other words the final projected solution converges to optimal solution of augmented objective function and $a$ is some positive constant depends on condition number $\kappa$ .
+
+We note step (1) follows directly from Theorem 8 in Zhang & Xiao (2019b). In the following, we prove step (2). First note that as $\tilde{g}_i(\pmb{x}^*)\leq 0$ for all $1\leq i\leq m$ , we have:
+
+$$
+\begin{array}{l} \Psi (\boldsymbol {x} ^ {(*)}) = r (\boldsymbol {x} ^ {(*)}) + \gamma \ln \left(\frac {1}{m + 1} \left[ 1 + \sum_ {i = 1} ^ {m} \exp \left(\frac {\alpha \tilde {g} _ {i} (\boldsymbol {x} ^ {(*)})}{\gamma}\right) \right]\right) \\ \stackrel {\tilde {g} _ {i} (\boldsymbol {x} ^ {(*)}) \leq 0} {\leq} r (\boldsymbol {x} ^ {(*)}) + \gamma \ln \left(\frac {1}{m + 1} \left[ 1 + \sum_ {i = 1} ^ {m} (1) \right]\right) \\ = r \left(\boldsymbol {x} ^ {(*)}\right) \tag {23} \\ \end{array}
+$$
+
+This leads to
+
+$$
+\Psi \left(\boldsymbol {x} ^ {(*)}\right) \leq r \left(\boldsymbol {x} ^ {(*)}\right) + \gamma \ln (m + 1) \tag {24}
+$$
+
+Therefore, using item (1) we have:
+
+$$
+\mathbb {E} \left[ \bar {\Psi} (\boldsymbol {x} ^ {(K)}) \right] \leq r (\boldsymbol {x} ^ {(*)}) + O \left(\exp (- a K)\right) \tag {25}
+$$
+
+On the other hand, due to the definition of $\Psi(x)$ and smoothed max or log-sum property, we have:
+
+$$
+\bar {\Psi} \left(\boldsymbol {x} ^ {(K)}\right) \geq r \left(\boldsymbol {x} ^ {(K)}\right) + \max _ {1 \leq i \leq m} \left(0, \alpha \tilde {g} _ {i} \left(\boldsymbol {x} ^ {(K)}\right)\right). \tag {26}
+$$
+
+For the purpose of lower bounding the second term in Eq. (26) we need the following Lemma:
+
+Lemma F.1. If $\bar{\pmb{x}}^T\neq \pmb{x}^T$ , by defining $g(\pmb{x}^{(K)})\triangleq \max_{1\leq i\leq m}\tilde{g}_i(\pmb{x}^{(K)})$ for all $i\in [1:m]$ we have:
+
+$$
+g \left(\boldsymbol {x} ^ {(K)}\right) \geq \rho \left\| \boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)} \right\| _ {2} \tag {27}
+$$
+
+The proof of this lemma can be found in Mahdavi et al. (2012) but for the sake of completeness we also include the proof.
+
+Proof. As $\bar{\pmb{x}}^{(K)}$ is the projection of $\pmb{x}^{(K)}$ into $\mathcal{K}$ ; i.e., $\bar{\pmb{x}}^{(K)} = \operatorname*{arg\min}_{g(\pmb{x}^{(K)})\leq 0}\left\| \pmb {x} - \pmb{x}^{(K)}\right\|^2$ , then due to first order optimality condition, there exists a positive constant $k > 0$ such that
+
+$$
+g \left(\bar {\boldsymbol {x}} ^ {(K)}\right) = 0 \quad \text {s . t .}, \quad \bar {\boldsymbol {x}} ^ {(K)} - \boldsymbol {x} ^ {(K)} = k \nabla g \left(\bar {\boldsymbol {x}} ^ {(K)}\right) \tag {28}
+$$
+
+As a result we have:
+
+$$
+g (\boldsymbol {x} ^ {(K)}) = g (\boldsymbol {x} ^ {(K)}) - g (\bar {\boldsymbol {x}} ^ {(K)}) \geq \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \nabla g (\bar {\boldsymbol {x}} ^ {(K)}) = \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| \left\| \nabla g (\bar {\boldsymbol {x}} ^ {(K)}) \right\|
+$$
+
+$$
+\stackrel {(\mathcal {G})} {\geq} \rho \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| \tag {29}
+$$
+
+where $(\mathcal{O})$ follows from Assumption 3.
+
+Hence, we have:
+
+$$
+\bar {\Psi} \left(\boldsymbol {x} ^ {(K)}\right) \geq r \left(\boldsymbol {x} ^ {(K)}\right) + \alpha \rho \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| \tag {30}
+$$
+
+Moreover, note that we have:
+
+$$
+\begin{array}{l} r \left(\boldsymbol {x} ^ {(K)}\right) \leq r \left(\boldsymbol {x} ^ {(*)}\right) + \gamma \ln (m + 1) + O \left(\exp (- a K)\right) - \max _ {1 \leq i \leq m} \left(0, \alpha \tilde {g} _ {i} \left(\boldsymbol {x} ^ {(K)}\right)\right) \\ \leq r \left(\boldsymbol {x} ^ {(*)}\right) + \gamma \ln (m + 1) + O \left(\exp (- a K)\right) \\ \end{array}
+$$
+
+Next, we can write:
+
+$$
+\begin{array}{l} r \left(\boldsymbol {x} ^ {(*)}\right) - r \left(\bar {\boldsymbol {x}} ^ {(K)}\right) = r \left(\boldsymbol {x} ^ {(*)}\right) - r \left(\boldsymbol {x} ^ {(K)}\right) + r \left(\boldsymbol {x} ^ {(K)}\right) - r \left(\bar {\boldsymbol {x}} ^ {(K)}\right) \\ \leq r \left(\boldsymbol {x} ^ {(K)}\right) - r \left(\bar {\boldsymbol {x}} ^ {(K)}\right) \\ \leq G \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| \tag {31} \\ \end{array}
+$$
+
+Eqs. (24), (30) and (31) lead to the bound:
+
+$$
+\begin{array}{l} \alpha \rho \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| \leq r (\boldsymbol {x} ^ {(*)}) - r (\boldsymbol {x} ^ {(K)}) + \gamma \ln (m + 1) + O \left(\exp (- a K)\right) \\ \leq G \left\| \left(\boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)}\right) \right\| + \gamma \ln (m + 1) + O (\exp (- a K)) \tag {32} \\ \end{array}
+$$
+
+which allows us to the following:
+
+$$
+\left\| \boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)} \right\| \leq \frac {\gamma \ln m}{\alpha \rho - G} + \frac {1}{\alpha \rho - G} O (\exp (- a K)) \tag {33}
+$$
+
+Finally, we have:
+
+$$
+\begin{array}{l} r (\bar {\boldsymbol {x}} ^ {(K)}) = r (\bar {\boldsymbol {x}} ^ {(K)}) - r (\boldsymbol {x} ^ {(K)}) + r (\boldsymbol {x} ^ {(K)}) \\ \leq G \left\| \boldsymbol {x} ^ {(K)} - \bar {\boldsymbol {x}} ^ {(K)} \right\| + r (\boldsymbol {x} ^ {(K)}) \\ \leq \underbrace {G \left[ \frac {\gamma \ln (m + 1)}{\alpha \rho - G} + \frac {1}{\alpha \rho - G} O \left(\exp (- a K)\right) \right] + \gamma \ln (m + 1)} _ {\text {C o s t o f v i o l a t i n g c o n s t r a i n t s}} + r \left(\boldsymbol {x} ^ {(*)}\right) + O \left(\exp (- a K) \right. \tag {34} \\ \end{array}
+$$
+
+Therefore, by setting $\gamma = \frac{\exp(-aK)}{\ln(m + 1)}$ we achieve the desired result.
+
+Proof of Corollary 4.2: The proof follows directly from Eq. (34).
+
+Proof of Theorem D.1: The proof follows directly from Theorem 8 in Zhang & Xiao (2019b).
+
+# F.1 COMPUTATIONAL COMPLEXITY OF THEOREM 4.1 AND THEOREM D.1
+
+Given the GCIVR algorithm, the sample complexity for Theorem 4.1 (where $S_{t}$ , $B_{t}$ and $\tau_{t}$ are fixed) is
+
+$$
+\begin{array}{l} O \left(\max \{T B, 2 T \tau S \}\right) \times K) = O \left(\max \{m, \frac {5}{\sqrt {m} \mu \eta} m \} + \max \{2 \frac {5}{\sqrt {m} \mu \eta} \sqrt {m} \sqrt {m}, \sqrt {m} \sqrt {m} \} \ln (1 / \epsilon)\right) \\ = O \left(\left(\max \{m, \frac {5}{\sqrt {m}} \mu \eta m \} + \max \{\frac {1 0}{\mu \eta} \sqrt {m}, m \}\right) \ln (1 / \epsilon)\right) \\ = O \left(\left[ m + \kappa \sqrt {m} \right] \ln (1 / \epsilon)\right) \tag {35} \\ \end{array}
+$$
+
+Proof of Theorem 4.3: The proof follows directly from Theorem 4 in Zhang & Xiao (2019b).
+
+# F.2 COMPUTATIONAL COMPLEXITY OF STRONGLY-CONVEX OBJECTIVES CORRESPONDING TO THEOREMS 4.3
+
+From Theorem 4 in Zhang & Xiao (2019b) for non-convex objectives we have:
+
+$$
+\mathbb {E} \left[ \left\| \mathcal {G} _ {\eta} \left(\bar {\boldsymbol {x}} ^ {(T)}\right) \right\| ^ {2} \right] \leq \left\{ \begin{array}{l l} O \left(\frac {\ln T}{T ^ {2}}\right) & \text {i f} T \leq T _ {0}, \\ O \left(\frac {\ln m}{\sqrt {m} (T - T _ {0} + 1)}\right) & \text {e l s e} T > T _ {0}, \end{array} \right. \tag {36}
+$$
+
+Considering the GCIVR algorithm and the bound in Eq. (36), the sample complexity for Theorem 4.3 (where $S_{t}$ and $\tau_{t}$ are fixed) can be expressed as follows:
+
+$$
+\begin{array}{l} \left\{ \begin{array}{l l} \sum_ {t = 0} ^ {T} (B _ {t} + S _ {t} \tau_ {t}) & \mathrm {i f} T = O (\epsilon^ {- 1 / 2}) \leq T _ {0} = O (\sqrt {m}), \\ T \times (B + S \tau) & T = O (1 / \sqrt {m} \epsilon) > T _ {0} = O (\sqrt {m}), \end{array} \right. \\ = \left\{ \begin{array}{l l} \sum_ {t = 0} ^ {T} 2 (\gamma t + \beta) ^ {2} & \text {i f} T = O (\epsilon^ {- 1 / 2}) \leq T _ {0} = O (\sqrt {m}), \\ \frac {1}{\sqrt {m} \epsilon} \times (m + \sqrt {m} \sqrt {m}) & T = O (1 / \sqrt {m} \epsilon) > T _ {0} = O (\sqrt {m}), \end{array} \right. \\ = \left\{ \begin{array}{l l} O \left(\gamma^ {2} T ^ {3}\right) & \text {i f} T = O \left(\epsilon^ {- 1 / 2}\right) \leq T _ {0} = O \left(\sqrt {m}\right), \\ O \left(\frac {\sqrt {m}}{\epsilon}\right) & T = O \left(1 / \sqrt {m} \epsilon\right) > T _ {0} = O \left(\sqrt {m}\right), \end{array} \right. \\ = \left\{ \begin{array}{l l} O \left(\epsilon^ {- 3 / 2}\right) & \text {i f} T = O \left(\epsilon^ {- 1 / 2}\right) \leq T _ {0} = O (\sqrt {m}), \\ O \left(\frac {\sqrt {m}}{\epsilon}\right) & T = O (1 / \sqrt {m} \epsilon) > T _ {0} = O (\sqrt {m}), \end{array} \right. \tag {37} \\ \end{array}
+$$
+
+Therefore, depending on how large $\sqrt{m}$ is and also desired accuracy level $\epsilon$ , we can decide to choose an adaptive or a non-adaptive approach.
+
+# F.3 CONVERGENCE ANALYSIS
+
+In this section, we extend assumptions used for centralized setting to distributed counterpart as follows:
+
+Assumption 6. We have the following assumptions:
+
+1) $\| f^{\prime}(\pmb {x}_1) - f^{\prime}(\pmb {x}_2)\| \leq L_h\| \pmb {x}_1 - \pmb {x}_2\|$ where $\pmb {x}_1,\pmb {x}_2\in \mathbb{R}$ . We also assume that $\| f(\pmb {x}_1) - f(\pmb {x}_2)\| \leq \ell_h\| \pmb {x}_1 - \pmb {x}_2\|$
+2) $\| \nabla h_j(\pmb{x}_1) - \bar{\nabla} h_j(\pmb{x}_2)\| \leq L_h\| \pmb{x}_1 - \pmb{x}_2\|$ where $\pmb{x}_1,\pmb{x}_2\in \mathbb{R}^d$ . We also assume that $\| h_j(\pmb {x}_1) - h_j(\pmb {x}_2)\| \leq \ell_h\| \pmb {x}_1 - \pmb {x}_2\|$
+3) $\| \nabla g_{j}(\pmb{x}_{1};\xi) - \nabla g_{j}(\pmb{x}_{2};\xi)\| \leq L_{g}\| \pmb{x}_{1} - \pmb{x}_{2}\|$ and $\| g_{j}(\pmb{x}_{1};\xi) - g_{j}(\pmb{x}_{2};\xi)\|\leq$ $\ell_g\| \pmb {x}_1 - \pmb {x}_2\| for\forall \pmb {x}_1,\pmb {x}_2\in \mathbb{R}^d and 1\leq j\leq p.$
+4) We suppose that $\Psi (\pmb {x})$ in Eq. (2) is bounded from below that $\Psi^{*} = \inf_{\pmb{x}}\Psi (\pmb {x}) > - \infty$
+5) We assume $r(\pmb{x}) \in \mathbb{R} \cup \{\infty\}$ is a convex and lower-semicontinues function.
+
+Assumption 7 (Unbiased estimation). The mini-batch sampling is unbiased that is $\mathbb{E}\left[g_j(\pmb{x};\xi)\right] = g_j(\pmb{x})$ and $\mathbb{E}\left[\nabla g_j(\pmb{x};\xi)\right] = \nabla g_j(\pmb{x})$ for $1 \leq j \leq p$ .
+
+# Convergence Analysis for Strongly Convex Objectives:
+
+Assumption 8. We additionally for the DRO problem with Wessterstein metric suppose that the function $r(x)$ is smooth with module $G$ .
+
+Theorem F.2. Under Assumptions 3 and 6 to 8, when $\Psi$ is $\mu$ -optimally strongly convex, if we set $\tau_{t} = S_{t} = \sqrt{B_{t}} = \sqrt{m}$ and $T = \frac{5}{\sqrt{m}\mu\eta}$ , and $\gamma = \frac{\exp(-K)}{\ln(m + 1)}$ letting $\eta < \frac{2}{L_{\Phi} + \sqrt{L_{\Phi}^2 + 36G_0}}$ and $\alpha > \frac{G}{\rho}$ , if we let $\mathbf{x}^{(k + 1)} = \text{DistBCO}(\mathbf{x}^{(k)})$ for $k = 0,\dots,K - 1$ using Algorithm 2 after $K = \ln (1 / \epsilon)$ stages and returning the final solution after projecting onto the constraint set $\mathcal{K} = \{\pmb{x}|g_i(\pmb{x})\leq 0,i = 1,2,\dots,m\}$ , i.e., $\bar{\pmb{x}}^{(K)} = \Pi_{\mathcal{K}}(\pmb{x}^{(K)})$ , solves the optimization problem in Eq. (3) with convergence error $r(\tilde{\pmb{x}}^{(T)}) - r(\pmb{x}^{(*)})\leq \epsilon$ with
+
+$$
+O \left(\left(m + \frac {m}{p} + \kappa \sqrt {m}\right) \ln \frac {1}{\epsilon}\right) \tag {38}
+$$
+
+per device number of constraint checks.
+
+Remark 5 (Computational Complexity). The sample complexity for Theorem F.2 (where $S_{t}$ , $B_{t}$ and $\tau_{t}$ are fixed) is
+
+$$
+\begin{array}{l} O \left(\max \{T B, 2 T \tau S \}\right) \times K) = O \left(\max \{\frac {m}{p}, \frac {5}{\sqrt {m} \mu \eta} m \} + \max \{2 \frac {5}{\sqrt {m} \mu \eta} \sqrt {m} \sqrt {m}, \sqrt {m} \sqrt {m} \} \ln (1 / \epsilon)\right) \\ = O \left(\left(\max \{m, \frac {5}{\sqrt {m}} \mu \eta m \} + \max \{\frac {1 0}{\mu \eta} \sqrt {m}, m \}\right) \ln (1 / \epsilon)\right) \\ = O \left(\left[ m + \frac {m}{p} + \kappa \sqrt {m} \right] \ln (1 / \epsilon)\right) \tag {39} \\ \end{array}
+$$
+
+Convergence Analysis for Non-Convex Objectives: For the non-convex case we also need the following extra assumption.
+
+Assumption 9 (Bounded variance). The mini-batch sampling has bounded variance that is
+
+$$
+\mathbb {E} \left[ \left\| \nabla g _ {j} (\pmb {x}; \mathcal {Z}) - \nabla g _ {j} (\pmb {x}) \right\| ^ {2} \right] \leq \sigma^ {2}
+$$
+
+for $1\leq j\leq m$
+
+Theorem F.3. Under Assumptions 6 to 9 using Algorithm 2, for some positive constants $\beta$ and $0 \leq \zeta < \sqrt{m}$ ; denoting $T_0 \triangleq \frac{\sqrt{m} - \zeta}{\beta} = O(\sqrt{m})$ , if $t \leq T_0$ , parameters are chosen to be $\tau_t = S_t = \sqrt{B_t} = \beta t + \zeta$ ; and when $t > T_0$ , set $\tau_t = S_t = \sqrt{m}$ . Then, if $\eta < \frac{4}{L_\Phi + \sqrt{L_\Phi^2 + 12G_0}}$ it holds that
+
+$$
+\mathbb {E} \left[ \left\| \mathcal {G} _ {\eta} \left(\bar {\boldsymbol {x}} ^ {(T)}\right) \right\| ^ {2} \right] \leq \left\{ \begin{array}{l l} O \left(\frac {\ln T}{T ^ {2}}\right) & \text {i f} T \leq T _ {0}, \\ O \left(\frac {\ln p}{\sqrt {m} (T - T _ {0} + 1)}\right) & T > T _ {0}, \end{array} \right. \tag {40}
+$$
+
+This leads to the per device sample complexity of $\tilde{O}\left(\min \{\frac{\sqrt{m}}{p\epsilon} +\frac{\sqrt{m}}{\epsilon},\frac{1}{p\epsilon^{1.5}} +\frac{1}{\epsilon^{1.5}}\}\right)$ where $\tilde{O}(.)$ notation hides logarithmic factors. Therefore, depending on the objective function $\Psi$ this sample complexity corresponds to both DRO problem with $\chi^2$ and regularized KL metrics.
+
+We highlight that while in distributed setting we can not reduce computational complexity in terms of order of magnitude, we can reduce computational complexity partially linearly with number of devices.
+
+# G PROOF OF THE DISTRIBUTED ALGORITHM
+
+For the convince, we define the following notations
+
+$$
+\boldsymbol {\xi} ^ {(t)} = \{\boldsymbol {\xi} _ {1} ^ {(t)}, \dots , \boldsymbol {\xi} _ {p} ^ {(t)} \},
+$$
+
+to denote the set of local solutions and sampled mini-batches at iteration $t$ at different machines, respectively.
+
+We use notation $\mathbb{E}[\cdot ]$ to denote the conditional expectation $\mathbb{E}_{\pmb{\xi}^{(t)}}[\cdot ]$
+
+# G.1 GENERAL LEMMAS
+
+Before proceeding to the proof of main theorems, we first review a few properties of our algorithm that will be useful in our convergence proof:
+
+$$
+\mathbb {E} \left[ \boldsymbol {y} _ {j} ^ {(t, i)} | \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {y} _ {j - 1} ^ {(t, i)} + g _ {i} (\boldsymbol {x} _ {j} ^ {(t)}) - g _ {i} (\boldsymbol {x} _ {j - 1} ^ {(t)})
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {z} _ {j} ^ {(t, i)} | \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {z} _ {j - 1} ^ {(t, i)} + \nabla g _ {i} (\boldsymbol {x} _ {j} ^ {(t)}) - \nabla g _ {i} (\boldsymbol {x} _ {j - 1} ^ {(t)})
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {w} _ {j} ^ {(t, i)} | \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {w} _ {j - 1} ^ {(t, i)} + \nabla h _ {i} \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \nabla h _ {i} \left(\boldsymbol {x} _ {j - 1} ^ {(t)}\right) \tag {41}
+$$
+
+which due to linearity and taking average over the models of all devices, leads to
+
+$$
+\mathbb {E} \left[ \boldsymbol {y} _ {j} ^ {(t)} \mid \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {y} _ {j - 1} ^ {(t)} + g \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - g \left(\boldsymbol {x} _ {j - 1} ^ {(t)}\right) \tag {42}
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {z} _ {j} ^ {(t)} | \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {z} _ {j - 1} ^ {(t)} + \nabla g (\boldsymbol {x} _ {j} ^ {(t)}) - \nabla g (\boldsymbol {x} _ {j - 1} ^ {(t)})
+$$
+
+$$
+\mathbb {E} \left[ \boldsymbol {w} _ {j} ^ {(t)} | \boldsymbol {x} _ {j} ^ {(t)} \right] = \boldsymbol {w} _ {j - 1} ^ {(t)} + \nabla h \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \nabla h \left(\boldsymbol {x} _ {j - 1} ^ {(t)}\right) \tag {43}
+$$
+
+Additionally, we have equivalent update rule as follows:
+
+$$
+\boldsymbol {y} _ {j} ^ {(t)} = \boldsymbol {y} _ {j - 1} ^ {(t)} + \frac {1}{S ^ {(t)}} \sum_ {\xi \in S _ {j} ^ {(t)}} \left[ g \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - g \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {44}
+$$
+
+$$
+\boldsymbol {z} _ {j} ^ {(t)} = \boldsymbol {z} _ {j - 1} ^ {(t)} + \frac {1}{S ^ {(t)}} \sum_ {\xi \in \mathcal {S} _ {j} ^ {(t)}} \left[ \nabla g (\boldsymbol {x} _ {j} ^ {(t)}; \xi) - \nabla g (\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi) \right]
+$$
+
+$$
+\boldsymbol {w} _ {j} ^ {(t)} = \boldsymbol {w} _ {j - 1} ^ {(t)} + \frac {1}{S ^ {(t)}} \sum_ {\xi \text {i n} \mathcal {S} _ {j} ^ {(t)}} \left[ \nabla h \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - \nabla h \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \right] \tag {45}
+$$
+
+Lemma G.1. For any $1 \leq j \leq \tau_t$ we have:
+
+$$
+\mathbb {E} \left[ \left\| \boldsymbol {y} _ {j} ^ {(t)} - g \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \leq \mathbb {E} \left[ \left\| \boldsymbol {y} _ {0} ^ {(t)} - g \left(\boldsymbol {x} _ {0} ^ {(t)}\right) \right\| ^ {2} \right] + \sum_ {r = 1} ^ {j} \frac {\ell_ {g} ^ {2}}{S ^ {(t)}} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {r} ^ {(t)} - \boldsymbol {x} _ {r - 1} ^ {(t)} \right\| ^ {2} \right] \tag {46}
+$$
+
+$$
+\mathbb {E} \left[ \left\| \boldsymbol {z} _ {j} ^ {(t)} - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \leq \mathbb {E} \left[ \left\| \boldsymbol {z} _ {0} ^ {(t)} - g ^ {\prime} (\boldsymbol {x} _ {0} ^ {(t)}) \right\| ^ {2} \right] + \sum_ {r = 1} ^ {j} \frac {L _ {g} ^ {2}}{S ^ {(t)}} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {r} ^ {(t)} - \boldsymbol {x} _ {r} ^ {(t)} \right\| ^ {2} \right]
+$$
+
+$$
+\mathbb {E} \left[ \left\| \boldsymbol {w} _ {j} ^ {(t)} - h ^ {\prime} \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \leq \mathbb {E} \left[ \left\| \boldsymbol {w} _ {0} ^ {(t)} - h ^ {\prime} \left(\boldsymbol {x} _ {0} ^ {(t)}\right) \right\| ^ {2} \right] + \sum_ {r = 1} ^ {j} \frac {L _ {h} ^ {2}}{S ^ {(t)}} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {r} ^ {(t)} - \boldsymbol {x} _ {r} ^ {(t)} \right\| ^ {2} \right] \tag {47}
+$$
+
+We note that Lemma G.1 is the generalization of Lemma 1 in Zhang & Xiao (2019b), and we provide the proof for the sake of completeness.
+
+Proof. Our proof can be considered as a generalization of the proof in Zhang & Xiao (2019b) to distributed setting. For this end, we use the following equation for every fix vector $\pmb{u}$ :
+
+$$
+\mathbf {V a r} (\boldsymbol {x}) = \mathbb {E} \left[ \| \boldsymbol {x} - \boldsymbol {u} \| ^ {2} \right] - \| \mathbb {E} [ \boldsymbol {x} ] - \boldsymbol {u} \| ^ {2} \tag {48}
+$$
+
+Therefore, letting $\pmb{u} = g(\pmb{x}_j^{(t)})$ we obtain:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \boldsymbol {y} _ {j} ^ {(t)} - g (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \mid \boldsymbol {x} _ {j} ^ {(t)} \right] = \left\| \mathbb {E} \left[ \boldsymbol {y} _ {j} ^ {(t)} \mid \boldsymbol {x} _ {j} ^ {(t)} \right] - g (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} + \mathbf {V a r} \left(\boldsymbol {y} _ {j} ^ {(t)} \mid \boldsymbol {x} _ {j} ^ {(t)}\right) \\ \stackrel {(4 2)} {=} \left\| \mathbb {E} \left[ \boldsymbol {y} _ {j - 1} ^ {(t)} \mid \boldsymbol {x} _ {j - 1} ^ {(t)} \right] - g (\boldsymbol {x} _ {j - 1} ^ {(t)}) \right\| ^ {2} + \operatorname {V a r} \left(\boldsymbol {y} _ {j} ^ {(t)} \mid \boldsymbol {x} _ {j} ^ {(t)}\right) \tag {49} \\ \end{array}
+$$
+
+The final step of proof involves bounding the term $\mathbf{Var}\left(\boldsymbol{y}_j^{(t)}\mid \boldsymbol{x}_j^{(t)}\right)$ as follows:
+
+$$
+\begin{array}{l} \mathbf {V a r} \left(\boldsymbol {y} _ {j} ^ {(t)} \mid \boldsymbol {x} _ {j} ^ {(t)}\right) = \mathbf {V a r} \left(\boldsymbol {y} _ {j - 1} ^ {(t)} + \frac {1}{S ^ {(t)}} \sum_ {\xi \in S _ {j} ^ {(t)}} \left[ g (\boldsymbol {x} _ {j} ^ {(t)}; \xi) - g (\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi) \right] \mid \boldsymbol {x} _ {j} ^ {(t)}\right) \\ = \frac {1}{S ^ {(t)}} \mathbf {V a r} \left(g \left(\boldsymbol {x} _ {j} ^ {(t)}; \xi\right) - g \left(\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi\right) \mid \boldsymbol {x} _ {j} ^ {(t)}\right) \\ \stackrel {(\Leftrightarrow)} {\leq} \frac {1}{S ^ {(t)}} \mathbb {E} \left[ \left\| g (\boldsymbol {x} _ {j} ^ {(t)}; \xi) - g (\boldsymbol {x} _ {j - 1} ^ {(t)}; \xi) \right\| ^ {2} \left| \boldsymbol {x} _ {j} ^ {(t)} \right] \right. \\ \stackrel {(\mathcal {E})} {\leq} \frac {\ell_ {g} ^ {2}}{S ^ {(t)}} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {j} ^ {(t)} - \boldsymbol {x} _ {j - 1} ^ {(t)} \right\| ^ {2} \mid \boldsymbol {x} _ {j} ^ {(t)} \right] \tag {50} \\ \end{array}
+$$
+
+where $(\otimes)$ and $(\mathcal{O})$ follows from the definition of $\mathbf{Var}(.)$ and Assumption 6.
+
+The proof for Eq. (47) follows similarly.
+
+The rest of the proof is similar to Zhang & Xiao (2019b) but for the sake of completeness we add the rest of the proof. For this purpose, we use the notation $\Phi(\pmb{x}) \triangleq h(\pmb{x}) + f(g(\pmb{x}))$ and $\tilde{\nabla} \Phi(\pmb{x}_j^{(t)}) = \left(\pmb{z}_j^{(t)}\right)^T f'(\pmb{y}_j^{(t)}) + \pmb{w}_j^{(t)}$
+
+Lemma G.2. Under Assumption 6 we have:
+
+$$
+\mathbb {E} \left[ \left\| \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \leq \frac {G _ {0}}{S ^ {(t)}} \sum \mathbb {E} \left[ \left\| \boldsymbol {x} ^ {(t)} - \boldsymbol {x} ^ {(t)} \right\| ^ {2} \right] + \frac {\sigma_ {0} ^ {2}}{B ^ {(t)}} \tag {51}
+$$
+
+with definitions $G_0 \triangleq 3\left(g_g^4 L_f^2 + g_f^2 L_g^2\right)$ and $\sigma_0^2 \triangleq 3\left(g_g^2 L_f^2 \sigma_g^2 + g_f^2 \sigma_{g'}^2 + \sigma_h^2\right)$
+
+Proof. Using Assumption 6, we obtain:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \tilde {\nabla} \Phi (\boldsymbol {x} _ {j} ^ {(t)}) - \nabla \Phi (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \\ = \mathbb {E} \left[ \left\| \left(\boldsymbol {z} _ {j} ^ {(t)}\right) ^ {T} f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) + \boldsymbol {w} _ {j} ^ {(t)} - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (g (\boldsymbol {x} _ {j} ^ {(t)})) - h ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \\ = \mathbb {E} \left[ \left\| \left(\boldsymbol {z} _ {j} ^ {(t)}\right) ^ {T} f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) + g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (g (\boldsymbol {x} _ {j} ^ {(t)})) + \boldsymbol {w} _ {j} ^ {(t)} - h ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \\ \leq 3 \mathbb {E} \left[ \left\| \left(\boldsymbol {z} _ {j} ^ {(t)}\right) ^ {T} f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) \right\| ^ {2} \right] + 3 \mathbb {E} \left[ \left\| g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (\boldsymbol {y} _ {j} ^ {(t)}) - g ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) f ^ {\prime} (g (\boldsymbol {x} _ {j} ^ {(t)})) \right\| ^ {2} \right] \\ + 3 \mathbb {E} \left[ \left\| \boldsymbol {w} _ {j} ^ {(t)} - h ^ {\prime} (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \\ \end{array}
+$$
+
+$$
+\leq 3 g _ {f} ^ {2} \mathbb {E} \left[ \left\| \boldsymbol {z} _ {j} ^ {(t)} - g \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] + 3 g _ {g} ^ {2} L _ {f} ^ {2} \mathbb {E} \left[ \left\| \boldsymbol {y} _ {j} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} \right] + 3 \mathbb {E} \left[ \left\| \boldsymbol {w} _ {j} ^ {(t)} - h ^ {\prime} \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \tag {52}
+$$
+
+Next step of proof is to utilize Lemma G.1 in Eq. (52), which leads to
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \tilde {\nabla} \Phi (\boldsymbol {x} _ {j} ^ {(t)}) - \nabla \Phi (\boldsymbol {x} _ {j} ^ {(t)}) \right\| ^ {2} \right] \leq \frac {3 \left(\ell_ {g} ^ {4} L _ {f} ^ {2} + \ell_ {f} ^ {2} L _ {g} ^ {2}\right)}{S ^ {(t)}} \sum \mathbb {E} \left[ \left\| \boldsymbol {x} ^ {(t)} - \boldsymbol {x} ^ {(t)} \right\| ^ {2} \right] + 3 \left(\ell_ {g} ^ {2} L _ {f} ^ {2}\right) \mathbb {E} \left[ \left\| \boldsymbol {y} _ {0} ^ {(t)} - \boldsymbol {x} _ {0} ^ {(t)} \right\| ^ {2} \right] \\ + 3 \left(\ell_ {f} ^ {2}\right) \mathbb {E} \left[ \left\| \boldsymbol {z} _ {0} ^ {(t)} - \boldsymbol {x} _ {0} ^ {(k)} \right\| ^ {2} \right] + \sum_ {r = 1} ^ {j} \frac {3 L _ {h} ^ {2}}{S ^ {(t)}} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {r} ^ {(t)} - \boldsymbol {x} _ {r} ^ {(t)} \right\| ^ {2} \right] + 3 \mathbb {E} \left[ \left\| \boldsymbol {w} _ {0} ^ {(t)} - h ^ {\prime} \left(\boldsymbol {x} _ {0} ^ {(t)}\right) \right\| ^ {2} \right] \\ \stackrel {(a)} {=} \frac {3 \left(\ell_ {g} ^ {4} L _ {f} ^ {2} + \ell_ {f} ^ {2} L _ {g} ^ {2} + L _ {h} ^ {2}\right)}{S ^ {(t)}} \sum_ {r = 1} ^ {j} \mathbb {E} \left[ \left\| \boldsymbol {x} _ {r} ^ {(t)} - \boldsymbol {x} _ {r - 1} ^ {(t)} \right\| ^ {2} \right] + \frac {\sigma_ {0} ^ {2}}{B ^ {(t)}} \tag {53} \\ \end{array}
+$$
+
+where (a) comes from algorithm and computing initial full batch in the beginning of each epoch, and using Assumption 9 as well as following bounds:
+
+$$
+\mathbb {E} \left[ \left\| \boldsymbol {y} _ {0} ^ {(t)} - g \left(\boldsymbol {x} _ {0} ^ {(t)}\right) \right\| ^ {2} \right] \leq \frac {\sigma_ {g} ^ {2}}{B ^ {(t)}}, \quad \mathbb {E} \left[ \left\| \boldsymbol {z} _ {0} ^ {(t)} - g ^ {\prime} \left(\boldsymbol {x} _ {0} ^ {(k)}\right) \right\| ^ {2} \right] \leq \frac {\sigma_ {g ^ {\prime}} ^ {2}}{B ^ {(t)}} \quad \text {a n d} \quad \mathbb {E} \left[ \left\| \boldsymbol {w} _ {0} ^ {(t)} - h ^ {\prime} \left(\boldsymbol {x} _ {0} ^ {(k)}\right) \right\| ^ {2} \right] \leq \frac {\sigma_ {h ^ {\prime}} ^ {2}}{B ^ {(t)}} \tag {54}
+$$
+
+
+
+The rest of the proof is to show that $\mathbb{E}\left[\left\| \mathcal{G}_{\eta}(\pmb{x}_j^2)\right\|^2\right] \leq \epsilon$ where $\mathcal{G}_{\eta}(\pmb{x}_j^{(t)}) \triangleq \frac{1}{\eta}\left(\pmb{x}_j^{(t)} - \hat{\pmb{x}}_{j+1}^{(t)}\right)$ and
+
+$$
+\hat {\boldsymbol {x}} _ {j + 1} ^ {(t)} = \Pi_ {f} ^ {\eta} \left(\boldsymbol {x} _ {j} ^ {(t)} - \eta \left[ \nabla \Phi (\boldsymbol {x} _ {j} ^ {(t)}) \right]\right)
+$$
+
+However, Algorithm 2 produces approximate proximal gradient mapping:
+
+$$
+\tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \triangleq \frac {1}{\eta} \left(\boldsymbol {x} _ {j} ^ {(t)} - \boldsymbol {x} _ {j + 1} ^ {(t)}\right) \tag {55}
+$$
+
+where $\hat{\pmb{x}}_{j + 1}^{(t)} = \Pi_f^\eta \left(\pmb {x}_j^{(t)} - \eta \nabla \Phi (\pmb {x}_j^{(t)})\right)$ . So the following Lemmas connect two gradient approximations:
+
+Lemma G.3. We have:
+
+$$
+\mathbb {E} \left[ \left\| \mathcal {G} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] \leq 2 \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + 2 \mathbb {E} \left[ \left\| \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \tag {56}
+$$
+
+Proof. Using triangle inequality $\left\| \pmb{x}_j^{(t)} - \hat{\pmb{x}}_{j + 1}^{(t)}\right\|^2 \leq 2\left\| \pmb{x}_j^{(t)} - \pmb{x}_{j + 1}^{(t)}\right\|^2 + 2\left\| \pmb{x}_{j + 1}^{(t)} - \hat{\pmb{x}}_{j + 1}^{(t)}\right\|^2$ and the definition of $\tilde{\mathcal{G}}_{\eta}(\pmb{x}_j^{(t)})$ and $\mathcal{G}_{\eta}(\pmb{x}_j^2)$ , we have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| \mathcal {G} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] \leq 2 \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + \frac {2}{\eta^ {2}} \left\| \boldsymbol {x} _ {j} ^ {(t)} - \hat {\boldsymbol {x}} _ {j + 1} ^ {(t)} \right\| ^ {2} \\ = 2 \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + \frac {2}{\eta^ {2}} \left\| \Pi_ {f} ^ {\eta} \left(\boldsymbol {x} _ {j} ^ {(t)} - \eta \left[ \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right]\right) - \Pi_ {f} ^ {\eta} \left(\boldsymbol {x} _ {j} ^ {(t)} - \eta \left[ \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right]\right) \right\| ^ {2} \\ = 2 \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + 2 \left\| \left[ \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right] \right\| ^ {2} \tag {57} \\ \end{array}
+$$
+
+
+
+Based on the definition $\Psi (\pmb {x})\triangleq F(g(\pmb {x})) + h(\pmb {x}) + r(\pmb {x})$ we have the following lemma:
+
+Lemma G.4. With definition $L_{\Phi} = L_{F} + L_{h}$ , we have:
+
+$$
+\mathbb {E} \left[ \Psi \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) \right] \leq \mathbb {E} \left[ \Psi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right] - \frac {1}{2} (\eta - L _ {\Psi} \eta^ {2}) \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + \frac {\eta}{2} \| \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \| ^ {2} \tag {58}
+$$
+
+and
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \Psi \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) \right] \leq \mathbb {E} \left[ \Psi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right] - \frac {\eta}{8} \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + \frac {3 \eta}{4} \mathbb {E} \left[ \left\| \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \\ - \left(\frac {1}{4 \eta} - \frac {L _ {\Phi}}{2}\right) \mathbb {E} \left[ \left\| \boldsymbol {x} _ {j} ^ {(t)} - \boldsymbol {x} _ {j + 1} ^ {(t)} \right\| ^ {2} \right] \tag {59} \\ \end{array}
+$$
+
+Proof. Using $L_{\Phi}$ -Lipschitz continuity of $\Psi$ and the optimality of the $\frac{1}{\eta}$ -strongly convex of subproblem $(r(\pmb{x}))$ , we obtain
+
+$$
+\begin{array}{l} \Psi \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) = F \left(g \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right)\right) + h \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) + r \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) \\ \leq F (g (\boldsymbol {x} _ {j} ^ {(t)})) + h (\boldsymbol {x} _ {j} ^ {(t)}) + \left\langle \left[ \nabla F (g (\boldsymbol {x} _ {j} ^ {(t)})) + \nabla h (\boldsymbol {x} _ {j} ^ {(t)}) \right], \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\rangle + \frac {L _ {F} + L _ {h}}{2} \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} + r (\boldsymbol {x} _ {j + 1} ^ {(t)}) \\ = F \left(g \left(\boldsymbol {x} _ {j} ^ {(t)}\right)\right) + h \left(\boldsymbol {x} _ {j} ^ {(t)}\right) + \left\langle \left[ \tilde {\nabla} F \left(g \left(\boldsymbol {x} _ {j} ^ {(t)}\right)\right) + \tilde {\nabla} h \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right], \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\rangle + \frac {1}{2 \eta} \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} + r \left(\boldsymbol {x} _ {j + 1} ^ {(t)}\right) \\ + \left\langle \left[ \nabla F (g (\boldsymbol {x} _ {j} ^ {(t)})) + \nabla h (\boldsymbol {x} _ {j} ^ {(t)}) \right] - \left[ \tilde {\nabla} F (g (\boldsymbol {x} _ {j} ^ {(t)})) + \tilde {\nabla} h (\boldsymbol {x} _ {j} ^ {(t)}) \right], \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\rangle \\ + \left(\frac {1}{2 \eta} - \frac {L _ {F} + L _ {h}}{2}\right) \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} \\ \leq F \left(g \left(\boldsymbol {x} _ {j} ^ {(t)}\right)\right) + h \left(\boldsymbol {x} _ {j} ^ {(t)}\right) + r \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \frac {1}{2 \eta} \left\| \boldsymbol {x} _ {j} ^ {(t)} - \boldsymbol {x} _ {j + 1} ^ {(t)} \right\| ^ {2} - \left(\frac {1}{2 \eta} - \frac {L _ {F} + L _ {h}}{2}\right) \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} \\ + \frac {\eta}{2} \left\| \left[ \nabla F (g (\boldsymbol {x} _ {j} ^ {(t)})) + \nabla h (\boldsymbol {x} _ {j} ^ {(t)}) - \left[ \tilde {\nabla} F (g (\boldsymbol {x} _ {j} ^ {(t)})) + \tilde {\nabla} h (\boldsymbol {x} _ {j} ^ {(t)}) \right] \right] \right\| ^ {2} + \frac {1}{2 \eta} \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} \\ = \Psi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \frac {1}{2 \eta} \left\| \boldsymbol {x} _ {j} ^ {(t)} - \boldsymbol {x} _ {j + 1} ^ {(t)} \right\| ^ {2} - \left(\frac {1}{2 \eta} - \frac {L _ {F} + L _ {h}}{2}\right) \left\| \boldsymbol {x} _ {j + 1} ^ {(t)} - \boldsymbol {x} _ {j} ^ {(t)} \right\| ^ {2} + \frac {\eta}{2} \left\| \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right)\right) \| ^ {2} \tag {60} \\ \end{array}
+$$
+
+Next, we complete the proof by taking expectation from both sides of Eq. (60) concludes the proof of Eq. (58).
+
+Next, using Lemma G.2, we have
+
+$$
+- \frac {\eta}{4} \mathbb {E} \left[ \left\| \tilde {\mathcal {G}} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] \leq - \frac {\eta}{8} \mathbb {E} \left[ \left\| \mathcal {G} _ {\eta} \left(\boldsymbol {x} _ {j} ^ {2}\right) \right\| ^ {2} \right] + \frac {\eta}{4} \mathbb {E} \left[ \left\| \nabla \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) - \tilde {\nabla} \Phi \left(\boldsymbol {x} _ {j} ^ {(t)}\right) \right\| ^ {2} \right] \tag {61}
+$$
+
+We can prove Eq. (59), by simply adding Eq. (61) to both sides of Eq. (58).
+
+We note that Lemmas G.3 and G.4 are an extension of Lemma 3 and 4 in Appendix Section of Zhang & Xiao (2019b) with difference that here the function $\Psi(\boldsymbol{x})$ includes extra function $h(\boldsymbol{x})$ , which leads to $L_{\Phi} = L_F + L_h$ which is bigger than $L_F$ in Zhang & Xiao (2019b).
+
+The rest of the proof is same as the proof of Theorems 4 and 8 in Zhang & Xiao (2019b) which is based on Lemmas G.3 and G.4, and for more details we refer the reader to the Appendix section of the reference Zhang & Xiao (2019b).
+
+
+
+# H APPROXIMATE APPROACH FOR DRO WITH WESSERSTEIN METRIC WITH NON-CONVEX OBJECTIVES
+
+For the non-convex objectives, the optimization problem in Eq. (3) can be upper-bounded with the optimization problem as follows:
+
+$$
+\inf _ {\boldsymbol {x} \in \mathbb {X}} \sup _ {Q \in \hat {\mathcal {D}} _ {N}} \mathbb {E} _ {Q} [ h (\boldsymbol {x}; \xi) ] \leq \underset {\boldsymbol {x}} {\text {m i n i m i z e}} r (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} \left(\boldsymbol {x} _ {i}\right) \tag {62}
+$$
+
+$$
+\text {s u b j e c t} \quad \tilde {g} _ {i} (\boldsymbol {x}) \leq 0, \forall i \in \{1, \dots , m \}
+$$
+
+We note that for the case of convex objective in optimum solution inequality holds with equality; however, in case of non-convex cost functions we do not have equality necessarily. We note that Eq. (62) with non-convex constraint can not be easily solved via augmented function approach in previous section. In order to solve the upper bound optimization problem in Eq. (62) efficiently via our suggested composite approach. For this end, we suggest to solve the following optimization problem where in constrained are modified to be convex:
+
+$$
+\underset {\boldsymbol {x}} {\text {m i n i m i z e}} \quad f (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} \left(\boldsymbol {x} _ {i}\right) \tag {63}
+$$
+
+$$
+\text {s u b j e c t} \quad \hat {g} _ {i} \triangleq \tilde {g} _ {i} (\boldsymbol {x}) + \mu_ {i} \| \boldsymbol {x} \| ^ {2} \leq 0, \forall i \in \{1, \dots , m \} \tag {64}
+$$
+
+where we choose $\tilde{g}_i$ such that $\hat{g}_i$ are strongly convex. Therefore, we have the following relationship between optimization problem:
+
+$$
+\inf _ {\boldsymbol {x} \in \mathbb {X}} \sup _ {Q \in \hat {\mathcal {D}} _ {N}} \mathbb {E} _ {Q} [ h (\boldsymbol {x}; \xi) ] \leq \underset {\boldsymbol {x}} {\text {m i n i m i z e}} r (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} \left(\boldsymbol {x} _ {i}\right) \tag {65}
+$$
+
+$$
+\text {s u b j e c t} \quad \tilde {g} _ {i} (\boldsymbol {x}) \leq 0, \forall i \in \{1, \dots , m \}
+$$
+
+$$
+\leq \underset {\boldsymbol {x}} {\text {m i n i m i z e}} r (\boldsymbol {x}) \triangleq \frac {1}{m} \sum_ {i = 1} ^ {m} f _ {i} \left(\boldsymbol {x} _ {i}\right) \tag {66}
+$$
+
+$$
+\text {s u b j e c t} \quad \tilde {g} _ {i} (\boldsymbol {x}) + \mu_ {i} \| \boldsymbol {x} \| ^ {2} \leq 0, \forall i \in \{1, \dots , m \} \tag {67}
+$$
\ No newline at end of file
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/images.zip b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d1e85cadc023364a4fd667e8b2d42ccb921dcd38
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:982b17b5a548be0084924a58825419dc1e1dadc13471cbe6f50f9a29f8f217ce
+size 1201643
diff --git a/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/layout.json b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5a2621c920087138c07df4a24983e7143b64a2b4
--- /dev/null
+++ b/learningdistributionallyrobustmodelsatscaleviacompositeoptimization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3ebb1cdace4242ee8e81be1c6224d9ba8d505bf8f0fa27b0277730390d0223e5
+size 1062308
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_content_list.json b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..2b19e1338da1d43eed82e4a7deab9fb032c6da37
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a1c5e02e176ae92444b90306330fe389b04cb14304a83cdfcbe8c28c549d0b17
+size 87330
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_model.json b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..1fafab9375923bbb447dd8ea86816ef2da1db588
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:82ea2576d5e4af350ed2ff13fe1c7bcb0328442ce2d19016b3faa1a6ddfea77d
+size 109352
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_origin.pdf b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f75c27e3b860468924c97439878cfdce67bec98f
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/da1f1c30-ab2a-43fd-8898-702dc0006506_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dd5f086ff63aaca5e5c615db8e1c3ebb188010469cddcd5ba3d1187d6648ab4d
+size 2027145
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/full.md b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1b0428740690d3a008bebc657704c844b8788808
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/full.md
@@ -0,0 +1,318 @@
+# LEARNING EFFICIENT IMAGE SUPER-RESOLUTION NETWORKS VIA STRUCTURE-REGULARIZED PRUNING
+
+Yulun Zhang $^{1,\dagger}$ Huan Wang $^{1,\dagger,*}$ Can Qin $^{1}$ Yun Fu $^{1}$
+
+$^{1}$ Northeastern University, USA
+
+# ABSTRACT
+
+Several image super-resolution (SR) networks have been proposed for efficient SR, achieving promising results. However, they are still not lightweight enough and neglect to be extended to larger networks. At the same time, model compression methods (i.e., knowledge distillation and neural architecture search) usually need heavy extra resources. Then, we turn to a cheap and effective model compression way: network pruning. However, it is not easy to directly apply network pruning to image SR. It is well-known tricky to conduct filter pruning for residual blocks commonly used in SR networks. To solve these problems, we propose structure-regularized pruning (SRP), which imposes regularization on the pruned structure to ensure the locations of pruned filters are aligned across different layers. Specifically, for the layers connected by the same residual, we select the filters of the same indices as unimportant filters. To transfer the expressive power in the unimportant filters to the rest of the network, we employ $L_{2}$ regularization to drive the weights towards zero so that eventually, their absence will cause minimal performance degradation. We apply SRP to train efficient image SR networks, resulting in a lightweight network SRPN-Lite and a very deep one SRPN. We provide extensive comparisons with both lightweight and larger image SR networks. Our SRPN-Lite and SRPN perform favorably against other recent works.
+
+# 1 INTRODUCTION
+
+Given a low-resolution (LR) image, single image super-resolution (SR) aims to reconstruct a high-resolution (HR) output. Essentially, as a many-to-one mapping problem image SR is ill-posed. To tackle this problem, plenty of deep convolutional neural networks (CNNs) (Dong et al., 2014; 2016; Kim et al., 2016b; Zhang et al., 2018c; 2020; 2021) have been investigated to learn the accurate mapping from LR input to the corresponding HR target.
+
+Deep CNN for image SR is first investigated in SRCNN (Dong et al., 2014) and has continuously shown promising SR performance. SRCNN consists of there convolutional (Conv) layers, constraining its expressivity. Kim et al. adopted residual learning to increase network depth in VDSR (Kim et al., 2016a) and obtained notable improvements over SRCNN. Lim et al. (Lim et al., 2017) simplified residual blocks and built a much deeper network EDSR. Zhang et al. (Zhang et al., 2018b) proposed a even much deeper one RCAN with the residual in residual structure. Empowered by increased network size, deep SR models like EDSR (Lim et al., 2017) and RCAN (Zhang et al., 2018b) have seen remarkable SR performance. However, as a cost, the large model size brings about problems such as excessive memory footprint, slow inference speed. It is thereby impractical to deploy them on resource-constrained platforms directly (Lee et al., 2020).
+
+Aiming for efficient SR, more and more works introduce lightweight network architectures (Ahn et al., 2018; Luo et al., 2020). Ahn et al. proposed cascading residual network (CARN) (Ahn et al., 2018). Hui et al. proposed information multi-distillation network (IMDN) (Hui et al., 2019). Lee et al. introduced knowledge distillation (Hinton et al., 2014) for image SR (Lee et al., 2020). Besides, neural architecture search (NAS) (Zoph & Le, 2017; Elsken et al., 2019) was also utilized for lightweight SR model (Chu et al., 2019a). However, there are still several downsides to these networks: (1) There is still an obvious performance gap between those lightweight models and the very deep models; (2) These methods can consume considerable computation resources for training. For example, (Chu et al., 2019a) train a single network with 8 Tesla V100 GPUs, and the training
+
+
+Figure 1: Visual comparisons $(\times 4)$ about lightweight and large SR networks on Urban100 dataset. The first row is lightweight SR networks comparison. The second row is about larger models comparison. SRPN-Lite and SRPN are our proposed lightweight and larger image SR networks.
+
+takes about three days; (3) It is hard for most lightweight SR network designs to generalize to more large-scale networks and achieve superior performance at the same time. So, it is needed to explore more resource-friendly, effective, and generic lightweight SR networks.
+
+On the other hand, neural network pruning is well-known as an effective technique to reduce model complexity (Reed, 1993; Sze et al., 2017). For acceleration, filter pruning (a.k.a. structured pruning) (Li et al., 2017) attracts more attention than weight-element pruning (a.k.a. unstructured pruning) (Han et al., 2015; 2016b). Introducing filter pruning into image SR is a promising way to achieve a good trade-off between performance and complexity. However, it is not easy to apply filter pruning techniques to image SR networks directly. This is mainly because residual connections are well-known difficult to prune in structured pruning (Li et al., 2017). On the other hand, they are extensively used in state-of-the-art (SOTA) image SR methods (e.g., EDSR (Lim et al., 2017) has 32 residual blocks; RCAN (Zhang et al., 2018b) even has nested residual blocks).
+
+To tackle the above issue, we propose Structure-Regularized Pruning (SRP), which imposes regularization on the pruned structure to ensure the locations of pruned filters are aligned across different layers. Specifically, for the layers connected by the same residual, we select the filters of the same indices as unimportant filters (i.e., those we will remove finally). To transfer the expressive power in the unimportant filters to the remainder of the network, we employ $L_{2}$ regularization to drive the weights towards zero gradually so that eventually, their absence will incur negligible performance loss. To the best of our knowledge, our SRP is one of the leading works (Zhang et al., 2021) to leverage structured pruning for efficient image SR. Our main contributions are as follows:
+
+- We propose a network structure-regularized pruning (SRP) method to learn efficient image SR networks. We try to jointly train image SR models with network pruning simultaneously to achieve high reconstruction performance as well as efficiency.
+- Our SRP provides a general idea to structurally prune networks, which consists of extensive residual connections. The introduction of regularization as a pruning tool manages to maintain the expressivity of the original network while peeling off the unnecessary redundancy.
+- We employ SRP to train efficient image SR networks, resulting in a lightweight network (named SRPN-Lite) and a very deep one (named SRPN). We achieve superior performance gains on both lightweight and large image SR networks.
+
+# 2 RELATED WORK
+
+Deep Image SR Models. Dong et al. (Dong et al., 2014) firstly proposed SRCNN for image SR and achieved superior performance with only 3 convolutional (Conv) layers. Residual learning was introduced in VDSR (Kim et al., 2016a), reaching 20 Conv layers and a significant improvement over SRCNN. Tai et al. later introduced memory block in MemNet (Tai et al., 2017b) for deeper network structure. Lim et al. (Lim et al., 2017) simplified the residual block (He et al., 2016) and constructed deeper and wider networks with a large number of parameters. Zhang et al. (Zhang et al., 2018b) proposed an even deeper one, residual channel attention network (RCAN), where the attention mechanism was firstly introduced in image SR. Liu et al. proposed FRANet (Liu et al., 2020) to make the residual features focus on critical spatial contents. Later, Zhang et al. (Zhang et al., 2019) extended to image restoration with residual non-local attention. Mei et al. proposed CSNLN (Mei et al., 2020) by combining local and non-local feature correlations. Most of those methods have achieved SOTA results. However, they suffer from huge model size (i.e., network parameter number) and/or heavy computation operations (i.e., FLOPs).
+
+
+Figure 2: (a) Illustration of channel-wise and filter-wise pruning for single Conv layer. In this work, we adopt filter-wise pruning to learn efficient image SR networks. (b) Illustration of filter pruning within a residual block. We depict deep features $F$ as 3d cubes. We expand the Conv kernel $W$ (4d tensor) as a 2d matrix here for easy illustration (each row represents a filter). Both green and blue color denote the pruned filters (or feature map channels): green denotes the pruned filters in free Conv layers; blue denotes the pruned filters in constrained Conv layers. The basic idea of our SRP is to apply the $L_{2}$ regularization to the unimportant filters to make sure the pruned indices of $F^{(i)}$ are exactly the same as those of $F^{(i + 2)}$ . (c) Illustration of filter pruning across different residual blocks. All the layers that are directly followed by the add operators are constrained Conv layers (in blue). Others are free Conv layers (in green).
+
+Lightweight Image SR Models. Recent years have been rising interest in investigating lightweight image SR models. These approaches try to design lightweight architectures, which mainly take advantage of recursive learning and channel splitting. Kim et al. firstly decreased parameter number by utilizing recursive learning in DRCN (Kim et al., 2016b). Ahn et al. proposed CARN by designing a cascading mechanism upon a residual network (Ahn et al., 2018). Hui et al. proposed IMDN by using distillation and fusion modules (Hui et al., 2019). Luo et al. designed the lattice block with butterfly structures (Luo et al., 2020). Recently, neural architecture search was applied for image SR, like FALSR (Chu et al., 2019a). Also, model compression techniques have been explored for image SR. He et al. proposed knowledge distillation based feature-affinity for efficient image SR (He et al., 2020). Lee et al. distilled knowledge from a larger teacher network to a student one (Lee et al., 2020). Those lightweight image SR models have obtained great progress, but we still need to investigate deeper for more efficient image SR models.
+
+Neural Network Pruning. Network pruning aims to eliminate redundant parameters in a neural network without compromising its performance seriously (Reed, 1993; Sze et al., 2017). The methodology of pruning mainly falls into two groups: filter pruning (or more generally known as structured pruning)* and weight-element pruning (also referred to as unstructured pruning). The former aims to remove weights by filters (i.e., 4-d tensors), while the latter removes weights by single elements (i.e., scalars). Structured pruning results in regular sparsity after pruning. It does not demand any special hardware features to achieve considerable practical acceleration. In contrast, unstructured pruning leads to irregular sparsity. Leveraging the irregular sparsity for acceleration typically demands special software supports, while past works have shown the practical speedup is very limited (Wen et al., 2016), unless using customized hardware platforms (Han et al., 2016a). In this paper, we tackle filter pruning instead of weight-element pruning for effortless acceleration. The major efforts in pruning (mainly in image classification) have been focusing on proposing a more sound pruning criterion to select unimportant weights (Reed, 1993; Sze et al., 2017). Criteria based on weight magnitude (Han et al., 2015; 2016b; Li et al., 2017) are the most prevailing ones, which we will also employ to develop our method in this paper.
+
+# 3 METHODOLOGY
+
+We first show the overview of the problem setting about deep CNN for image SR. It is also observed that excessive redundancy exists in the SR deep CNNs. Then we move on to proposing our structure-regularized pruning (SRP) method attempting to achieve more efficient SR networks.
+
+# 3.1 DEEP CNN FOR IMAGE SR
+
+In image super-resolution (SR), a high-resolution (a.k.a. super-resolved) image $I_{SR}$ is reconstructed from its low-resolution (LR) input $I_{LR}$ . This image SR process can be described as
+
+$$
+I _ {S R} = \mathcal {F} _ {S R} \left(I _ {L R}; \Theta\right), \tag {1}
+$$
+
+where $\mathcal{F}_{SR}(\cdot)$ is the image SR network, parameterized by $\Theta$ . Meanwhile, the LR input $I_{LR}$ from the corresponding HR image can be formulated as
+
+$$
+I _ {L R} = \mathcal {F} _ {\downarrow s} \left(I _ {H R}\right), \tag {2}
+$$
+
+where $\mathcal{F}_{\downarrow s}(\cdot)$ downscales the original HR image $I_{HR}$ by a scale factor $s$ . This downscaling process typically introduces additional compression, blurring, noise, and/or other unknown artifacts. Therein, the desired structural details could be removed more or less. The job of image SR methods is to reconstruct the high-frequency information as much as possible.
+
+We aim to present a structural sparsity inducing SR network learning method, which can deliver more efficient SR networks with fewer parameters and FLOPs.
+
+# 3.2 STRUCTURE-REGULARIZED PRUNING (SRP)
+
+Pruned Index Constraint. Pruning filters in residual networks is well-known non-trivial as the Add operators in residual blocks require the pruned filter indices across different residual blocks must be aligned. A figurative illustration of filter pruning within a residual block is shown in Fig. 2(b). A typical residual block (e.g., in EDSR (Lim et al., 2017), RCAN (Zhang et al., 2018b)) consists of two convolutional layers. According to the mutual connection relationship, the convolutional layers can be categorized into two groups. One group is made up with the layers that can be pruned without any constraint, dubbed free Conv layers in this work; the other comprises Conv layers whose filters must be pruned at the same indices, dubbed constrained Conv layers. Concretely, the layer $W^{(i)}$ in Fig. 2(b) is a free Conv layer, while the layer $W^{(i + 1)}$ is a constrained one.
+
+Owing to the pruned index constraint problem, many filter pruning methods in image classification simply do not prune the last Conv layer in residual blocks (Li et al., 2017; Wang et al., 2021), which can still deliver considerable speedup of practical interest. Nevertheless, this doing-nothing solution can barely translate to the image SR networks if we target a considerable speedup. The root cause is that image SR networks usually utilize many more residual blocks, and each block usually has only two Conv layers. In some top-performing SR networks (e.g., RCAN Zhang et al. (2018b)), there are even nested residual blocks. Taking EDSR for a concrete example, it has 32 residual blocks with two Conv layers within each block. If the 2nd Conv layer in a residual block is spared from pruning, half of the Conv layers will not be pruned. In other words, at best, we can only obtain $2 \times$ theoretical acceleration measured by FLOPs reduction.
+
+Given this issue, it is imperative to prune all the Conv layers in residual blocks, thus calling for an approach to align the pruned indices of all constrained Conv layers. We then use regularization as a promising solution considering that it has been widely used before to impose priors on the sparsity structure in classification (Reed, 1993; Wen et al., 2016; Wang et al., 2021).
+
+Our SRP method is based on regularization to form desired hardware-friendly sparsity structure. Primarily, there are three questions to answer in SRP: (1) which pruning criterion is used to choose unimportant filters; (2) which kind of regularization is chosen to induce sparsity; (3) how to schedule the pruning process to make the algorithm robust and easy to use.
+
+(1) Pruning Criterion. When it comes to formulated pruning criteria, they mainly fall into three groups: magnitude based (Han et al., 2015; Li et al., 2017), 1st-order gradient based (Molchanov et al., 2017; 2019), and 2nd-order gradient based (LeCun et al., 1990; Hassibi & Stork, 1993; Wang et al., 2019a). The 1st-order and 2nd-order gradient-based criteria are based on Taylor approximation of the increased loss when a weight is removed, pioneered by (LeCun et al., 1990). They are more accurate than magnitude-based one right after pruning. However, pruning is typically followed by a finetuning process (Reed, 1993) to regain performance. After finetuning, the advantage of the 1st-order and 2nd-order gradient-based criteria usually becomes marginal. Meanwhile, they are typically more costly than the magnitude-based criteria. Taking the cost and flexibility into account, we simply employ magnitude-based pruning criteria.
+
+Specifically, given a pretrained SR network, for all the free Conv layers, we sort the filters in ascending order by their $L_{1}$ -norms and select the filers with the least norms as unimportant filters, by a predefined pruning ratio $r \in (0, 1)$ . For the constrained Conv layers, the problem becomes a little bit more complex. Given the pruned index constraint, ideally, we can only prune the filters in the intersection set (denoted by $S^{(net)}$ ) for the whole network,
+
+$$
+\mathcal {S} ^ {(n e t)} = \bigcap_ {l \in \mathcal {C}} S ^ {(l)}, \tag {3}
+$$
+
+where $S^{(l)}$ represents the set of unimportant filters selected by certain pruning criterion in the $l$ -th Conv layer; $\mathcal{C}$ denotes the set of constrained Conv layers. For top-performed image SR networks, $|\mathcal{C}|(|\cdot|)$ denotes cardinality of a set) is at the order of magnitude of hundreds (e.g., $|\mathcal{C}| = 200$ for RCAN). Meanwhile, given a pretrained model, its pruned filter indices by $L_{1}$ -norm are usually random across different layers. As a consequence, $|S^{(net)}|$ will be rather small (in practice, on RCAN, we even observe $|S^{(net)}| = 0$ when we try to prune 32 filters out of 64). This issue brings much trouble to user control when we want to prune a layer to a pre-defined number of filters. To address this issue, we choose to randomly select a set of filters as unimportant and fixed during the whole pruning process. In practice, we find this simple scheme works pretty well. The reason enabling us to do so is that regularization for pruning is a gradual process. It allows ample time for the network to recover from the introduced penalty term (this will be empirically verified in our experiments, see Fig. 3). Apart from aligning cross-layer sparsity structure, this is the second reason we choose regularization for pruning in our algorithm.
+
+(2) Regularization Form. Although $L_{1}$ regularization is well-known to induce sparsity in machine learning, it is hard to tune the coefficient to realize a desired trade-off between sparsity and performance. Instead, $L_{2}$ regularization is thereby adopted in our method given its more tamable control over the sparsification process – note the gradient of $L_{2}$ regularization is proportion to the weight magnitude while the gradient of $L_{1}$ regularization is not. Specifically, given the loss function $\mathcal{L}$ of a neural network $\Theta$ , the total error function $\mathcal{E}$ with adaptive $L_{2}$ regularization term is formulated as
+
+$$
+\mathcal {E} (\Theta ; \mathcal {D}) = \mathcal {L} (\Theta ; \mathcal {D}) + \frac {1}{2} \sum_ {l, j} \alpha_ {j} ^ {(l)} \left\| W _ {j} ^ {(l)} \right\| _ {2} ^ {2}, \tag {4}
+$$
+
+where $\mathcal{D}$ stands for the training dataset; $W_{j}^{(l)}$ refers to the $j$ -th filter in $l$ -th Conv layer; $\alpha_{j}^{(l)}$ stands for the $L_{2}$ regularization co-efficient for that filter. If a filter $j$ falls into the set of unimportant filters $S^{(l)}, \alpha_{j}^{(l)} > 0$ ; otherwise, $\alpha_{j}^{(l)} = 0$ since we do not restrict the learning of important filters.
+
+(3) Regularization Schedule. As mentioned above, for the constrained Conv layers, we select the unimportant filters randomly. To mitigate the side effect of this sub-optimal choice, the network should be provided with abundant training iterations to adapt so that it can transfer its expressive power to the remaining part of the network. To achieve this goal, we choose to gradually increase the penalty strength, drawing inspirations from (Wang et al., 2019b; 2021),
+
+$$
+\alpha_ {j} ^ {(l)} = \alpha_ {j} ^ {(l)} + \Delta , \tag {5}
+$$
+
+where $\Delta$ (a pre-defined constant) is a small amount that the penalty strength is increased each time. This design allows us to raise the penalty strength to a large amount eventually (like 0.5 in our experiments; in contrast, note the normal $L_{2}$ regularization co-efficient is at the scale of $10^{-4}$ ). As a result, the unimportant weights are driven rather close to zero, and removing them will hardly hurt the performance. Besides, $\alpha$ is updated every $T$ iterations during training for stability.
+
+To indicate when to terminate the pruning process, a ceiling limit $\tau$ is introduced for the regularization co-efficient $\alpha$ . The pruning is over when all the $\alpha$ 's for unimportant filters arise to $\tau$ .
+
+# 3.3 LEARNING EFFICIENT IMAGE SR MODELS VIA SRP
+
+SRP can be applied to top-performing SR algorithms in a plug-and-play manner – simply replace the loss function $\mathcal{L}$ in Eq. (4) with the loss objective function of an SR approach of interest. The proposed $L_{2}$ regularization can be implemented on any deep learning framework very easily.
+
+Upon finishing pruning, we take away the unimportant filters (not zeroing out them only, but literally removing them from the model), which will give us a compact SR model. Finally, the compact model will be finetuned to regain performance following the common practice in pruning (Reed, 1993).
+
+# 3.4 IMPLEMENTATION DETAILS
+
+We explain how to apply SRP to both lightweight and deep image SR networks to demonstrate the method can work with a wide range of SR networks under different computation budgets.
+
+Lightweight Networks. First, we adapt the EDSR baseline (Lim et al., 2017) with 16 residual blocks and remove its final Conv layer to reduce model size. The reconstruction upscaling is realized by the pixel-shuffle layer (Shi et al., 2016) following common practice. The channel number in the revised EDSR baseline is first set as 256 and then pruned to 45. For $\times 2$ scale, we reduce the number of parameters from $19.5\mathrm{M}$ to $609\mathrm{K}$ and name the compressed model as SRPN-Lite.
+
+| Pruning ratio | Params (K) | FLOPs (G) | Scratch | \(L_{1}\)-norm pruning (Li et al., 2017) | SRP (ours) |
| 0.1 | 1,101.8 | 254.5 | 37.85 | 37.91 | 37.97 |
| 0.3 | 681.1 | 157.7 | 37.81 | 37.81 | 37.89 |
| 0.5 | 381.8 | 88.9 | 37.75 | 37.73 | 37.84 |
| 0.7 | 154.2 | 36.5 | 37.56 | 37.58 | 37.71 |
| 0.9 | 26.9 | 7.3 | 36.74 | 36.87 | 37.28 |
+
+Table 1: PSNR (dB) values on the Set5 $(\times 2)$ between SRP and other two baselines to achieve exactly the same compact network. "Scratch" stands for training the small network from scratch. $L_{1}$ -norm" removes filters with the smallest $L_{1}$ -norms. The unpruned model is EDSR baseline (Params: 1,369.9K, FLOPs: 316.3G, PSNR: 37.99 dB). The best results are highlighted.
+
+
+Figure 3: Plots of the mean $L_{1}$ -norm of filters vs. iterations for "model.body.12.body.0" (free Conv layer) and "model.body.12.body.2" (constrained Conv layer) in EDSR baseline. As expected, the unimportant filters ("Pruned filters") are driven down (owing to strong regularization); interestingly, the important ones arise spontaneously.
+
+
+
+Deep Networks. To apply SRP to the very deep network RCAN (Zhang et al., 2018b), a representative top-performing deep SR network with over 400 Conv layers, we revise RCAN by removing all the channel attention modules (Zhang et al., 2018b). The channel number in the revised RCAN is chosen as 96 and then pruned to 64. For $\times 2$ scale, we reduce the number of parameters from 34.5M to 15.3M and dub the compressed model as SRPN.
+
+# 4 EXPERIMENTAL RESULTS
+
+# 4.1 SETTINGS
+
+Data and Evaluation. We use DIV2K dataset (Timofte et al., 2017) and Flickr2K Lim et al. (2017) as training data, following most recent works (Timofte et al., 2017; Lim et al., 2017; Zhang et al., 2018a; Haris et al., 2018). For testing, we use five standard benchmark datasets: Set5 (Bevilacqua et al., 2012), Set14 (Zeyde et al., 2010), B100 (Martin et al., 2001), Urban100 (Huang et al., 2015), and Manga109 (Matsui et al., 2017). The SR results are evaluated with PSNR and SSIM (Wang et al., 2004) on the Y channel in YCbCr space.
+
+Training Settings. Following (Zhang et al., 2018b), data augmentation is used in training - training images are randomly rotated by $90^{\circ}$ , $180^{\circ}$ , $270^{\circ}$ and flipped horizontally. Image patches (patch size $48 \times 48$ ) are cropped out to form each training batch. Adam optimizer (Kingma & Ba, 2014) is adopted for training with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , and $\epsilon = 10^{-8}$ . Initial learning rate is set to $10^{-4}$ and then decayed by factor 0.5 every $2 \times 10^{5}$ iterations. We use PyTorch (Paszke et al., 2017) to implement our models with a Tesla V100 GPU†.
+
+# 4.2 ABLATION STUDY
+
+The EDSR baseline with 16 residual blocks (Lim et al., 2017)‡ is used as the backbone for ablation study given its broad use in the community.
+
+Comparison with Baseline Pruning Methods. To start with, we show that our SRP is more effective than the available baseline compact image SR network learning methods. Two baseline methods
+
+| Method | Scale | Params | Mult-Adds | Set5 | Set14 | B100 | Urban100 |
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM |
| SRCNN | ×2 | 57K | 52.7G | 36.66 | 0.9542 | 32.42 | 0.9063 | 31.36 | 0.8879 | 29.50 | 0.8946 |
| FSRCNN | ×2 | 12K | 6.0G | 37.00 | 0.9558 | 32.63 | 0.9088 | 31.53 | 0.8920 | 29.88 | 0.9020 |
| VDSR | ×2 | 665K | 612.6G | 37.53 | 0.9587 | 33.03 | 0.9124 | 31.90 | 0.8960 | 30.76 | 0.9140 |
| DRCN | ×2 | 1,774K | 17,974.3G | 37.63 | 0.9588 | 33.04 | 0.9118 | 31.85 | 0.8942 | 30.75 | 0.9133 |
| LapSRN | ×2 | 813K | 29.9G | 37.52 | 0.9590 | 33.08 | 0.9130 | 31.80 | 0.8950 | 30.41 | 0.9100 |
| DRRN | ×2 | 297K | 6,796.9G | 37.74 | 0.9591 | 33.23 | 0.9136 | 32.05 | 0.8973 | 31.23 | 0.9188 |
| MemNet | ×2 | 677K | 2,662.4G | 37.78 | 0.9597 | 33.28 | 0.9142 | 32.08 | 0.8978 | 31.31 | 0.9195 |
| CARN | ×2 | 1,592K | 222.8G | 37.76 | 0.9590 | 33.52 | 0.9166 | 32.09 | 0.8978 | 31.92 | 0.9256 |
| IMDN | ×2 | 694K | 158.8G | 38.00 | 0.9605 | 33.63 | 0.9177 | 32.19 | 0.8996 | 32.17 | 0.9283 |
| SRPN-Lite (ours) | ×2 | 609K | 139.9G | 38.10 | 0.9608 | 33.70 | 0.9189 | 32.25 | 0.9005 | 32.26 | 0.9294 |
| SRCNN | ×3 | 57K | 52.7G | 32.75 | 0.9090 | 29.28 | 0.8209 | 28.41 | 0.7863 | 26.24 | 0.7989 |
| FSRCNN | ×3 | 12K | 5.0G | 33.16 | 0.9140 | 29.43 | 0.8242 | 28.53 | 0.7910 | 26.43 | 0.8080 |
| VDSR | ×3 | 665K | 612.6G | 33.66 | 0.9213 | 29.77 | 0.8314 | 28.82 | 0.7976 | 27.14 | 0.8279 |
| DRCN | ×3 | 1,774K | 17,974.3G | 33.82 | 0.9226 | 29.76 | 0.8311 | 28.80 | 0.7963 | 27.15 | 0.8276 |
| DRRN | ×3 | 297K | 6,796.9G | 34.03 | 0.9244 | 29.96 | 0.8349 | 28.95 | 0.8004 | 27.53 | 0.8378 |
| MemNet | ×3 | 677K | 2,662.4G | 34.09 | 0.9248 | 30.00 | 0.8350 | 28.96 | 0.8001 | 27.56 | 0.8376 |
| CARN | ×3 | 1,592K | 118.8G | 34.29 | 0.9255 | 30.29 | 0.8407 | 29.06 | 0.8034 | 28.06 | 0.8493 |
| IMDN | ×3 | 703K | 71.5G | 34.36 | 0.9270 | 30.32 | 0.8417 | 29.09 | 0.8046 | 28.17 | 0.8519 |
| SRPN-Lite (ours) | ×3 | 615K | 62.7G | 34.47 | 0.9276 | 30.38 | 0.8425 | 29.16 | 0.8061 | 28.22 | 0.8534 |
| SRCNN | ×4 | 57K | 52.7G | 30.48 | 0.8628 | 27.49 | 0.7503 | 26.90 | 0.7101 | 24.52 | 0.7221 |
| FSRCNN | ×4 | 12K | 4.6G | 30.71 | 0.8657 | 27.59 | 0.7535 | 26.98 | 0.7150 | 24.62 | 0.7280 |
| VDSR | ×4 | 665K | 612.6G | 31.35 | 0.8838 | 28.01 | 0.7674 | 27.29 | 0.7251 | 25.18 | 0.7524 |
| DRCN | ×4 | 1,774K | 17,974.3G | 31.53 | 0.8854 | 28.02 | 0.7670 | 27.23 | 0.7233 | 25.14 | 0.7510 |
| LapSRN | ×4 | 813K | 149.4G | 31.54 | 0.8850 | 28.19 | 0.7720 | 27.32 | 0.7280 | 25.21 | 0.7560 |
| DRRN | ×4 | 297K | 6,796.9G | 31.68 | 0.8888 | 28.21 | 0.7720 | 27.38 | 0.7284 | 25.44 | 0.7638 |
| MemNet | ×4 | 677K | 2,662.4G | 31.74 | 0.8893 | 28.26 | 0.7723 | 27.40 | 0.7281 | 25.50 | 0.7630 |
| CARN | ×4 | 1,592K | 90.9G | 32.13 | 0.8937 | 28.60 | 0.7806 | 27.58 | 0.7349 | 26.07 | 0.7837 |
| IMDN | ×4 | 715K | 40.9G | 32.21 | 0.8948 | 28.58 | 0.7811 | 27.56 | 0.7353 | 26.04 | 0.7838 |
| SRPN-Lite (ours) | ×4 | 623K | 35.8G | 32.24 | 0.8958 | 28.69 | 0.7836 | 27.63 | 0.7373 | 26.16 | 0.7875 |
+
+Table 2: Quantitative results of lightweight SR networks. Best results are highlighted.
+
+
+Urban100: img_020 $(\times 4)$
+
+
+HR
+
+
+Bicubic
+
+
+SRCNN
+
+
+FSRCNN
+
+
+VDSR
+
+
+Urban100: img_024 $(\times 4)$
+Figure 4: Visual comparison of different lightweight SR approaches on the Urban100 dataset $(\times 4)$ .
+
+
+HR
+
+
+Bicubic
+
+
+SRCNN
+
+
+FSRCNN
+
+
+VDSR
+
+are compared to: training from scratch and the original $L_{1}$ -norm pruning (Li et al., 2017). The results are presented in Tab. 1. As we can see, our pruned network delivers the best PSNR consistently across different pruning ratios. Notably, under a greater pruning ratio, the advantage of our method over scratch training or $L_{1}$ -norm pruning is more evident in general, suggesting that our SRP is more valuable in aggressive pruning cases. Of particular note is that, our method SRP also utilizes the $L_{1}$ -norm as the scoring criterion to select unimportant filters, same as (Li et al., 2017). Nevertheless, our method delivers significantly better results than theirs. The primary reason is that they do not impose any regularization on the pruned structure; the remaining feature maps are thus mismatched in residual blocks after pruning. In contrast, our method SRP is not bothered by this issue, showing the effectiveness of our proposed structure regularization.
+
+Visualization of Pruning Process. In Fig. 3, we visualize the pruning process by plotting the mean $L_{1}$ -norm of filters in two layers of EDSR baseline during SRP training. The filters are split into two groups, kept filters and pruned filters. As is shown in the figure, the mean $L_{1}$ -norm of the pruned filters goes down gradually because the penalty grows stronger and stronger, driving them towards zero. Interestingly, note the $L_{1}$ -norms of the kept filters arise themselves. Recall that there is no explicit regularization to promote them to grow. In other words, the network learns to recover by itself, akin to the compensation effect found in human brain (Duffau et al., 2003).
+
+| Method | Scale | Set5 | Set14 | B100 | Urban100 | Manga109 |
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM |
| EDSR | ×2 | 38.11 | 0.9602 | 33.92 | 0.9195 | 32.32 | 0.9013 | 32.93 | 0.9351 | 39.10 | 0.9773 |
| DBPN | ×2 | 38.09 | 0.9600 | 33.85 | 0.9190 | 32.27 | 0.9000 | 32.55 | 0.9324 | 38.89 | 0.9775 |
| RCAN | ×2 | 38.27 | 0.9614 | 34.12 | 0.9216 | 32.41 | 0.9027 | 33.34 | 0.9384 | 39.44 | 0.9786 |
| SRFBN | ×2 | 38.11 | 0.9609 | 33.82 | 0.9196 | 32.29 | 0.9010 | 32.62 | 0.9328 | 39.08 | 0.9779 |
| SAN | ×2 | 38.31 | 0.9620 | 34.07 | 0.9213 | 32.42 | 0.9028 | 33.10 | 0.9370 | 39.32 | 0.9792 |
| HAN | ×2 | 38.27 | 0.9614 | 34.16 | 0.9217 | 32.41 | 0.9027 | 33.35 | 0.9385 | 39.46 | 0.9785 |
| IGNNN | ×2 | 38.24 | 0.9613 | 34.07 | 0.9217 | 32.41 | 0.9025 | 33.23 | 0.9383 | 39.35 | 0.9786 |
| CSNLN | ×2 | 38.28 | 0.9616 | 34.12 | 0.9223 | 32.40 | 0.9024 | 33.25 | 0.9386 | 39.37 | 0.9785 |
| RFANet | ×2 | 38.26 | 0.9615 | 34.16 | 0.9220 | 32.41 | 0.9026 | 33.33 | 0.9389 | 39.44 | 0.9783 |
| SRPN (ours) | ×2 | 38.34 | 0.9619 | 34.29 | 0.9232 | 32.47 | 0.9032 | 33.50 | 0.9401 | 39.76 | 0.9796 |
| EDSR | ×3 | 34.65 | 0.9280 | 30.52 | 0.8462 | 29.25 | 0.8093 | 28.80 | 0.8653 | 34.17 | 0.9476 |
| RCAN | ×3 | 34.74 | 0.9299 | 30.65 | 0.8482 | 29.32 | 0.8111 | 29.09 | 0.8702 | 34.44 | 0.9499 |
| SRFBN | ×3 | 34.70 | 0.9292 | 30.51 | 0.8461 | 29.24 | 0.8084 | 28.73 | 0.8641 | 34.18 | 0.9481 |
| SAN | ×3 | 34.75 | 0.9300 | 30.59 | 0.8476 | 29.33 | 0.8112 | 28.93 | 0.8671 | 34.30 | 0.9494 |
| HAN | ×3 | 34.75 | 0.9299 | 30.67 | 0.8483 | 29.32 | 0.8110 | 29.10 | 0.8705 | 34.48 | 0.9500 |
| IGNNN | ×3 | 34.72 | 0.9298 | 30.66 | 0.8484 | 29.31 | 0.8105 | 29.03 | 0.8696 | 34.39 | 0.9496 |
| CSNLN | ×3 | 34.74 | 0.9300 | 30.66 | 0.8482 | 29.33 | 0.8105 | 29.13 | 0.8712 | 34.45 | 0.9502 |
| RFANet | ×3 | 34.79 | 0.9300 | 30.67 | 0.8487 | 29.34 | 0.8115 | 29.15 | 0.8720 | 34.59 | 0.9506 |
| SRPN (ours) | ×3 | 34.84 | 0.9303 | 30.76 | 0.8497 | 29.39 | 0.8120 | 29.36 | 0.8749 | 34.88 | 0.9515 |
| EDSR | ×4 | 32.46 | 0.8968 | 28.80 | 0.7876 | 27.71 | 0.7420 | 26.64 | 0.8033 | 31.02 | 0.9148 |
| SRMDNF | ×4 | 31.96 | 0.8925 | 28.35 | 0.7787 | 27.49 | 0.7337 | 25.68 | 0.7731 | 30.09 | 0.9024 |
| RCAN | ×4 | 32.63 | 0.9002 | 28.87 | 0.7889 | 27.77 | 0.7436 | 26.82 | 0.8087 | 31.22 | 0.9173 |
| SRFBN | ×4 | 32.47 | 0.8983 | 28.81 | 0.7868 | 27.72 | 0.7409 | 26.60 | 0.8015 | 31.15 | 0.9160 |
| SAN | ×4 | 32.64 | 0.9003 | 28.92 | 0.7888 | 27.78 | 0.7436 | 26.79 | 0.8068 | 31.18 | 0.9169 |
| HAN | ×4 | 32.64 | 0.9002 | 28.90 | 0.7890 | 27.80 | 0.7442 | 26.85 | 0.8094 | 31.42 | 0.9177 |
| IGNNN | ×4 | 32.57 | 0.8998 | 28.85 | 0.7891 | 27.77 | 0.7434 | 26.84 | 0.8090 | 31.28 | 0.9182 |
| CSNLN | ×4 | 32.68 | 0.9004 | 28.95 | 0.7888 | 27.80 | 0.7439 | 27.22 | 0.8168 | 31.43 | 0.9201 |
| RFANet | ×4 | 32.66 | 0.9004 | 28.88 | 0.7894 | 27.79 | 0.7442 | 26.92 | 0.8112 | 31.41 | 0.9187 |
| SRPN (ours) | ×4 | 32.72 | 0.9010 | 29.04 | 0.7917 | 27.87 | 0.7457 | 27.25 | 0.8172 | 31.82 | 0.9221 |
+
+Table 3: Quantitative results of large SR networks. Best results are highlighted.
+
+
+Urban100: img_044 $(\times 4)$
+
+
+HR
+
+
+Bicubic
+
+
+EDSR
+
+
+DBPN
+
+
+RCAN
+
+
+Urban100: img_062 $(\times 4)$
+Figure 5: Visual comparison of different large SR networks on the Urban100 dataset $(\times 4)$ .
+
+
+HR
+
+
+Bicubic
+
+
+EDSR
+
+
+DBPN
+
+
+RCAN
+
+# 4.3 COMPARISONS WITH LIGHTWEIGHT NETWORKS
+
+We compare our SRPN-Lite with lightweight SR networks: SRCNN (Dong et al., 2014), FSR-CNN (Dong et al., 2016), VDSR (Kim et al., 2016a), DRCN (Kim et al., 2016b), LapSRN (Lai et al., 2017), DRRN (Tai et al., 2017a), MemNet (Tai et al., 2017b), CARN (Ahn et al., 2018) and IMDN (Hui et al., 2019). The compared results are produced from their released code.
+
+Performance Comparisons. Table 2 shows PSNR/SSIM comparisons for $\times 2$ , $\times 3$ , and $\times 4$ SR. When compared with previous leading models, our SRPN-Lite obtains the best performance on all benchmarks and scaling factors. Unlike most comparison methods, which achieve efficiency through careful network designs, our work starts with the existing EDSR baseline (Lim et al., 2017) and prunes it to a much smaller network, showing the effectiveness of our proposed SRP.
+
+Model Size and Mult-Adds. Our SRPN-Lite has the fewest parameter number in comparison to recent efficient SR works such as MemNet, CARN, and IMDN. The comparison in terms of Mult-Adds (measured when the output size is set to $3 \times 1,280 \times 720$ ) is also presented. As seen, our SRPN-Lite costs fewer Mult-Adds than most comparison methods. These results demonstrate the merits of SRP against other counterparts in striking a better network performance-complexity trade-off.
+
+| Method | Params | Mult-Adds | Set5 | Set14 | B100 | Urban100 |
| MoreMNAS-A (Chu et al., 2019b) | 1,039K | 238.6G | 37.63 | 33.23 | 31.95 | 31.24 |
| FALSR-A (Chu et al., 2019a) | 1,021K | 234.7G | 37.82 | 33.55 | 32.12 | 31.93 |
| CARN+KD (Lee et al., 2020) | 1,592K | 222.8G | 37.82 | N/A | 32.08 | N/A |
| SRPN-Lite (ours) | 609K | 139.9G | 38.10 | 33.70 | 32.25 | 32.26 |
+
+Table 4: Model complexity comparisons $\left( {\times 2}\right)$ . Output size is $3 \times 1,{280} \times {720}$ to calculate Mult-Adds.
+
+Visual Comparisons. The visual comparisons at $\times 4$ scale are shown in Fig. 4. It is easy to see that most of the comparison algorithms can barely recover the lost texture details in the correct direction; moreover, they suffer from blurring artifacts. In stark contrast, our SRPN-Lite effectively alleviates the blurring artifacts and recovers sharper structural fine textures in the right way, justifying the performance superiority of our SRP approach over other methods.
+
+# 4.4 COMPARISONS WITH LARGER NETWORKS
+
+Most previous lightweight SR networks neglect to extend their models to deeper and compare with larger networks. As stated in Sec. 3.4, we extend our SRP method to larger network training and obtain a deeper network SRPN. In Tab. 3, we compare with large SR networks: EDSR (Lim et al., 2017), DBPN (Haris et al., 2018), RCAN (Zhang et al., 2018b), SRFBN (Li et al., 2019), SAN (Dai et al., 2019), HAN (Niu et al., 2020), IGNN (Zhou et al., 2020), CSNLN (Mei et al., 2020), and RFANet (Liu et al., 2020). The compared results are produced from their released code.
+
+Performance Comparisons. In Tab. 3, we observe that our SRPN achieves the best PSNR/SSIM values across different test sets and scales, except for SSIM value on Set5 $(\times 2)$ . Our SRPN utilizes slightly fewer parameters (15.3M vs. 15.4M) with the same network depth as RCAN (Zhang et al., 2018b). Notably, our SRPN removes the channel attention module in RCAN, but still achieves better results. This is mainly because our SRPN is initially trained from a wider and stronger network (with 96 channels). We train the much larger network and then prune it to the target size.
+
+Visual Comparisons. We further show visual comparisons with larger networks (e.g., CSNLN, RFANet, and IGNN) in Fig. 5, we can also observe similar situations as in Fig. 4. For example, in img_011, other methods suffer from heavy blurring artifacts. In other cases, they may not recover clear structures in img_044 or even wrong details in img_062. Our SRPN achieves more visually pleasing results with more structural details. Those comparisons demonstrate that our SRP method can be applied to train larger networks and obtain comparable or even better performance.
+
+# 4.5 MORE COMPARISON WITH MODEL COMPRESSION TECHNIQUES
+
+We further compare our SRP to other representative efficient image SR approaches via model compression. Concretely, neural architecture search based methods (Chu et al., 2019b;a) and knowledge distillation (KD) based methods (Lee et al., 2020) are compared to. Quantitative results at $\times 2$ scale are presented in Tab. 4, where our SRPN-Lite delivers better PSNR results across different datasets with fewer parameters and Mult-Adds. With our SRP pruning method, there is no need to search massive network architectures or pretraining a teacher network, which usually consumes considerable computation resources. These comparisons show that our SRP, as a network pruning method, has as much potential (if not more) as other model compression techniques for efficient image SR.
+
+# 5 CONCLUSION
+
+Existing efficient image SR methods have achieved promising results with moderate model parameters and Mult-Adds. However, they neglect to extend their approaches to larger networks, which usually perform much better with more parameters and/or operations with residual learning. Meanwhile, although model compression approaches, like knowledge distillation and neural architecture search, have also been exploited for efficient image SR networks, they typically demand excessive computation resources. As another promising model compression method, network pruning is hard to be incorporated into lightweight SR models directly. To address these issues, we present structure-regularized pruning (SRP), which imposes $L_{2}$ regularization on the pruned structure to align the locations of pruned filters across different layers. It can transfer the expressive power in the unimportant filters to the remaining part of the network. We employ SRP to train both lightweight and large image SR networks, resulting in a lightweight network SRPN-Lite and a very deep one SRPN, delivering superior performance over recent SOTA efficient SR methods.
+
+Acknowledgments. This research is supported by the U.S. Army Research Office Award W911NF-17-1-0367.
+
+# REFERENCES
+
+Namhyuk Ahn, Byungkon Kang, and Kyung-Ah Sohn. Fast, accurate, and lightweight super-resolution with cascading residual network. In ECCV, 2018. 1, 3, 8
+Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In BMVC, 2012. 6
+Xiangxiang Chu, Bo Zhang, Hailong Ma, Ruijun Xu, and Qingyuan Li. Fast, accurate and lightweight superresolution with neural architecture search. arXiv preprint arXiv:1901.07261, 2019a. 1, 3, 9
+Xiangxiang Chu, Bo Zhang, Ruijun Xu, and Hailong Ma. Multi-objective reinforced evolution in mobile neural architecture search. arXiv preprint arXiv:1901.01074, 2019b. 9
+Tao Dai, Jianrui Cai, Yongbing Zhang, Shu-Tao Xia, and Lei Zhang. Second-order attention network for single image super-resolution. In CVPR, 2019. 9
+Chao Dong, Chen Change Loy, Kaiming He, and Xiaou Tang. Learning a deep convolutional network for image super-resolution. In ECCV, 2014. 1, 2, 8
+Chao Dong, Chen Change Loy, and Xiaou Tang. Accelerating the super-resolution convolutional neural network. In ECCV, 2016. 1, 8
+H Duffau, L Capelle, D Denvil, N Sichez, P Gatignol, M Lopes, MC Mitchell, JP Sichez, and R Van Effenterre. Functional recovery after surgical resection of low grade gliomas in eloquent brain: hypothesis of brain compensation. Journal of Neurology, Neurosurgery & Psychiatry, 74(7):901-907, 2003. 7
+Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. JMLR, 2019. 1
+S. Han, X. Liu, and H. Mao. EIE: efficient inference engine on compressed deep neural network. ACM Sigarch Computer Architecture News, 44(3):243-254, 2016a. 3
+Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural network. In NeurIPS, 2015. 2, 3, 4
+Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016b. 2, 3
+Muhammad Haris, Greg Shakhnarovich, and Norimichi Ukita. Deep back-projection networks for superresolution. In CVPR, 2018. 6, 9
+B. Hassibi and D. G. Stork. Second order derivatives for network pruning: Optimal brain surgeon. In NeurIPS, 1993. 4
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 2
+Zibin He, Tao Dai, Jian Lu, Yong Jiang, and Shu-Tao Xia. Fakd: Feature-affinity based knowledge distillation for efficient image super-resolution. In ICIP, 2020. 3
+Geoffrey Hinton, Oriol Vinyls, and Jeff Dean. Distilling the knowledge in a neural network. In NeurIPS Workshop, 2014. 1
+Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed selfexemplars. In CVPR, 2015. 6
+Zheng Hui, Xinbo Gao, Yunchu Yang, and Xiumei Wang. Lightweight image super-resolution with information multi-distillation network. In ACM MM, 2019. 1, 3, 8
+Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In CVPR, 2016a. 1, 2, 8
+Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Deeply-recursive convolutional network for image superresolution. In CVPR, 2016b. 1, 3, 8
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014. 6
+Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In CVPR, 2017. 8
+
+Y. LeCun, J. S. Denker, and S. A. Solla. Optimal brain damage. In NeurIPS, 1990. 4
+Wonkyung Lee, Junghyup Lee, Dohyung Kim, and Bumsub Ham. Learning with privileged information for efficient image super-resolution. In ECCV, 2020. 1, 3, 9
+Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In ICLR, 2017. 2, 3, 4, 6, 7
+Zhen Li, Jinglei Yang, Zheng Liu, Xiaomin Yang, Gwanggil Jeon, and Wei Wu. Feedback network for image super-resolution. In CVPR, 2019. 9
+Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In CVPRW, 2017. 1, 2, 4, 5, 6, 8, 9
+Jie Liu, Wenjie Zhang, Yuting Tang, Jie Tang, and Gangshan Wu. Residual feature aggregation network for image super-resolution. In CVPR, 2020. 2, 9
+Xiaotong Luo, Yuan Xie, Yulun Zhang, Yanyun Qu, Cuihua Li, and Yun Fu. Latticenet: Towards lightweight image super-resolution with lattice block. In ECCV, 2020. 1, 3
+David Martin, Charless Fowlkes, Doron Tal, and Jitendra Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In ICCV, 2001. 6
+Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools and Applications, 2017. 6
+Yiqun Mei, Yuchen Fan, Yuqian Zhou, Lichao Huang, Thomas S Huang, and Humphrey Shi. Image superresolution with cross-scale non-local attention and exhaustive self-exemplars mining. In CVPR, 2020. 2, 9
+P. Molchanov, S. Tyree, and T. Karras. Pruning convolutional neural networks for resource efficient inference. In ICLR, 2017. 4
+Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In CVPR, 2019. 4
+Ben Niu, Weilei Wen, Wenqi Ren, Xiangde Zhang, Lianping Yang, Shuzhen Wang, Kaihao Zhang, Xiaochun Cao, and Haifeng Shen. Single image super-resolution via a holistic attention network. In ECCV, 2020. 9
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017. 6
+R. Reed. Pruning algorithms - a survey. IEEE Transactions on Neural Networks, 4(5):740-747, 1993. 2, 3, 4, 5
+Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In CVPR, 2016. 5
+Vivienne Sze, Yu-Hsin Chen, Tien-Ju Yang, and Joel S Emer. Efficient processing of deep neural networks: A tutorial and survey. Proceedings of the IEEE, 105(12):2295-2329, 2017. 2, 3
+Ying Tai, Jian Yang, and Xiaoming Liu. Image super-resolution via deep recursive residual network. In CVPR, 2017a. 8
+Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. Memnet: A persistent memory network for image restoration. In ICCV, 2017b. 2, 8
+Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, Lei Zhang, Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, Kyoung Mu Lee, et al. Ntire 2017 challenge on single image super-resolution: Methods and results. In CVPRW, 2017. 6
+Chaoqi Wang, Roger Grosse, Sanja Fidler, and Guodong Zhang. *Eigendamage: Structured pruning in the kronecker-factored eigenbasis.* In ICML, 2019a. 4
+Huan Wang, Xinyi Hu, Qiming Zhang, Yuehai Wang, Lu Yu, and Haoji Hu. Structured pruning for efficient convolutional neural networks via incremental regularization. IEEE Journal of Selected Topics in Signal Processing, 14(4):775-788, 2019b. 5
+
+Huan Wang, Can Qin, Yulun Zhang, and Yun Fu. Neural pruning via growing regularization. In ICLR, 2021. 4, 5
+Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. TIP, 2004. 6
+Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NeurIPS, 2016. 3, 4
+Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In Proc. 7th Int. Conf. Curves Surf., 2010. 6
+Kai Zhang, Wangmeng Zuo, and Lei Zhang. Learning a single convolutional super-resolution network for multiple degradations. In CVPR, 2018a. 6
+Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In ECCV, 2018b. 1, 2, 4, 6, 9
+Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image superresolution. In CVPR, 2018c. 1
+Yulun Zhang, Kunpeng Li, Kai Li, Bineng Zhong, and Yun Fu. Residual non-local attention networks for image restoration. In ICLR, 2019. 2
+Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image restoration. TPAMI, 2020. 1
+Yulun Zhang, Huan Wang, Can Qin, and Yun Fu. Aligned structured sparsity learning for efficient image super-resolution. NeurIPS, 2021. 1, 2
+Shangchen Zhou, Jiawei Zhang, Wangmeng Zuo, and Chen Change Loy. Cross-scale internal graph neural network for image super-resolution. In NeurIPS, 2020. 9
+Barret Zoph and Quoc Le. Neural architecture search with reinforcement learning. In ICLR, 2017. 1
\ No newline at end of file
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/images.zip b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..daf7e125fb2d822be263b9e07545853a8c7acbb2
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1227afff03ad7097de1e3c83426d27f6fbd8e684401682c77be2da8a6d672225
+size 718946
diff --git a/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/layout.json b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f5cf246543f83cbc047b6eea0cf3ef6a498a8ec5
--- /dev/null
+++ b/learningefficientimagesuperresolutionnetworksviastructureregularizedpruning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:43979c26973c1768be71edfe28c18cfce435c476cfa95f16b7f69384e7375171
+size 450985
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_content_list.json b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..271b751f95e40f92e2e75be2d559ccee695f7f46
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:95247179e3b3bc53f6c368e41a1db097ac6928792975197a75527e162d452a37
+size 127771
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_model.json b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..c3e628750e936a3ed25d4f0a4c9385d8defb5107
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2bf2a492715e17fcd59f33ec287a88942e4425fa655ad63fe1c0305a0ffcbccb
+size 148364
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_origin.pdf b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..89db9f7920bc76fdf9a667b51af2e71153332138
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/101f6709-6677-4995-ad80-515e45df64db_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be68f9177001acf2822527a3e7248fd7d381c65a930569373ccdaccee20781dc
+size 1236368
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/full.md b/learningefficientonline3dbinpackingonpackingconfigurationtrees/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..657b1c6a5eb44f21da8a58c5052f9c618f832ed0
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/full.md
@@ -0,0 +1,401 @@
+# LEARNING EFFICIENT ONLINE 3D BIN PACKING ON PACKING CONFIGURATION TREES
+
+Hang Zhao $^{1,2*}$ , Yang Yu $^{2}$ , Kai Xu $^{1\dagger}$
+
+$^{1}$ School of Computer Science, National University of Defense Technology, China
+
+$^{2}$ National Key Lab for Novel Software Technology, Nanjing University, China
+
+{alex hang.zhao, kevin.kai.xu}@gmail.com, yuy@nju.edu.cn
+
+# ABSTRACT
+
+Online 3D Bin Packing Problem (3D-BPP) has widespread applications in industrial automation and has aroused enthusiastic research interest recently. Existing methods usually solve the problem with limited resolution of spatial discretization, and/or cannot deal with complex practical constraints well. We propose to enhance the practical applicability of online 3D-BPP via learning on a novel hierarchical representation — packing configuration tree (PCT). PCT is a full-fledged description of the state and action space of bin packing which can support packing policy learning based on deep reinforcement learning (DRL). The size of the packing action space is proportional to the number of leaf nodes, i.e. candidate placements, making the DRL model easy to train and well-performing even with continuous solution space. During training, PCT expands based on heuristic rules, however, the DRL model learns a much more effective and robust packing policy than heuristic methods. Through extensive evaluation, we demonstrate that our method outperforms all existing online BPP methods and is versatile in terms of incorporating various practical constraints.
+
+# 1 INTRODUCTION
+
+As one of the most classic combinatorial optimization problems, the 3D bin packing problem usually refers to packing a set of cuboid-shaped items $i \in \mathcal{I}$ , with sizes $s_i^x, s_i^y, s_i^z$ along $x, y, z$ axes, respectively, into the minimum number of bins with sizes $S^x, S^y, S^z$ , in an axis-aligned fashion. Traditional 3D-BPP assumes that all the items to be packed are known a priori (Martello et al., 2000), which is also called offline BPP. The problem is known to be strongly NP-hard (De Castro Silva et al., 2003). However, in many real-world application scenarios, e.g., logistics or warehousing (Wang & Hauser, 2019a), the upcoming items cannot be fully observed; only the current item to be packed is observable. Packing items without the knowledge of all upcoming items is referred to as online BPP (Seiden, 2002).
+
+Due to its obvious practical usefulness, online 3D-BPP has received increasing attention recently. Given the limited knowledge, the problem cannot be solved by usual search-based methods. Different from offline 3D-BPP where the items can be placed in an arbitrary order, online BPP must place items following their coming order, which imposes additional constraints. Online 3D-BPP is usually solved with either heuristic methods (Ha et al., 2017) or learning-based ones (Zhao et al., 2021), with complementary pros and cons. Heuristic methods are generally not limited by the size of action space, but they find difficulties in handling complex practical constraints such as packing stability or specific packing preferences. Learning-based approaches usually perform better than heuristic methods, especially under various complicated constraints. However, the learning is hard to converge with a large action space, which has greatly limited the applicability of learning-based methods due to, e.g., the limited resolution of spatial discretization (Zhao et al., 2021).
+
+We propose to enhance learning-based online 3D-BPP towards practical applicability through learning with a novel hierarchical representation — packing configuration tree (PCT). PCT is a dynamically growing tree where the internal nodes describe the space configurations of packed items and
+
+leaf nodes the packable placements of the current item. PCT is a full-fledged description of the state and action space of bin packing which can support packing policy learning based on deep reinforcement learning (DRL). We extract state features from PCT using graph attention networks (Velickovic et al., 2018) which encodes the spatial relations of all space configuration nodes. The state feature is input into the actor and critic networks of the DRL model. The actor network, designed based on pointer mechanism, weighs the leaf nodes and outputs the action (the final placement).
+
+During training, PCT grows under the guidance of heuristics such as Corner Point (Martello et al., 2000), Extreme Point (Crainic et al., 2008), and Empty Maximal Space (Ha et al., 2017). Although PCT is expanded with heuristic rules, confining the solution space to what the heuristics could explore, our DRL model learns a discriminant fitness function (the actor network) for the candidate placements, resulting in an effective and robust packing policy exceeding the heuristic methods. Furthermore, the size of the packing action space is proportional to the number of leaf nodes, making the DRL model easy to train and well-performing even with continuous solution space where the packing coordinates are continuous values. Through extensive evaluation, we demonstrate that our method outperforms all existing online 3D-BPP methods and is versatile in terms of incorporating various practical constraints such asisle friendliness and load balancing (Gzara et al., 2020). Our work is, to our knowledge, the first that deploys the learning-based method on solving online 3D-BPP with continuous solution space successfully.
+
+# 2 RELATED WORK
+
+Offline 3D-BPP The early interest of 3D-BPP mainly focused on its offline setting. Offline 3D-BPP assumes that all items are known as a priori and can be placed in an arbitrary order. Martello et al. (2000) first solved this problem with an exact branch-and-bound approach. Limited by exponential worst-case complexity of exact approaches, lots of heuristic and meta-heuristic algorithms are proposed to get an approximate solution quickly, such as guided local search (Faroe et al., 2003), tabu search (Crainic et al., 2009), and hybrid genetic algorithm (Kang et al., 2012). Hu et al. (2017) decompose the offline 3D-BPP into packing order decisions and online placement decisions. The packing order is optimized with an end-to-end DRL agent and the online placement policy is a hand-designed heuristic. This two-step fashion is widely accepted and followed by Duan et al. (2019), Hu et al. (2020), and Zhang et al. (2021).
+
+Heuristics for Online 3D-BPP Although offline 3D-BPP has been well studied, their search-based approaches cannot be directly transferred to the online setting. Instead, lots of heuristic methods have been proposed to solve this problem. For reasons of simplicity and good performance, the deep-bottom-left (DBL) heuristic (Karabulut & Inceoglu, 2004) has long been a favorite. Ha et al. (2017) sort the empty spaces with this DBL order and place the current item into the first fit one. Wang & Hauser (2019b) propose a Heightmap-Minimization method to minimize the volume increase of the packed items as observed from the loading direction. Hu et al. (2020) optimize the empty spaces available for the packing future with a Maximize-Accessible-Convex-Space method.
+
+DRL for Online 3D-BPP The heuristic methods are intuitive to implement and can be easily applied to various scenarios. However, the price of good flexibility is that these methods perform mediocrely, especially for online 3D-BPP with specific constraints. Designing new heuristics for specific classes of 3D-BPP is heavy work since this problem has an NP-hard solution space, many situations need to be premeditated manually by trial and error. Substantial domain knowledge is also necessary to ensure safety and reliability. To automatically generate a policy that works well on specified online 3D-BPP, Verma et al. (2020); Zhao et al. (2021) employ the DRL method on solving this problem, however, their methods only work in small discrete coordinate spaces. Despite their limitations, these works are soon followed by Hong et al. (2020); Yang et al. (2021); Zhao et al. (2022) for logistics robot implementation. Zhang et al. (2021) adopt a similar online placement policy for offline packing needs referring to Hu et al. (2017). All these learning-based methods only work in a grid world with limited discretization accuracy, which reduces their practical applicability.
+
+Practical Constraints The majority of literature for 3D-BPP (Martello et al., 2000) only considers the basic non-overlapping constraint 1 and containment constraint 2:
+
+$$
+\begin{array}{l} p _ {i} ^ {d} + s _ {i} ^ {d} \leq p _ {j} ^ {d} + S ^ {d} \left(1 - e _ {i j} ^ {d}\right) \quad i \neq j, i, j \in \mathcal {I}, d \in \{x, y, z \} (1) \\ 0 \leq p _ {i} ^ {d} \leq S ^ {d} - s _ {i} ^ {d} \quad i \in \mathcal {I}, d \in \{x, y, z \} (2) \\ \end{array}
+$$
+
+
+Figure 1: PCT expansion illustrated using a 2D example (in $xoz$ plane) for simplicity and the number of allowed orientations $|\mathbf{O}|$ is 1 (see Appendix B for the 3D version). A newly added item introduces a series of empty spaces and new candidate placements are generated, e.g., the left-bottom corner of the empty space.
+
+Where $p_i$ means the front-left-bottom coordinate of item $i$ and $d$ the coordinate axis, $e_{ij}$ takes value 1 otherwise 0 if item $i$ precedes item $j$ along $d$ . The algorithms for 3D-BPP are of limited practical applicability if no even basic real-world constraints, e.g., stability (Ramos et al., 2016), are considered. Zhao et al. (2022) propose a fast stability estimation method for DRL training and test their learned policies with real logistics boxes. The flaw of their work is the heightmap (the upper frontier of packed items) state representation like Zhang et al. (2021) is still used, while the underlying constraints between packed items are missed. The unavailability of underlying spatial information makes their problem a partially observable Markov Decision Process (Spaan, 2012) which is not conducive to DRL training and limits the performance on 3D-BPP instances with more complex practical constraints, likeisle friendliness and load balancing (Gzara et al., 2020).
+
+# 3 METHOD
+
+In this section, we first introduce our PCT concept in Section 3.1 for describing the online packing process. The parameterization of the tree structure and the leaf node selection policy are introduced in Section 3.2 and Section 3.3 respectively. In Section 3.4, we formulate online 3D-BPP as Markov Decision Process based on PCT, followed by the description of the training method.
+
+# 3.1 PACKING CONFIGURATION TREE
+
+When a rectangular item $n_t$ is added to a given packing with position $(p_n^x, p_n^y, p_n^z)$ at time step $t$ , it introduces a series of new candidate positions where future items can be accommodated, as illustrated in Figure 1. Combined with the axis-aligned orientation $o \in \mathbf{O}$ for $n_t$ based on existing positions, we get candidate placements (i.e. position and orientation). The packing process can be seen as a placement node being replaced by a packed item node, and new candidate placement nodes are generated as children. As the packing time step $t$ goes on, these nodes are iteratively updated and a dynamic packing configuration tree is formed, denoted as $\mathcal{T}$ . The internal node set $\mathbf{B}_t \in \mathcal{T}_t$ represents the space configurations of packed items, and the leaf node set $\mathbf{L}_t \in \mathcal{T}_t$ the packable candidate placements. During the packing, leaf nodes that are no longer feasible, e.g., covered by packed items, will be removed from $\mathbf{L}_t$ . When there is no packable leaf node that makes $n_t$ satisfy the constraints of placement, the packing episode ends. Without loss of generality, we stipulate a vertical top-down packing within a single bin (Wang & Hauser, 2019b).
+
+Traditional 3D-BPP literature only cares about the remaining placements for accommodating the current item $n_t$ , their packing policies can be written as $\pi(\mathbf{L}_t | \mathbf{L}_t, n_t)$ . If we want to promote this problem for practical demands, 3D-BPP needs to satisfy more complex practical constraints which also act on $\mathbf{B}_t$ . Taking packing stability for instance, a newly added item $n_t$ has possibly force and torque effect on the whole item set $\mathbf{B}_t$ (Ramos et al., 2016). The addition of $n_t$ should make $\mathbf{B}_t$ a more stable spatial distribution so that more items can be added in the future. Therefore, our packing policy over $\mathbf{L}_t$ is defined as $\pi(\mathbf{L}_t | \mathcal{T}_t, n_t)$ , which means probabilities of selecting leaf nodes from $\mathbf{L}_t$ given $\mathcal{T}_t$ and $n_t$ . For online packing, we hope to find the best leaf node selection policy to expand the PCT with more relaxed constraints so that more future items can be appended.
+
+Leaf Node Expansion Schemes The performance of online 3D-BPP policies has a strong relationship with the choice of leaf node expansion schemes — which incrementally calculate new candidate placements introduced by the just placed item $n_t$ . A good expansion scheme should reduce
+
+the number of solutions to be explored while not missing too many feasible packings. Meanwhile, polynomially computability is also expected. Designing such a scheme from scratch is non-trivial. Fortunately, several placement rules independent from particular packing problems have been proposed, such as Corner Point (Martello et al., 2000), Extreme Point (Crainic et al., 2008), and Empty Maximal Space (Ha et al., 2017). We extend these schemes which have proven to be accurate and efficient to our PCT expansion. The performance of learned policies will be reported in Section 4.1.
+
+# 3.2 TREE REPRESENTATION
+
+Given the bin configuration $\mathcal{T}_t$ and the current item $n_t$ , the packing policy can be parameterized as $\pi(\mathbf{L}_t|\mathcal{T}_t,n_t)$ . The tuple $(\mathcal{T}_t,n_t)$ can be treated as a graph and encoded by Graph Neural Networks (GNNs) (Gori et al., 2005). Specifically, the PCT keeps growing with time step $t$ and cannot be embedded by spectral-based approaches (Bruna et al., 2014) which require a fixed graph structure. We adopt non-spectral Graph Attention Networks (GATs) (Velickovic et al., 2018), which require no priori on graph structures.
+
+The raw space configuration nodes $\mathbf{B}_t, \mathbf{L}_t, n_t$ are presented by descriptors in different formats. We use three independent node-wise Multi-Layer Perceptron (MLP) blocks to project these heterogeneous descriptors into the homogeneous node features: $\hat{\mathbf{h}} = \{\phi_{\theta_B}(\mathbf{B}_t), \phi_{\theta_L}(\mathbf{L}_t), \phi_{\theta_n}(n_t)\} \in \mathbb{R}^{d_h \times N}$ , $d_h$ is the dimension of each node feature and $\phi_\theta$ is an MLP block with its parameters $\theta$ . The feature number $N$ should be $|\mathbf{B}_t| + |\mathbf{L}_t| + 1$ , which is a variable. The GAT layer is used to transform $\hat{\mathbf{h}}$ into high-level node features. The Scaled Dot-Product Attention (Vaswani et al., 2017) is applied to each node for calculating the relation weight of one node to another. These relation weights are normalized and used to compute the linear combination of features $\hat{\mathbf{h}}$ . The feature of node $i$ embedded by the GAT layer can be represented as:
+
+$$
+\operatorname {G A T} \left(\hat {h} _ {i}\right) = W ^ {O} \sum_ {j = 1} ^ {N} \text {s o f t m a x} \left(\frac {\left(W ^ {Q} \hat {h} _ {i}\right) ^ {T} W ^ {K} \hat {h} _ {j}}{\sqrt {d _ {k}}}\right) W ^ {V} \hat {h} _ {j} \tag {3}
+$$
+
+Where $W^{Q} \in \mathbb{R}^{d_{k} \times d_{h}}$ , $W^{K} \in \mathbb{R}^{d_{k} \times d_{h}}$ , $W^{V} \in \mathbb{R}^{d_{v} \times d_{h}}$ , and $W^{O} \in \mathbb{R}^{d_{h} \times d_{v}}$ are projection matrices, $d_{k}$ and $d_{v}$ are dimensions of projected features. The softmax operation normalizes the relation weight between node $i$ and node $j$ . The initial feature $\hat{\mathbf{h}}$ is embedded by a GAT layer and the skip-connection operation (Vaswani et al., 2017) is followed to get the final output features $\mathbf{h}$ :
+
+$$
+\mathbf {h} ^ {\prime} = \hat {\mathbf {h}} + \operatorname {G A T} (\hat {\mathbf {h}}) \quad \mathbf {h} = \mathbf {h} ^ {\prime} + \phi_ {F F} \left(\mathbf {h} ^ {\prime}\right) \tag {4}
+$$
+
+Where $\phi_{FF}$ is a node-wise Feed-Forward MLP with output dimension $d_h$ and $\mathbf{h}'$ is an intermediate variable. Equation 4 can be seen as an independent block and be repeated multiple times with different parameters. We don't extend GAT to employ the multi-head attention mechanism (Vaswani et al., 2017) since we find that additional attention heads cannot help the final performance. We execute Equation 4 once and we set $d_v = d_k$ . More implementation details are provided in Appendix A.
+
+# 3.3 LEAF NODE SELECTION
+
+Given the node features $\mathbf{h}$ , we need to decide the leaf node indices for accommodating the current item $n_t$ . Since the leaf nodes vary as the PCT keeps growing over time step $t$ , we use a pointer mechanism (Vinyals et al., 2015) which is context-based attention over variable inputs to select a leaf node from $\mathbf{L}_t$ . We still adopt Scaled Dot-Product Attention for calculating pointers, the global context feature $\bar{h}$ is aggregated by a mean operation on $\mathbf{h}$ : $\bar{h} = \frac{1}{N}\sum_{i=1}^{N}h_i$ . The global feature $\bar{h}$ is projected to a query $q$ by matrix $W^q \in \mathbb{R}^{d_k\times d_h}$ and the leaf node features $\mathbf{h}_{\mathbf{L}}$ are utilized to calculate a set of keys $k_{\mathbf{L}}$ by $W^k \in \mathbb{R}^{d_k\times d_h}$ . The compatibility $\mathbf{u}_{\mathbf{L}}$ of the query with all keys are:
+
+$$
+q = W ^ {q} \bar {h} \quad k _ {i} = W ^ {k} h _ {i} \quad u _ {i} = \frac {q ^ {T} k _ {i}}{\sqrt {d _ {\mathrm {k}}}} \tag {5}
+$$
+
+Here $h_i$ only comes from $\mathbf{h}_{\mathbf{L}}$ . The compatibility vector $\mathbf{u}_{\mathbf{L}} \in \mathbb{R}^{|\mathbf{L}_t|}$ represents the leaf node selection logits. The probability distribution over the PCT leaf nodes $\mathbf{L}_t$ is:
+
+$$
+\pi_ {\theta} \left(\mathbf {L} _ {t} \mid \mathcal {T} _ {t}, n _ {t}\right) = \text {s o f t m a x} \left(c _ {\text {c l i p}} \cdot \operatorname {t a n h} \left(u _ {\mathbf {L}}\right)\right) \tag {6}
+$$
+
+Following Bello et al. (2017), the compatibility logits are clipped with tanh, where the range is controlled by hyperparameter $c_{clip}$ , and finally normalized by a softmax operation.
+
+# 3.4 MARKOV DECISION PROCESS FORMULATION
+
+The online 3D-BPP decision at time step $t$ only depends on the tuple $(\mathcal{T}_t, n_t)$ and can be formulated as Markov Decision Process, which is constructed with state $S$ , action $\mathcal{A}$ , transition $\mathcal{P}$ , and reward $R$ . We solve this MDP with an end-to-end DRL agent. The MDP model is formulated as follows.
+
+State The state $s_t$ at time step $t$ is represented as $s_t = (\mathcal{T}_t, n_t)$ , where $\mathcal{T}_t$ consists of the internal nodes $\mathbf{B}_t$ and the leaf nodes $\mathbf{L}_t$ . Each internal node $b \in \mathbf{B}_t$ is a spatial configuration of sizes $(s_b^x, s_b^y, s_b^z)$ and coordinates $(p_b^x, p_b^y, p_b^z)$ corresponding to a packed item. The current item $n_t$ is a size tuple $(s_n^x, s_n^y, s_n^z)$ . Extra properties will be appended to $b$ and $n_t$ for specific packing preferences, such as density, item category, etc. The descriptor for leaf node $l \in \mathbf{L}_t$ is a placement vector of sizes $(s_o^x, s_o^y, s_o^z)$ and position coordinates $(p^x, p^y, p^z)$ , where $(s_o^x, s_o^y, s_o^z)$ indicates the sizes of $n_t$ along each dimension after an axis-aligned orientation $o \in \mathbf{O}$ . Only the packable leaf nodes which satisfy placement constraints are provided.
+
+Action The action $a_{t} \in \mathcal{A}$ is the index of the selected leaf node $l$ , denoted as $a_{t} = \text{index}(l)$ . The action space $\mathcal{A}$ has the same size as $\mathbf{L}_{t}$ . A surge of learning-based methods (Zhao et al., 2021) directly learn their policy on a grid world through discretizing the full coordinate space, where $|\mathcal{A}|$ grows explosively with the accuracy of the discretization. Different from existing works, our action space solely depends on the leaf node expansion scheme and the packed items $\mathbf{B}_{t}$ . Therefore, our method can be used to solve online 3D-BPP with continuous solution space. We also find that even if only an intercepted subset $\mathbf{L}_{sub} \in \mathbf{L}_{t}$ is provided, our method can still maintain a good performance.
+
+Transition The transition $\mathcal{P}(s_{t + 1}|s_t)$ is jointly determined by the current policy $\pi$ and the probability distribution of sampling items. Our online sequences are generated on-the-fly from an item set $\mathcal{I}$ in a uniform distribution. The generalization performance of our method on item sampling distributions different from the training one is discussed in Section 4.4.
+
+Reward Our reward function $R$ is defined as $r_t = c_r \cdot w_t$ once $n_t$ is inserted into PCT as an internal node successfully, otherwise, $r_t = 0$ and the packing episode ends. Here $c_r$ is a constant and $w_t$ is the weight of $n_t$ . The choice of $w_t$ depends on the customized needs. For simplicity and clarity, unless otherwise noted, we set $w_t$ as the volume occupancy $v_t$ of $n_t$ , where $v_t = s_n^x \cdot s_n^y \cdot s_n^z$ .
+
+Training Method A DRL agent seeks for a policy $\pi (a_t|s_t)$ to maximize the accumulated discounted reward. Our DRL agent is trained with the ACKTR method (Wu et al., 2017). The actor weighs the leaf nodes $\mathbf{L}_t$ and outputs the policy distribution $\pi_{\theta}(\mathbf{L}_t|\mathcal{T}_t,n_t)$ . The critic maps the global context $\overline{h}$ into a state value prediction to predict how much accumulated discount reward the agent can get from $t$ and helps the training of the actor. The action $a_{t}$ is sampled from the distribution $\pi_{\theta}(\mathbf{L}_t|\mathcal{T}_t,n_t)$ for training and we take the argmax of the policy for the test.
+
+ACKTR runs multiple parallel processes for gathering on-policy training samples. The node number $N$ of each sample varies with the time step $t$ and the packing sequence of each process. For batch calculation, we fulfill PCT to a fixed length with dummy nodes, as illustrated by Figure 2 (a). These redundant nodes are eliminated by masked attention (Velickovic et al., 2018) during the feature calculation of GAT. The aggregation of $\mathbf{h}$ only happens on the eligible nodes. For preserving node spatial relations, state $s_t$ is embedded by GAT as a fully connected graph as Figure 2 (b), without any inner mask operation. More implementation details are provided in Appendix A.
+
+
+Figure 2: Batch calculation for PCT.
+
+# 4 EXPERIMENTS
+
+In this section, we first report the performance of our PCT model combined with different leaf node expansion schemes. Then we will demonstrate the benefits of the PCT structure: better node spatial relation representations as well as more flexible action space. Finally, we test the generalization performance of our method and extend it to other online 3D-BPP with complex practical constraints.
+
+Baselines Although there are very few online packing implementations publicly available, we still do our best to collect or reproduce various online 3D-BPP algorithms, both heuristic and learning-
+
+based, from potentially relevant literature. We help the heuristic methods to make a pre-judgment of placement constraints, e.g., stability, in case of premature downtime. The learning-based agents are trained until there are no significant performance gains. Although both Zhao et al. (2022) and Zhao et al. (2021) are learning-based methods recently proposed, we only compare with the former since it is the upgrade of the latter. We also compare with the reported results of Zhang et al. (2021) under the same condition. All methods are implemented in Python and tested on 2000 instances with a desktop computer equipped with a Gold 5117 CPU and a GeForce TITAN V GPU. We publish the source code of our method along with related baselines at $\mathsf{G h i t b u^{1}}$
+
+Datasets Some baselines like Karabulut & Inceoglu (2004) need to traverse the entire coordinate space to find the optimal solution, and the running costs explode as the spatial discretization accuracy increases. To ensure that all algorithms are runnable within a reasonable period, we use the discrete dataset proposed by Zhao et al. (2021) without special declaration. The bin sizes $S^d$ are set to 10 with $d \in \{x, y, z\}$ and the item sizes $s^d \in \mathbb{Z}^+$ are not greater than $S^d / 2$ to avoid over-simplified scenarios. Our performance on a more complex continuous dataset will be reported in Section 4.3. Considering that there are many variants of 3D-BPP, we choose three representative settings:
+
+Setting 1: Following Zhao et al. (2022), the stability of the $\mathbf{B}_t$ is checked when $n_t$ is placed. Only two horizontal orientations ( $|\mathbf{O}| = 2$ ) are permitted for robot manipulation convenience.
+
+Setting 2: Following Martello et al. (2000), item $n_t$ only needs to satisfy Constraint 1 and 2. Arbitrary orientation $(|\mathbf{O}| = 6)$ is allowed here. This is the most common setting in 3D-BPP literature.
+
+Setting 3: Inherited from setting 1, each item $n_t$ has an additional density property $\rho$ sampled from $(0,1]$ uniformly. This information is appended into the descriptors of $\mathbf{B}_t$ and $n_t$ .
+
+# 4.1 PERFORMANCE OF PCT POLICIES
+
+We first report the performance of our PCT model combined with different leaf node expansion schemes. Three existing schemes which have proven to be both efficient and effective are adopted here: Corner Point (CP), Extreme Point (EP), and Empty Maximal Space (EMS). These schemes are all related to boundary points of a packed item along $d$ axis. We combine the start/end points of $n_t$ with the boundary points of $b \in \mathbf{B}_t$ to get the superset, namely Event Point (EV). See Appendix B for details and learning curves. We extend these schemes to our PCT model. Although the number of leaf nodes generated by these schemes is within a reasonable range, we only randomly intercept a subset $\mathbf{L}_{sub_t}$ from $\mathbf{L}_t$ if $|\mathbf{L}_t|$ exceeds a certain length, for saving computing resources. The interception length is a constant during training and determined by a grid search (GS) during the test. See Appendix A for implementation details. The performance comparisons are summarized in Table 1.
+
+Table 1: Performance comparisons. Uti. and Num. mean the average space utilization and the average number of packed items separately. Var. $(\times 10^{-3})$ is the variance of Uti. and Gap is w.r.t. the best Uti. across all methods. Random and Random & EV randomly pick placements from full coordinates and full EV nodes respectively. DBL, LSAH, MACS, and BR are heuristic methods proposed by Karabulut & Inceoglu (2004), Hu et al. (2017), Hu et al. (2020), and Zhao et al. (2021). Ha et al. (2017), LSAH, and BR are heuristics based on EMS.
+
+| Method | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Var. | Num. | Gap | Uti. | Var. | Num. | Gap | Uti. | Var. | Num. | Gap |
| Heuristic | Random | 36.7% | 10.3 | 14.9 | 51.7% | 38.6% | 8.3 | 15.7 | 55.1% | 36.8% | 10.6 | 14.9 | 51.4% |
| BR | 49.0% | 10.8 | 19.6 | 35.5% | 56.7% | 6.6 | 22.6 | 34.1% | 48.9% | 10.7 | 19.5 | 35.4% |
| Ha et al. | 52.1% | 20.1 | 20.6 | 31.4% | 59.9% | 10.4 | 23.8 | 30.3% | 51.9% | 20.2 | 20.6 | 31.4% |
| LSAH | 52.5% | 12.2 | 20.8 | 30.9% | 65.0% | 6.1 | 25.6 | 24.4% | 52.4% | 12.2 | 20.7 | 30.8% |
| Wang & Hauser | 57.6% | 11.5 | 24.1 | 24.2% | 66.1% | 8.4 | 25.9 | 23.1% | 56.5% | 11.2 | 22.3 | 25.4% |
| MACS | 57.7% | 10.5 | 22.6 | 24.1% | 50.8% | 8.8 | 20.1 | 40.9% | 57.7% | 10.6 | 22.6 | 23.8% |
| DBL | 60.5% | 8.8 | 23.8 | 20.4% | 70.6% | 7.9 | 27.8 | 17.9% | 60.5% | 8.9 | 23.8 | 20.1% |
| Learning-based | Zhao et al. | 70.9% | 6.2 | 27.5 | 6.7% | 70.3% | 4.3 | 27.4 | 18.3% | 59.6% | 5.4 | 23.1 | 21.3% |
| PCT & CP | 69.4% | 5.4 | 26.7 | 8.7% | 81.8% | 2.0 | 31.3 | 4.9% | 69.5% | 5.4 | 26.7 | 8.2% |
| PCT & EP | 71.9% | 6.6 | 27.8 | 5.4% | 78.1% | 3.8 | 30.3 | 9.2% | 72.2% | 5.8 | 27.9 | 4.6% |
| PCT & FC | 72.4% | 4.7 | 28.0 | 4.7% | 76.9% | 3.3 | 29.7 | 10.6% | 69.8% | 5.3 | 27.1 | 7.8% |
| PCT & EMS | 75.8% | 4.4 | 29.3 | 0.3% | 86.0% | 1.9 | 33.0 | 0.0% | 75.5% | 4.7 | 29.2 | 0.3% |
| PCT & EV | 76.0% | 4.2 | 29.4 | 0.0% | 85.3% | 2.1 | 32.8 | 0.8% | 75.7% | 4.6 | 29.2 | 0.0% |
| PCT & EVF | 75.7% | 4.8 | 29.2 | 0.4% | 80.5% | 2.9 | 31.0 | 6.4% | 73.5% | 4.6 | 28.4 | 2.9% |
| PCT & EV/GS | 75.8% | 4.7 | 29.2 | 0.3% | 84.8% | 2.1 | 32.6 | 1.4% | 75.5% | 4.8 | 29.1 | 0.3% |
| Random & EV | 45.7% | 13.5 | 18.4 | 39.9% | 51.0% | 8.3 | 20.4 | 40.7% | 45.1% | 12.5 | 18.1 | 40.4% |
+
+https://github.com/alexfrom0815/Online-3D-BPP-PCT
+
+Although PCT grows under the guidance of heuristics, the combinations of PCT with EMS and EV still learn effective and robust policies outperforming all baselines by a large margin regarding all settings. Note that the closer the space utilization is to 1, the more difficult online 3D-BPP is. It is interesting to see that policies guided by EMS and EV even exceed the performance of the full coordinate space (FC) which is expected to be optimal. This demonstrates that a good leaf node expansion scheme reduces the complexity of the problem and helps DRL agents learn better performance. To prove that the interception of $\mathbf{L}_t$ will not harm the final performance, we train agents with full leaf nodes derived from the EV scheme (EVF) and the test performance is slightly worse than the intercepted cases. We conjecture that the interception keeps the final performance may be caused by two reasons. First, sub-optimal solutions for online 3D-BPP may exist even in the intercepted leaf node set $\mathbf{L}_{sub}$ . In addition, the randomly chosen leaf nodes force the agent to make new explorations in case the policy $\pi$ falls into the local optimum. We remove GS from EV cases to prove its effectiveness. The performance of Zhao et al. (2022) deteriorates quickly in setting 2 and setting 3 due to the multiplying orientation space and insufficient state representation separately. Running costs, scalability performance, behavior understanding, visualized results, and the implementation details of our real-world packing system can all be found in Appendix C.
+
+We also repeat the same experiment as Zhang et al. (2021) which pack items sampled from a predefined item set $|\mathcal{I}| = 64$ in setting 2. While Zhang et al. (2021) packs on average 15.6 items and achieves $67.0\%$ space utilization, our method packs 19.7 items with a space utilization of $83.0\%$ .
+
+# 4.2 BENEFITS OF TREE PRESENTATION
+
+Here we verify that the PCT representation does help online 3D-BPP tasks. For this, we embed each space configuration node independently like PointNet (Qi et al., 2017) to prove the node spatial relations help the final performance. We also deconstruct the tree structure into node sequences and embed them with $\mathrm{Ptr - Net}$ (Vinyals et al., 2015), which selects a member from serialized inputs, for indicating that the graph embedding fashion fits our tasks well. We have verified that an appropriate choice of $\mathbf{L}_t$ makes DRL agents easy to train, then we remove the internal nodes $\mathbf{B}_t$ from $\mathcal{T}_t$ , along with its spatial relations with other nodes, to prove $\mathbf{B}_t$ is also a necessary part. We choose EV as the leaf node expansion scheme here. The comparison results are summarized in Table 2.
+
+Table 2: A graph embedding for complete PCT helps the final performance.
+
+| Presentation | Uti. | Setting 1 | Gap | Uti. | Setting 2 | Gap | Uti. | Setting 3 |
| Var. | Num. | | Var. | Num. | | Var. | Num. | |
| PointNet | 69.2% | 6.7 | 26.9 | 8.9% | 78.9% | 3.2 | 30.5 | 7.5% | 71.5% | 5.3 | 27.7 | 5.5% | | |
| Ptr-Net | 64.1% | 10.0 | 25.1 | 15.7% | 77.5% | 4.1 | 30.1 | 9.1% | 63.5% | 7.9 | 24.8 | 16.1% | | |
| PCT (T/B) | 70.9% | 5.9 | 27.5 | 6.7% | 84.1% | 2.6 | 32.3 | 1.4% | 70.6% | 5.3 | 27.4 | 6.7% | | |
| PCT (T) | 76.0% | 4.2 | 29.4 | 0.0% | 85.3% | 2.1 | 32.8 | 0.0% | 75.7% | 4.6 | 29.2 | 0.0% | | |
+
+If we ignore the spatial relations between the PCT nodes or only treat the state input as a flattened sequence, the performance of the learned policies will be severely degraded. The presence of $\mathbf{B}$ functions more on setting 1 and setting 3 since setting 2 allows items to be packed in any empty spaces without considering constraints with internal nodes. This also confirms that a complete PCT representation is essential for online 3D-BPP of practical needs.
+
+# 4.3 PERFORMANCE ON CONTINUOUS DATASET
+
+The most concerning issue about online 3D-BPP is their solution space limit. Given that most learning-based methods can only work in a limited discrete coordinate space, we directly test our method in a continuous bin with sizes $S^d = 1$ to prove our superiority. Due to the lack of public datasets for online 3D-BPP issues, we generate item sizes through a uniform distribution $s^d \sim U(a, S^d / 2)$ , $a$ is set to 0.1 in case endless items are generated. Specifically, for 3D-BPP instances where stability is considered, the diversity of item size $s^z$ needs to be controlled. If all subsets of $\mathbf{B}_t$ meet:
+
+
+
+$$
+\sum_ {i \in \mathbf {B} _ {s u b 1}} s _ {i} ^ {z} \neq \sum_ {i \in \mathbf {B} _ {s u b 2}} s _ {i} ^ {z} \quad \mathbf {B} _ {s u b 1} \neq \mathbf {B} _ {s u b 2}, \mathbf {B} _ {s u b 1}, \mathbf {B} _ {s u b 2} \in \mathbf {B} _ {t} \tag {7}
+$$
+
+This means any packed items cannot form a new plane for providing support in the direction of gravity and the available packing areas shrink. Excessive diversity of $s^z$ will degenerate 3D-BPP into 1D-BPP as shown in the toy demo. To prevent this degradation from leading to the underutilization of the bins, we sample $s^z$ from a finite set $\{0.1, 0.2, \dots, 0.5\}$ on setting 1 and setting 3.
+
+Table 3: Online 3D-BPP with continuous solution space.
+
+| Method | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Var. | Num. | Gap | Uti. | Var. | Num. | Gap | Uti. | Var. | Num. | Gap |
| Heu. | BR | 40.9% | 7.4 | 16.1 | 37.5% | 45.3% | 5.2 | 17.8 | 31.7% | 40.9% | 7.3 | 16.1 | 38.6% |
| Ha et al. | 43.9% | 14.2 | 17.2 | 32.9% | 46.1% | 6.8 | 18.1 | 30.5% | 43.9% | 14.2 | 17.2 | 34.1% |
| LSAH | 48.3% | 12.1 | 18.7 | 26.1% | 58.7% | 4.6 | 22.8 | 11.5% | 48.4% | 12.2 | 18.8 | 27.3% |
| DRL | GD | 5.6% | - | 2.2 | 91.4% | 7.5% | - | 2.9 | 88.7% | 5.2% | - | 2.1 | 92.2% |
| PCT & EMS | 65.3% | 4.4 | 24.9 | 0.2% | 66.3% | 2.3 | 27.0 | 0.0% | 66.6% | 3.3 | 25.3 | 0.0% |
| PCT & EV | 65.4% | 3.3 | 25.0 | 0.0% | 65.0% | 2.6 | 26.4 | 2.0% | 65.8% | 3.6 | 25.1 | 2.7% |
+
+We find that some heuristic methods (Ha et al., 2017) also have the potential to work in the continuous domain. We improve these methods as our baselines. Another intuitive approach for solving online 3D-BPP with continuous solution space is driving a DRL agent to sample actions from a gaussian distribution (GD) and output continuous coordinates directly. The test results are summarized in Table 3. Although the continuous-size item set is infinite $(|\mathcal{I}| = \infty)$ which increases the difficulty of the problem and reduces the performance of all methods, our method still performs better than all competitors. The DRL agent which outputs continuous actions directly cannot even converge and their variance is not considered. Our work is, to our knowledge, the first that deploys the learning-based method on solving online 3D-BPP with continuous solution space successfully.
+
+# 4.4 GENERALIZATION ON DIFFERENT DISTRIBUTIONS
+
+The generalization ability of learning-based methods has always been a concern. Here we demonstrate that our method has a good generalization performance on item size distributions different from the training one. We conduct this experiment with continuous solution space. We sample $s^d$ from normal distributions $N(\mu, \sigma^2)$ for generating test sequences where $\mu$ and $\sigma$ are the expectation and the standard deviation. Three normal distributions are adopted here, namely $N(0.3, 0.1^2)$ , $N(0.1, 0.2^2)$ , and $N(0.5, 0.2^2)$ , as shown in Figure 3. The larger $\mu$ of the normal distribution, the larger the average size of sampled items. We still control $s^d$ within the range of [0.1, 0.5]. If the sampled item sizes are not within this range, we will resample until it meets the condition.
+
+Table 4: Generalization performance on different kinds of item sampling distributions.
+
+| Test Distribution | Method | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Var. | Num. | Uti. | Var. | Num. | Uti. | Var. | Num. |
| sd~U(0.1,0.5) | LSAH | 48.3% | 12.1 | 18.7 | 58.7% | 4.6 | 22.8 | 48.4% | 12.2 | 18.8 |
| PCT & EMS | 65.3% | 4.4 | 24.9 | 66.3% | 2.3 | 27.0 | 66.6% | 3.3 | 25.3 |
| PCT & EV | 65.4% | 3.3 | 25.0 | 65.0% | 2.6 | 26.4 | 65.8% | 3.6 | 25.1 |
| sd~N(0.3,0.12) | LSAH | 49.2% | 11.1 | 18.9 | 60.0% | 4.1 | 22.9 | 49.2% | 11.0 | 18.9 |
| PCT & EMS | 66.1% | 3.6 | 25.1 | 64.3% | 3.5 | 25.6 | 66.4% | 3.0 | 25.2 |
| PCT & EV | 65.1% | 2.8 | 24.7 | 63.7% | 2.6 | 25.3 | 66.2% | 2.9 | 25.1 |
| sd~N(0.1,0.22) | LSAH | 52.4% | 8.9 | 30.3 | 62.9% | 2.4 | 44.3 | 52.3% | 8.9 | 30.2 |
| PCT & EMS | 68.5% | 2.5 | 39.0 | 66.4% | 3.0 | 49.7 | 69.2% | 2.5 | 39.4 |
| PCT & EV | 66.5% | 2.7 | 38.0 | 64.9% | 2.7 | 48.3 | 67.4% | 2.4 | 38.5 |
| sd~N(0.5,0.22) | LSAH | 47.3% | 12.6 | 13.0 | 56.0% | 5.5 | 12.9 | 47.3% | 12.6 | 13.0 |
| PCT & EMS | 63.5% | 5.0 | 17.3 | 64.5% | 2.8 | 15.4 | 65.2% | 3.8 | 17.7 |
| PCT & EV | 65.1% | 3.3 | 17.7 | 64.5% | 2.8 | 15.3 | 65.1% | 3.7 | 17.7 |
+
+We directly transfer our policies trained on $U(0.1, 0.5)$ to these new datasets without any fine-tuning. We use the best-performing heuristic method LSAH (Hu et al., 2017) in Section 4.3 as a baseline. The test results are summarized in Table 4. Our method performs well on the distributions different from the training one and always surpasses the LSAH method. See Appendix C for more results about the generalization ability of our method on disturbed distributions and unseen items.
+
+
+Figure 3: The probability distribution for sampling item sizes. The area of the colored zone is normalized to 1.
+
+
+
+
+
+
+
+# 4.5 MORE COMPLEX PRACTICAL CONSTRAINTS
+
+To further prove that our method fits 3D-BPP with complex constraints well, we give two demonstrations about extending our method to online 3D-BPP with additional practical constraints: isle friendliness and load balancing (Gzara et al., 2020):
+
+3D-BPP with Isle Friendliness Isle friendliness refers to that items belonging to the same category should be packed as closely as possible. The item weight is set as $w_{t} = \max (0,v_{t} - c\cdot dist(n_{t},\mathbf{B}_{t}))$ , $c$ is a constant. The additional object function $dist(n_{t},\mathbf{B}_{t})$ means the average distance between $n_t$ and the items of the same category in $\mathbf{B}_t$ . The additional category information is appended into the descriptors of $\mathbf{B}_t$ and $n_t$ . Four item categories are tested here.
+
+3D-BPP with Load Balancing Load balancing dictates that the packed items should have an even mass distribution within the bin. The item weight is set as $w_{t} = \max (0, v_{t} - c \cdot var(n_{t}, \mathbf{B}_{t}))$ . Object $var(n_{t}, \mathbf{B}_{t})$ is the variance of the mass distribution of the packed items on the bottom of the bin.
+
+Table 5: Online 3D-BPP with practical constraints. Obj. means the task-specific objective score, the smaller the better. Setting 2 involves no mass property and the load balancing is not considered.
+
+ | Method | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Num. | Obj. | Uti. | Num. | Obj. | Uti. | Num. | Obj. |
| Isle Friendliness | Zhao et al. | 58.3% | 22.5 | 4.58 | 64.2% | 24.8 | 4.67 | 59.0% | 22.8 | 4.60 |
| PCT & EV | 72.1% | 29.0 | 4.44 | 85.2% | 32.8 | 2.69 | 74.6% | 28.8 | 4.45 |
| Load Balancing | Zhao et al. | 60.3% | 23.3 | 88.0 | - | 61.1% | 23.7 | 30.1 |
| PCT & EV | 73.7% | 28.6 | 40.5 | - | 74.0% | 28.7 | 20.9 |
+
+We choose the learning-based method Zhao et al. (2022) as our baseline since heuristic methods only take space utilization as their objects. The results are summarized in Table 5. Compared with the baseline algorithm, our method better achieves the additional object while still taking into account the space utilization as the primary.
+
+# 5 DISCUSSION
+
+We formulate the online 3D-BPP as a novel hierarchical representation -- packing configuration tree. PCT is a full-fledged description of the state and action space of bin packing which makes the DRL agent easy to train and well-performing. We extract state feature from PCT using graph attention networks which encodes the spatial relations of all space configuration nodes. The graph representation of PCT helps the agent with handling online 3D-BPP with complex practical constraints, while the finite leaf nodes prevent the action space from growing explosively. Our method surpasses all other online 3D-BPP algorithms and is the first learning-based method that solves online 3D-BPP with continuous solution space successfully. Our method performs well even on item sampling distributions different from the training one. We also give demonstrations to prove that our method is versatile in terms of incorporating various practical constraints. For future research, we are extremely interested in applying our method to the more difficult irregular shape packing (Wang & Hauser, 2019a), where the sampling costs for training DRL agents are more expensive and the solution space will be far more complex. A good strategy for balancing exploration and exploitation for learning agents is eagerly needed in this situation. Finding other alternatives for better representing 3D-BPP with different packing constraints and designing better leaf node expansion schemes for PCT are also interesting directions.
+
+# ACKNOWLEDGEMENTS
+
+We thank Zhan Shi, Wei Yu, and Lintao Zheng for helpful discussions. We would also like to thank anonymous reviewers for their insightful comments and valuable suggestions. This work is supported by the National Natural Science Foundation of China (62132021, 61876077).
+
+# ETHICS STATEMENT
+
+We believe the broader impact of this research is significant. BPP is considered one of the most needed academic problems due to its wide applicability in our daily lives (Skiena, 1997). Providing a good solution to online 3D-BPP yields direct and profound impacts beyond academia. We note that online packing setups have been already widely deployed in logistics hubs and manufacturing plants. A good online 3D-BPP policy benefits all the downstream operations like package wrapping, transportation, warehousing, and distribution.
+
+Our method can also be treated as a separate decision module and utilized to solve other variants of 3D-BPP issues, such as multi-bin online 3D-BPP, online 3D-BPP with lookahead (Zhao et al., 2021), online placement decision for offline 3D-BPP (Hu et al., 2017), and the logistics robot implementation for online packing (Zhao et al., 2022), which have been well studied in previous works. We give demonstrations about applying our method to solving online 3D-BPP with various complex practical constraints, the similar idea can also be adopted to meet other customized desires.
+
+# REPRODUCIBILITY
+
+Our real-world video demo is submitted with the supplemental material. The source code of our method and related baselines is published at https://github.com/alexfrom0815/Online-3D-BPP-PCT.
+
+# REFERENCES
+
+Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Workshop Track Proceedings. OpenReview.net, 2017.
+Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
+Teodor Gabriel Crainic, Guido Perboli, and Roberto Tadei. Extreme point-based heuristics for three-dimensional bin packing. INFORMS J. Comput., 20(3):368-384, 2008. doi: 10.1287/ijoc.1070.0250.
+Teodor Gabriel Crainic, Guido Perboli, and Roberto Tadei. Ts2pack: A two-level tabu search for the three-dimensional bin packing problem. Eur. J. Oper. Res., 195(3):744-760, 2009. doi: 10.1016/j.ejor.2007.06.063.
+JL De Castro Silva, NY Soma, and N Maculan. A greedy search for the three-dimensional bin packing problem: the packing static stability case. International Transactions in Operational Research, 10(2):141-153, 2003.
+Lu Duan, Haoyuan Hu, Yu Qian, Yu Gong, Xiaodong Zhang, Jiangwen Wei, and Yinghui Xu. A multi-task selected learning approach for solving 3D flexible bin packing problem. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS '19, Montreal, QC, Canada, May 13-17, 2019, pp. 1386-1394. International Foundation for Autonomous Agents and Multiagent Systems, 2019.
+
+Oluf Faroe, David Pisinger, and Martin Zachariasen. Guided local search for the three-dimensional bin-packing problem. INFORMS J. Comput., 15(3):267-283, 2003. doi: 10.1287/ijoc.15.3.267.16080.
+M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pp. 729-734 vol. 2, 2005. doi: 10.1109/IJCNN.2005.1555942.
+Fatma Gzara, Samir Elhedhli, and Burak C. Yildiz. The pallet loading problem: Three-dimensional bin packing with practical constraints. Eur. J. Oper. Res., 287(3):1062-1074, 2020. doi: 10.1016/j.ejor.2020.04.053.
+Chi Trung Ha, Trung Thanh Nguyen, Lam Thu Bui, and Ran Wang. An online packing heuristic for the three-dimensional container loading problem in dynamic environments and the physical internet. In *Applications of Evolutionary Computation - 20th European Conference*, EvoApplications 2017, Amsterdam, The Netherlands, April 19-21, 2017, Proceedings, Part II, volume 10200 of Lecture Notes in Computer Science, pp. 140-155, 2017. doi: 10.1007/978-3-319-55792-2\_10. URL https://doi.org/10.1007/978-3-319-55792-2_10.
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 1856-1865. PMLR, 2018. URL http://proceedings.mlr.press/v80/haarnoja18b.html.
+Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross B. Girshick. Mask R-CNN. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 2980-2988. IEEE Computer Society, 2017. doi: 10.1109/ICCV.2017.322.
+Young-Dae Hong, Young-Joo Kim, and Ki-Baek Lee. Smart pack: Online autonomous object-packing system using RGB-D sensor data. Sensors, 20(16):4448, 2020. doi: 10.3390/s20164448.
+Haoyuan Hu, Xiaodong Zhang, Xiaowei Yan, Longfei Wang, and Yinghui Xu. Solving a new 3D bin packing problem with deep reinforcement learning method. CoRR, abs/1708.05930, 2017.
+Ruizhen Hu, Juzhan Xu, Bin Chen, Minglun Gong, Hao Zhang, and Hui Huang. Tap-net: transport-and-pack using reinforcement learning. ACM Trans. Graph., 39(6):232:1-232:15, 2020. doi: 10.1145/3414685.3417796.
+Kyungdaw Kang, Ilkyeong Moon, and Hongfeng Wang. A hybrid genetic algorithm with a new packing strategy for the three-dimensional bin packing problem. Appl. Math. Comput., 219(3): 1287-1299, 2012. doi: 10.1016/j.amc.2012.07.036.
+Korhan Karabulut and Mustafa Murat Inceoglu. A hybrid genetic algorithm for packing in 3d with deepest bottom left with fill method. In Advances in Information Systems, Third International Conference, ADVIS 2004, Izmir, Turkey, October 20-22, 2004, Proceedings, volume 3261 of Lecture Notes in Computer Science, pp. 441-450. Springer, 2004. doi: 10.1007/978-3-540-30198-1\45.
+Silvano Martello, David Pisinger, and Daniele Vigo. The three-dimensional bin packing problem. Oper. Res., 48(2):256-267, 2000. doi: 10.1287/opre.48.2.256.12386.
+James Martens and Roger B. Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp. 2408-2417. JMLR.org, 2015. URL http://proceedings.mlr.press/v37/martens15.html.
+Charles Ruizhongtai Qi, Hao Su, Kaichun Mo, and Leonidas J. Guibas. Pointnet: Deep learning on point sets for 3D classification and segmentation. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 77-85. IEEE Computer Society, 2017. doi: 10.1109/CVPR.2017.16.
+
+António Galrao Ramos, José Fernando Oliveira, and Manuel Pereira Lopes. A physical packing sequence algorithm for the container loading problem with static mechanical equilibrium conditions. Int. Trans. Oper. Res., 23(1-2):215-238, 2016. doi: 10.1111/itor.12124.
+Steven S. Seiden. On the online bin packing problem. J. ACM, 49(5):640-671, 2002. doi: 10.1145/585265.585269.
+Steven S Skiena. The stony brook algorithm repository. http://www.cs.sunysb.edu/algorithm/implement/nauty/implement.shtml, 1997.
+Matthijs TJ Spaan. Partially observable markov decision processes. In Reinforcement Learning, pp. 387-414. Springer, 2012.
+Matthew E. Taylor and Peter Stone. Transfer learning for reinforcement learning domains: A survey. J. Mach. Learn. Res., 10:1633-1685, 2009. URL https://dl.acm.org/citation.cfm?id=1755839.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998-6008, 2017.
+Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver; BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
+Richa Verma, Aniruddha Singhal, Harshad Khadilkar, Ansuma Basumatary, Siddharth Nayak, Harsh Vardhan Singh, Swagat Kumar, and Rajesh Sinha. A generalized reinforcement learning algorithm for online 3d bin-packing. CoRR, abs/2007.00463, 2020.
+Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 2692-2700, 2015.
+Fan Wang and Kris Hauser. Robot packing with known items and nondeterministic arrival order. In Robotics: Science and Systems XV, University of Freiburg, Freiburg im Breisgau, Germany, June 22-26, 2019, 2019a. doi: 10.15607/RSS.2019.XV.035.
+Fan Wang and Kris Hauser. Stable bin packing of non-convex 3D objects with a robot manipulator. In International Conference on Robotics and Automation, ICRA 2019, Montreal, QC, Canada, May 20-24, 2019, pp. 8698-8704. IEEE, 2019b. doi: 10.1109/ICRA.2019.8794049.
+Yuhuai Wu, Elman Mansimov, Roger B. Grosse, Shun Liao, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. 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. 5279-5288, 2017.
+Zifei Yang, Shuo Yang, Shuai Song, Wei Zhang, Ran Song, Jiyu Cheng, and Yibin Li. Packerbot: Variable-sized product packing with heuristic deep reinforcement learning. In IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2021, Prague, Czech Republic, September 27 - Oct. 1, 2021, pp. 5002-5008. IEEE, 2021. doi: 10.1109/IROS51168.2021.9635914.
+Jingwei Zhang, Bin Zi, and Xiaoyu Ge. Attend2pack: Bin packing through deep reinforcement learning with attention. CoRR, abs/2107.04333, 2021.
+Hang Zhao, Qijin She, Chenyang Zhu, Yin Yang, and Kai Xu. Online 3D bin packing with constrained deep reinforcement learning. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Virtual Event, February 2-9, 2021, pp. 741-749. AAAI Press, 2021.
+Hang Zhao, Chenyang Zhu, Xin Xu, Hui Huang, and Kai Xu. Learning practically feasible policies for online 3d bin packing. Science China Information Sciences, 65(1):1-17, 2022.
+
+In this appendix, we provide more details and statistical results of our PCT method. Our real-world packing demo is also submitted with the supplemental material.
+
+- Section A gives more descriptions about training methods, which include the implementation of the deep reinforcement learning method, specific GAT network designs for extracting problem features from PCT, and recommendations for finding suitable PCT length.
+- Section B elaborates the concept of the leaf node expansion schemes adopted for finding candidate placements in our method. Learning curves and the computational complexity analysis of these schemes are also provided in this section.
+- Section C reports more statistical results of our method, including further discussions on generalization ability, running costs, and scalability. The understanding of model behaviors, the visualized results, and details of our real-world packing system are also provided.
+
+# A IMPLEMENTATION DETAILS
+
+Deep Reinforcement Learning We formulate online 3D-BPP as Markov Decision Process and solve it with the deep reinforcement learning method. A DRL agent seeks for a policy $\pi$ to maximize the accumulated discounted reward:
+
+$$
+J (\pi) = E _ {\tau \sim \pi} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} R \left(s _ {t}, a _ {t}\right) \right] \tag {8}
+$$
+
+Where $\gamma \in [0,1]$ is the discount factor, and $\tau = (s_0,a_0,s_1,\ldots)$ is a trajectory sampled based on the policy $\pi$ . We extract the feature of state $s_t = (\mathcal{T}_t,n_t)$ using graph attention networks (Velickovic et al., 2018) for encoding the spatial relations of all space configuration nodes. The context feature is fed to two key components of our pipeline: an actor network and a critic network. The actor network, designed based on pointer mechanism, weighs the leaf nodes of PCT, which is written as $\pi (a_{t}|s_{t})$ . The action $a_{t}$ is an index of selected leaf node $l\in \mathbf{L}_t$ , denoted as $a_{t} = index(l)$ . The critic network maps the context feature into a state value prediction $V(s_{t})$ which helps the training of actor network. The whole network is trained via a composite loss $L = \alpha \cdot L_{actor} + \beta \cdot L_{critic}$ ( $\alpha = \beta = 1$ in our implementation), which consists of actor loss $L_{actor}$ and critic loss $L_{critic}$ . These two loss functions are defined as:
+
+$$
+\left\{ \begin{array}{l l} L _ {a c t o r} & = (r _ {t} + \gamma V (s _ {t + 1}) - V (s _ {t})) \log \pi (a _ {t} | s _ {t}) \\ L _ {c r i t i c} & = (r _ {t} + \gamma V (s _ {t + 1}) - V (s _ {t})) ^ {2} \end{array} \right. \tag {9}
+$$
+
+Where $r_t = c_r \cdot w_t$ is our reward signal and we set $\gamma$ as 1 since the packing episode is finite. We adopt a step-wise reward $r_t = c_r \cdot w_t$ once $n_t$ is inserted into PCT as an internal node successfully. Otherwise, $r_t = 0$ and the packing episode ends. The choice of item weight $w_t$ depends on the packing preferences. In the general sense, we set $w_t$ as the volume occupancy $v_t = s_n^x \cdot s_n^y \cdot s_n^z$ of $n_t$ , and the constant $c_r$ is $10 / (S^x \cdot S^y \cdot S^z)$ . For online 3D-BPP with additional packing constraints, this weight can be set as $w_t = \max(0, v_t - c \cdot O(s_t, a_t))$ . While term $v_t$ ensures that space utilization is still the primary concern, the objective function $O(s_t, a_t)$ guides the agent to satisfy additional constraints like isle friendliness and load balancing. We adopt ACKTR (Wu et al., 2017) method for training our DRL agent, which iteratively updates an actor and a critic using Kronecker-factored approximate curvature (K-FAC) (Martens & Grosse, 2015) with trust region. Zhao et al. (2021) have demonstrated that this method has a surprising superiority on online 3D packing problems over other model-free DRL algorithms like SAC (Haarnoja et al., 2018).
+
+Feature extraction Specifically, ACKTR runs multiple parallel processes (64 here) to interact with their respective environments and gather samples. The different processes may have different packing time step $t$ and deal with different packing sequences, the space configuration nodes number $N$ also changes. To combine these data with irregular shapes into one batch, we fulfill $\mathbf{B}_t$ and $\mathbf{L}_t$ to fixed lengths, 80 and $25 \cdot |\mathbf{O}|$ respectively, with dummy nodes. The descriptors for dummy nodes are all-zero vectors and have the same size as the internal nodes or the leaf nodes. The relation weight logs $u_{ij}$ of dummy node $j$ to arbitrary node $i$ is replaced with $-inf$ to eliminate these dummy nodes during the feature calculation of GAT. The global context feature $\bar{h}$ is aggregated only on the eligible nodes $h$ : $\bar{h} = \frac{1}{N} \sum_{i=1}^{N} h_i$ . All space configuration nodes are embedded by GAT as a fully connected graph as Figure 2(b), without any inner mask operation.
+
+We only provide the packable leaf nodes which satisfy placement constraints for DRL agents. For setting 2, we check in advance if a candidate placement satisfies Constraint 1 and 2. For setting 1 and setting 3 where the mass of item $n_t$ is $v_t$ and $\rho \cdot v_t$ respectively, we will additionally check if one placement meets the constraints of packing stability. Benefits from the fast stability estimation method proposed by Zhao et al. (2022), this pre-checking process can be completed in a very short time, and our DRL agent samples data at a frequency of more than 400 FPS.
+
+The node-wise MLPs $\phi_{\theta_B}, \phi_{\theta_L}$ , and $\phi_{\theta_n}$ used to embed raw space configuration nodes are two-layer linear networks with LeakyReLU activation function. $\phi_{FF}$ is a two-layer linear structure activated by ReLU. The feature dimensions $d_h, d_k$ , and $d_v$ are 64. The hyperparameter $c_{clip}$ used to control the range of clipped compatibility logits is set to 10 in our GAT implementation.
+
+Choice of PCT Length Since PCT allows discarding some valid leaf nodes and this will not harm our performance, we randomly intercept a subset $\mathbf{L}_{sub_t}$ from $\mathbf{L}_t$ if $|\mathbf{L}_t|$ exceeds a certain length. Determining the suitable PCT length for different bin configurations is important, we give our recommendations for finding this hyperparameter. For training, we find that the performance of learned policies is more sensitive to the number of allowed orientations $|\mathbf{O}|$ . Thus we set the PCT length as $c \cdot |\mathbf{O}|$ where $c$ can be determined by a grid search nearby $c = 25$ for different bin configurations. For our experiments, $c = 25$ works quite well. During the test, the PCT length can be different from the training one, we suggest searching this interception length with a validation dataset via a grid search which ranges from 50 to 300 with step length 10.
+
+# B LEAF NODE EXPANSION SCHEMES
+
+We introduce the leaf node expansion schemes adopted in our PCT implementation here. These schemes are used to incrementally calculate new candidate placements introduced by the just placed item $n_t$ . A good expansion scheme should reduce the number of solutions to be explored while not missing too many feasible packings. Meanwhile, polynomially computability is also expected. As shown in Figure 4, the policies guided by suitable leaf node expansion schemes outperform the policy trained on a full coordinate (FC) space in the whole training process. We extend three existing heuristic placement rules which have proven to be both accurate and efficient to our PCT expansion, i.e. Corner Point, Extreme Point, and Empty Maximal Space. Since all these schemes are related to boundary points of packed items, we combine the start/end points of $n_t$ with these boundary points as a superset, namely Event Point.
+
+
+Figure 4: Learning curves on setting 1. A good expansion scheme for PCT reduces the complexity and helps DRL methods for more efficient learning and better performance. EVF means the full EV leaf node set without an interception.
+
+**Corner Point Martello et al. (2000)** first introduce the concept of Corner Point (CP) for their branch-and-bound methods. Given 2D packed items in the $xoy$ plane, the corner points can be found where the envelope of the items in the bin changes from vertical to horizontal, as shown in Figure 5 (a). The past corner points which no longer meet this condition will be deleted. Extend this 2D situation to 3D cases, the new candidate 3D positions introduce by the just placed item $n_t$ are a subset of $\{(p_n^x + s_n^x, p_n^y, p_n^z), (p_n^x, p_n^y + s_n^y, p_n^z), (p_n^x, p_n^y, p_n^z + s_n^z)\}$ if the envelope of the corresponding 2D plane, i.e. $xoy, yoz$ , and $xoz$ , is changed by $n_t$ . The time complexity of finding 3D corner points incrementally is $O(c)$ with an easy-to-maintained bin height map data structure to detect the change of envelope on each plane, $c$ is a constant here.
+
+Extreme Point Crainic et al. (2008) extend the concept of Corner Point to Extreme Point (EP) and claim their method reaches the best offline performance of that era. Its insight is to provide the means to exploit the free space defined inside a packing by the shapes of the items that already exist. When the current item $n_t$ is added, new EPs are incrementally generated by projecting the coordinates $\{(p_n^x + s_n^x, p_n^y, p_n^z), (p_n^x, p_n^y + s_n^y, p_n^z), (p_n^x, p_n^y, p_n^z + s_n^y)\}$ on the orthogonal axes, e.g., project $(p_n^x + s_n^x, p_n^y, p_n^z)$ in the directions of the $y$ and $z$ axes to find intersections with all items lying between item $n_t$ and the boundary of the bin. The nearest intersection in the respective direction is an
+
+
+(a) CPs
+
+
+(b) EPs
+Figure 5: Full candidate positions generated by different PCT expansion schemes (all in $xoy$ plane). The gray dashed lines are the boundaries of the bin. Circles in (a) and (b) represent corner points and extreme points respectively. (c): The candidate positions (circles) introduced by different EMSs are rendered with different colors. All intersections of two dashed lines in (d) constitute event points.
+
+
+(c) EMSs
+
+
+(d) EVs
+
+extreme point. Since we stipulate a vertical top-down loading direction, the 3D extreme points in the strict sense may exist a large item blocking the loading direction. So we find the 2D extreme points (see Figure 5 (b)) in the $xoy$ plane and repeat this operation on each distinct $p^z$ value (i.e. start/end $z$ coordinate of a packed item) which satisfies $p_n^z \leq p^z \leq p_n^z + s_n^z$ . The time complexity of this method is $O(m \cdot |\mathbf{B}_{2D}|)$ , where $\mathbf{B}_{2D}$ is the packed items that exist in the corresponding $z$ plane and $m$ is the number of related $z$ scans.
+
+Empty Maximal Space Empty Maximal Spaces (EMSs) (Ha et al., 2017) are the largest empty orthogonal spaces whose sizes cannot extend more along the coordinate axes from its front-left-bottom (FLB) corner. This is a simple and effective placement rule. An EMS $e$ is presented by its FLB corner $(p_{e}^{x}, p_{e}^{y}, p_{e}^{z})$ and sizes $(s_{e}^{x}, s_{e}^{y}, s_{e}^{z})$ . When the current item $n_{t}$ is placed into $e$ on its FLB corner, this EMS is split into three smaller EMSs with positions $(p_{e}^{x} + s_{n}^{x}, p_{e}^{y}, p_{e}^{z}), (p_{e}^{x}, p_{e}^{y} + s_{n}^{y}, p_{e}^{z}), (p_{e}^{x}, p_{e}^{y}, s_{e}^{x})$ and sizes $(s_{e}^{x} - s_{n}^{x}, s_{e}^{y}, s_{e}^{z}), (s_{e}^{x}, s_{e}^{y} - s_{n}^{y}, s_{e}^{z}), (s_{e}^{x}, s_{e}^{y}, s_{e}^{z} - s_{n}^{z})$ , respectively. If the item $n_{t}$ only partially intersects with $e$ , we can apply a similar volume subtraction to the intersecting part for splitting $e$ . For each EMS, we define the left-up $(p_{e}^{x}, p_{e}^{y} + s_{e}^{y}, p_{e}^{z})$ , right-up $(p_{e}^{x} + s_{e}^{x}, p_{e}^{y}, s_{e}^{y})$ , left-bottom $(p_{e}^{x}, p_{e}^{y}, p_{e}^{z})$ , and right-bottom $(p_{e}^{x} + s_{e}^{x}, p_{e}^{y}, p_{e}^{z})$ corners of its vertical bottom as candidate positions, as shown in Figure 5 (c). These positions also need to be converted to the FLB corner coordinate for placing item $n_{t}$ . The left-up, right-up, left-bottom and right-bottom corners of $e$ should be converted to $(p_{e}^{x}, p_{e}^{y} + s_{e}^{y} - s_{n}^{y}, p_{e}^{z}), (p_{e}^{x} + s_{e}^{x} - s_{n}^{x}, p_{e}^{y} + s_{e}^{y} - s_{n}^{y}, p_{e}^{z}), (p_{e}^{x}, p_{e}^{y}, p_{e}^{z})$ , and $(p_{e}^{x} + s_{e}^{x} - s_{n}^{x}, p_{e}^{y}, p_{e}^{z})$ respectively. Since all EMSs $e \in \mathbf{E}$ in the bin needs to detect intersection with $n_t$ , the time complexity of finding 3D EMSs incrementally is $O(|\mathbf{E}|)$ . A 3D schematic diagram of PCT expansion guided by EMSs is provided in Figure 6.
+
+
+Figure 6: A 3D PCT expansion schematic diagram. This PCT grows under the guidance of the EMS expansion scheme. For simplicity, we only choose the bottom-right-up corners of each EMS as candidate positions and we set $|\mathbf{O}| = 1$ here.
+
+Event Point It's not difficult to find that all schemes mentioned above are related to boundary points of a packed item along $d \in \{x, y\}$ axes (we assume the initial empty bin is also a special packed item here). When the current item $n_t$ is packed, we update the existing PCT leaf nodes by scanning all distinct $p^z$ values which satisfy $p_n^z \leq p^z \leq p_n^z + s_n^z$ and combine the start/end points of $n_t$ with the boundary points that exist in this $z$ plane to get the superset (see Figure 5 (d)), which is called Event Points. The time complexity for detecting event points is $O(m \cdot |B_{2D}|^2)$ .
+
+# C MORE RESULTS
+
+In this section, we report more results of our method. Section C.1 further discusses the generalization ability of our method on disturbed item sampling distributions and unseen items. Section C.2 reports the running cost of each method. Section C.3 scales our method to a larger problem and reports the performance. Section C.4 visualizes packing sequences to analyze model behavior and more visualized results are provided in Section C.5. Section C.6 introduces our real-world packing system.
+
+# C.1 FURTHER DISCUSSIONS ON GENERALIZATION
+
+We have verified in Section 4.4 that our method has good generalization performance on item sampling distributions different from the training one. Now we further analyze the generalization ability of our method. Firstly, we demonstrate that our algorithm has a good generalization performance on disturbed item sampling distributions. We conduct this experiment in the discrete setting where the item set is finite $(|\mathcal{I}| = 125)$ . For each item $i \in \mathcal{I}$ , we add a random non-zero disturbance $\delta_i$ on its original sample probability $p_i$ , e.g., $p_i = p_i \cdot (1 - \delta_i)$ . We normalize the disturbed $p_i$ as the final item sampling probability. Note that $\delta_i$ is fixed during sampling one complete sequence. The state transition of DRL $\mathcal{P}(s_{t+1} | s_t)$ which is partly determined by the probabilities of sampling items will be different from the training transition where the uniform distribution sample items with equal probabilities. Generalizing to a new transition is a classic challenge for reinforcement learning (Taylor & Stone, 2009). We test different ranges of $\delta_i$ and the results are summarized in Table 6.
+
+Table 6: Transfer the best-performing PCT policies directly to the disturbed item sampling distributions. Dif. means how much the generalization performance drops from the undisturbed case ( $\delta_i = 0$ ).
+
+| Disturbance | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Var. | Num. | Dif. | Uti. | Var. | Num. | Dif. | Uti. | Var. | Num. | Dif. |
| δi=0 | 76.0% | 4.2 | 29.4 | 0.0% | 86.0% | 1.9 | 33.0 | 0.0% | 75.7% | 4.6 | 29.2 | 0.0% |
| δi∈[−20%,20%] | 75.6% | 4.6 | 29.1 | 0.5% | 85.7% | 2.1 | 32.8 | 0.3% | 75.3% | 4.5 | 29.0 | 0.5% |
| δi∈[−40%,40%] | 75.5% | 4.5 | 29.0 | 0.7% | 85.6% | 2.1 | 32.8 | 0.5% | 75.6% | 4.8 | 29.3 | 0.1% |
| δi∈[−60%,60%] | 75.5% | 4.3 | 28.9 | 0.7% | 85.8% | 2.1 | 32.8 | 0.2% | 75.5% | 4.8 | 28.9 | 0.3% |
| δi∈[−80%,80%] | 75.7% | 4.5 | 29.2 | 0.4% | 85.6% | 2.2 | 32.9 | 0.5% | 75.4% | 4.9 | 29.3 | 0.4% |
| δi∈[−100%,100%] | 75.8% | 4.4 | 29.0 | 0.3% | 85.5% | 2.2 | 32.6 | 0.6% | 75.3% | 4.7 | 29.3 | 0.5% |
+
+Benefits from the efficient guidance of heuristic leaf node expansion schemes, our method maintains its performance under various amplitude disturbances. Our method even behaves well with a strong disturbance $\delta_{i}\in [-100\%, 100\%]$ applied, which means some items may never be sampled by some distributions when $\delta_{i} = 1$ and $p_i\cdot (1 - \delta_i) = 0$ in a specific sequence.
+
+Beyond experiments on generalization to disturbed distributions, we also test our method with unseen items. We conduct this experiment in the discrete setting. We randomly delete 25 items from $\mathcal{I}$ and train PCT policies with $|\mathcal{I}_{sub}| = 100$ . Then we test the trained policies on full $\mathcal{I}$ . See Table 7 for results. Our method still performs well on datasets where unseen items exist regarding all settings.
+
+Table 7: Generalization performance on unseen items. All policies are trained with the EV scheme.
+
+| Train | Test | Setting 1 | Setting 2 | Setting 3 |
| Uti. | Var. | Num. | Uti. | Var. | Num. | Uti. | Var. | Num. |
| |I|=125 | |I|=125 | 76.0% | 4.2 | 29.4 | 85.3% | 2.1 | 32.8 | 75.7% | 4.6 | 29.2 |
| Isub|=100 | Isub|=100 | 74.4% | 5.1 | 29.4 | 86.3% | 1.7 | 33.8 | 74.2% | 4.7 | 29.3 |
| Isub|=100 | I|=125 | 74.6% | 5.4 | 28.9 | 85.6% | 2.6 | 33.0 | 74.4% | 5.2 | 28.8 |
+
+# C.2 RUNNING COSTS
+
+For 3D-BPP of online needs, the running cost for placing each item is especially important. We count the running costs of the experiments in Section 4.1 and Section 4.3 and summarize them in Table 8. Each running cost at time step $t$ is counted from putting down the previous item $n_{t-1}$ until the current item $n_t$ is placed, which includes the time to make placement decisions, the time to check placement feasibility, and the time to interact with the packing environment. The running cost of our method is comparable to most baselines. Our method can meet real-time packing requirements in both discrete solution space and continuous solution space.
+
+Table 8: Running costs (seconds) tested on online 3D-BPP with discrete solution space (Section 4.1) and continuous solution space (Section 4.3). The running costs of the latter are usually more expensive since checking Constraint 1 and 2 in the continuous domain is more time-consuming.
+
+| Method | Setting 1 | Setting 2 | Setting 3 |
| Discrete | Continuous | Discrete | Continuous | Discrete | Continuous |
| Heuristic | Random | 4.59 × 10-2 | - | 2.03 × 10-2 | - | 4.62 × 10-2 | - |
| Wang & Hauser | 4.76 × 10-2 | - | 3.01 × 10-2 | - | 4.55 × 10-2 | - |
| DBL | 5.58 × 10-2 | - | 1.87 × 10-2 | - | 5.44 × 10-2 | - |
| BR | 1.50 × 10-2 | 1.69 × 10-2 | 1.74 × 10-2 | 1.76 × 10-2 | 1.42 × 10-2 | 1.62 × 10-2 |
| Ha et al. | 5.89 × 10-3 | 1.48 × 10-2 | 3.39 × 10-3 | 7.17 × 10-3 | 4.86 × 10-3 | 1.38 × 10-2 |
| LSAH | 1.22 × 10-2 | 1.44 × 10-2 | 4.98 × 10-3 | 7.02 × 10-3 | 1.14 × 10-2 | 1.33 × 10-2 |
| MACS | 2.68 × 10-2 | - | 3.00 × 10-2 | - | 2.79 × 10-2 | - |
| DRL | Zhao et al. | 5.51 × 10-2 | - | 1.33 × 10-2 | - | 3.31 × 10-2 | - |
| PCT & CP | 8.43 × 10-3 | 1.61 × 10-2 | 7.36 × 10-3 | 1.52 × 10-2 | 8.79 × 10-3 | 1.73 × 10-2 |
| PCT & EP | 1.22 × 10-2 | 3.73 × 10-2 | 1.13 × 10-2 | 1.57 × 10-2 | 1.25 × 10-2 | 3.65 × 10-2 |
| PCT & EMS | 1.77 × 10-2 | 4.11 × 10-2 | 9.49 × 10-3 | 2.36 × 10-2 | 1.80 × 10-2 | 3.08 × 10-2 |
| PCT & EV | 2.66 × 10-2 | 4.46 × 10-2 | 1.25 × 10-2 | 3.21 × 10-2 | 2.61 × 10-2 | 4.38 × 10-2 |
+
+# C.3 SCALABILITY
+
+The number of PCT nodes changes constantly with the generation and removal of leaf nodes during the packing process. To verify whether our method can solve packing problems with a larger scale $|\mathbf{B}|$ , we conduct a stress test on setting 2 where the most orientations are allowed and the most leaf nodes are generated. We limit the maximum item sizes $s^d$ to $S^d /5$ so that more items can be accommodated. We transfer the best-performing policies on setting 2 (trained with EMS) to these new datasets without any fine-tuning. The results are summarized in Table 9.
+
+Table 9: Scalability on larger packing problems. $|\mathbf{L}|$ is the average number of leaf nodes per step. Run is the running cost. $|\mathbf{L}|$ will not increase exponentially with $|\mathbf{B}|$ since invalid leaf nodes will be removed.
+
+| Item sizes | Discrete | Continuous |
| |B| | |L| | Uti. | Run. | |L|/|B| | |B| | |L| | Uti. | Run. | |L|/|B| |
| [Sd/10, Sd/2] | 33.0 | 51.5 | 86.0% | 9.5 × 10-2 | 1.6 | 27.0 | 197.5 | 66.3% | 2.4 × 10-2 | 7.3 |
| [Sd/10, Sd/5] | 241.3 | 67.2 | 81.3% | 9.8 × 10-3 | 0.3 | 185.4 | 956.5 | 61.9% | 3.7 × 10-2 | 5.2 |
+
+PCT size will not grow exponentially with packing scale $|\mathbf{B}|$ since invalid leaf nodes will be removed from leaf nodes $\mathbf{L}$ during the packing process, both discrete and continuous cases. For continuous cases, $|\mathbf{L}|$ is more sensitive to $|\mathbf{B}|$ due to the diversity of item sizes (i.e. $|\mathcal{I}| = \infty$ ), however, $|\mathbf{L}|$ still doesn't explode with $|\mathbf{B}|$ and it grows in a sub-linear way. Our method can execute packing decisions at a real-time speed with controllable PCT sizes even if the item scale is around two hundred.
+
+# C.4 UNDERSTANDING OF MODEL BEHAVIORS
+
+The qualitative understanding of model behaviors is important, especially for practical concerns. We visualize our packing sequences to give our analysis. The behaviors of learned models differ with the packing constraints. If there is no specific packing preference, our learned policies will start packing nearby a fixed corner (Figure 7 (a)). The learned policies tend to combine items of different heights together to form a plane for supporting future ones (Figure 7 (b)). Meanwhile, it prefers to assign little items to gaps and make room (Figure 7 (c)) for future large ones (Figure 7 (d)). If additional packing preference is considered, the learned policies behave differently. For online 3D-BPP with load balancing, the model will keep the maximum height in the bin as low as possible and pack items layer by layer (Figure 7(e)). For online 3D-BPP with isle friendliness, our model tends to pack the same category of items nearby the same bin corner (Figure 7 (f)).
+
+# C.5 VISUALIZED RESULTS
+
+We visualize the experimental results of Section 4.1 in Figure 8. Each plot is about a randomly generated item sequence packed by our best-performing policies (PCT & EV on setting 1 and setting 3, PCT & EMS on setting 2).
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+
+
+Figure 7: (a)~(d): Different packing stages of the same sequence. The learned policies assign little items (colored in blue) to gaps and save room for future uncertainty. (e): Online 3D-BPP where load balancing is considered. (f): Online 3D-BPP with isle-friendliness, different color means different item categories.
+Figure 8: Visualized results of our method.
+
+# C.6 REAL-WORLD PACKING SYSTEM
+
+We follow the online autonomous bin packing system implementation of Zhao et al. (2022) in a logistics warehouse to validate our PCT method. As shown in Figure 9, the conveyor belt transports items to the robot arm (STEP®SR20E) at a fixed speed. The on-conveyor RGB-D camera (PhoXi 3D Scanner XL) recognizes the size and location of the current item. This information is sent to the robot arm for picking the current item and our PCT model for the placement decision. We align the bin coordinate with the robot coordinate and transform the packing decision to a real-world position. Then the robot arm places the current item into the bin which is a table trolley with sizes $S^x = 110cm$ , $S^y = 90cm$ , and $S^z = 80cm$ . We record sizes and positions of packed items as descriptors of internal nodes B.
+
+
+Figure 9: Our packing system. The on-conveyor camera detects packing targets. The on-bin camera monitors possible drifts of packed items.
+
+Different from the original implementation of Zhao et al. (2022) where only one on-conveyor camera is used for detecting the target item to be packed, we add one more on-bin RGB-D camera and adopt Mask R-CNN (He et al., 2017) for instance segmentation of input depth image, for monitoring possible drift of packed items. If a packed item deviates from the position of the PCT decision and this drift is detected, we will correct the descriptor of the corresponding internal node $b \in \mathbf{B}$ with the offset position. We use items with $s^x$ and $s^y$ ranging from 20cm to 40cm, and $s^z$ ranging from 10cm to 25cm. We fill items with paddings of the same density and train PCT policies on setting 1 with the EV scheme and the load balancing constraint. We test our system with 50 random sequences and our method achieves 78.6% space utilization with 50.9 items packed. Our real-world packing video demo is also submitted with the supplemental material.
\ No newline at end of file
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/images.zip b/learningefficientonline3dbinpackingonpackingconfigurationtrees/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e1adb0353bcb0d0bfbaac9b65e03ef21f48362c8
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:531efef2b946e741d467e43a32c24d11b9fd77b16fbab3de79a56da8db5ab04c
+size 957900
diff --git a/learningefficientonline3dbinpackingonpackingconfigurationtrees/layout.json b/learningefficientonline3dbinpackingonpackingconfigurationtrees/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..56ca40660930f682dba25cabcaf62cad906b6368
--- /dev/null
+++ b/learningefficientonline3dbinpackingonpackingconfigurationtrees/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0a1c4cebba83aff5b39bcb40e8cda7d5b5f91685d3b83f2ddebf627e4e393f3a
+size 741371
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_content_list.json b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..71e2f42318c254c63127abd0e8b6e19b923a07db
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae59a3f6c59e3907106b100129ff6b8292d7c25f41d18e80728f1050e7a1cb56
+size 117578
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_model.json b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0253aec9df075edf87ff55c7a5f3d8ea59d1427f
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0973a935bb8f22543fc4c053c36dd0d6af7f0d4c85b8acee8afda9222787019b
+size 136813
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_origin.pdf b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f7a42d201e7647cb8b894b91fbecb857f8e17623
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/4874f68e-8187-47da-b665-ef5dfd5a49db_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:89c8d653fc37a80ed6b1eb29651f841082413bb63f3acf4f77b9150758e28644
+size 615597
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/full.md b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..9911971747394dd0ebd4b5d65e6803aa1b3d7f1d
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/full.md
@@ -0,0 +1,363 @@
+# LEARNING FAST, LEARNING SLOW: A GENERAL CONTINUAL LEARNING METHOD BASED ON COMPLEMENTARY LEARNING SYSTEM
+
+Elahe Arani*, Fahad Sarfraz* & Bahram Zonooz
+
+Advanced Research Lab, NavInfo Europe, Eindhoven, Netherlands
+
+{elahe.arani, fahad.sarfraz}@navinfo.eu, bahram.zonooz@gmail.com
+
+# ABSTRACT
+
+Humans excel at continually learning from an ever-changing environment whereas it remains a challenge for deep neural networks which exhibit catastrophic forgetting. The complementary learning system (CLS) theory suggests that the interplay between rapid instance-based learning and slow structured learning in the brain is crucial for accumulating and retaining knowledge. Here, we propose CLS-ER, a novel dual memory experience replay (ER) method which maintains short-term and long-term semantic memories that interact with the episodic memory. Our method employs an effective replay mechanism whereby new knowledge is acquired while aligning the decision boundaries with the semantic memories. CLS-ER does not utilize the task boundaries or make any assumption about the distribution of the data which makes it versatile and suited for "general continual learning". Our approach achieves state-of-the-art performance on standard benchmarks as well as more realistic general continual learning settings.
+
+# 1 INTRODUCTION
+
+Continual learning (CL) refers to the ability of a learning agent to continuously interact with a dynamic environment and process a stream of information to acquire new knowledge while consolidating and retaining previously obtained knowledge (Parisi et al., 2019). This ability to continuously learn from a changing environment is a hallmark of intelligence and a critical missing component in our quest towards making our models truly intelligent. The major challenge towards enabling CL in deep neural networks (DNNs) is that the continual acquisition of incrementally available information from non-stationary data distributions leads to catastrophic forgetting whereby the performance of the model on previously learned tasks drops drastically (McCloskey & Cohen, 1989).
+
+Several approaches have been proposed to address the issue of catastrophic forgetting in CL. These can be broadly categorized into regularization-based methods (Farajtabar et al., 2020; Kirkpatrick et al., 2017; Ritter et al., 2018; Zenke et al., 2017) which penalizes changes in the network weights, network expansion-based methods (Rusu et al., 2016; Yoon et al., 2017) which dedicate a distinct set of network parameters to distinct tasks, and rehearsal-based methods (Chaudhry et al., 2018; Lopez-Paz & Ranzato, 2017) which maintains a memory buffer and replays samples from previous tasks. Amongst these, rehearsal-based methods have proven to be more effective in challenging CL tasks (Farquhar & Gal, 2018). However, an optimal approach for replaying memory samples and constraining the model update to efficiently consolidate knowledge remains an open question.
+
+In the brain, the ability to continually acquire, consolidate, and transfer knowledge over time is mediated by a rich set of neurophysiological processing principles (Parisi et al., 2019; Zenke et al., 2017) and multiple memory systems (Hassabis et al., 2017). In particular, the CLS theory (Kumaran et al., 2016) posits that efficient learning requires two complementary learning systems: the hippocampus exhibits short-term adaptation and rapid learning of episodic information which is then gradually consolidated to the neocortex for slow learning of structured information. Furthermore, a recent study by Hayes et al. (2021) identified the missing elements of biological reply in the replay
+
+
+Figure 1: CLS-ER employs a dual-memory learning mechanism whereby the episodic memory stores the samples and the semantic memories build short-term and long-term memories of the learned representations of the working model. The two memories interact to enforce a consistency loss on the working model which prevents rapid changes in the parameter space and enables the alignment of the decision boundary with semantic memories for effective knowledge consolidation.
+
+mechanisms employed in DNNs for CL. They highlight that many existing approaches only focus on modeling the prefrontal cortex directly and do not have a fast learning network which plays a critical role in enabling efficient CL in the brain. Inspired by these studies, we hypothesize that mimicking the slow and rapid adaptation of information and having an efficient mechanism for incorporating them into the working memory can enable better CL in DNNs.
+
+To this end, we propose a novel dual memory experience replay method based on the complementary learning systems theory in the brain, dubbed as CLS-ER. In addition to a small episodic memory, our method builds long-term and short-term semantic memories which mimic the rapid and slow adaptation of information (Figure 1). As the network weights encode the learned representations of the tasks (Krishnan et al., 2019), the semantic memories are maintained by taking the exponential moving average of the working model's weights to consolidate information across the tasks with varying time windows and frequencies. The semantic memories interact with the episodic memory to extract consolidated replay activation patterns and enforce a consistency loss on the update of the working model so that new knowledge is acquired while aligning the decision boundary of the working model with the decision boundaries of semantic memories. This maintains a balance between the plasticity and stability of the model for effective knowledge consolidation.
+
+CLS-ER provides a general CL method that does not utilize the task boundaries or make any strong assumption regarding the distribution of the data and tasks. We demonstrate the versatility and effectiveness of our method on a wide range of CL benchmark tasks as well as more challenging scenarios which simulate the complexities of CL in the real world.
+
+# 2 RELATED WORK
+
+The base method for the rehearsal-based approach, Experience Replay (ER) (Riemer et al., 2018) combines the memory samples with the task samples into the training batch. Several techniques have since been employed on top of ER. Meta Experience Replay (MER) (Riemer et al., 2018) considers replay as a meta-learning problem for maximizing the transfer from previous tasks and minimizing the interference. iCARL (Rebuffi et al., 2017) uses the nearest average representation of past exemplars to classify in an incrementally learned representation space. Gradient Episodic Memory (GEM) (Lopez-Paz & Ranzato, 2017) formulates optimization constraints on the exemplars in memory. Gradient-based Sample Selection (GSS) (Aljundi et al., 2019) aims for memory sample diversity in the gradient space and provides a greedy selection approach. Function Distance Regularization (FDR) (Benjamin et al., 2018) saves the network response at the task boundaries and adds a consistency loss on top of ER. Dark Experience Replay (DER++) applies knowledge distillation (Sarfraz et al., 2021) and regularization on logits sampled during the optimization trajectory.
+
+CLS has been used as a source of inspiration for dual memory learning systems in earlier works (French, 1999; Robins, 1993) but they have not been shown to scale to current computer vision tasks (Parisi et al., 2019). Recently, Rostami et al. (2019) utilizes a generative model to couple sequential tasks in a latent embedding space. Kamra et al. (2017) utilizes two generative models
+
+
+Figure 2: Task-wise performance on S-CIFAR-10 test set with 500 buffer size. The models are evaluated at the end of each task (y-axis) to evaluate how the task performances (x-axis) are affected as training progress. The stable model retains information from earlier tasks while the plastic model quickly adapts to the recent task. Note that there is less forgetting in the semantic memories compared to the working model. For other buffer sizes and S-TinyImageNet see Figures S1 and S2.
+
+
+
+
+
+in a dual memory architecture. However, they utilize the task boundaries and generative replay has its own set of challenges as it is difficult to learn a faithful distribution and performs sub-par in comparison to instance-based replay methods on challenging CL settings. Generally, the inspiration from CLS theory in DNNs has been mostly limited to episodic memory and mimicking the rapid and slow learning mechanism is majorly ignored (Hayes et al., 2021) which we aim to address.
+
+# 3 METHOD
+
+We first provide an overview of the CLS theory for the brain and how we aim to mimic it for DNNs before introducing the main components of our method and the overall formulation.
+
+# 3.1 COMPLEMENTARY LEARNING SYSTEM THEORY
+
+The CLS theory posits that effective lifelong learning in the brain requires two complementary learning systems. The hippocampus rapidly encodes novel information as a short-term memory which is subsequently used to transfer and consolidate knowledge in the neocortex which gradually acquires structured knowledge representation as long-term memory through experience replay. The interplay between the functionality of the hippocampus and neocortex is crucial for concurrently learning efficient representations (for better generalization) and the specifics of instance-based episodic memory.
+
+# 3.2 COMPLEMENTARY LEARNING SYSTEM BASED EXPERIENCES REPLAY
+
+Inspired by the CLS theory, we propose a dual memory experience replay method, CLS-ER, which aims to mimic the interplay between fast learning and slow learning mechanisms for enabling effective CL in DNNs. Our method maintains short-term and long-term semantic memories of the encountered tasks which interact with the episodic memory for replaying the associated neural activities. The working model is updated so that it acquires new knowledge while aligning its decision boundary with the semantic memories to enable the consolidation of structured knowledge across the tasks. Figure 1 highlights the parallels between CLS theory and our method.
+
+Semantic Memories: Central to our method is the maintenance of two semantic memories which accumulate and consolidate information over long-term and short-term periods. As the acquired knowledge of the learned tasks is encoded in the weights of DNNs (Krishnan et al., 2019), we aim to form our semantic memories by accumulating the knowledge encoded in the corresponding weights of the model as it sequentially learns different tasks.
+
+An efficient method for aggregating the weights of a model is provided by Mean Teacher (Tarvainen & Valpola, 2017) which is a knowledge distillation approach that uses an exponential moving average (EMA) of the student's weights during training as a teacher for semi-supervised learning. It can also be considered as forming a self-ensemble of the intermediate model states that leads to better
+
+internal representations. We adapt the Mean Teacher approach to build our semantic memories as it provides a computational and memory-efficient method for accumulating knowledge over the tasks.
+
+As CL involves learning tasks sequentially, the model weights at each training step can be considered as a student model specialized for a particular task. Therefore, averaging the weights during training can be considered as forming an ensemble of task-specific student models which effectively aggregates information across the tasks and leads to smoother decision boundaries. CLS-ER builds long-term (stable model) and short-term (plastic model) semantic memories by maintaining two EMA-weighted models over the working model's weights. The stable model is updated less frequently with a larger window size so that it retains more information from the earlier tasks while the plastic model is updated more frequently with a smaller window size so that it adapts faster to information from new tasks (Figure 2). Section D further demonstrates the benefits of employing two semantic memories instead of a single semantic memory.
+
+Episodic Memory: Replay of samples from the previous tasks stored in a small episodic memory is a common approach in CL that has proven to be effective in mitigating catastrophic forgetting. As we aim to position CLS-ER as a versatile general incremental learning method, we do not utilize the task boundaries or make any strong assumptions about the distribution of the tasks or samples. Therefore, to maintain a fixed episodic memory buffer, we employ Reservoir sampling (Vitter, 1985) which assigns equal probability to each sample in the stream for being represented in the buffer and randomly replaces the existing memory samples (Algorithm 2). It is a global distribution matching strategy that ensures that at any given time the distribution of samples in the buffer will approximately match the distribution of all the samples seen so far (Isele & Cosgun, 2018).
+
+Consolidation of Information: The key challenge in CL is the consolidation of new information with the previously acquired information. This requires an effective balance between the stability and plasticity of the model. Furthermore, the sharp change in decision boundary as a new task is learned makes the consolidation of information over tasks more challenging. CLS-ER tackles these challenges through a novel dual memory experience replay mechanism. The long-term and short-term semantic memories interact with the episodic memory to extract the consolidated activations for the memory samples which are then utilized to constrain the update of the working model so that new knowledge is obtained whilst the decision boundary is aligned with the semantic memories. This prevents rapid changes in the parameter space as new tasks are learned. Furthermore, aligning the working model's decision boundary with the semantic memories serves two goals: (i) helps in retaining and consolidating information and (ii) leads to a smoother adaptation of decision boundary.
+
+# 3.3 FORMULATION
+
+CLS-ER involves training a working model $f(:, \theta_w)$ on a data stream $\mathcal{D}$ sampled from a non-iid distribution. Two additional EMA-weighted models are maintained as semantic memories: plastic model $f(:, \theta_P)$ and the stable model $f(:, \theta_S)$ . Finally, Reservoir sampling (Vitter, 1985) is employed to maintain a small episodic memory $\mathcal{M}$ .
+
+At each training step, the working model receives the training batch $X_{b}$ from the data stream and retrieves a random batch of exemplars $X_{m}$ from the episodic memory. This is then followed by the retrieval of optimal semantic information, i.e. the structural knowledge encoded in the semantic memories which account for the consolidation of feature space and adaptation of the decision boundaries of the previous tasks. The semantic memories are designed so that the plastic model has higher performance on recent tasks whereas the stable model prioritizes retaining information on the older tasks. Therefore, we would prefer to use the logits from the stable model $Z_{S}$ for older exemplars and the plastic model $Z_{P}$ for recent exemplars. As CLS-ER is a general incremental learning method, instead of using a hard threshold or task information, we opt for a simple task-agnostic approach of using the performance of the semantic memories on the exemplars as a selection criterion that empirically works well. For each exemplar, we select the replay logits $Z$ based on which model has the highest softmax score for the ground-truth class (lines 5-6 in Algorithm 1).
+
+The selected replay logits from the semantic memories are then used to enforce a consistency loss on the working model so that it does not deviate from the already learned experiences. Hence, the working model is updated with a combination of the cross-entropy loss on the union of the data stream and episodic memory samples, $X$ , and the consistency loss on the exemplars $X_{m}$
+
+$$
+\mathcal {L} = \mathcal {L} _ {C E} (\sigma (f (X; \theta_ {W})), Y) + \lambda \mathcal {L} _ {M S E} (f (X _ {m}; \theta_ {W}), Z) \tag {1}
+$$
+
+Algorithm 1 Complementary Learning System-Experience Replay Algorithm
+Input: Data stream $\mathcal{D}$ , Learning rate $\eta$ Consistency weight $\lambda$ , Update rates $r_P$ and $r_S$ , Decay parameters $\alpha_{P}$ and $\alpha_{S}$ Initialize: $\theta_W = \theta_P = \theta_S$ $\mathcal{M}\gets \{\}$
+1: while Training do
+2: $(X_b,Y_b)\sim \mathcal{D}$ and $(X_m,Y_m)\sim \mathcal{M}$
+3: $(X,Y) = \{(X_b,Y_b),(X_m,Y_m)\}$
+4: $Z_{P},Z_{S}\gets f(X_{m};\theta_{P}),f(X_{m};\theta_{S})$ Select optimal semantic memory
+5: $Z\gets Z_P$ if $\sigma (Z_P)^{(Y_m)} > \sigma (Z_S)^{(Y_m)}$ else $Z_{S}$
+6: $\mathcal{L} = \mathcal{L}_{CE}(\sigma (f(X;\theta_W)),Y) + \lambda \mathcal{L}_{MSE}(f(X_m;\theta_W),Z)$ Update working model
+7: $\theta_W\gets \theta_W - \eta \nabla_{\theta_W}\mathcal{L}$
+8: $a,b\sim \mathcal{U}(0,1)$ Update semantic memories
+9: $\theta_P\gets \alpha_p\theta_P + (1 - \alpha_P)\theta_W$ if $a < r_P$ else $\theta_P$
+10: $\theta_S\gets \alpha_S\theta_S + (1 - \alpha_S)\theta_W$ if $b < r_S$ else $\theta_S$
+11: $\mathcal{M}\gets Reservoir(\mathcal{M},(X_b,Y_b))$ Update episodic memory (Algorithm 2) return $\theta_W,\theta_P,\theta_S$
+
+where $\sigma$ is the softmax function, $\lambda$ the regularization parameter, and $\mathcal{L}_{MSE}$ the mean squared error loss used as consistency term.
+
+After updating the working model, we stochastically update the plastic and stable models with rates $r_P$ and $r_S$ (note that $r_P > r_S$ so that the plastic model is updated more frequently). A stochastic rather than a deterministic approach is more biologically plausible (Maass, 2014; Arani et al., 2021) which reduces the overlap in the snapshots of the working model and leads to more diversity in semantic memories. The semantic memories are updated by taking an exponential moving average of the working model's weights (Tarvainen & Valpola, 2017) with decay parameters $\alpha_P$ and $\alpha_S$ ,
+
+$$
+\theta_ {i} = \alpha_ {i} \theta_ {i} + (1 - \alpha_ {i}) \theta_ {W}, \quad i \in \{P, S \} \tag {2}
+$$
+
+Note that $\alpha_{P} \leq \alpha_{S}$ so that the plastic model mimics the rapid adaptation of information while the stable model mimics slow acquisition of structured knowledge. See Algorithm 1 for more details.
+
+For inference, we use the stable model as it retains long-term memory across the tasks, consolidates structural knowledge, and learns efficient representations for generalization (Figure 1).
+
+# 4 EXPERIMENTAL SETUP
+
+To ensure a fair comparison of different CL methods under uniform experimental settings, we extended the Mammoth framework (Buzzega et al., 2020a) and unless stated otherwise, we follow the same training scheme (learning rate, batch sizes of incoming data and memory buffer, and the number of training epochs) as them for each of the evaluation settings. To find the optimal hyperparameters for CLS-ER, we run a grid search over $\lambda$ , $\alpha_{S}$ , $\alpha_{P}$ , $r_{S}$ , and $r_{P}$ on a small validation set. Sections C.4 and E show that our method is not highly sensitive to the particular choice of hyperparameters and different settings can attain similar performance. Also, because of the complementary nature of the components, we can often fix a set of parameters (e.g. $\lambda$ , $\alpha_{S}$ , $\alpha_{P}$ and $r_{S}$ ) and only finetune the remaining parameters (e.g. $r_{P}$ ) which facilitates hyperparameter tuning significantly.
+
+Following Buzzega et al. (2020a), we employ a fully connected network with two hidden layers, each with 100 ReLU units on all the variants of the MNIST dataset and ResNet-18 (He et al., 2015) without pretraining for the other datasets. In all the settings, we use the SGD optimizer. We use random horizontal flip and random crop on both the stream and buffer samples for S-CIFAR-10, S-Tiny-ImageNet, and GCIL-CIFAR-100. The selected hyperparameters for each of the settings are provided in Table S4. Note that for the vast majority of datasets, we use uniform settings (lr, epochs, batch size, memory batch size, and lambda) across different buffer sizes and only slight modifications in the other hyperparameters which shows that our method does not require extensive finetuning for different memory budgets. For each of our experiments, we fix the order of the classes and report the average and one standard deviation of the mean test accuracy of all the tasks across 10 runs with different initializations. Section E provides further training and implementation details.
+
+| Buffer | Method | Class-IL | Domain-IL |
| S-MNIST | S-CIFAR-10 | S-Tiny-ImageNet | R-MNIST | P-MNIST |
| - | JOINT | 95.57±0.24 | 92.20±0.15 | 59.99±0.19 | 95.76±0.04 | 94.33±0.17 |
| SGD | 19.60±0.04 | 19.62±0.05 | 7.92±0.26 | 67.66±8.53 | 40.70±2.33 |
| 200 | ER | 80.43±1.89 | 44.79±1.86 | 8.49±0.16 | 85.01±1.90 | 72.37±0.87 |
| GEM | 80.11±1.54 | 25.54±0.76 | - | 80.80±1.15 | 66.93±1.25 |
| iCaRL | 70.51±0.53 | 49.02±3.20 | 7.53±0.79 | - | - |
| FDR | 79.43±3.26 | 30.91±2.74 | 8.70±0.19 | 85.22±3.35 | 74.77±0.83 |
| GSS | 38.92±2.49 | 39.07±5.59 | - | 79.50±0.41 | 63.72±0.70 |
| DER++ | 85.61±1.40 | 64.88±1.17 | 10.96±1.17 | 90.43±1.87 | 83.58±0.59 |
| CLS-ER | 89.54±0.21 | 66.19±0.75 | 23.47±0.80 | 92.26±0.18 | 84.63±0.40 |
| 500 | ER | 86.12±1.89 | 57.74±0.27 | 9.99±0.29 | 88.91±1.44 | 80.60±0.86 |
| GEM | 85.99±1.35 | 26.20±1.26 | - | 81.15±1.98 | 76.88±0.52 |
| iCaRL | 70.10±1.08 | 47.55±3.95 | 9.38±1.53 | - | - |
| FDR | 85.87±4.04 | 28.71±3.23 | 10.54±0.21 | 89.67±1.63 | 83.18±0.53 |
| GSS | 49.76±4.73 | 49.73±4.78 | - | 81.58±0.58 | 76.00±0.87 |
| DER++ | 91.00±1.49 | 72.70±1.36 | 19.38±1.41 | 92.77±1.05 | 88.21±0.39 |
| CLS-ER | 92.05±0.32 | 75.22±0.71 | 31.03±0.56 | 94.06±0.07 | 88.30±0.14 |
| 5120 | ER | 93.40±1.29 | 82.47±0.52 | 27.40±0.31 | 93.45±0.56 | 89.90±0.13 |
| GEM | 95.11±0.87 | 25.26±3.46 | - | 88.57±0.40 | 87.42±0.95 |
| iCaRL | 70.60±1.03 | 55.07±1.55 | 14.08±1.92 | - | - |
| FDR | 87.47±3.15 | 19.70±0.07 | 28.97±0.41 | 94.19±0.44 | 90.87±0.16 |
| GSS | 89.39±0.75 | 67.27±4.27 | - | 85.24±0.59 | 82.22±1.14 |
| DER++ | 95.30±1.20 | 85.24±0.49 | 39.02±0.97 | 94.65±0.33 | 92.26±0.17 |
| CLS-ER | 95.73±0.11 | 86.78±0.17 | 46.74±0.31 | 94.25±0.06 | 92.03±0.05 |
+
+Table 1: Comparison with prior works on Class-IL and Domain-IL settings. The baseline results are from Buzzega et al. (2020a) (- indicates the experiments that the authors were unable to run).
+
+# 5 EMPIRICAL EVALUATION
+
+There are a plethora of evaluation protocols in the CL literature, each of which biases the evaluation towards a certain approach (Farquhar & Gal, 2018; Mi et al., 2020; van de Ven & Tolias, 2019). It is therefore of utmost importance to conduct an extensive and robust evaluation over different CL settings to gauge the versatility of the method. Details of the datasets used in each CL setting are provided in Section A. We compare our method with the state-of-the-art rehearsal-based approaches on various CL settings and memory budgets under uniform experimental settings. $SGD$ refers to standard training and JOINT provides an upper bound given by training all tasks jointly.
+
+Class Incremental Learning (Class-IL): refers to the CL scenario where new classes are added with each subsequent task and the agent must learn to distinguish not only amongst the classes within the current task but also across previous tasks. Class-IL measures how well the method can learn general representations, accumulate, consolidate, and transfer the acquired knowledge to learn efficient representations and decision boundaries for all the classes seen so far.
+
+Table 1 provides the comparison with six rehearsal-based approaches on Class-IL settings with varying datasets and task length complexities. CLS-ER provides the highest performance in all of these scenarios. In particular, as the dataset complexity and number of tasks increase from S-MNIST to S-Tiny/ImageNet, the performance gap between CLS-ER and DER++ increases considerably. Especially, with a smaller memory budget, CLS-ER is able to retain more information than other methods. In the most challenging setting, S-Tiny/ImageNet with 200 buffer size, CLS-ER provides a percentage gain of $176\%$ and $114\%$ over the baseline ER and the current state-of-the-art $\mathrm{DER} + +$ respectively. The results demonstrate the capability of CLS-ER to efficiently accumulate and retain knowledge over longer sequences under complex and memory restrictive scenarios.
+
+We believe that the performance gains over DER++ highlight a key component of an efficient CL agent: the ability to consolidate previously acquired knowledge. DER++ fails to account for the consolidation of feature space and adaptation of the decision boundaries of the previous tasks. Therefore, constraining the model to match the sub-optimal logits might hamper the consolidation of knowledge. This becomes more prominent as the number of classes in each task, the sequence
+
+| JOINT | SGD | Buffer | ER | MER | GSS | DER++ | CLS-ER |
| 82.98±3.24 | 19.09±0.69 | 200 | 49.27±2.25 | 48.58±1.07 | 43.92±2.43 | 54.16±3.02 | 66.37±0.83 |
| 500 | 65.04±1.53 | 62.21±1.36 | 54.45±3.14 | 69.62±1.59 | 75.70±0.41 |
| 1000 | 75.18±1.50 | 70.91±0.76 | 63.84±2.09 | 76.03±1.61 | 79.54±0.34 |
+
+Table 2: Comparison with prior works on MNIST-360 test set. The baseline results are from Buzzega et al. (2020a).
+
+| Distribution | Uniform | Longtail |
| JOINT | 58.36±1.02 | 56.94±1.56 |
| SGD | 12.67±0.24 | 22.88±0.53 |
| Buffer | 200 | 500 | 1000 | 200 | 500 | 1000 |
| ER | 16.40±0.37 | 28.21±0.69 | 31.98±0.72 | 19.27±0.77 | 20.30±0.63 | 34.13±0.83 |
| DER++ | 18.84±0.60 | 32.92±0.74 | 38.95±0.56 | 26.94±1.27 | 25.82±0.83 | 33.64±0.88 |
| CLS-ER | 25.06±0.81 | 36.34±0.59 | 39.69±0.66 | 28.54±0.87 | 28.63±0.68 | 39.52±0.91 |
+
+Table 3: Comparison with prior works on GCIL-CIFAR-100 dataset.
+
+length, and the cross-task resemblance increase. For instance, for DER++, replaying a sample from Task-1 when training on S-Tiny/ImageNet Task-10, the reference logit values which are used to enforce the consistency are from a model representation state which has not considered how to distinguish the 20 classes in Task-1 from 80 additional classes which are visually and semantically similar. It stands to reason that the optimal representation space and subsequently the decision boundaries for the classes in Task-1 would drift considerably when required to distinguish between 80 additional classes as well. Therefore, the local information provided by the sub-optimal saved logits in DER++ fails to provide the global context required for consolidating knowledge. CLS-ER, on the other hand, extracts logits from the semantic memories which consolidate knowledge across the tasks, and hence the working model receives more optimal feedback.
+
+Domain Incremental Learning (Domain-IL): refers to the CL scenario where the classes remain the same in subsequent tasks but the input distribution changes. We consider R-MNIST where each task contains digits rotated by a fixed angle and P-MNIST which applies a fixed random permutation to the pixels for each task. Table 1 shows that CLS-ER provides generalization gains under both settings, particularly for lower memory budget, and performs on par with DER++ on 5120 buffer size. We attribute this to the consolidated soft targets from the semantic memories which provide relational information about the classes from a global context compared to the local information in DER++. This enables our method to maintain the similarity structure across sequences effectively.
+
+General Incremental Learning (GIL): Class-IL and Domain-IL fail to assimilate the challenges in the real-world setting where the task boundaries are blurry, and classes can reappear and have different distributions. The CL method has to consider the sample efficiency, challenge of imbalanced data, and efficient knowledge transfer in addition to preventing catastrophic forgetting. We consider two GIL settings: MNIST-360 (Buzzega et al., 2020a) exposes the model to both sharp (changes in class) and smooth (rotation of digits) distribution shifts. This requires the CL method to tackle the challenges of class-IL as well as domain-IL. The Generalized Class Incremental Learning (GCIL; Mi et al. (2020)) is the closest to the real-world scenario as it utilizes probabilistic modeling to sample the classes and data distributions in each task. The number of classes in each task is not fixed, the classes can overlap and the sample size for each class can vary.
+
+Table 2 shows that CLS-ER provides considerable performance gains on the challenging MNIST-360, particularly with a low memory budget. Similarly, Table 3 demonstrates the effectiveness of CLS-ER on GCIL-CIFAR-100 under both uniform and imbalanced class samples. Both of these settings involve recurring classes in subsequent sequences which makes the transfer of knowledge from previous occurrences important. The performance gap between CLS-ER and $\mathrm{DER}++$ in the recurring classes setting alludes to another shortcoming of saving logits from the previous state. Consider the case where class c appears in sequence (Seq)-1 with 20 samples, and then subsequently in Seq-5 with 200 samples. In the following sequences, $\mathrm{DER}++$ uses exemplars from class c saved in Seq-1 with sub-optimal logits from the model state which was attained with only 20 samples and fails to take advantage of the better learned representations with additional data in Seq-5. CLS-ER,
+
+
+Figure 3: Model characteristics analyses of different methods trained on S-CIFAR-10 with 500 buffer size. The Left and middle figures show the training loss and accuracy under varying Gaussian noise added to the weights of each layer of the model. CLS-ER is considerably less sensitive to perturbations, suggesting convergence to flatter minima. The right figure shows the task probabilities. CLS-ER effectively mitigates the bias to the recent tasks and provides a more uniform probability of being predicted for the classes over the tasks even very early ones.
+
+
+
+
+
+on the other hand, is able to take advantage of the additional samples and provide feedback from the improved learned representations. Moreover, the considerable performance improvement in the longtail setting shows that CLS-ER is more robust to class imbalance
+
+Note that the MNIST-based settings can be considered under the online CL setting (see Section A.4) as we only pass through the data once for each task and the performance of CLS-ER on these settings demonstrates its potential as an efficient method for online CL.
+
+# 6 MODEL CHARACTERISTICS
+
+We analyze CLS-ER and provide some insights into the characteristics of the proposed approach which enables it to learn effectively under challenging CL scenarios. In the subsequent analyses, we compare CLS-ER with the baseline ER and $\mathrm{DER}++$ .
+
+# 6.1 CONVERGENCE TO FLATTER MINIMA
+
+Due to the non-convexity of the loss landscape, there can be multiple solutions to the optimization objective, however, the local geometry at the convergence point can affect the generalization of the model. Solutions that reside in wide valleys instead of narrow crevices generalize better (Chaudhari et al., 2019; Hochreiter & Schmidhuber, 1997; Keskar et al., 2016) as the predictions do not change drastically with small perturbations. A CL model which converges to flatter minima has more flexibility to explore the neighboring parameter space to optimize on the new task without drastically increasing the loss on the previous tasks. Following the analysis in Zhang et al. (2018), we add independent Gaussian noise of increasing strength to the parameters of the trained model and analyze the change in accuracy and loss across the training samples. Figure 3 shows that CLS-ER is significantly less sensitive to perturbations compared to ER and $\mathrm{DER}++$ . CLS-ER also retains performance for a longer period and its performance drops more smoothly. These results suggest that the fast and slow adaptation of information in CLS-ER can guide the optimization to wider valleys.
+
+# 6.2 TASK PROBABILITIES
+
+Because of the sequential nature of CL, an implicit bias is induced towards the current task (Wu et al., 2019). A number of CL methods employ explicit techniques to reduce this bias (Hou et al., 2019; Wu et al., 2019), however, they utilize the task boundaries which is counterproductive for general incremental learning. We believe that the efficient knowledge consolidation in CLS-ER through the semantic memories can implicitly mitigate the bias towards recent tasks. We follow the analysis performed in Buzzega et al. (2020b) to observe the probability of each task being predicted at the end of the training. For each sample in the test dataset, we take the softmax output and then
+
+
+Figure 4: Reliability plots for different methods on S-CIFAR-10 with 500 buffer size. CLS-ER results in considerably better-calibrated models and hence more reliable predictions. For other buffer sizes and S-TinyImageNet see Figures S5 and S6.
+
+
+
+
+
+average the probabilities of the associated classes for each task across the dataset. We normalize the values and report the probability of each task being predicted. Figure 3 (right plot) shows that CLS-ER is able to maintain a more uniform prediction probability across all the tasks over a long sequence. Figures S3 and S4 show similar results for other buffer sizes and S-TinyImageNet.
+
+# 6.3 MODEL CALIBRATION
+
+Model calibration refers to the accuracy with which the scores provided by the model reflect its predictive uncertainty. The class probabilities predicted by DNNs are uncalibrated, often tending towards over-confidence which is detrimental to the reliability of the model's prediction (Guo et al., 2017). This is even more pronounced in CL where the models tend to be biased towards recent tasks. Following Guo et al. (2017), we provide the reliability diagrams (model accuracy as a function of its prediction confidence) and the Expected Calibration Error (ECE; a weighted average over the absolute difference between accuracy and confidence). Figure 4 shows the remarkable ability of CLS-ER to provide well-calibrated models without the application of any calibration technique.
+
+Note that these characteristics are complementary in nature: convergence to flatter minima allows our method to remain in the vicinity of optimal parameters for previous tasks when adapting to the new task, this leads to more uniform performance across tasks which can improve the task probabilities, and since the model is not too biased towards the current task, the model can provide reliable prediction across the tasks which improve the calibration. Additional characteristics analyses on different datasets and buffer sizes are provided in Appendix. We observe that our model's behavior is consistent across varying datasets and buffer sizes.
+
+# 7 CONCLUSION
+
+We proposed a novel dual memory experience replay method based on the complementary learning systems theory in the brain. Our method maintains long-term and short-term semantic memories which are utilized to effectively replay the neural activities of the episodic memories and align the decision boundary of the working model for efficient knowledge consolidation. We demonstrated the effectiveness of our approach on benchmark datasets as well as more challenging general incremental learning scenarios and achieved the new state-of-the-art in the vast majority of the continual learning settings. We further showed that CLS-ER converges to flatter minima, mitigates the bias towards recent tasks, and provides a well-calibrated high-performance model. Our strong empirical results motivate further study into mimicking the complementary learning system in the brain more faithfully to enable optimal continual learning in DNNs.
+
+# REFERENCES
+
+Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Advances in Neural Information Processing Systems, pp. 11816-11825, 2019. 2, 14
+Elahe Arani, Fahad Sarfraz, and Bahram Zonooz. Noise as a resource for learning in knowledge distillation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 3129-3138, 2021. 5
+Ari S Benjamin, David Rolnick, and Konrad Kording. Measuring and regularizing networks in function space. arXiv preprint arXiv:1805.08289, 2018. 2
+Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. arXiv preprint arXiv:2004.07211, 2020a. 5, 6, 7, 13, 14, 17, 20
+Pietro Buzzega, Matteo Boschini, Angelo Porrello, and Simone Calderara. Rethinking experience replay: a bag of tricks for continual learning. arXiv preprint arXiv:2010.05595, 2020b. 8
+Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. Journal of Statistical Mechanics: Theory and Experiment, 2019(12): 124018, 2019. 8
+Arslan Chaudhry, Marc'Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018. 1
+Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. arXiv preprint arXiv:1909.08383, 2019. 13
+Mehrdad Farajtabar, Navid Azizan, Alex Mott, and Ang Li. Orthogonal gradient descent for continual learning. In International Conference on Artificial Intelligence and Statistics, pp. 3762-3773. PMLR, 2020. 1
+Sebastian Farquhar and Yarin Gal. Towards robust evaluations of continual learning. arXiv preprint arXiv:1805.09733, 2018. 1, 6, 13, 14
+Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128-135, 1999. 2
+Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pp. 1321-1330. PMLR, 2017. 9
+Demis Hassabis, Dharshan Kumaran, Christopher Summerfield, and Matthew Botvinick. Neuroscience-inspired artificial intelligence. Neuron, 95(2):245-258, 2017. 1
+Tyler L Hayes, Giri P Krishnan, Maxim Bazhenov, Hava T Siegelmann, Terrence J Sejnowski, and Christopher Kanan. Replay in deep learning: Current approaches and missing biological elements. arXiv preprint arXiv:2104.04132, 2021. 1, 3
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. corr abs/1512.03385 (2015), 2015. 5
+Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural computation, 9(1):1-42, 1997. 8
+Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 831-839, 2019. 8
+David Isele and Akansel Cosgun. Selective experience replay for lifelong learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. 4
+
+Nitin Kamra, Umang Gupta, and Yan Liu. Deep generative dual memory network for continual learning. arXiv preprint arXiv:1710.10368, 2017. 2
+Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. 8
+J Kirkpatrick, R Pascanu, N Rabinowitz, J Veness, G Desjardins, AA Rusu, K Milan, J Quan, T Ramalho, A Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks.(dec. arXiv preprint cs.LG/1612.00796, 2016. 13
+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. 1
+Giri P Krishnan, Timothy Tadros, Ramyaa Ramyaa, and Maxim Bazhenov. Biologically inspired sleep algorithm for artificial neural networks. arXiv preprint arXiv:1908.02240, 2019. 2, 3
+Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009. 13
+Dharshan Kumaran, Demis Hassabis, and James L McClelland. What learning systems do intelligent agents need? complementary learning systems theory updated. Trends in cognitive sciences, 20 (7):512-534, 2016. 1
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. 13
+David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in neural information processing systems, pp. 6467-6476, 2017. 1, 2, 13
+Wolfgang Maass. Noise as a resource for computation and learning in networks of spiking neurons. Proceedings of the IEEE, 102(5):860-880, 2014. 5
+Zheda Mai, Ruiwen Li, Jihwan Jeong, David Quispe, Hyunwoo Kim, and Scott Sanner. Online continual learning in image classification: An empirical survey. Neurocomputing, 469:28-51, 2022. 14
+Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In *Psychology of learning and motivation*, volume 24, pp. 109–165. Elsevier, 1989. 1
+Fei Mi, Lingjing Kong, Tao Lin, Kaicheng Yu, and Boi Faltings. Generalized class incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 240-241, 2020. 6, 7, 13, 20
+German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54-71, 2019. 1, 2
+Hadi Pouransari and Saman Ghili. Tiny imagenet visual recognition challenge. CS231N course, Stanford Univ., Stanford, CA, USA, 2015. 13
+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. 2
+Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. arXiv preprint arXiv:1810.11910, 2018. 2
+Hippolyt Ritter, Aleksandar Botev, and David Barber. Online structured laplace approximations for overcoming catastrophic forgetting. In Advances in Neural Information Processing Systems, pp. 3738-3748, 2018. 1
+
+Anthony Robins. Catastrophic forgetting in neural networks: the role of rehearsal mechanisms. In Proceedings 1993 The First New Zealand International Two-Stream Conference on Artificial Neural Networks and Expert Systems, pp. 65–68. IEEE, 1993. 2
+Mohammad Rostami, Soheil Kolouri, and Praveen K Pilly. Complementary learning for overcoming catastrophic forgetting using experience replay. arXiv preprint arXiv:1903.04566, 2019. 2
+Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 1
+Fahad Sarfraz, Elahe Arani, and Bahram Zonooz. Knowledge distillation beyond model compression. In 2020 25th International Conference on Pattern Recognition (ICPR), pp. 6136-6143. IEEE, 2021. 2
+Dongsub Shim, Zheda Mai, Jihwan Jeong, Scott Sanner, Hyunwoo Kim, and Jongseong Jang. Online class-incremental continual learning with adversarial shapley value. arXiv e-prints, pp. arXiv-2009, 2020. 13
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780, 2017. 3, 5
+Gido M van de Ven and Andreas S Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019. 6, 13
+Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37-57, 1985. 4
+Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. Large scale incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 374-382, 2019. 8
+Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017. 1
+Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. Proceedings of machine learning research, 70:3987, 2017. 1, 13
+Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4320-4328, 2018. 8
+
+# A CONTINUAL LEARNING SETTINGS
+
+There are a plethora of evaluation protocols in the CL literature, each of which biases the evaluation towards a certain approach (Farquhar & Gal, 2018; Mi et al., 2020; Shim et al., 2020; van de Ven & Tolias, 2019). It is therefore of utmost importance to conduct an extensive and robust evaluation to gauge the versatility of the method. We believe that adhering to the key desiderata as suggested in Farquhar & Gal (2018) would help the CL community immensely in moving towards a robust evaluation of methods. An experimental protocol that trains the method on a long sequence of tasks where the boundaries between the tasks are not distinct and the tasks themselves are not disjoint and the method does not make sure of task boundaries during training or testing can be considered as adhering to all five desiderata. Our work focuses on the aforementioned setting which can be considered as General Incremental Learning (GIL) setting. Here, we provide a broad categorization of these evaluation protocols which test different aspects of CL.
+
+# A.1 CLASS INIncrementAL LEARNING (CLASS-IL)
+
+Class-IL refers to the CL scenario where new classes are added with each subsequent task and the agent must learn to distinguish not only amongst the classes within the current task but also across previous tasks. Class-IL measures how well the method can learn general representations, accumulate, consolidate, and transfer the acquired knowledge to learn efficient representations and decision boundaries for all the classes seen so far. Following Buzzega et al. (2020a); De Lange et al. (2019); Zenke et al. (2017), we consider the common benchmark datasets MNIST (LeCun et al., 1998) (S-MNIST), CIFAR-10 (Krizhevsky et al., 2009) (S-CIFAR-10) and Tiny-ImageNet (Pouransari & Ghili, 2015) (S-Tiny-ImageNet) which are split into 5, 5, and 10 tasks each including 2, 2, and 20 classes respectively. These represent Class-IL settings of increasing dataset complexity as well as longer sequences. While it is an important and challenging benchmark, it assumes that each subsequent task will have the same number of disjoint classes and have uniform samples for each class which is not representative of real-world scenarios. We do not consider the related Task Increment Learning (Task-IL) setting as it assumes the availability of task labels at both training and inference which cannot truly be considered as a CL task (Farquhar & Gal, 2018).
+
+# A.2 DOMAIN INIncrementAL LEARNING (DOMAIN-IL)
+
+Domain-IL refers to the CL scenario where the classes remain the same in each subsequent task but the input distribution changes. We consider Rotated-MNIST (Lopez-Paz & Ranzato, 2017) (R-MNIST) where each task contains digits rotated by a fixed angle between 0 and 180 degrees and Permuted-MNIST (Kirkpatrick et al., 2016) (P-MNIST) which applies a fixed random permutation to the pixels for each task. Though we provide the results for Permuted MNIST for completion, we share the opinion by Farquhar & Gal (2018) that it should not be considered as a benchmark dataset as it violates the cross-task resemblance desiderata and deviates from the goal of continual learning.
+
+# A.3 GENERAL INIncrementAL LEARNING (GIL)
+
+The aforementioned CL scenarios fail to assimilate the challenges in the real world, setting where the task boundaries are blurry and the learning agent must rather learn from a continuous stream of data where classes can reappear and have different data distributions. The CL method must deal with the issues of sample efficiency, imbalanced classes, and efficient transfer of knowledge in addition to preventing catastrophic forgetting. To test the efficacy of our method in this challenging setting, we consider two GIL evaluation protocols. MNIST-360 (Buzzega et al., 2020a) models a stream of data which presents batches of two consecutive MNIST images with each sample rotated at an increasing angle and the sequence is repeated three times. This exposes the model to both a sharp distribution shift when the class changes and a smooth rotational distribution shift. However, the number of classes in each task and the samples are uniform. The Generalized Class Incremental Learning (GCIL) (Mi et al., 2020) utilizes probabilistic modeling to sample the classes and data distributions in each task. Hence, the number of classes in each task is not fixed, the classes can overlap and the sample size for each class can vary. Following Mi et al. (2020), we use GCIL on CIFAR-100 (Krizhevsky et al., 2009) dataset (GCIL-CIFAR-100), set the number of samples
+
+and maximum number of classes per task to 1000 and 50 respectively, number of tasks to 20, and evaluate on both uniform and longtail (imbalanced) sample distribution.
+
+# A.4 ONLINE CONTINUAL LEARNING
+
+Online continual learning refers to the challenging scenario where a stream of samples is only seen once and is non-iid (Mai et al., 2022; Aljundi et al., 2019). The common approach in the literature is to use the single-epoch protocol where the network is trained on each task in the sequence for only one epoch and there are no additional passages over data. As we aim to position CLS-ER as a general incremental learning method, we are also interested in the online continual learning setting. However, similar to Buzzega et al. (2020a), we also believe that the dataset complexity needs to be considered when setting the number of epochs to disentangle the effect of catastrophic forgetting from underfitting and share their suggestion that future CL works should strive for realism by designing experimental settings which are in line with the guidelines of General Continual Learning (Farquhar & Gal, 2018) which is the goal of our study rather than adopting the single-epoch protocol. For the MNIST-based settings, we use only one epoch per task as it is sufficient for the SGD baseline to learn the single task well. And for the more complex settings, we increase the number of epochs: 50 epochs for Sequential CIFAR-10 and Sequential Tiny-[ImageNet and 100 epochs for GCIL-CIFAR-100.
+
+We would also like to emphasize that the experiments on MNIST based settings (S-MNIST, R-MNIST, P-MNIST, and MNIST-360) can be considered as online continual learning settings as we only train the network for 1 epoch, and thereby the model only sees the data for each task once. CLSER's performance in these settings demonstrates its potential for the challenging online continual learning setting.
+
+# B RESERVOIR SAMPLING
+
+Here, we provide the algorithm for the Reservoir Sampling for maintaining a fixed-size memory buffer. Reservoir sampling takes in a data stream of unknown length and assigns equal probability to each sample for being represented in the memory buffer $(\mathcal{M})$ with a fixed budget size $(\mathcal{B})$ . Sampling and replacement are done at random and no priority is assigned to the samples being added or replaced from the memory buffer.
+
+Algorithm 2 Reservoir Sampling Algorithm
+Input: Memory Buffer $\mathcal{M}$ ,Memory Budget $\mathcal{B}$ Number of seen examples $N$ Selected example $(x,y)$
+1: if $\mathcal{B} > N$ then $\triangleright$ Memory is not full
+2: $\mathcal{M}[N]\gets (x,y)$
+3: else $\triangleright$ Select a sample to remove
+4: $\nu =$ randomInteger(min $= 0$ max $= N$
+5: if $\nu < \mathcal{B}$ then
+6: $\mathcal{M}[\nu ]\gets (x,y)$ return M
+
+# C ADDITIONAL RESULTS
+
+In this section, we provide additional experimental results and analysis of the behavior of the model.
+
+# C.1 CLS-ER COMPONENTS PERFORMANCE
+
+CLS-ER involves the interplay between the working model and the two semantic memories: the plastic and stable models. While we use the stable model for final inference, here we provide the performance of each of these individual components to provide further insights into the workings of our method. Table S1 shows the corresponding performance of the working model and plastic model for each of our experimental settings. We can see that the stable model can effectively consolidate
+
+| Dataset | Buffer | Stable Model | Working Model | Plastic Model |
| S-MNIST | 200 | 89.54±0.21 | 89.32±0.23 | 89.52±0.21 |
| 500 | 92.05±0.30 | 91.61±0.47 | 92.04±0.33 |
| 5120 | 95.73±0.10 | 95.65±0.15 | 95.73±0.12 |
| S-CIFAR-10 | 200 | 66.19±0.75 | 50.09±1.48 | 62.68±1.94 |
| 500 | 75.22±0.71 | 63.09±1.12 | 71.32±0.89 |
| 5120 | 86.78±0.17 | 85.00±0.33 | 86.77±0.17 |
| S-Tiny/ImageNet | 200 | 23.47±0.80 | 9.97±0.18 | 17.19±0.71 |
| 500 | 31.03±0.56 | 15.35±0.34 | 27.16±0.43 |
| 5120 | 46.74±0.31 | 41.39±0.39 | 47.10±0.42 |
| R-MNIST | 200 | 92.26±0.18 | 89.37±0.47 | 89.99±0.43 |
| 500 | 94.06±0.07 | 93.24±0.14 | 93.52±0.09 |
| 5120 | 94.25±0.06 | 94.28±0.08 | 94.37±0.06 |
| P-MNIST | 200 | 84.63±0.40 | 84.33±0.45 | 84.54±0.41 |
| 500 | 88.30±0.14 | 88.12±0.16 | 88.25±0.14 |
| 5120 | 92.03±0.05 | 91.96±0.06 | 92.02±0.05 |
| MNIST-360 | 200 | 66.37±0.83 | 55.59±1.74 | 60.60±1.41 |
| 500 | 75.70±0.41 | 72.70±0.80 | 75.03±0.37 |
| 1000 | 79.54±0.34 | 78.39±0.69 | 79.16±0.42 |
| GCIL-CIFAR-100 (Uniform) | 200 | 33.15±2.80 | 31.74±2.72 | 32.70±2.78 |
| 500 | 37.01±1.67 | 35.89±1.69 | 36.18±1.68 |
| 1000 | 41.09±1.58 | 40.44±1.80 | 40.70±1.66 |
| GCIL-CIFAR-100 (Longtail) | 200 | 29.57±3.80 | 28.19±3.90 | 29.12±3.89 |
| 500 | 33.26±3.66 | 32.22±3.79 | 32.95±3.70 |
| 1000 | 39.21±3.46 | 38.51±3.55 | 38.84±3.52 |
+
+Table S1: CLS-ER components performance analysis for each of the experimental setting.
+
+knowledge across the tasks and therefore provide the highest mean performance for the vast majority of the settings. Figures S1 and S2 further shows how the task-wise performance (on test set) of each of the component varies as subsequent tasks are learned. The stable model retains the performance on previous tasks while the plastic model adapts better to the recent task. Both these models provide feedback to the working model which in turn improves the plastic and stable model.
+
+# C.2 TASK PROBABILITIES
+
+To test the effectiveness of our method in mitigating the bias towards recent tasks, we provide the task probabilities of the models trained with different buffer sizes on S-CIFAR-10 and S-TinyImageNet. Figures S3 and S4 show that CLS-ER consistently achieves more uniform task probabilities compared to ER and $\mathrm{DER}++$ and effectively mitigates the bias towards the last task.
+
+# C.3 MODEL CALIBRATION
+
+To further test the consistency of CLS-ER in providing well-calibrated models and the impact of the buffer size, we evaluate the calibration of models trained with different buffer sizes on S-CIFAR-10 and S-Tiny-ImageNet. Figures S5 and S6 show that CLS-ER consistently provides better calibrated models compared to ER and $\mathrm{DER} + +$ . Remarkably, for both the datasets, on lower buffer sizes, the difference in Expected Calibration Error (ECE) is considerable. This demonstrates the capability of CLS-ER to train high-performance and reliable models under challenging conditions.
+
+# C.4 EFFECT OF HYPERPARAMETERS
+
+The interaction between the three components of CLS-ER is complementary. Table S3 shows how the performance of each component is affected under different hyperparameter settings. We can draw the following conclusions from the results. The performance improvement in the plastic and stable model is reflected in the working model and the best performance is seen in cases where both the semantic memories are performing well (albeit the focus on tasks is different). This highlights
+
+
+Figure S1: Test set task-wise performance for the individual models on S-CIFAR-10 with different buffer sizes. The task-wise performance (x-axis) is evaluated at the end of training of each task (y-axis) to evaluate how it is affected as training progresses.
+
+the crucial role of both memories in enabling CLS-ER to learn efficiently. For a fixed $r_S$ value, the final performance of the stable model is affected considerably by the performance of the plastic model. The method is not highly sensitive to the particular choice of hyperparameters as different settings can attain similar performance. Because of the complementary nature of the components, we can often fix a set of parameters (e.g. $\lambda$ , $\alpha_S$ , $\alpha_S$ and $r_S$ ) and only finetune the remaining parameters (e.g. $r_P'$ ) which facilitates hyperparameter tuning significantly.
+
+# D COMPARISON WITH A SINGLE SEMANTIC MEMORY
+
+CLS-ER employs two semantic memories as we aim to mimic the fast and slow learning mechanisms in the hippocampus and neocortex respectively. Here we compare our method with a single semantic memory (Mean-ER) and Table S2 shows that while it still performs admirably compared to the other CL methods, the dual semantic memories in CLS-ER provides additional performance gains especially on the complex datasets under the challenging lower memory buffer settings and has a much lower variance. We attribute this to the failure of Mean-ER in maintaining the performance on both the recent and earlier tasks together i.e there is an inherent trade-off as tuning the semantic memory to adapt to the recent changes comes at the cost of performance on earlier tasks and vice versa. CLS-ER efficiently tackles this trade-off by maintaining two specialized long-term and short-term memories. The performance of Mean-ER, however, provides further evidence for the benefits of using consolidated information for memory replay.
+
+Note that for a fair comparison, we use the same hyperparameter search space as CLS-ER for finding the optimal parameters for Mean-ER and report the average and 1 std of 10 runs with different initializations using the best parameters for each setting. Table S6 provides the chosen hyperparameters. For inference, similar to CLS-ER, we use the EMA-weighted model (semantic memory) for Mean-ER.
+
+
+Figure S2: Test set task-wise performance for the individual models on S-Tiny-ImageNet with different buffer sizes. The task-wise performance (x-axis) is evaluated at the end of training of each task (y-axis) to evaluate how it is affected as training progresses.
+
+
+Figure S3: Task probabilities for different methods on S-CIFAR-10 with varying memory budget.
+
+# E TRAINING AND IMPLEMENTATION DETAILS
+
+For a fair comparison, we aim to keep the experimental settings close to the current state-of-the-art DER++ (Buzzega et al., 2020a) as much as possible to disassociate the effect of the training
+
+
+Figure S4: Task probabilities for different methods on S-Tiny-ImageNet with varying memory budget.
+
+
+Figure S5: Reliability plots for the different methods on S-CIFAR-10 with varying memory budget.
+
+schedule. We use the same optimizer, the number of epochs, batch size, and memory batch size as DER++. For S-Tiny-ImageNet, we reduce the number of epochs to 50 from 100 used by DER++. As our method can learn efficiently with fewer epochs, and quickly acquiring new knowledge is preferred for CL. Similar to DER++, we finetune the memory batch size for S-MNIST and MNIST-360. We select the hyperparameters for each of the experimental setting using a small validation set,
+
+
+Figure S6: Reliability plots for the different methods on S-Tiny-ImageNet with varying memory budget.
+
+| Buffer | Method | Class-IL | Domain-IL |
| S-MNIST | S-CIFAR-10 | S-Tiny-ImageNet | R-MNIST | P-MNIST |
| - | JOINT | 95.57±0.24 | 92.20±0.15 | 59.99±0.19 | 95.76±0.04 | 94.33±0.17 |
| SGD | 19.60±0.04 | 19.62±0.05 | 7.92±0.26 | 67.66±8.53 | 40.70±2.33 |
| 200 | Mean-ER | 88.32±0.65 | 61.88±2.43 | 17.68±1.65 | 92.10±1.07 | 83.28±0.68 |
| CLS-ER | 89.54±0.21 | 66.19±0.75 | 23.47±0.80 | 92.26±0.18 | 84.63±0.40 |
| 500 | Mean-ER | 91.79±0.23 | 70.40±1.21 | 24.97±0.80 | 92.78±0.44 | 87.73±0.39 |
| CLS-ER | 92.05±0.32 | 75.22±0.71 | 31.03±0.56 | 94.06±0.07 | 88.30±0.14 |
| 5120 | Mean-ER | 95.57±0.18 | 84.84±2.0 | 45.69±0.58 | 94.25±0.51 | 91.90±0.11 |
| CLS-ER | 95.73±0.11 | 86.78±0.17 | 46.74±0.31 | 94.25±0.06 | 92.03±0.05 |
+
+Table S2: Comparison of CLS-ER with Mean-ER (single semantic memory) on Class-IL and Domain-IL settings. We report the mean and 1 std of 10 runs with different initializations.
+
+$\alpha_{S}, \alpha_{P} \in (0.99, 0.999)$ , $r_{S}, r_{P} \in (0, 1]$ , $\lambda \in (0, 2]$ . Table S4 provides the hyperparameters used for each of the experimental settings. Note that for the vast majority of datasets, we use uniform settings (lr, epochs, batch size, memory batch size, and lambda) across the different buffer sizes and requires only slight modifications in the other hyperparameters which shows that our method does not require extensive finetuning for different memory budgets.
+
+# E.1 GCIL-CIFAR-100
+
+To test our method under challenging GIL settings that better simulate the challenges of CL in the real world, we incorporate the GCIL setting from the code provided by Mi et al. (2020) with the continual dataset template class in the mammoth framework. We set the number of phases (length of task sequences) to 20, with the total number of samples in each phase set to 1000 and the maximum number of classes in each phase set to 50. We evaluate on both uniform and longtail (imbalanced) data distributions. Since GCIL involves the probabilistic sampling of the classes and their samples in each phase, the random seed determines the complexity of the GCIL setting. Therefore, for reproducibility and to gauge the stability of the methods, we fix the dataset seed to 1993 and report the average and standard deviation of 10 differently initialized models trained on the same settings.
+
+For each of our method, we use identical training scheme (lr=0.1, epochs=100, batch size=32 and memory batch size=32). For DER++, as per the authors suggestion, we performed hyperparameter search over $\alpha \in [0.2, 0.3]$ and $\beta \in [0.5, 1.0]$ with step size of 0.1. Table S5 provides the parameters chosen for each of the method under the different settings.
+
+# E.2 PERTURBATION ANALYSIS
+
+For the perturbation analysis, we used the code and checkpoints provided by Buzzega et al. (2020a) for DER++ and ER. We would like to express our gratitude to the authors for their support and for making the mammoth framework available for the research community which provides a framework for a fair comparison of different CL methods under uniform experimental conditions.
+
+| λ | rS | rP | Stable Model | Working Model | Plastic Model |
| 0.1 | 0.2 | 73.53±1.07 | 62.80±0.63 | 71.11±2.21 | |
| 0.3 | 72.44±1.37 | 63.53±1.98 | 70.97±1.71 | |
| 0.4 | 73.05±0.93 | 61.81±1.92 | 68.75±2.20 | |
| 0.5 | 75.16±1.09 | 63.95±1.92 | 70.42±1.09 | |
| 0.6 | 75.04±0.66 | 62.82±0.70 | 69.61±0.31 | |
| 0.7 | 73.94±0.48 | 63.34±0.46 | 70.30±1.68 | |
| 0.8 | 74.61±1.10 | 62.68±0.65 | 70.74±0.39 | |
| 0.9 | 73.74±2.14 | 62.69±1.97 | 69.52±0.79 | |
| 1.0 | 75.73±0.68 | 64.21±1.11 | 72.00±0.56 | |
| 0.1 | 0.3 | 70.26±1.79 | 61.63±1.03 | 69.31±1.82 | |
| 0.4 | 71.80±1.17 | 62.64±0.18 | 70.64±1.22 | |
| 0.5 | 70.69±2.13 | 61.76±0.64 | 69.65±1.92 | |
| 0.6 | 72.45±0.68 | 63.87±0.85 | 71.29±0.72 | |
| 0.7 | 71.47±1.98 | 61.12±1.90 | 70.22±2.24 | |
| 0.8 | 72.16±0.56 | 62.71±0.57 | 70.83±0.64 | |
| 0.9 | 72.09±0.59 | 63.33±1.01 | 71.20±0.87 | |
| 1.0 | 72.05±1.35 | 63.74±1.75 | 71.01±1.28 | |
| 0.3 | 0.4 | 68.46±1.48 | 60.96±1.62 | 68.31±1.40 | |
| 0.5 | 70.05±2.54 | 63.06±1.26 | 69.90±2.57 | |
| 0.6 | 69.57±1.07 | 61.25±1.96 | 69.36±1.06 | |
| 0.7 | 68.99±2.34 | 61.61±2.17 | 68.81±2.27 | |
| 0.8 | 71.21±0.48 | 63.08±0.82 | 70.99±0.57 | |
| 0.9 | 71.26±1.47 | 62.33±0.64 | 71.03±1.56 | |
| 1 | 69.00±0.41 | 61.38±0.92 | 68.69±0.31 | |
| 0.15 | 0.2 | 70.19±1.97 | 61.39±2.06 | 69.81±1.60 | |
| 0.3 | 73.72±0.83 | 62.07±0.84 | 70.18±0.09 | |
| 0.4 | 71.60±2.30 | 61.11±2.00 | 69.15±1.08 | |
| 0.5 | 74.18±0.37 | 63.32±0.98 | 71.08±2.04 | |
| 0.6 | 74.90±0.40 | 62.35±2.31 | 71.58±0.79 | |
| 0.7 | 74.52±1.10 | 62.59±2.64 | 70.90±2.30 | |
| 0.8 | 75.27±1.21 | 62.00±1.98 | 71.27±1.64 | |
| 0.9 | 74.61±0.91 | 63.47±1.60 | 70.49±0.95 | |
| 1.0 | 76.03±0.64 | 63.63±1.01 | 71.42±1.11 | |
| 0.3 | 72.59±1.44 | 61.81±1.03 | 72.02±1.30 | |
| 0.4 | 71.30±3.42 | 63.15±0.51 | 70.92±2.83 | |
| 0.5 | 69.89±1.95 | 60.60±0.95 | 68.87±2.56 | |
| 0.6 | 72.34±0.89 | 62.18±1.31 | 71.15±0.94 | |
| 0.7 | 72.70±1.11 | 62.50±1.18 | 71.49±1.21 | |
| 0.8 | 72.42±1.50 | 61.85±0.83 | 71.04±1.68 | |
| 0.9 | 71.18±0.71 | 61.81±1.29 | 70.09±0.54 | |
| 1.0 | 73.52±0.65 | 64.19±0.86 | 72.56±0.52 | |
| 0.4 | 70.32±1.39 | 62.39±2.00 | 70.13±1.33 | |
| 0.5 | 71.60±1.53 | 62.67±2.08 | 71.40±1.54 | |
| 0.6 | 70.36±1.82 | 62.28±2.28 | 70.13±2.03 | |
| 0.7 | 69.79±1.93 | 61.13±1.37 | 69.65±1.82 | |
| 0.8 | 69.85±0.95 | 60.69±1.63 | 69.78±0.60 | |
| 0.9 | 71.32±1.68 | 61.79±1.41 | 71.03±1.61 | |
| 1.0 | 71.39±0.49 | 62.35±0.88 | 71.11±0.55 | |
+
+Table S3: The effect of different hyperparameter settings on the individual components of CLS-ER trained on S-CIFAR-10 with 500 buffer size. For all the experiments $\alpha_{S}$ and $\alpha_{P}$ are fixed to 0.999 and the performance is averaged over 3 runs with different initialization.
+
+| Dataset | Buffer | lr | Epochs | Batch Size | Memory Batch Size | λ | αS | αP | rs | rP |
| S-MNIST | 200 | 0.03 | 1 | 10 | 128 | 2.0 | 0.99 | 0.99 | 0.9 | 1.0 |
| 500 | 0.1 | 1 | 10 | 32 | 2.0 | 0.99 | 0.99 | 0.9 | 1.0 |
| 5120 | 0.1 | 1 | 10 | 32 | 2.0 | 0.99 | 0.99 | 0.8 | 1.0 |
| S-CIFAR-10 | 200 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.999 | 0.1 | 0.3 |
| 500 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.999 | 0.1 | 0.9 |
| 5120 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.999 | 0.8 | 1.0 |
| S-Tiny/ImageNet | 200 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.04 | 0.08 |
| 500 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.05 | 0.08 |
| 5120 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.07 | 0.08 |
| R-MNIST | 200 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 0.99 | 1.0 | 1.0 |
| 500 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 0.99 | 1.0 | 1.0 |
| 5120 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 0.99 | 1.0 | 1.0 |
| P-MNIST | 200 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 0.99 | 0.8 | 1.0 |
| 500 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 0.99 | 0.8 | 1.0 |
| 5120 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 0.99 | 0.9 | 1.0 |
| MNIST-360 | 200 | 0.2 | 1 | 16 | 16 | 0.75 | 0.999 | 0.99 | 1.0 | 1.0 |
| 500 | 0.2 | 1 | 16 | 32 | 1.25 | 0.99 | 0.99 | 0.9 | 1.0 |
| 1000 | 0.2 | 1 | 16 | 128 | 0.75 | 0.99 | 0.99 | 0.9 | 1.0 |
| GCIL-CIFAR-100 | 200 | 0.1 | 100 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.6 | 0.7 |
| 500 | 0.1 | 100 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.6 | 0.7 |
| 1000 | 0.1 | 100 | 32 | 32 | 0.1 | 0.999 | 0.999 | 0.6 | 0.8 |
+
+Table S4: The hyperparameters used for each of the experimental settings for CLS-ER.
+
+| Distribution | Buffer | lr | Epochs | Batch Size | Memory Batch Size | α | β |
| Uniform | 200 | 0.1 | 100 | 32 | 32 | 0.2 | 0.5 |
| 500 | 0.1 | 100 | 32 | 32 | 0.2 | 0.6 |
| 1000 | 0.1 | 100 | 32 | 32 | 0.3 | 0.6 |
| Longtail | 200 | 0.1 | 100 | 32 | 32 | 0.2 | 0.6 |
| 500 | 0.1 | 100 | 32 | 32 | 0.2 | 0.8 |
| 1000 | 0.1 | 100 | 32 | 32 | 0.3 | 0.9 |
+
+Table S5: The hyperparameters used for DER++ on GCIL-CIFAR-100 experiments. CLS-ER uses the same hyperparameters for both Uniform and Longtail settings (Table S4).
+
+| Dataset | Buffer | lr | Epochs | Batch Size | Memory Batch Size | λ | α | r |
| S-MNIST | 200 | 0.03 | 1 | 10 | 128 | 2.0 | 0.99 | 1.0 |
| 500 | 0.1 | 1 | 10 | 32 | 2.0 | 0.99 | 1.0 |
| 5120 | 0.1 | 1 | 10 | 32 | 2.0 | 0.99 | 1.0 |
| S-CIFAR-10 | 200 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.2 |
| 500 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.5 |
| 5120 | 0.1 | 50 | 32 | 32 | 0.15 | 0.999 | 0.8 |
| S-Tiny/ImageNet | 200 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.06 |
| 500 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.08 |
| 5120 | 0.05 | 50 | 32 | 32 | 0.1 | 0.999 | 0.08 |
| R-MNIST | 200 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 1.0 |
| 500 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 1.0 |
| 5120 | 0.2 | 1 | 128 | 128 | 0.75 | 0.999 | 1.0 |
| P-MNIST | 200 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 0.9 |
| 500 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 1.0 |
| 5120 | 0.2 | 1 | 128 | 128 | 1.0 | 0.99 | 0.9 |
+
+Table S6: The hyperparameters used for each of the experimental settings for Mean-ER.
\ No newline at end of file
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/images.zip b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ff7e7081a8251f44d2da12d53e25d5e08c26ab17
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a882809ebb662a9380d45aea1e1054127ab801d84dc37eced0ca5e50ff346269
+size 1598730
diff --git a/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/layout.json b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ba1f1b7984405bcbb795c3c5f4cc324a70e2c220
--- /dev/null
+++ b/learningfastlearningslowageneralcontinuallearningmethodbasedoncomplementarylearningsystem/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6a334662da15883a99dec6995ba30d1250001c7772106ccefb00454c2b152d5a
+size 487896
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_content_list.json b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..479400b7fdf54de4e3deee817128f06fc0944412
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d0b77d853c46c761d71c659b5bff5ac8b7cd5775fa9bb3d672df54055d2324de
+size 91343
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_model.json b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..19a0f21531d74c13e8098a242280efa2fe469fdc
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b1b3e74d975c8e1c88c500bf9c40aa5fbfaccdf5bdd7af057385c84c459e034f
+size 110424
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_origin.pdf b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ee5676146f6ed01be82a39d172ccf9b3dfb7780c
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/86f396ba-e534-4416-9828-8102b74b5aa9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cf7c79615f9ac7864ad7cbf32cb659d2c1a6d40976c1c0e91880cadca882a0ab
+size 60424788
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/full.md b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..ffa59eb49bef0f95ef182c747ed9d682f9ac0a86
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/full.md
@@ -0,0 +1,367 @@
+# LEARNING FAST SAMPLERS FOR DIFFUSION MODELS BY DIFFERENTIATING THROUGH SAMPLE QUALITY
+
+Daniel Watson*, William Chan, Jonathan Ho & Mohammad Norouzi
+
+Google Research, Brain Team
+
+{watsondaniel,williamchan,jonathanho,mnorouzi}@google.com
+
+# ABSTRACT
+
+Diffusion models have emerged as an expressive family of generative models rivaling GANs in sample quality and autoregressive models in likelihood scores. Standard diffusion models typically require hundreds of forward passes through the model to generate a single high-fidelity sample. We introduce Differentiable Diffusion Sampler Search (DDSS): a method that optimizes fast samplers for any pre-trained diffusion model by differentiating through sample quality scores. We present Generalized Gaussian Diffusion Models (GGDM), a family of flexible non-Markovian samplers for diffusion models. We show that optimizing the degrees of freedom of GGDM samplers by maximizing sample quality scores via gradient descent leads to improved sample quality. Our optimization procedure backpropagates through the sampling process using the reparametrization trick and gradient rematerialization. DDSS achieves strong results on unconditional image generation across various datasets (e.g., FID scores on LSUN church 128x128 of 11.6 with only 10 inference steps, and 4.82 with 20 steps, compared to 51.1 and 14.9 with strongest DDPM/DDIM baselines). Our method is compatible with any pre-trained diffusion model without fine-tuning or re-training required.
+
+# 1 INTRODUCTION
+
+Denoising Diffusion Probabilistic Models (DDPM) (Sohl-Dickstein et al., 2015; Song & Ermon, 2019; Ho et al., 2020) have emerged as a powerful family of generative models, capable of synthesizing high-quality images, audio, and 3D shapes (Ho et al., 2020; 2021; Chen et al., 2021a;b; Cai et al., 2020; Luo & Hu, 2021). Recent work (Dhariwal & Nichol, 2021; Ho et al., 2021) shows that DDPMs can outperform Generative Adversarial Networks (GAN) (Goodfellow et al., 2014; Brock et al., 2018) in generation quality, but unlike GANs, DDPMs admit likelihood computation and much more stable training dynamics (Arjovsky et al., 2017; Gulrajani et al., 2017).
+
+
+Figure 1: Non-cherrypicked samples from DDSS (ours) and strongest $\mathrm{DDIM}(\eta = 0)$ baseline for unconditional DDPMs trained on LSUN churches $128\times 128$ . All samples are generated with the same random seed. Original DDPM samples (1000 steps) and training images are shown on the left.
+
+However, GANs are typically much more efficient than DDPMs at generation time, often requiring a single forward pass through the generator network, whereas DDPMs require hundreds of forward passes through a U-Net model. Instead of learning a generator directly, DDPMs learn to convert noisy data to less noisy data starting from pure noise, which leads to a wide variety of feasible strategies for sampling (Song et al., 2021b). In particular, at inference time, DDPMs allow controlling the number of forward passes (a.k.a. inference steps) through the denoising network (Song et al., 2020; Nichol & Dhariwal, 2021).
+
+It has been shown both empirically and mathematically that, for any sufficiently good DDPM, more inference steps leads to better log-likelihood and sample quality (Nichol & Dhariwal, 2021; Kingma et al., 2021). In practice, the minimum number of inference steps to achieve competitive sample quality is highly problem-dependent, e.g., depends on the complexity of the dataset, and the strength of the conditioning signal if the task is conditional. Given the importance of generation speed, recent work (Song et al., 2020; Chen et al., 2021a; Watson et al., 2021) has explored reducing the number of steps required for high quality sampling with pretrained diffusion models. See Section 7 for a more complete review of prior work on few-step sampling.
+
+This paper treats the design of fast samplers for diffusion models as a differentiable optimization problem, and proposes Differentiable Diffusion Sampler Search (DDSS). Our key observation is that one can unroll the sampling chain of a diffusion model and use reparametrization trick (Kingma & Welling, 2013) and gradient rematerialization (Kumar et al., 2019a) to optimize over a class of parametric few-step samplers with respect to a global objective function. Our class of parametric samplers, which we call Generalized Gaussian Diffusion Model (GGDM), includes Denoising Diffusion Implicit Models (DDIM) (Song et al., 2020) as a special case and is motivated by the success of DDIM on fast sampling of diffusion models.
+
+An important challenge for fast DDPM sampling is the mismatch between the training objective (e.g., ELBO or weighted ELBO) and sample quality. Prior work (Watson et al., 2021; Song et al., 2021a) finds that samplers that are optimal with respect to ELBO often lead to worse sample quality and Fréchet Inception Distance (FID) scores (Heusel et al., 2017), especially with few inference steps. We propose the use of a perceptual loss within the DDSS framework to find high-fidelity diffusion samplers, motivated by prior work showing that their optimization leads to solutions that correlate better with human perception of quality. We empirically find that using DDSS with the Kernel Inception Distance (KID) (Binkowski et al., 2018) as the perceptual loss indeed leads to fast samplers with significantly better image quality than prior work (see Figure 1). Moreover, our method is robust to different choices of kernels for KID.
+
+Our main contributions are as follows:
+
+1. We propose Differentiable Diffusion Sampler Search (DDSS), which uses the reparametrization trick and gradient rematerialization to optimize over a parametric family of fast samplers for diffusion models.
+2. We identify a parametric family of Generalized Gaussian Diffusion Model (GGDM) that admits high-fidelity fast samplers for diffusion models.
+3. We show that using DDSS to optimize samplers by minimizing the Kernel Inception Distance leads to fast diffusion model samplers with state-of-the-art sample quality scores.
+
+# 2 BACKGROUND ON DENOISING DIFFUSION IMPLICIT MODELS
+
+We start with a brief review on DDPM (Ho et al., 2020) and DDIM (Song et al., 2020). DDPMs pre-specify a Markovian forward diffusion process, which gradually adds noise to data in $T$ steps. Following the notation of Ho et al. (2020),
+
+$$
+q \left(\boldsymbol {x} _ {0}, \dots , \boldsymbol {x} _ {T}\right) = q \left(\boldsymbol {x} _ {0}\right) \prod_ {t = 1} ^ {T} q \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {t - 1}\right) \tag {1}
+$$
+
+$$
+q (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {t - 1}) = \mathcal {N} (\boldsymbol {x} _ {t} | \sqrt {1 - \beta_ {t}} \boldsymbol {x} _ {s}, \beta_ {t} \boldsymbol {I}), \tag {2}
+$$
+
+where $q(\pmb{x}_0)$ is the data distribution, and $\beta_{t}$ is the variance of Gaussian noise added at step $t$ . To be able to gradually convert noise to data, DDPMs learn to invert (1) with a model $p_{\theta}(\pmb{x}_{t - 1}|\pmb{x}_t)$ , which
+
+is trained by maximizing a (possibly reweighted) evidence lower bound (ELBO):
+
+$$
+\mathbb {E} _ {q} \left[ D _ {\mathrm {K L}} [ q (\boldsymbol {x} _ {T} | \boldsymbol {x} _ {0}) \| p (\boldsymbol {x} _ {T}) ] + \sum_ {t = 2} ^ {T} D _ {\mathrm {K L}} [ q (\boldsymbol {x} _ {t - 1} | \boldsymbol {x} _ {t}, \boldsymbol {x} _ {0}) \| p _ {\theta} (\boldsymbol {x} _ {t - 1} | \boldsymbol {x} _ {t}) ] - \log p _ {\theta} (\boldsymbol {x} _ {0} | \boldsymbol {x} _ {1}) \right] \tag {3}
+$$
+
+DDPMs specifically choose the model to be parametrized as
+
+$$
+\begin{array}{l} p _ {\theta} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}\right) = q \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}, \hat {\boldsymbol {x}} _ {0} = \frac {1}{\sqrt {\bar {\alpha} _ {t}}} \left(\boldsymbol {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \boldsymbol {\epsilon} _ {\theta} \left(\boldsymbol {x} _ {t}, t\right)\right)\right) \tag {4} \\ = \mathcal {N} \left(\boldsymbol {x} _ {t - 1} \left| \frac {1}{\sqrt {1 - \beta_ {t}}} \left(\boldsymbol {x} _ {t} - \frac {\beta_ {t}}{\sqrt {1 - \bar {\alpha} _ {t}}} \boldsymbol {\epsilon} _ {\theta} (\boldsymbol {x} _ {t}, t)\right), \frac {1 - \bar {\alpha} _ {t}}{1 - \bar {\alpha} _ {t - 1}} \beta_ {t} \boldsymbol {I} _ {d}\right) \right. \\ \end{array}
+$$
+
+where $\bar{\alpha}_t = \prod_{s=1}^t (1 - \beta_t)$ for each $t$ . With this parametrization, maximizing the ELBO is equivalent to minimizing a weighted sum of denoising score matching objectives (Vincent, 2011).
+
+The seminal work of Song et al. (2020) presents Denoising Diffusion Implicit Models (DDIM): a family of evidence lower bounds (ELBOs) with corresponding forward diffusion processes and samplers. All of these ELBOs share the same marginals as DDPM, but allow arbitrary choices of posterior variances. Specifically, Song et al. (2020) note that it is possible to construct alternative ELBOs with only a subsequence of the original timesteps $S \subset \{1, \dots, T\}$ that shares the same marginals as the construction above (i.e., $q_{S}(\boldsymbol{x}_{t} | \boldsymbol{x}_{0}) = q(\boldsymbol{x}_{t} | \boldsymbol{x}_{0})$ for every $t \in S$ , so $q_{S}$ defines a faster sampler compatible with the pre-trained model) by simply using the new contiguous timesteps in the equations above. They also show it is also possible to construct an infinite family of non-Markovian processes $\{q_{\sigma} : \sigma \in [0, 1]^{T-1}\}$ where each $q_{\sigma}$ also shares the same marginals as the original forward process with:
+
+$$
+q _ {\sigma} \left(\boldsymbol {x} _ {0}, \dots , \boldsymbol {x} _ {t}\right) = q \left(\boldsymbol {x} _ {0}\right) q \left(\boldsymbol {x} _ {T} \mid \boldsymbol {x} _ {0}\right) \prod_ {t = 1} ^ {T - 1} q _ {\sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {t + 1}, \boldsymbol {x} _ {0}\right) \tag {5}
+$$
+
+and where the posteriors are defined as
+
+$$
+q _ {\sigma} \left(\boldsymbol {x} _ {t - 1} \mid \boldsymbol {x} _ {t}, \boldsymbol {x} _ {0}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t - 1} \mid \sqrt {\bar {\alpha} _ {t - 1}} \boldsymbol {x} _ {0} + \sqrt {1 - \bar {\alpha} _ {t - 1} - \sigma_ {t} ^ {2}} \cdot \frac {\boldsymbol {x} _ {t} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0}}{\sqrt {1 - \bar {\alpha} _ {t}}}, \sigma_ {t} ^ {2} \boldsymbol {I} _ {d}\right) \tag {6}
+$$
+
+Song et al. (2020) empirically find that the extreme case of using all-zero variances (a.k.a. $\mathrm{DDIM}(\eta = 0)$ ) consistently helps with sample quality in the few-step regime. Combined with a good selection of timesteps to evaluate the modeled score function (a.k.a. strides), $\mathrm{DDIM}(\eta = 0)$ establishes the current state-of-the-art for few-step diffusion model sampling with the smallest inference step budgets. Our key contribution that allows improving sample quality significantly by optimizing sampler families is constructing a family that generalizes DDIM. See Section 4 for a more complete treatment of our novel GGDM family.
+
+# 3 DIFFERENTIABLE DIFFUSION SAMPLER SEARCH (DDSS)
+
+We now describe DDSS, our approach to search for fast high-fidelity samplers with a limited budget of $K < T$ steps. Our key observation is that one can backpropagate through the sampling process of a diffusion model via the reparamterization trick (Kingma & Welling, 2013). Equipped with this, we can now use stochastic gradient descent to learn fast samplers by optimizing any given differentiable loss function over a minibatch of model samples.
+
+We begin with a pre-trained DDPM and a family of $K$ -step samplers that we wish to optimize for the given DDPM. We parametrize this family's degrees of freedom as simple transformations of trainable variables. We experiment with the following families in this paper, but emphasize that DDSS is applicable to any other family where model samples are differentiable with respect to the trainable variables:
+
+- DDIM: we parametrize the posterior variances with $\sigma_t = \sqrt{1 - \bar{\alpha}_{t-1}}$ sigmoid $(v_t)$ , where $v_1, \ldots, v_K$ are trainable variables (the $\sqrt{1 - \bar{\alpha}_{t-1}}$ constant ensures real-valued mean coefficients; see the square root in Equation 6).
+
+
+Figure 2: Illustration of GGDM. To improve sample quality, our novel family of samplers combines information from all previous (noisier) images at every denoising step.
+
+- VARS: we parametrize the marginal variances of a DDPM as cumsum(softmax([v; 1])) $_t$ instead of fixing them to $1 - \bar{\alpha}_t$ . This ensures they are monotonically increasing with respect to $t$ (appending a one to ensure $K$ degrees of freedom).
+- GGDM: a new family of non-Markovian samplers for diffusion models with more degrees of freedom illustrated in Figure 2 and defined in Section 4. We parametrize $\mu_{tu}$ and $\sigma_t$ of a GGDM for all $t$ as sigmoid functions of trainable variables.
+- GGDM +PRED: we parametrize all the $\mu_{tu}$ and $\sigma_t$ identically to GGDM, but also learn the marginal coefficients with a cumsum $\circ$ softmax parametrization (identical to VARS) instead of computing them via Theorem 1, as well as the coefficients that predict $x_0$ from $a_t x_t - b_t \epsilon$ with $1 +$ softmax and softmax parametrizations.
+- [family]+TIME: for any sampler family, we additionally parametrize the timesteps used to query the score model with a cumsum $\circ$ softmax parametrization (identical to VARS).
+
+As we will show in the experiments, despite the fact that our pre-trained DDPMs are trained with discrete timesteps, learning the timesteps is still helpful. In principle, this should only be possible for DDPMs trained with continuous time sampling (Chen et al., 2021a; Song et al., 2021b; Kingma et al., 2021), but in practice we find that DDPMs trained with continuously embedded discrete timesteps are still well-behaved when applied at timesteps not present during training. We think this is due to the regularity of the sinusoidal positional encodings Vaswani et al. (2017) used in these model architectures and training with a sufficiently large number of timesteps $T$ .
+
+# 3.1 DIFFERENTIABLE SAMPLE QUALITY SCORES
+
+We can differentiate through a stochastic sampler using the reparameterization trick, but the question of which objective to optimize still remains. Prior work has shown that optimizing log-likelihood can actually worsen sample quality and FID scores in the few-step regime (Watson et al., 2021; Song et al., 2021a). Thus, we instead design a perceptual loss which simply compares mean statistics between model samples and real samples in the neural network feature space. These types of objectives have been shown in prior work to better correlate with human perception of sample quality (Johnson et al., 2016; Heusel et al., 2017), which we also confirm in our experiments.
+
+We rely on the representations of the penultimate layer of a pre-trained InceptionV3 classifier (Szegedy et al., 2016) and optimize the Kernel Inception Distance (KID) (Binkowski et al., 2018). Let $\phi (\pmb {x})$ denote the inception features of an image $\pmb{x}$ and $p_{\psi}$ represent a diffusion sampler with trainable parameters $\psi$ . For a linear kernel, which works best in our experiments, the objective is:
+
+$$
+\mathcal {L} (\psi) = \underset {\boldsymbol {x} _ {p} \sim p _ {\psi}} {\mathbb {E}} \underset {\boldsymbol {x} _ {p} ^ {\prime} \sim p _ {\psi}} {\mathbb {E}} \phi \left(\boldsymbol {x} _ {p}\right) ^ {\top} \phi \left(\boldsymbol {x} _ {p} ^ {\prime}\right) - \underset {\boldsymbol {x} _ {p} \sim p _ {\psi}} {\mathbb {E}} \underset {\boldsymbol {x} _ {q} \sim q} {\mathbb {E}} \phi \left(\boldsymbol {x} _ {p}\right) ^ {\top} \phi \left(\boldsymbol {x} _ {q}\right) \tag {7}
+$$
+
+More generally, KID can be expressed as:
+
+$$
+\mathcal {L} _ {\mathrm {K I D}} (\psi) = \left\| \underset {\boldsymbol {x} _ {p} \sim p _ {\psi}} {\mathbb {E}} f ^ {*} \left(\boldsymbol {x} _ {p}\right) - \underset {\boldsymbol {x} _ {q} \sim q} {\mathbb {E}} f ^ {*} \left(\boldsymbol {x} _ {q}\right) \right\| _ {2} ^ {2}, \tag {8}
+$$
+
+where $f^{*}(\pmb{x}) = \mathbb{E}_{\pmb{x}_{p}^{\prime}\sim p_{\psi}}k_{\phi}(\pmb{x},\pmb{x}_{p}^{\prime}) - \mathbb{E}_{\pmb{x}_{q}^{\prime}\sim q(\pmb{x}_{0})}k_{\phi}(\pmb{x},\pmb{x}_{q}^{\prime})$ is the witness function for any differentiable, positive definite kernel $k$ , and $k_{\phi}(\pmb{x},\pmb{y}) = k(\phi (\pmb {x}),\phi (\pmb {y}))$ . Note that $f^{*}$ attains the supremum of the MMD. To enable stochastic gradient descent, we use an unbiased estimator of KID using a minibatch of $n$ model samples $\pmb{x}_p^{(1)}\dots \pmb{x}_p^{(n)}\sim p_\psi$ and $n$ real samples $\pmb{x}_q^{(1)}\dots \pmb{x}_q^{(n)}\sim q$ :
+
+$$
+\frac {1}{n (n - 1)} \sum_ {i \neq j} ^ {n} k _ {\phi} \left(\boldsymbol {x} _ {p} ^ {(i)}, \boldsymbol {x} _ {p} ^ {(j)}\right) - \frac {2}{n ^ {2}} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {n} k _ {\phi} \left(\boldsymbol {x} _ {p} ^ {(i)}, \boldsymbol {x} _ {q} ^ {(j)}\right) + c, \tag {9}
+$$
+
+where $c$ is constant in $\psi$ . Since the sampling chain of any Gaussian diffusion process admits using the reparametrization trick, our loss function is fully differentiable with respect to the trainable variables $\psi$ . We empirically find that using the perceptual features is crucial; i.e., by trying $\phi(\pmb{x}) = \pmb{x}$ to compare images directly on pixel space rather than neural network feature space (as above), we observe that our method makes samples consistently worsen in apparent quality as training progresses.
+
+# 3.2 GRADIENT REMATERIALIZATION
+
+In order for backpropagation to be feasible under reasonable memory constraints, one final problem must be addressed: since we are taking gradients with respect to model samples, the cost in memory to maintain the state of the forward pass scales linearly with the number of inference steps, which can quickly become unfeasible considering the large size of typical DDPM architectures. To address this issue, we use gradient rematerialization (Kumar et al., 2019b). Instead of storing a particular computation's output from the forward pass required by the backward pass computation, we recompute it on the fly. To trade $\mathcal{O}(K)$ memory cost for $\mathcal{O}(K)$ computation time, we simply rematerialize calls to the pre-trained DDPM (i.e., the estimated score function), but keep in memory all the progressively denoised images from the sampling chain. In JAX (Bradbury et al., 2018), this is trivial to implement by simply wrapping the score function calls with jax.remat.
+
+# 4 GENERALIZED GAUSSIAN DIFFUSION MODELS
+
+We now present Generalized Gaussian Diffusion Model (GGDM), our novel family of Gaussian diffusion processes that includes DDIM as a special case mentioned in section 3. We define a joint distribution with no independence assumptions
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {0}, \dots , \boldsymbol {x} _ {T}) = q (\boldsymbol {x} _ {0}) q (\boldsymbol {x} _ {T} | \boldsymbol {x} _ {0}) \prod_ {t = 1} ^ {T - 1} q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {> t}, \boldsymbol {x} _ {0}) \tag {10}
+$$
+
+where the new factors are defined as
+
+$$
+q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {> t}, \boldsymbol {x} _ {0}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Bigg | \sum_ {u \in S _ {t}} \mu_ {t u} \boldsymbol {x} _ {u}, \sigma_ {t} ^ {2} \boldsymbol {I} _ {d}\right) \tag {11}
+$$
+
+(letting $S_{t} = \{0,\dots,T\} \setminus \{1,\dots,t\}$ for notation compactness), with $\sigma_{t}$ and $\mu_{tu}$ free parameters $\forall t\in \{1,\dots,T\} ,u\in S_t$ . In other words, when predicting the next, less noisy image, the sampler can take into account all the previous, noisier images in the sampling chain, and similarly to DDIM, we can also control the sampler's variances. As we prove in the appendix (A.2), this construction admits Gaussian marginals, and we can differentiably compute the marginal coefficients from arbitrary choices of $\mu$ and $\sigma$ :
+
+Theorem 1. Given some $t \in \{1, \dots, T\}$ , let $a_{tu}^{(1)} = \mu_{tu} \forall u \in S_t$ and $v_t^{(1)} = \sigma_t^2$ . For each $i \in \{1, \dots, T - t\}$ , recursively define
+
+$$
+a _ {t u} ^ {(i + 1)} = a _ {t, t + i} ^ {(i)} \mu_ {t + i, u} + a _ {t u} ^ {(i)} \forall u \in S _ {t + i} \quad \text {a n d} \quad v _ {t} ^ {(i + 1)} = v _ {t} ^ {(i)} + \left(a _ {t, t + i} ^ {(i)} \sigma_ {t + i}\right) ^ {2}.
+$$
+
+Then, it follows that
+
+$$
+q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {> t + i}, \boldsymbol {x} _ {0}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Bigg | \sum_ {u \in S _ {t + i}} a _ {t u} ^ {(i + 1)} \boldsymbol {x} _ {u}, v _ {t} ^ {(i + 1)} \boldsymbol {I} _ {d}\right). \tag {12}
+$$
+
+In other words, instead of letting the $\beta_{t}$ (or equivalently, the $\bar{\alpha}_{t}$ ) define the forward process as done by a usual DDPM, the GGDM family lets the $\mu_{tu}$ and $\sigma_{t}$ define the process. In particular, an immediate corollary of Theorem 1 is that the marginal coefficients are given by
+
+$$
+q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {0}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t} \mid a _ {t 0} ^ {(T - t + 1)} \boldsymbol {x} _ {0}, v _ {t} ^ {(T - t + 1)} \boldsymbol {I} _ {d}\right) \tag {13}
+$$
+
+The reverse process is thus defined as $p(\boldsymbol{x}_T)\prod_{t=1}^{T}p(\boldsymbol{x}_{t-1}|\boldsymbol{x}_t)$ with $p(\boldsymbol{x}_T)\sim \mathcal{N}(\boldsymbol{0},\boldsymbol{I}_d)$ and
+
+$$
+p _ {\theta} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {> t}\right) = q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {> t}, \hat {\boldsymbol {x}} _ {0} = \frac {1}{a _ {t 0} ^ {(T - t + 1)}} \left(\boldsymbol {x} _ {t} - \sqrt {v _ {t} ^ {(T - t + 1)}} \boldsymbol {\epsilon} _ {\theta} \left(\boldsymbol {x} _ {t}, t\right)\right)\right). \tag {14}
+$$
+
+Table 1: FID and IS scores for DDSS against baseline methods for a DDPM trained on CIFAR10 with the $L_{\text{simple}}$ objective proposed by (Ho et al., 2020). FID scores (lower is better) are the numbers at the left of each entry, and IS scores (higher is better) are at the right.
+
+| Sampler \ K | 5 | 10 | 15 | 20 | 25 |
| DDPM (linear stride) | 84.27 / 5.396 | 43.39 / 7.034 | 31.40 / 7.609 | 25.94 / 7.879 | 22.60 / 8.043 |
| DDPM (quadratic stride) | 76.25 / 5.435 | 42.03 / 6.965 | 27.78 / 7.714 | 20.225 / 8.128 | 16.17 / 8.350 |
| DDIM (linear stride) | 44.41 / 6.750 | 19.11 / 7.965 | 14.06 / 8.190 | 11.82 / 8.420 | 10.52 / 8.512 |
| DDIM (quadratic stride) | 32.66 / 7.090 | 13.62 / 8.190 | 9.318 / 8.495 | 7.500 / 8.641 | 6.560 / 8.759 |
| GGDM +PRED+TIME | 13.77 / 8.520 | 8.227 / 8.903 | 6.115 / 9.050 | 4.722 / 9.261 | 4.250 / 9.186 |
+
+Table 2: FID / IS scores for DDSS against baseline methods for a DDPM trained on ImageNet 64x64 with the $L_{\mathrm{hybrid}}$ objective proposed by Nichol & Dhariwal (2021).
+
+| Sampler \ K | 5 | 10 | 15 | 20 | 25 |
| DDPM (linear stride) | 122.0 / 5.878 | 58.78 / 10.67 | 39.30 / 13.22 | 31.36 / 14.72 | 26.36 / 15.71 |
| DDPM (quadratic stride) | 394.8 / 1.351 | 129.5 / 5.997 | 80.10 / 9.595 | 61.34 / 11.60 | 49.60 / 13.01 |
| DDIM (linear stride) | 135.4 / 5.898 | 40.70 / 12.225 | 28.54 / 13.99 | 24.225 / 14.75 | 22.13 / 15.16 |
| DDIM (quadratic stride) | 409.1 / 1.380 | 148.6 / 5.533 | 67.65 / 9.842 | 45.60 / 11.99 | 36.11 / 13.225 |
| GGDM +PRED+TIME | 55.14 / 12.90 | 37.32 / 14.76 | 24.69 / 17.225 | 20.69 /17.92 | 18.40 / 18.12 |
+
+# 4.1 IGNORING THE MATCHING MARGINALS CONDITION
+
+Unlike DDIM, the GGDM family does not guarantee that the marginals of the new forward process match that of the original DDPM. We empirically find, however, that this condition can often be too restrictive and better samplers exist where the marginals $q_{\mu,\sigma}(\pmb{x}_t|\pmb{x}_0) = \mathcal{N}\left(\pmb{x}_t\Big|a_{t0}^{(T-t+1)}\pmb{x}_0, v_t^{(T-t+1)}\pmb{I}_d\right)$ of the new forward process differ from the original DDPM's marginals. We verify this empirically by applying DDSS to both the family of DDIM sigmas and DDPM variances ("VARS" in Section 3): both sampler families have the same number of parameters (the reverse process variances), but the latter does not adjust the mean coefficients like DDIM to ensure matching marginals and still achieves similar or better scores than the former across sample quality metrics (and even outperforms the DDIM( $\eta=0$ ) baseline); see Section 5.2.
+
+# 5 EXPERIMENTS
+
+In order to emphasize that our method is compatible with any pre-trained DDPM, we apply our method on pre-trained DDPM checkpoints from prior work. Specifically, we experiment with the DDPM trained by Ho et al. (2020) with $L_{\text{simple}}$ on CIFAR10, as well as a DDPM following the exact configuration of Nichol & Dhariwal (2021) trained on ImageNet 64x64 (Deng et al., 2009) with their $L_{\text{hybrid}}$ objective (with the only difference being that we trained the latter ourselves for 3M rather than 1.5M steps). Both of these models utilize adaptations of the UNet architecture (Ronneberger et al., 2015) that incorporate self-attention layers (Vaswani et al., 2017).
+
+We evaluate all of our models on both FID and Inception Score (IS) (Salimans et al., 2016), comparing the samplers discovered by DDSS against DDPM and DDIM baselines with linear and quadratic strides. As previously mentioned, more recent methods for fast sampling are outperformed by DDIM when the budget of inference steps is as small as those we utilize in this work (5, 10, 15, 20, 25). All reported results on both of these approximate sample quality metrics were computed by comparing 50K model and training data samples, as is standard in the literature. Also as is standard, IS scores are computed 10 times, each time on 5K samples, and then averaged.
+
+In all of our experiments, we optimize the DDSS objective presented in Section 3.1 with the following hyperparameters:
+
+1. For every family of models we search over, we initialize the degrees of freedom such that training begins with a sampler matching DDPM with $K$ substeps following Song et al. (2020); Nichol & Dhariwal (2021).
+
+Table 3: FID / IS scores for the KID kernel ablation on CIFAR10. When not learning the timesteps, we fix them to a quadratic stride, as Table 1 shows this performs best on CIFAR10.
+
+| Sampler \ K | 5 | 10 | 15 | 20 | 25 |
| DDSS (linear kernel) | | | | | |
| GGDM +PRED+TIME | 13.77 / 8.520 | 8.227 / 8.903 | 6.115 / 9.050 | 4.722 / 9.261 | 4.250 / 9.186 |
| GGDM +PRED | 14.26 / 8.406 | 8.617 / 8.842 | 5.939 / 9.035 | 4.893 / 9.153 | 4.574 / 9.145 |
| GGDM +TIME | 12.85 / 8.383 | 7.858 / 8.895 | 6.265 / 9.075 | 5.367 / 9.136 | 4.887 / 9.229 |
| GGDM) | 14.45 / 8.281 | 8.154 / 8.892 | 7.045 / 8.939 | 5.477 / 9.183 | 4.815 / 9.189 |
| DDSS (cubic kernel) | | | | | |
| GGDM +PRED+TIME | 14.41 / 8.527 | 8.2257 / 9.007 | 5.895 / 9.036 | 4.932 / 9.092 | 4.278/ 9.286 |
| GGDM +PRED | 14.39 / 8.401 | 8.977 / 8.870 | 6.517 / 8.970 | 4.915 / 9.132 | 4.471 / 9.247 |
| GGDM +TIME | 12.35 / 8.406 | 7.879 / 8.852 | 6.682 / 8.999 | 5.639 / 9.058 | 4.631 / 9.189 |
| GGDM | 14.57 / 8.297 | 8.2252 / 8.836 | 6.727 / 8.904 | 5.569 / 9.177 | 4.668 / 9.192 |
+
+2. We apply gradient updates using the Adam optimizer (Kingma & Ba, 2015). We sweeped over the learning rate and used $\lambda = 0.0005$ . We did not sweep over other Adam hyperparameters and kept $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , and $\epsilon = 1 \times 10^{-8}$ .
+3. We tried batch sizes of 128 and 512 and opted for the latter, finding that it leads to better sample quality upon inspection. Since the loss depends on averages over examples as our experiments are on unconditional generation, this choice was expected.
+4. We run all of our experiments for 50K training steps and evaluate the discovered samplers at this exact number of training steps. We did not sweep over this value.
+
+We include our main results in Table 1 for CIFAR10 and Table 2 for ImageNet 64x64, comparing DDSS applied to GGDM +PRED+TIME against DDPM and DDIM baselines with linear and quadratic strides. All models use a linear kernel, i.e., $k_{\phi}(\pmb{x}, \pmb{y}) = \phi(\pmb{x})^{\top} \phi(\pmb{y})$ , which we found to perform slightly better than the cubic kernel used by Binkowski et al. (2018) (we ablate this in section 5.1). We omit the use of the learned variances of the ImageNet 64x64 model (i.e., following Nichol & Dhariwal (2021)), as we search for the variances ourselves via DDSS. We include samples for 5, 10 and 25 steps comparing the strongest DDIM baselines to DDSS + GGDM with a learned stride; see Figures 1 and 3. We include additional ImageNet 64x64 samples (A.1) and results for larger resolution datasets (A.4) in the appendix.
+
+# 5.1 ABLATIONS FOR KID KERNEL AND GGDM VARIANTS
+
+As our approach is compatible with any choice of KID kernel, we experiment with different choices of kernels. Namely, we try the simplest possible linear kernel, $k_{\phi}(\pmb{x}, \pmb{y}) = \phi(\pmb{x})^{\top} \phi(\pmb{y})$ , as well as the cubic kernel $k_{\phi}(\pmb{x}, \pmb{y}) = \left( \frac{1}{d} \phi(\pmb{x})^{\top} \phi(\pmb{y}) + 1 \right)^3$ used by Binkowski et al. (2018). We compare the performance of these two kernels, as well as different variations of GGDM (i.e., with and without TIME and PRED as defined in Section 3). Results are included for CIFAR10 across all budgets in Table 3. We also include a smaller version of this ablation for ImageNet 64x64 in the appendix (A.3).
+
+The results in this ablation show that the contributions of the linear kernel, timestep learning, and the empirical choice of learning the coefficients that predict $x_0$ all slightly contribute to better FID and IS scores. Importantly, however, removing any of these additions still allows us to comfortably outperform the strongest baselines. See also the results on LSUN in the appendix A.4, which also do not include these additional trainable variables.
+
+# 5.2 SEARCH SPACE ABLATION
+
+Now, in order to further demonstrate the key importance of optimizing our GGDM family to find high-fidelity samplers, we also apply DDSS to the less general DDIM and VARS families. We show that, while we still attain better scores than a regular DDPM, searching these less flexible families of samplers does not yield improvements as significant as with out novel GGDM family. In particular, optimizing the DDIM sigma coefficients does not outperform the corresponding DDIM $(\eta = 0)$ baseline on CIFAR10, which is not a surprising result as Song et al. (2020) show empirically that most choices of the $\sigma_t$ degrees of freedom lead to worse FID scores than setting them all to 0. These
+
+Table 4: FID / IS scores for the DDSS search space ablation on CIFAR10. All runs fix the timesteps to a quadratic stride and use a linear kernel except for the last row (we only include the GGDM results for ease of comparison).
+
+| Sampler \ K | 5 | 10 | 15 | 20 | 25 |
| DDIM(η = 0) | 32.66 / 7.090 | 13.62 / 8.190 | 9.318 / 8.495 | 7.500 / 8.641 | 6.560 / 8.759 |
| DDSS | | | | | |
| VARS | 33.08 / 7.096 | 15.33 / 8.559 | 9.693 / 8.845 | 7.297 / 8.924 | 6.172 / 9.057 |
| DDIM | 32.61 / 7.084 | 16.29 / 7.966 | 11.31 / 8.372 | 9.120 / 8.563 | 7.853 / 8.644 |
| GGDM | 14.45 / 8.281 | 8.154 / 8.892 | 7.045 / 8.939 | 5.477 / 9.183 | 4.815 / 9.189 |
| GGDM +PRED+TIME | 13.77 / 8.520 | 8.227 / 8.903 | 6.115 / 9.050 | 4.722 / 9.261 | 4.250 / 9.186 |
+
+results also show that optimizing the VARS can outperform DDSS applied to the DDIM family, and even the strongest $\mathrm{DDIM}(\eta = 0)$ baselines for certain budgets, justifying our choice of not enforcing the marginals to match (as discussed in Section 4.1).
+
+# 6 DISCUSSION
+
+When applied to a sufficiently flexible family (such as the GGDM family proposed in this work), DDSS consistently finds samplers that achieve better image generation quality than the strongest baselines in the literature for very few steps. This is qualitatively apparent in non-cherrypicked samples (e.g., $\mathrm{DDIM}(\eta = 0)$ tends to generate blurrier images and with less background details as the budget decreases), and multiple quantitative sample quality metrics (FID and IS) also reflect these results. Still, we observe limitations to our method. Finding samplers with inference step budgets as small as $K < 10$ that have little apparent loss in quality remains challenging with our proposed search family. And, while on CIFAR10 the metrics indicate significant relative improvement over sample quality metrics, the relative improvement on ImageNet 64x64 is less pronounced. We hypothesize that this is an inherent difficulty of ImageNet due to its high diversity of samples, and that in order to retain sample quality and diversity, it might be impossible to escape some minimum number of inference steps with score-based models as they might be crucial to mode-breaking.
+
+Beyond the empirical gains of applying our procedure, our findings shed further light into properties of pre-trained score-based generative models. First, we show that without fine-tuning a DDPM's parameters, these models are already capable of producing high-quality samples with very few inference steps, though the default DDPM sampler in this regime is usually suboptimal when using a few-step sampler. We further show that better sampling paths exist, and interestingly, these are determined by alternative variational lower bounds to the data distribution that make use of the score-based model but do not necessarily share the same marginals as the original DDPM forward process. Our findings thus suggest that enforcing this marginal-sharing constraint is unnecessary and can be too restrictive in practice.
+
+# 7 OTHER RELATED WORK
+
+Besides DDIM (Song et al., 2020), there have been more recent attempts at reducing the number of inference steps for DDPMs. Jolicoeur-Martineau et al. (2021) proposed a dynamic step size SDE solver that can reduce the number of calls to the modeled score function to $\sim 150$ on CIFAR10 (Krizhevsky et al., 2009) with minimal cost in FID scores, but quickly falls behind DDIM $(\eta = 0)$ with as many as 50 steps. Watson et al. (2021) proposed a dynamic programming algorithm that chooses log-likelihood optimal strides, but find that log-likelihood reduction has a mismatch with FID scores, particularly with in the very few step regime, also falling behind DDIM $(\eta = 0)$ in this front. Other methods that have been shown to help sample quality in the few-step regime include non-Gaussian variants of diffusion models (Nachmani et al., 2021) and adaptively adjusting the sampling path by introducing a noise level estimating network (San-Roman et al., 2021), but more thorough evaluation of sample quality achieved by these approaches is needed with budgets as small as those considered in this work.
+
+Other approaches to sampling DDPMs have also been recently proposed, though not for the explicit purpose of efficient sampling. Song et al. (2021b) derive a reverse SDE that, when discretized, uses
+
+
+Figure 3: Non-cherrypicked samples for a DDPM trained on CIFAR10, comparing the strongest DDIM $(\eta = 0)$ baseline and our approach. All samples were generated with the same random seeds. For reference, we include DDPM samples using all 1,000 steps (top right) and real images (bottom right).
+
+different coefficients than the ancestral samplers considered in this work. The same authors also derive "corrector" steps, which introduce additional calls to the pre-trained DDPM as a form of gradient ascent (Langevin dynamics) that help with quality but introduce computation cost, as well as an alternative sampling procedure using a probability flow ODE that shares the same marginals as the DDPM's original forward process. Huang et al. (2021) generalize this family of samplers to a "plug-in reverse SDE" that interpolates between a probability flow ODE and the reverse SDE, similarly to how the DDIM $\eta$ interpolates between an implicit probabilistic model and a stochastic reverse process. Our proposed search family includes discretizations of most of these cases for Gaussian processes, notably missing corrector steps, where reusing a single timestep is considered.
+
+# 8 CONCLUSION AND FUTURE WORK
+
+We propose Differentiable Diffusion Sampler Search (DDSS), a method for finding few-step samplers for Denoising Diffusion Probabilistic Models. We show how to optimize a perceptual loss over a space of diffusion processes that makes use of a pre-trained DDPM's samples by leveraging the reparametrization trick and gradient rematerialization. Our results qualitatively and quantitatively show that DDSS is able to significantly improve sample quality for unconditional image generation over prior methods on efficient DDPM sampling. The success of our method hinges on searching a novel, wider family of Generalized Gaussian Diffusion Model (GGDM) than those identified in prior work (Song et al., 2020). DDSS does not fine-tune the pre-trained DDPM, only needs to be applied once, has few hyperparameters, and does not require re-training the DDPM.
+
+Our findings suggest future directions to further reduce the number of inference steps while retaining high fidelity in generated samples. For instance, it is plausible to use different representations for the perceptual loss instead of those of a classifier, e.g., use representations from an unsupervised model such as SimCLR (Chen et al., 2020), to using internal representations learned by the pre-trained DDPM itself, which would eliminate the burden of additional computation. Moreover, considering the demonstrated benefits of applying DDSS to our proposed GGDM family of samplers (as opposed to narrower families like DDIM), we motivate future work on identifying more general families of samplers and investigating whether they help uncover even better samplers or lead to overfitting. Finally, identifying other variants of perceptual losses (e.g., that do not sample from the model), or alternative optimization strategies (e.g., gradient-free methods) that lead to similar results is important future work. This would make DDSS itself a more efficient procedure, as gradient-based optimization of our proposed loss requires extensive memory or computation requirements to backpropagate through the whole sampling chain.
+
+# REFERENCES
+
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. In arXiv, 2017.
+Mikołaj Bińkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying mmd gans. arXiv preprint arXiv:1801.01401, 2018.
+James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
+Ruojin Cai, Guandao Yang, Hadar Averbuch-Elor, Zekun Hao, Serge Belongie, Noah Snavely, and Bharath Hariharan. Learning Gradient Fields for Shape Generation. In ECCV, 2020.
+Nanxin Chen, Yu Zhang, Heiga Zen, Ron J. Weiss, Mohammad Norouzi, and William Chan. Wave-Grad: Estimating Gradients for Waveform Generation. In ICLR, 2021a.
+Nanxin Chen, Yu Zhang, Heiga Zen, Ron J. Weiss, Mohammad Norouzi, Najim Dehak, and William Chan. WaveGrad 2: Iterative Refinement for Text-to-Speech Synthesis. In INTERSPEECH, 2021b.
+Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big Self-Supervised Models are Strong Semi-Supervised Learners. In NeurIPS, 2020.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Prafulla Dhariwal and Alex Nichol. Diffusion models beat gans on image synthesis. arXiv preprint arXiv:2105.05233, 2021.
+Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
+Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. NeurIPS, 2020.
+Jonathan Ho, Chitwan Sahara, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. arXiv preprint arXiv:2106.15282, 2021.
+Chin-Wei Huang, Jae Hyun Lim, and Aaron Courville. A variational perspective on diffusion-based generative models and score matching. arXiv preprint arXiv:2106.02808, 2021.
+Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision, pp. 694-711. Springer, 2016.
+Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, and Ioannis Mitliagkas. Gotta go fast when generating data with score-based models. arXiv preprint arXiv:2105.14080, 2021.
+Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015.
+
+Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. In ICLR, 2013.
+Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. arXiv preprint arXiv:2107.00630, 2021.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical Report, 2009.
+Kundan Kumar, Rithesh Kumar, Thibault de Boissiere, Lucas Gestin, Wei Zhen Teoh, Jose Sotelo, Alexandre de Brebisson, Yoshua Bengio, and Aaron Courville. MelGAN: Generative Adversarial Networks for Conditional Waveform Synthesis. In NeurIPS, 2019a.
+Ravi Kumar, Manish Purohit, Zoya Svitkina, Erik Vee, and Joshua R Wang. Efficient rematerialization for deep networks. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pp. 15172-15181, 2019b.
+Shitong Luo and Wei Hu. Diffusion probabilistic models for 3d point cloud generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2837-2845, 2021.
+Eliya Nachmani, Robin San Roman, and Lior Wolf. Non gaussian denoising diffusion models. arXiv preprint arXiv:2106.07582, 2021.
+Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672, 2021.
+Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015.
+Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29: 2234-2242, 2016.
+Robin San-Roman, Eliya Nachmani, and Lior Wolf. Noise estimation for generative diffusion models. arXiv preprint arXiv:2104.02600, 2021.
+Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256-2265. PMLR, 2015.
+Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020.
+Yang Song and Stefano Ermon. Generative Modeling by Estimating Gradients of the Data Distribution. NeurIPS, 2019.
+Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of score-based diffusion models. arXiv e-prints, pp. arXiv-2101, 2021a.
+Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-Based Generative Modeling through Stochastic Differential Equations. In ICLR, 2021b.
+Markus Svensén and Christopher M Bishop. Pattern recognition and machine learning, 2007.
+Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the Inception Architecture for Computer Vision. In CVPR, 2016.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. In NIPS, 2017.
+Pascal Vincent. A connection between score matching and denoising autoencoders. *Neural Computation*, 23(7):1661-1674, 2011.
+
+Daniel Watson, Jonathan Ho, Mohammad Norouzi, and William Chan. Learning to efficiently sample from diffusion probabilistic models. arXiv preprint arXiv:2106.03802, 2021.
+Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
+
+# A APPENDIX
+
+# A.1 ADDITIONAL IMAGENET 64X64 SAMPLES
+
+We provide additional samples for our results on ImageNet 64x64. The DDPM and DDIM $(\eta = 0)$ samples (left and middle, respectively) use a linear stride, while our DDSS + GGDM samples (right) use a learned stride.
+
+
+Figure A.1: Additional samples on ImageNet 64x64. For reference, we include DDPM samples with all 4,000 steps (bottom left) and real samples (bottom middle).
+
+# A.2 PROOF FOR THEOREM 1
+
+Theorem 1. Given some $t \in \{1, \dots, T\}$ , let $a_{tu}^{(1)} = \mu_{tu} \forall u \in S_t$ and $v_t^{(1)} = \sigma_t^2$ . For each $i \in \{1, \dots, T - t\}$ , recursively define
+
+$a_{tu}^{(i + 1)} = a_{t,t + i}^{(i)}\mu_{t + i,u} + a_{tu}^{(i)}\forall u\in S_{t + i}$
+$v_{t}^{(i + 1)} = v_{t}^{(i)} + \left(a_{t,t + i}^{(i)}\sigma_{t + i}\right)^{2}$
+
+Then, it follows that
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {> t + i}, \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Bigg | \sum_ {u \in S _ {t + i}} a _ {t u} ^ {(i + 1)} \boldsymbol {x} _ {u}, v _ {t} ^ {(i + 1)} \boldsymbol {I} _ {d}\right)
+$$
+
+Proof. Let us prove this result with mathematical induction. Note that, for each such $t$ , we have by definition that
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {t + 1} | \boldsymbol {x} _ {> t + 1}, \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + 1}} \mu_ {t + 1, u} \boldsymbol {x} _ {u}, \sigma_ {t + 1} ^ {2} \boldsymbol {I} _ {d}\right)
+$$
+
+and
+
+$$
+q _ {\mu , \sigma} (\pmb {x} _ {t} | \pmb {x} _ {t + 1}, \pmb {x} _ {> t + 1}, \pmb {x} _ {0}) = \mathcal {N} (\pmb {x} _ {t} | \sum_ {u \in S _ {t}} \mu_ {t u} \pmb {x} _ {u}, \sigma_ {t} ^ {2} \pmb {I} _ {d}) = \mathcal {N} (\pmb {x} _ {t} | \sum_ {u \in S _ {t}} a _ {t u} ^ {(1)} \pmb {x} _ {u}, v _ {t} ^ {(1)} \pmb {I} _ {d})
+$$
+
+Therefore, following Svensén & Bishop (2007) (2.115), by prior conjugacy it follows that
+
+$$
+\begin{array}{l} q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {> t + 1}, \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | a _ {t, t + 1} ^ {(1)} \sum_ {u \in S _ {t + 1}} \mu_ {t + 1, u} \boldsymbol {x} _ {u} + \sum_ {u \in S _ {t + 1}} a _ {t u} ^ {(1)}, \left(v _ {t} ^ {(1)} + a _ {t, t + 1} ^ {(1)} \sigma_ {t + 1} ^ {2} a _ {t, t + 1} ^ {(1)}\right) \boldsymbol {I} _ {d}\right) \\ = \mathcal {N} \left(\boldsymbol {x} _ {t} \mid \sum_ {u \in S _ {t + 1}} \left(a _ {t, t + 1} ^ {(1)} \mu_ {t + 1, u} + a _ {t u} ^ {(1)}\right) \boldsymbol {x} _ {u}, v _ {t} ^ {(2)} \boldsymbol {I} _ {d}\right) \\ = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + 1}} a _ {t u} ^ {(2)} \boldsymbol {x} _ {u}, v _ {t} ^ {(2)} \boldsymbol {I} _ {d}\right). \\ \end{array}
+$$
+
+This proves the base case for our induction argument. Now, let us prove the inductive step. Suppose there exists some integer $j \in \{1, \dots, T - t + 1\}$ such that
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {> t + j}, \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + j}} a _ {t u} ^ {(j + 1)} \boldsymbol {x} _ {u}, v _ {t} ^ {(j + 1)} \boldsymbol {I} _ {d}\right).
+$$
+
+By definition, we already know $q(\pmb{x}_{t + j + 1} | \pmb{x}_{>t + j + 1}, \pmb{x}_0)$ , so we have
+
+$$
+q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t + j + 1} \mid \boldsymbol {x} _ {> t + j + 1}, \boldsymbol {x} _ {0}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t + j + 1} \Big | \sum_ {u \in S _ {t + j + 1}} \mu_ {t + j + 1, u} \boldsymbol {x} _ {u}, \sigma_ {t + j + 1} ^ {2} \boldsymbol {I} _ {d}\right)
+$$
+
+and (rewriting the inductive hypothesis)
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {t + j + 1}, \boldsymbol {x} _ {> t + j + 1}, \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + j}} a _ {t u} ^ {(j + 1)} \boldsymbol {x} _ {u}, v _ {t} ^ {(j + 1)} \boldsymbol {I} _ {d}\right).
+$$
+
+Therefore, by prior conjugacy again, it follows that
+
+$$
+\begin{array}{l} q _ {\mu , \sigma} \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {> t + j + 1}, \boldsymbol {x} _ {0}\right) \\ = \mathcal {N} \left(\boldsymbol {x} _ {t} \mid a _ {t, t + j + 1} ^ {(j + 1)} \sum_ {u \in S _ {t + j}} \mu_ {t + j + 1, u} \boldsymbol {x} _ {u} + \sum_ {u \in S _ {t + j}} a _ {t u} ^ {(j + 1)}, \left(v _ {t} ^ {(j + 1)} + a _ {t, t + j + 1} ^ {(j + 1)} \sigma_ {t + j + 1} ^ {2} a _ {t, t + j + 1} ^ {(j + 1)}\right) \boldsymbol {I} _ {d}\right) \\ = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + j}} \left(a _ {t, t + j + 1} ^ {(j + 1)} \mu_ {t + j + 1, u} + a _ {t u} ^ {(j + 1)}\right) \boldsymbol {x} _ {u}, v _ {t} ^ {(j + 2)} \boldsymbol {I} _ {d}\right) \\ = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | \sum_ {u \in S _ {t + j + 1}} a _ {t u} ^ {(j + 2)} \boldsymbol {x} _ {u}, v _ {t} ^ {(j + 2)} \boldsymbol {I} _ {d}\right). \\ \end{array}
+$$
+
+This concludes the proof of the inductive step. Hence, we have proven the result for any $i \in \{1, \dots, T - t\}$ . In particular,
+
+$$
+q _ {\mu , \sigma} (\boldsymbol {x} _ {t} | \boldsymbol {x} _ {0}) = \mathcal {N} \left(\boldsymbol {x} _ {t} \Big | a _ {t 0} ^ {(T - t + 1)} \boldsymbol {x} _ {0}, v _ {t} ^ {(T - t + 1)} \boldsymbol {I} _ {d}\right). \quad \square
+$$
+
+# A.3 ADDITIONAL ABLATION OF KID KERNEL AND GGDM VARIANTS FOR IMAGENET 64x64
+
+We also ran a smaller version of the ablation results presented in Section 5.1, but for ImageNet 64x64 instead of CIFAR10, as these are more computationally intensive to do a full grid search. Results for a step budget $K = 15$ are included below. When not learning the timesteps, we fix them to a linear stride, as Table 2 shows this performs best on ImageNet 64x64.
+
+| Sampler \ K | 15 |
| DDSS (linear kernel) | |
| GGDM +PRED+TIME | 24.69 / 17.225 |
| GGDM +PRED | 27.08 / 16.44 |
| GGDM +TIME | 25.73 / 17.27 |
| GGDM | 28.34 / 16.63 |
| DDSS (cubic kernel) | |
| GGDM +PRED+TIME | 26.52 / 16.29 |
| GGDM +PRED | 27.82 / 16.3 |
| GGDM +TIME | 26.87 / 16.99 |
| GGDM | 28.83 / 16.32 |
+
+# A.4 RESULTS ON LARGER RESOLUTION DATASETS
+
+We include results for LSUN (Yu et al., 2015) bedrooms and churches at the $128 \times 128$ resolution. We trained the models for $400\mathrm{K}$ and $200\mathrm{K}$ steps (respectively), and all other hyperparameters are identical: we use the Adam optimizer with learning rate 0.0003 (linearly warmed up for the first 1000 training steps), batch size 2048, gradient clipping at norms over 1.0, dropout of 0.1, and EMA over the weights with decay rate 0.9999. We train the models using a linear stride of 1000 evenly-spaced timesteps, fixing the log-signal-to-noise-ratio schedule to a cosine function monotonically decreasing from 20 to -20. The ELBO is reweighted with $L_{\mathrm{simple}}$ following Ho et al. (2020), but we additionally reweight each term by $\max(1, \mathrm{SNR})$ which we found to be slightly helpful in resulting FID scores (note this is equivalent to minimizing the worst mean squared error between either the $x_0$ or $\epsilon$ ). The UNet employs five down/up-sampling resolutions with $768 \times (1, 2, 4, 6, 8)$ respective channels, 3 ResNet blocks per resolution, and spatial self-attention at the 3 smallest resolutions, i.e., 8, 16, and 32.
+
+After training the models, we run DDSS using just the GGDM model family for simplicity (i.e., we don't use the +PRED and +TIME we experiment with in the paper) at 5, 10 and 20 evenly-spaced inference steps. DDSS training occurs for 50K steps, using the Adam optimizer with learning rate of 0.0005 and batch size 512, optimizing the linear kernel for the KID loss. We compare against the usual DDPM and $\mathrm{DDIM}(\eta = 0)$ baselines at the same inference budgets and include the FID scores with all 1000 steps for reference. Results and samples are included below.
+
+| Sampler \ K | 5 | 10 | 20 | 1000 |
| LSUN Bedroom | | | | |
| DDPM | 95.38 | 44.84 | 16.88 | 2.547 |
| DDIM(η = 0) | 168.7 | 56.33 | 9.527 | - |
| DDSS (GGDM) | 29.15 | 11.01 | 4.817 | - |
| LSUN Church | | | | |
| DDPM | 96.67 | 51.05 | 16.53 | 2.718 |
| DDIM(η = 0) | 133.1 | 54.39 | 14.96 | - |
| DDSS (GGDM) | 30.24 | 11.59 | 6.736 | - |
+
+
+Figure A.2: Non-cherrypicked samples for a DDPM trained on LSUN bedroom $128 \times 128$ , comparing DDPM and $\mathrm{DDIM}(\eta = 0)$ to our approach. All samples were generated with the same random seeds and a linear stride. For reference, we include DDPM samples using all 1,000 steps (bottom left) and real images (bottom middle).
+
+
+Figure A.3: Non-cherrypicked samples for a DDPM trained on LSUN church $128 \times 128$ , comparing DDPM and $\mathrm{DDIM}(\eta = 0)$ to our approach. All samples were generated with the same random seeds and a linear stride. For reference, we include DDPM samples using all 1,000 steps (bottom left) and real images (bottom middle).
\ No newline at end of file
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/images.zip b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..de638bc6d2ab6984850a31f3dc2a29e7f384025f
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:06a81cbd6201e6276ea65184e6c43e8950c19abd56860563181f560923401c99
+size 1691366
diff --git a/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/layout.json b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..05ce4d1480ee051607e963b81791b29dda639ec9
--- /dev/null
+++ b/learningfastsamplersfordiffusionmodelsbydifferentiatingthroughsamplequality/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0cd8686e78c4bc85f290ba4fd2c651b89688c00fdedb26168e37b8c7c4e8c70c
+size 452051
diff --git a/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_content_list.json b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5943cf916add319b1acbe0e3a88159cc1d41089b
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:72d60f1dc9abbc36de665d388f99ddd636e905edef085bd22f9fcd6130f03090
+size 130411
diff --git a/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_model.json b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3170943a05ceec9ec219b7207e824c337741de27
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:72e6b5b2c50d3927835b569b14d2fdf5fe116171050adb1538c98b57deb16b88
+size 156012
diff --git a/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_origin.pdf b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..cdd0c816dc96c7ad7a9ed7340bd3da0acf7a605e
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/613c594d-72d0-4f20-8a6b-3182e22b71c2_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c740fb1635c5af98f6dc2a235470e3100bf158a82fbb9a0807c155a911cff282
+size 6089390
diff --git a/learningfeatureswithparameterfreelayers/full.md b/learningfeatureswithparameterfreelayers/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..5a6a3b20f5017716af210757afdbb447ef093f4d
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/full.md
@@ -0,0 +1,488 @@
+# LEARNING FEATURES WITH PARAMETER-FREE LAYERS
+
+Dongyoon Han $^{1}$ , YoungJoon Yoo $^{1,2}$ , Beomyoung Kim $^{2}$ , Byeongho Heo $^{1}$
+
+$^{1}$ NAVER AI Lab, $^{2}$ NAVER CLOVA
+
+# ABSTRACT
+
+Trainable layers such as convolutional building blocks are the standard network design choices by learning parameters to capture the global context through successive spatial operations. When designing an efficient network, trainable layers such as the depthwise convolution is the source of efficiency in the number of parameters and FLOPs, but there was little improvement to the model speed in practice. This paper argues that simple built-in parameter-free operations can be a favorable alternative to the efficient trainable layers replacing spatial operations in a network architecture. We aim to break the stereotype of organizing the spatial operations of building blocks into trainable layers. Extensive experimental analyses based on layer-level studies with fully-trained models and neural architecture searches are provided to investigate whether parameter-free operations such as the max-pool are functional. The studies eventually give us a simple yet effective idea for redesigning network architectures, where the parameter-free operations are heavily used as the main building block without sacrificing the model accuracy as much. Experimental results on the ImageNet dataset demonstrate that the network architectures with parameter-free operations could enjoy the advantages of further efficiency in terms of model speed, the number of the parameters, and FLOPs. Code and ImageNet pretrained models are available at https://github.com/naver-ai/PfLayer.
+
+# 1 INTRODUCTION
+
+Image classification has been advanced with deep convolutional neural networks (Simonyan & Zisserman, 2015; Huang et al., 2017; He et al., 2016b) with the common design paradigm of the network building blocks with trainable spatial convolutions inside. Such trainable layers with learnable parameters effectively grasp attentive signals to distinguish input but are computationally heavy. Rather than applying pruning or distillation techniques to reduce the computational cost, developing new efficient operations has been another underlying strategy. For example, a variant of the regular convolution, such as depthwise convolution (Howard et al., 2017) has been proposed to bring more efficiency by reducing the inter-channel computations. The operation has benefits in the computational budgets, including the number of parameters and FLOPs. However, the networks heavily using the depthwise convolution (Howard et al., 2017; Sandler et al., 2018; Tan & Le, 2019) have an inherent downside of the latency, which generally do not reach the speed of the regular convolution.
+
+In a line of study of efficient operations, there have been many works (Wang et al., 2018; Wu et al., 2018; Han et al., 2020; Tan & Le, 2021) based on the regular convolution and the depthwise convolution. Most methods utilize the depthwise convolution's efficiency or target FLOPs-efficiency but are slow in the computation. Meanwhile, parameter-free operations were proposed; a representative work is the Shift operation (Wu et al., 2018). Its efficiency stems from the novel operation without learning spatial parameters by letting the feature mixing convolutions learn from the shifted features. However, the implementation does not bring about the actual speed-up as expected. This is because the operation-level optimization is still demanding compared to the regular convolution with highly optimized performance. Another parameter-free operation feature shuffling (Zhang et al., 2018) is a seminal operation that reduces the computational cost of the feature mixing layer. However, it hardly plays the role of a spatial operation.
+
+In this paper, we focus on efficient parameter-free operations that actually replace trainable layers for network design. We revisit the popular parameter-free operations, the max-pool and the avg-pool op
+
+erations (i.e., layers), which are used in many deep neural networks (Simonyan & Zisserman, 2015; Huang et al., 2017) restricted to perform downsampling (Simonyan & Zisserman, 2015; Howard et al., 2017; Sandler et al., 2018; He et al., 2016b). Can those simple parameter-free operations be used as the main network building block? If so, one can reduce a large portion of the parameters and the overall computational budget required during training and inference. To answer the question, the max-pool and the avg-pool operations are chosen to be demonstrated as representative simple parameter-free operations. We first conduct comprehensive studies on the layer replacements of the regular convolutions inside networks searched upon the baseline models with model training. Additionally, we incorporate a neural architecture search (Liu et al., 2019) to explore effective architectures based on the operation list with the parameter-free operations and convolutional operations. Based on the investigations, we provide a simple rule of thumb to design an efficient architecture using the parameter-free operations upon primitive network architectures. The design guide is applied to popular heavy networks and validated by the performance trained on ImageNet (Russakovsky et al., 2015). It turns out that our models have apparent benefits to the computational costs, particularly the faster model speeds. In addition, ImageNet-C (Hendrycks & Dietterich, 2019) and ImageNet-O (Hendrycks et al., 2021) results show our models are less prone to be overfitting. We further propose a novel deformable parameter-free operation based on the max-pool and the avg-pool to demonstrate the future of a parameter-free operation. Finally, we show that the parameter-free operations can successfully replace the self-attention layer (Vaswani et al., 2017), thus attaining further efficiency and speed up. We summarize our contributions as follows:
+
+- We study whether parameter-free operations can replace trainable layers as a network building block. To our knowledge, this is the first attempt to investigate a simple, built-in parameter-free layer as a building block for further efficiency (§3).
+- We provide a rule of thumb for designing a deep neural network including convolutional neural networks and vision transformers with parameter-free layers (§4).
+- Experimental results show that our efficient models outperform the previous efficient models and yield faster model speeds with further robustness ( $\S 5$ ).
+
+# 2 PRELIMINARIES
+
+A network building block where trainable layers are inside is a fundamental element of modularized networks (Xie et al., 2017; Sandler et al., 2018; Tan & Le, 2019). We start a discussion with the elementary building block and then explore more efficient ones.
+
+# 2.1 BASIC BUILDING BLOCKS
+
+Convolution Layer. We recall the regular convolutional operation by formulating with matrix multiplication first. Let $f \in \mathcal{R}^{c_{in} \times H \times W}$ as the input feature, the regular convolution of the feature $f$ with kernel size $k$ and stride $r$ is given as
+
+$$
+y _ {o, i, j} = \sigma \left(\sum_ {h, w = - \lfloor k / 2 \rfloor} ^ {\lfloor k / 2 \rfloor} \sum_ {u = 1} ^ {c _ {i n}} W _ {o, u, h, w} \cdot f _ {u, r * i + h, r * j + w}\right), \tag {1}
+$$
+
+where $W$ denotes the weight matrix, and the function $\sigma(\cdot)$ denotes an activation function such as ReLU (Nair & Hinton, 2010) with or without batch normalization (BN) (Ioffe & Szegedy, 2015). The convolution itself has been a building block due to the expressiveness and design flexibility. VGG (Simonyan & Zisserman, 2015) network was designed by accumulating the $3 \times 3$ convolution to substitute the convolutions with larger kernel sizes but still have high computational costs.
+
+Bottleneck Block. We now recall the bottleneck block, which primarily aimed at efficiency. We represent the bottleneck block by the matrix multiplication as equation 1:
+
+$$
+y _ {o, i, j} = \sigma \left(\sum_ {v = 1} ^ {\rho c _ {i n}} P _ {o, v} \cdot \sigma \left(\sum_ {h, w = - \lfloor k / 2 \rfloor} ^ {\lfloor k / 2 \rfloor} \sum_ {u = 1} ^ {\rho c _ {i n}} W _ {v, u, h, w} \cdot g _ {v, r * i + h, r * j + w}\right)\right), \tag {2}
+$$
+
+where $g_{o,i,j} = \sigma \left( \sum_{u=1}^{c_{in}} Q_{o,u} \cdot f_{u,i,j} \right)$ , and the matrix $P$ and $Q$ denote the weights of $1 \times 1$ convolutions with the inner dimensions $\rho c_{in}$ . This design regime is efficient in terms of the computational budgets and even proven to be effective in the generalization ability when stacking up the bottleneck blocks compared with the basic blocks. Albeit a $3 \times 3$ convolution is replaced with two feature
+
+mixing layers (i.e., $1 \times 1$ convolutions), the expressiveness is still high enough with a low channel expansion ratio $\rho$ (i.e., $\rho = 1/4$ in ResNet (He et al., 2016b; Xie et al., 2017)). However, due to the presence of the regular $3 \times 3$ convolution, only adjusting $\rho$ hardly achieves further efficiency.
+
+# 2.2 EFFICIENT BUILDING BLOCKS
+
+Inverted Bottleneck. The grouped operations, including the group convolution (Xie et al., 2017) and the depthwise convolution (Howard et al., 2017)) have emerged as more efficient building blocks. Using the depthwise convolution inside a bottleneck (Sandler et al., 2018) is called the inverted bottleneck, which is represented as
+
+$$
+y _ {o, i, j} = \sigma \left(\sum_ {v = 1} ^ {\rho c _ {i n}} P _ {o, v} \cdot \sigma \left(\sum_ {h, w = - \lfloor k / 2 \rfloor} ^ {\lfloor k / 2 \rfloor} W _ {v, h, w} \cdot g _ {v, r * i + h, r * j + w}\right)\right), \tag {3}
+$$
+
+where the summation over the channels in equation 2 has vanished. This slight modification takes advantage of further generalization ability, and therefore stacking of the blocks leads to outperform ResNet with a better trade-off between accuracy and efficiency as proven in many architectures (Tan & Le, 2019; Han et al., 2021). The feature mixing operation in equation 2 with the following pointwise activation function (i.e., ReLU) may offer a sufficient rank of the feature with the efficient operation. However, the inverted bottleneck and the variants below usually need a large expansion ratio $\rho > 1$ to secure the expressiveness (Sandler et al., 2018; Howard et al., 2019; Tan & Le, 2019), so the actual speed is hampered by the grouped operation that requires more optimization on GPU (Gibson et al., 2020; Lu et al., 2021).
+
+Variants of Inverted Bottleneck. More refinements on the bottleneck block could bring further efficiency; the prior works (Wang et al., 2018; Han et al., 2020; Tan & Le, 2021; Wu et al., 2018) fully or partially redesigned the layers in the bottleneck with new operations, and therefore theoretical computational costs have been decreased. VersatileNet (Wang et al., 2018) replaced the convolutions with the proposed filters consisting of multiple convolutional filters; GhostNet (Han et al., 2020) similarly replaced the layers with the proposed module that concatenates a preceding regular convolution and additional depthwise convolution. Rather than involving new operations, a simple replacement by simplifying the operations has been proposed instead. EfficientNetV2 (Tan & Le, 2021) improved the training speed by fusing the pointwise and the depthwise convolutions to a single regular convolution. This takes advantage of using the highly-optimized operation rather than using new unoptimized operations. ShiftNet (Wu et al., 2018) simplify the depthwise convolution to the shift operation, where the formulation is very similar to equation 3:
+
+$$
+y _ {o, i, j} = \sigma \left(\sum_ {v = 1} ^ {\rho c _ {i n}} P _ {o, v} \cdot \sigma \left(\sum_ {h, w = - \lfloor k / 2 \rfloor} ^ {\lfloor k / 2 \rfloor} W _ {v, h, w} \cdot g _ {v, r * i + h, r * j + w}\right)\right), \tag {4}
+$$
+
+where $W_{v, \dots}$ is simplified to have one 1 and 0 for the rest all $h, w$ for each $v$ . This change involves a new operation, so-called Shift, that looks like shifting the features after the computation, and the preceding and the following pointwise convolutions mix the shifted output. The shift operation is actually classified as a parameter-free operation, but a large expansion ratio is yet needed to hold the expressiveness. Furthermore, the implementation is not as readily optimized as regular operations, even in CUDA implementation (He et al., 2019; Chen et al., 2019a).
+
+# 3 EFFICIENT BUILDING BLOCK WITH PARAMETER-FREE OPERATIONS
+
+In this section, we extend an efficient building block by incorporating parameter-free operations. We empirically study whether the parameter-free operations can be used as the main building block in deep neural networks like regular convolution.
+
+# 3.1 MOTIVATION
+
+The learning mechanism of ResNets (He et al., 2016b;a) has been analyzed as the iterative unrolled estimation (Greff et al., 2017; Jastrzebski et al., 2018) which iteratively refine the features owing to the presence of skip connections. This indicates that some layers do not contribute much to learning, which has also been revealed in layer-drop experiments (Veit et al., 2016; Huang et al., 2016). In this light, we argue some building blocks in a residual network can be replaced with parameter-free operations. We investigate the replacement of the spatial operation in popular networks with parameter-free operations to rethink the common practice of network design.
+
+
+SGD
+aannnnnne aennnnnne
+
+
+AdamW
+
+
+AdamP
+
+
+6
+Figure 1. Single bottleneck study. We visualize top-1 accuracy (solid lines) trained with the different setups including 1) varying channel expansion ratios inside a bottleneck; 2) the different channel widths: 32 (upper row) and 64 (lower row); 3) diverse optimizers: SGD (left), AdamW (middle), and AdamP (right); We further plot accuracy per # parameters (dashed lines) to show the parameter-efficiency of the operations. We observe the regular convolutions work well but be replaceable at a low channel expansion ratio; the alternative operations are highly efficient; the max-pool consistently beats the depthwise convolution.
+
+
+
+
+
+# 3.2 RETHINKING PARAMETER-FREE OPERATIONS
+
+Our goal is to design an efficient building block that boosts model speed in practice while maintaining model accuracy. Based on equation 2, we remove the inter-channel operation similarly done in equation 3 and equation 4. Then, instead of assigning $W_{v,h,w}$ to be a single value, as in equation 4, we let $W$ have a dependency on the feature $g$ (i.e., $W_{v,h,w} = s(g_{v,r*i + h,r*j + w})$ ) by introducing a function $s(\cdot)$ . Then, the layer would have different learning dynamics interacting with $P$ and $Q$ .
+
+Among many candidates to formalize $s(\cdot)$ , we allocate the function with a simple one that does not have trainable parameters. We let $s(\cdot)$ pick some large values of $g$ in the range of all $h, w$ per each $v$ like the impulse function. Here, we simplify the function $s(\cdot)$ again to use only the largest values of $g$ , where we have the representation of $W_{v,h^*,w^*} = 1$ , $(h^*,w^*) = \operatorname{argmax}_{(h,w)} g_{v,r*i + h,r*j + w}$ and other $W_{v,h,w}$ to be 0 in equation 3. One may come up with another simple option: let $s(\cdot)$ compute the moments such as mean or variance of $g$ . In practice, those operations can be replaced with built-in spatial pooling operations, which are highly optimized at the operation level. In the following section, we empirically study the effectiveness of efficient parameter-free operations in network designs.
+
+# 3.3 EMPIRICAL STUDIES
+
+On a Single Bottleneck. Our study begins with a single bottleneck block of ResNet (He et al., 2016b). We identify such a parameter-free operation can replace the depthwise convolution which is a strong alternative of the regular convolution. We train a large number of different architectures on CIFAR10 and observe the accuracy trend of trained models. The models consist of a single bottleneck, but the channel expansion ratio inside a bottleneck varies from 0.25 to 2, and there are two options for the base-channel width (32 and 64). Training is done with three different optimizers of SGD, AdamW (Loshchilov & Hutter, 2017b), and AdamP (Heo et al., 2021a). Finally, we have total $4 \times 2 \times 3 \times 3 = 72$ models for the study. Fig.1 exhibit that the parameter-free operation consistently outperforms the depthwise convolution in a bottleneck1. The regular convolutions clearly achieved higher absolute accuracy, but the efficiency (the accuracy over the number of parameters) is getting worse for larger expansion ratios. We observe that the accuracy gaps between the regular convolution and the parameter-free operation are low for small channel expansion ratios (especially at the ratio=1/4 where the original bottleneck (He et al., 2016b; Xie et al., 2017) adopts). It means that the regular convolution in the original bottleneck block with the expansion ratio of 1/4 can be replaced by the parameter-free operation.
+
+
+(a) Speed (1-image)
+
+
+Figure 2. Multiple bottlenecks study. We respectively pick the $20\%$ best-performing models and visualize in the comparison graphs: (a) Accuracy vs. speed with the batch size of 1; (b) Accuracy vs. speed with the batch size of 256; (c) Accuracy vs. # parameters; (d) Accuracy vs. FLOPs (use FLOPs to mean multiply-adds). The depthwise convolution (blue dots) is an efficient operation in # parameters and FLOPs, but the parameter-free operation (red dots) has a clear benefit in the model speed in practice. A particular parameter-free operation can be an alternative to the depthwise convolution when replacing the regular convolutions.
+
+
+(b) Speed (256-images)
+(c) # parameters
+
+
+(d) FLOPs
+
+On Multiple Bottlenecks. We extend the single bottleneck study to deeper networks having multiple bottleneck blocks. We similarly study the bottleneck with different spatial operations, including the depthwise convolution and parameter-free operations, replacing the regular convolution. We choose the max-pool operation again as the parameter-free operation and compare it with the depthwise convolution. To study the impact of repeatedly using parameter-free operations in-depth, we exhaustively perform the layer replacements at layer-level upon the baseline network. We report the trade-off between accuracy and speed by replacing the regular convolutions with the max-pool operation and the depthwise convolution. We use the baseline network, which has eight bottleneck blocks in a standard ResNet architecture (i.e., ResNet-26), and the study has done by replacing each block have efficient operations (i.e., the efficient bottleneck and the bottleneck with the depthwise convolution). We train all the networks with large epochs (300 epochs) due to the depthwise convolution. Fig.2 illustrates the trade-offs of top-1 accuracy and the actual model speed; we observe the models with the parameter-free operations are faster than those with the depthwise convolution as the model accuracies are comparable.
+
+Table 1. Neural architecture search with individual cell searches. We investigate how parameter-free operations are chosen with convolutional operations. Six different normal cells are searched individually, and two reduction cells are searched by a unified single cell. Surprisingly, the parameter-free operations are consistently found regardless of the settings. The parameter-free operations in each cell are represented as max @[(d, \( x_1; \ldots; x_i) ]) \) and avg @[(d, \( x_1; \ldots; x_i) ]) which denote the max-pool_3×3 and the avg-pool_3×3 appear at every edge towards \( x_1 \ldots x_i \)-th nodes in \( d \)-th (from the input) cell, respectively.
+
+| # of Nodes | Seed No. | Normal Cells | Reduction Cell | Prec-1 |
| 4 (unified cells) | 1 | no parameter-free ops. | avg @[(3, 2), (6, 2)] | 87.84% |
| 1 | 1 | max @[(5, 1)] | max @[(3, 1), (6, 1)] | 86.15% |
| 1 | 2 | max @[(2, 1)] | max @[(3, 1), (6, 1)] | 86.27% |
| 1 | 3 | max @[(2, 1)] | max @[(3, 1), (6, 1)] | 85.42% |
| 2 | 1 | max @[(2, 2), (5, 1;2)] | no parameter-free ops. | 87.64% |
| 2 | 2 | max @[(4, 2), (5, 1;2), (7, 2)], avg @[(7, 1)] | no parameter-free ops. | 87.70% |
| 2 | 3 | max @[(2, 1), (5, 1;2)] | no parameter-free ops. | 87.65% |
| 3 | 1 | max @[(5, 1;2;3), (7, 1;2;3] | max @[(3, 3), (6, 3)] | 88.09% |
| 3 | 2 | max @[(4, 2), (5, 2), (7, 2)], avg @[(7, 1)] | max @[(3, 3), (6, 3)] | 88.06% |
| 3 | 3 | max @[(4, 1;3), (5, 3)], avg @[(5, 2)] | no parameter-free ops. | 88.03% |
| 4 | 1 | max @[(2, 3;4), (5, 1;2;3;4), (7, 1)], avg @[(8, 1;2)] | avg @[(3, 1;2), (6, 1;2)] | 88.12% |
| 4 | 2 | max @[(4, 1;3;4), (5, 2;3;4), (7, 1;2;3;4)], avg @[(5, 1)] | no parameter-free ops. | 87.79% |
| 4 | 3 | max @[(2, 3), (7, 1;2)], avg @[(4, 1;2;3), (8, 2)] | avg @[(3, 2), (6, 2)] | 87.54% |
+
+On Neural Architecture Searches. We further investigate whether parameter-free operations are likely to be chosen for model accuracy along with trainable operations in a neural architecture search (NAS). We choose DARTS (Liu et al., 2019) with the default architecture of eight cells and perform searches on CIFAR-10 (Krizhevsky, 2009) $^{2}$ . Towards a more sophisticated study, we refine the search configuration as follows. First, we force the entire normal cells to be searched individually rather than following the default setting searching one unified normal cell. This is because when searching with the unified normal cell, it is more likely to be searched without the parameter-free operations to secure the expressiveness of the entire network (see the search result
+
+at the first row in Table 1). Therefore we prevent this with the more natural configuration. Second, the operation list is changed to ensure fairness of the expressiveness among the operations; since the primitive DARTS has the default operation list with the separable convolutions (SEP_CONV_3×3, SEP_CONV_5×5) and the dilated separable convolutions (DIL_CONV_3×3, DIL_CONV_5×5) which consist of multiple convolutions and ReLU with BN. Thus, we need to simplify the primitive operations to [MAXPOOL_3×3, AVGPOOL_3×3, CONV_1×1, CONV_3×3, DW_CONV_3×3, ZERO, SKIPConnect]. Finally, we further perform searches with different numbers of nodes inside each cell to confirm the trend of search results regarding the architectural constraint. All the searches are repeated with three different seed numbers.
+
+As shown in Table 1 and Fig.3, we observe the parameter-free operations are frequently searched in the normal cells, which is different from the original search result (at the first row) similarly shown in
+
+the previous works (Liu et al., 2019; Chen et al., 2019b; Liang et al., 2019; Chu et al., 2020). Moreover, the accuracies are similar to the original setting with two unified cells, where the parameter-free operations are not searched in the normal cell (see the first and the last rows). Interestingly, the number of the picked parameter-free operations increases as the number of nodes increases; they do not dominate the reduction cells. As a result, it turns out that the accuracy objective in searches lets the parameter-free operations become chosen, and therefore the operations can be used at certain positions which looks similar to the Inception
+
+
+(a) 5-th normal cell
+
+
+(b) 5-th normal cell
+(c) 7-th normal cell
+(d) 5-th normal cell
+Figure 3. Visualization of the searched cells. The example searched cells shown in Table 1 are visualized.
+
+blocks (Szegedy et al., 2015; Ioffe & Szegedy, 2015; Szegedy et al., 2016). Notice that similar results are produced with different settings and seeds.
+
+# 4 DESIGNING EFFICIENT DEEP NEURAL NETWORKS
+
+Based on the studies above, parameter-free operations can be a building block of designing a network architecture. We apply the parameter-free operations to redesign a deeper neural network architecture, including a convolution neural network (CNN) and a vision transformer (ViT).
+
+# 4.1 EFFICIENT CNN ARCHITECTURES
+
+Hybrid Architecture with Efficient Bottlenecks. We employ the proposed efficient bottleneck to design deeper efficient CNNs. The max-pool operation plays a role of the spatial operation in the efficient bottleneck; specifically, the $3 \times 3$ convolution, BN, and ReLU triplet are replaced with a max-pool operation3. To design the entire network architecture, fully utilizing the efficient bottlenecks would yield a much faster inference speed model, but a combination of the efficient bottleneck and the regular bottleneck has a better trade-off between accuracy and speed. We use ResNet50 (He et al., 2016b) as the baseline to equip a simple heuristic of building a hybrid architecture of the efficient bottleneck and the regular bottleneck. The observation from the NAS searches in §3.3, the parameter-free operations are not explored much at the downsampling blocks but normal blocks. Thus, we similarly design a new efficient network architecture using the efficient bottlenecks as the fundamental building block except for the downsampling positions with the regular bottlenecks. We call this model hybrid architecture. The details of the architectures are illustrated in Appendix A.
+
+Architectural Study. The architectural study is further conducted with the replacements of the regular spatial convolutions in the regular bottlenecks. We involve the efficient bottlenecks into the stages of ResNet50, replacing the existing regular bottlenecks exhaustively to cover the design space as much as possible. It is worth noting that performing a neural architecture search would yield a precise design guide, but a direct search on ImageNet is costly. We use the ImageNet dataset to provide a more convincing result of the investigation. We also report the performance of the competitive
+
+architectures replacing the spatial operations (i.e., the $3 \times 3$ convolutions) with 1) the $1 \times 1$ convolutions; 2) the $3 \times 3$ depthwise convolution in entire stages.
+
+Table 2 shows the trade-off between accuracy and speed of the different models mixing the regular and the efficient bottlenecks. $\mathbf{B}\rightarrow \mathbf{B}\rightarrow \mathbf{B}\rightarrow \mathbf{B}$ denotes the baseline ResNet50; $\mathbf{E} / \mathbf{B}$ denotes the model using the regular bottleneck and the efficient block alternately. Among the different models, we highlight hybrid and $\mathbf{E} / \mathbf{B}$ models due to the promising performance. This shows that only a simple module-based design regime can achieve improved performance over the baseline. $\mathbf{E}\rightarrow \mathbf{E}\rightarrow \mathbf{E}\rightarrow \mathbf{E}$ is the model using the efficient bottlenecks only and shows the fastest speed as we expected. The model with the $1\times 1$ convolution replacements cannot reach the accuracy standard presumably due to the lack of the receptive field; this is why a sufficient number of spatial operations are required. We observe that the model with the depthwise convolutions shows a promising performance, but our models surpass it as we similarly observed in §3.3. All the models are trained on ImageNet with the standard 90-epochs training setup $^4$ (He et al., 2016a) to report the performance.
+
+Table 2. Model study on ResNet50. We report the performance of hybrid model, which is the most promising model compared with others, and the models with stage-level combinations of the regular bottleneck and the efficient bottleneck (denoted by B and E, respectively).We further report the performance of two variant models by replacing each $3\times 3$ convolution with 1) a $1\times 1$ convolution; 2) a $3\times 3$ depthwise convolution in all the regular bottlenecks. The two best trade-off models are in boldface.
+
+| Models | GPU Lat. (ms) | Top-1 acc.(%) |
| Hybrid | 7.3 | 74.9 |
| E / B | 7.7 | 75.3 |
| B→B→B→B | 8.7 | 76.2 |
| E→B→B→B | 8.4 | 75.4 |
| E→E→B→B | 8.0 | 75.1 |
| E→E→E→B | 7.3 | 73.1 |
| E→E→E→E | 6.8 | 72.0 |
| B→B→B→E | 8.4 | 75.4 |
| B→B→E→E | 7.7 | 74.6 |
| B→E→E→E | 7.3 | 74.0 |
| 1×1 conv | 6.2 | 30.1 |
| 3×3 dwconv | 8.3 | 74.9 |
+
+# 4.2 EFFICIENT VIT ARCHITECTURES
+
+We provide a further use case of the parameter-free operations in a totally different architecture from CNN. We again choose the max-pool operation as the parameter-free operation and apply it to replace the self-attention layer (Vaswani et al., 2017) in vision transformer (ViT) (Dosovitskiy et al., 2021) to observe how the efficient operation can replace a complicated layer. We do not change the MLP in a transformer block but replace the self-attention module with the max-pool operation. Specifically, after the linear projection with the ratio of 3 (i.e., identical to the concatenation of the projection of query, key, and value in the self-attention layer in ViT), the projected 1d-features are reshaped to 2d-features for the input of the spatial operation. Consequently, the self-attention layer is replaced with a cheaper parameter-free operation and will bring clear efficiency. We use the global average pooling (GAP) layer instead of using the classification token of ViT since the classification token is hardly available without the self-attention layer. Many transformer-based ViTs can be a baseline; we additionally adopt a strong baseline Pooling-based Vision Transformer (PiT) (Heo et al., 2021b) to show applicability. More details are elaborated in Appendix A.
+
+# 5 EXPERIMENTS
+
+# 5.1 IMAGENET CLASSIFICATION
+
+Efficient ResNets. We perform ImageNet (Russakovsky et al., 2015) trainings to validate the model performance. We adopt the standard architecture ResNet50 (He et al., 2016b) as the baseline and train our models with the aforementioned standard 90-epochs training setting to fairly compare with the competitors (Luo et al., 2017; Huang & Wang, 2018; Wu et al., 2018; Wang et al., 2018; Han et al., 2020; Yu et al., 2019; Qiu et al., 2021), where the efficient operators were proposed or the networks were pruned. We report each averaged speed of the models with the publicly released codes on a V100 GPU. Table 3 shows our networks achieve faster inference speeds than those of the competitors with the comparable accuracies. The channel-width pruned models (Slimmable-R50 $0.5 \times$ , $0.75 \times$ ) and the models with new operations (Veratile-R50, GhostNet-R50, and SlimConv-R50) can
+
+Table 3. ImageNet performance comparison of efficient models. We report the model performance including accuracy, the number of parameters, FLOPs, and the GPU latency measured on a V100 GPU. All the model speeds are measured by ourselves using the publicly released architectures.†: used further training recipes.
+
+| Network Architecture | Params. (M) | FLOPs (G) | GPU (ms) | Top-1 (%) | Top-5 (%) |
| ResNet50 (R50) (He et al., 2016b) | 25.6 | 4.1 | 8.7 | 76.2 | 93.8 |
| Thinet70-R50 (Luo et al., 2017) | 16.9 | 2.6 | - | 72.1 | 90.3 |
| SSS-R50 (Huang & Wang, 2018) | 18.6 | 2.8 | - | 74.2 | 91.9 |
| Shift-R50 (Wu et al., 2018) | 22.x | N/A | - | 75.6 | 92.8 |
| Versatile-R50 (Wang et al., 2018) | 17.1 | 1.8 | 18.7 | 75.5 | 92.4 |
| Sllimable-R50 (0.5×) (Yu et al., 2019) | 6.9 | 1.1 | 8.5 | 72.1 | N/A |
| Sllimable-R50 (0.75×) (Yu et al., 2019) | 14.8 | 2.4 | 8.6 | 74.9 | N/A |
| GhostNet-R50 (Han et al., 2020) | 14.0 | 2.1 | 20.3 | 75.0 | 92.3 |
| SlimConv-R50 (k=8/3) (Qiu et al., 2021) | 12.1 | 1.9 | 24.5 | 75.5 | N/A |
| Ours-R50 (max) | 14.2 | 2.2 | 6.8 | 72.0 | 90.5 |
| Ours-R50 (hybrid) | 17.3 | 2.6 | 7.3 | 74.9 | 92.2 |
| Ours-R50 (deform_max) | 18.0 | 2.9 | 10.3 | 75.3 | 92.5 |
| Ours-R50 (max)† | 14.2 | 2.2 | 6.8 | 74.3 | 92.0 |
| Ours-R50 (hybrid)† | 17.3 | 2.6 | 7.3 | 77.1 | 93.1 |
| Ours-R50 (deform_max)† | 18.0 | 2.9 | 10.3 | 78.3 | 93.9 |
+
+Table 4. ImageNet performance of CNN models. We report the ImageNet performance, mCE (ImageNet-C) and AUC (ImageNet-O) of the diverse CNN models. All the redesigned models experience massive reductions of the computational costs and the substantial gains on mCE and AUC but barely drop the accuracy $(< 2.0\%)$ .
+
+| Network | Params. (M)↓ | FLOPs (G)↓ | GPU (ms)↓ | CPU (ms)↓ | Top-1 (%)↑ | Top-5 (%)↑ | mCE (%)↓ | AUC (%)↑ |
| ResNet50 | 25.6 | 4.1 | 8.7 | 45.4 | 78.5 | 94.2 | 63.8 | 51.7 |
| Ours-R50 | 17.3 (-33%) | 2.6 (-37%) | 7.3 (-17%) | 39.8 (-12%) | 77.1 (-1.4) | 93.1 (-1.1) | 57.5 (-6.3) | 52.9 (+1.2) |
| ResNet50-SE | 28.1 | 4.1 | 13.9 | 98.0 | 79.5 | 94.7 | 69.6 | 58.9 |
| Ours-R50-SE | 19.9 (-29%) | 2.6 (-37%) | 12.5 (-10%) | 92.6 (-9%) | 78.2 (-1.3) | 93.9 (-0.8) | 63.8 (-5.8) | 59.2 (+0.3) |
| ResNet101 | 44.6 | 7.8 | 16.7 | 80.5 | 80.1 | 94.9 | 69.7 | 51.7 |
| Ours-R101 | 26.3 (-41%) | 4.3 (-45%) | 13.5 (-19%) | 65.7 (-18%) | 78.2 (-1.9) | 93.8 (-1.1) | 62.0 (-7.7) | 54.6 (+2.9) |
| WRN50-2 | 68.9 | 11.4 | 9.0 | 84.0 | 79.7 | 94.7 | 67.0 | 49.8 |
| Ours-WRN50-2 | 36.0 (-48%) | 5.4 (-53%) | 7.3 (-20%) | 59.8 (-29%) | 78.1 (-1.6) | 93.8 (-0.9) | 60.9 (-6.1) | 51.9 (+2.1) |
| WRN101-2 | 126.9 | 22.8 | 16.9 | 146.2 | 80.9 | 95.3 | 73.2 | 50.6 |
| Ours-WRN101-2 | 53.9 (-58%) | 8.9 (-61%) | 13.7 (19%) | 96.3 (-34%) | 78.9 (-2.0) | 94.2 (-1.1) | 63.4 (-9.8) | 54.8 (+4.2) |
+
+not reach the model speed to ours. Additionally, we report the improved model accuracy with further training tricks (see the details in Appendix C). This aims to show the maximal capacity of our model even using many parameter-free operations inside. The last rows in the table present our model can follow the baseline accuracy well, and we see the gap between the baseline and ours has diminished; this shows a potential of using parameter-free operations for a network design.
+
+Bigger Network Architectures. Our design regime is applied to complicated network architectures such as ResNet50-SE (Hu et al., 2017) and Wide ResNet-101-2 (WRN101-2) (Zagoruyko & Komodakis, 2016). We report the ImageNet performance plus mean Corruption Error (mCE) on ImageNet-C (Hendrycks & Dietterich, 2019) and Area Under the precision-recall Curve (AUC) the measure of out-of-distribution detection performance on ImageNet-O (Hendrycks et al., 2021). Table 4 indicates the models redesigned with the parameter-free operations work well; bigger models are more significantly compressed in the computational costs. Additionally, we notice all the mCEs and AUC of our models are remarkably improved, overtaking the accuracy degradation, which means the models with parameter-free operations suffer less from overfitting.
+
+Deformable Max-pool Operation. We manifest a future direction of utilizing a parameter-free operation. We borrow a similar idea of the deformable convolution $^5$ (Dai et al., 2017; Zhou & Feng, 2017). Specifically, we identically involve a convolution to interpolate the features predicted by itself to perform a parameter-free operation on. The max-pool operation still covers the spatial operation; only the offset predictor has weights to predict the locations. We regard this operator as to how the performance of the max-pool operation can be stretched when involving few numbers of parameters. Only performing computation on predicted locations can improve the accuracy over the vanilla
+
+Table 5. COCO object detection results. All the models are finetuned on train2017 by ourselves using the ImageNet-pretrained backbones in Table 2. We report box APs on val2017.
+
+| Backbone | IN Acc. (%) | Input Size | Bbox AP at IOU | GPU (ms) | Params. (M) | FLOPs (G) |
| AP | AP50 | AP75 |
| ResNet50 | 76.2 | 1200×800 | 32.9 | 51.8 | 35.1 | 42.8 | 41.8 | 202.2 |
| ResNet50 (hybrid) | 74.9 | 1200×800 | 31.9 (-1.0) | 51.5 | 34.1 | 37.5 (-12%) | 33.6 (-20%) | 175.8 (-13%) |
| ResNet50 (deform_max) | 75.3 | 1200×800 | 33.2(+0.3) | 53.0 | 35.3 | 47.7(+11%) | 34.3 (-18%) | 181.8 (-10%) |
+
+Table 6. ImageNet performance of ViTs. We report ViT models' performance trained on ImageNet with diverse training settings denoted by Vanilla, CutMix, and DeiT (with strong augmentations).
+
+| Model | Throughput (imgs/sec) | Vanilla | +CutMix | +DeiT |
| 256-batch | 1-batch |
| ResNet50 | 962 | 112 | 76.2 | 77.6 | 78.8 |
| ViT-S | 787 | 86 | 73.9 | 77.0 | 80.6 |
| ViT-S (dw-conv) | 571 (-216) | 95 (+9) | 76.1 (+2.2) | 78.7 (+1.7) | 81.2 (+0.6) |
| ViT-S (max-pool) | 763 (-24) | 96 (+10) | 74.2 (+0.3) | 77.3 (+0.3) | 80.0 (-0.6) |
| PiT-S | 952 | 57 | 75.5 | 78.7 | 81.1 |
| PiT-S (dw-conv) | 781 (-171) | 90 (+33) | 76.1 (+0.5) | 78.6 (-0.1) | 81.0 (-0.1) |
| PiT-S (max-pool) | 1000 (+48) | 92 (+35) | 75.7 (+0.2) | 78.1 (-0.6) | 80.8 (-0.3) |
+
+computation with a few extra costs, as shown in Table 3. Note that there is room for faster operation speed as the implementation can be further optimized.
+
+# 5.2 COCO OBJECT DETECTION
+
+We verify the transferability of our efficient backbones on the COCO2017 dataset (Lin et al., 2014). We adopt the standard Faster RCNN (Ren et al., 2015) with FPN (Lin et al., 2017) without any bells and whistles to finetune the backbones following the original training settings (Ren et al., 2015; Lin et al., 2017) Table 5 shows our models achieve a better trade-off between the AP scores and the computational costs, including the model speed, and does not significantly degrade the AP scores even inside massive parameter-free operations. We further validate the backbone with the deformable max-pool operations in Table 5. Strikingly, AP scores are improved over ResNet50 even with the low ImageNet accuracy; this shows the effectiveness of the operation in a localization task.
+
+# 5.3 IMAGENET CLASSIFICATION WITH EFFICIENT VISION TRANSFORMERS
+
+We demonstrate using parameter-free operations in ViT (Dosovitskiy et al., 2021) in a novel way. We follow the aforementioned architectural modifications. Two vision transformer models ViT-S and PiT-S (Heo et al., 2021b) are trained on ImageNet with three different training settings: Vanilla (Dosovitskiy et al., 2021), with CutMix (Yun et al., 2019) and DeiT (Touvron et al., 2021) settings in Heo et al. (2021b). We similarly apply the depthwise convolution into the self-attention layer, which can be a strong competitor to make a comparison. We report the performance of the models in Table 6; we report throughput (images/sec) as the speed measure following the ViT papers (Dosovitskiy et al., 2021; Heo et al., 2021b), which is measured on 256 batch-size and a single batch-size both. The result demonstrates that ViT and PiT with the max-pool operation have faster throughput without significant accuracy degradation compared with the baselines; the depthwise convolution is a promising alternative, but the throughput is a matter compared with the max-pool operation for both architectures. Interestingly, PiT takes advantage of using the parameter-free operation, which presumably comes from larger features in early layers.
+
+# 6 CONCLUSION
+
+In this paper, we rethink parameter-free operations as the building block of learning spatial information to explore a novel way of designing network architecture. We have experimentally studied the applicability of the parameter-free operations in network design and rebuild network architectures, including convolutional neural networks and vision transformers, towards more efficient ones. Extensive results on a large-scale dataset including ImageNet and COCO with diverse network architectures have demonstrated the effectiveness over the existing efficient architectures and the use case of the parameter-free operations as the main building block. We believe our work highlighted a new design paradigm for future research beyond conventional efficient architecture designs.
+
+# ACKNOWLEDGEMENTS
+
+We would like to thank Naver AI Lab members for valuable discussions. We also thank Seong Joon Oh, Sangwoo Yun, and Sungeun Hong for peer-reviews. Naver Smart Machine Learning (NSML) (Kim et al., 2018) has been used for experiments.
+
+# ETHICS STATEMENT
+
+This paper studies a general topic in computer vision which is designing an efficient network architecture. Therefore, our work does not be expected to have any potential negative social impact but would contribute to the computer vision field by providing pretrained models.
+
+# REPRODUCIBILITY STATEMENT
+
+We provide detailed information of all the experiments in the paper. Furthermore, the details of our models with specific training hyper-parameters are clearly announced for those who would like to design or train our proposed models.
+
+# REFERENCES
+
+Irwan Bello, William Fedus, Xianzhi Du, Ekin D Cubuk, Aravind Srinivas, Tsung-Yi Lin, Jonathon Shlens, and Barret Zoph. Revisiting resnets: Improved training and scaling strategies. arXiv preprint arXiv:2103.07579, 2021.
+Weijie Chen, Di Xie, Yuan Zhang, and Shiliang Pu. All you need is a few shifts: Designing efficient convolutional neural networks for image classification. In CVPR, 2019a.
+Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In ICCV, 2019b.
+Xiangxiang Chu, Tianbao Zhou, Bo Zhang, and Jixiang Li. Fair darts: Eliminating unfair advantages in differentiable architecture search. In ECCV, 2020.
+Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical data augmentation with no separate search. arXiv preprint arXiv:1909.13719, 2019.
+Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In ICCV, 2017.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
+Perry Gibson, José Cano, Jack Turner, Elliot J Crowley, Michael O'Boyle, and Amos Storkey. Optimizing grouped convolutions on edge devices. In ASAP, 2020.
+Ian Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In ICML, 2013.
+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.
+Klaus Greff, Rupesh K Srivastava, and Jürgen Schmidhuber. Highway and residual networks learn unrolled iterative estimation. In *ICLR*, 2017.
+Dongyoon Han, Sangwoo Yun, Byeongho Heo, and YoungJoon Yoo. Rethinking channel dimensions for efficient model design. In CVPR, 2021.
+Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. Ghostnet: More features from cheap operations. In CVPR, 2020.
+
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016a.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016b.
+Yihui He, Xianggen Liu, Huasong Zhong, and Yuchun Ma. Address: Shift-based primitives for efficient convolutional neural networks. In WACV, 2019.
+Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In ICLR, 2019.
+Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In CVPR, 2021.
+Byeongho Heo, Sanghyuk Chun, Seong Joon Oh, Dongyoon Han, Sangdoo Yun, Gyuwan Kim, Youngjung Uh, and Jung-Woo Ha. Adamp: Slowing down the slowdown for momentum optimizers on scale-invariant weights. In ICLR, 2021a.
+Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe, and Seong Joon Oh. Rethinking spatial dimensions of vision transformers. In ICCV, 2021b.
+Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017.
+Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetv3. In ICCV, 2019.
+Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
+Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In arXiv:1709.01507, 2017.
+Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
+Gao Huang, Zhuang Liu, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
+Zehao Huang and Naiyan Wang. Data-driven sparse structure selection for deep neural networks. In ECCV, 2018.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
+Stanisław Jastrzebski, Devansh Arpit, Nicolas Ballas, Tong Verma, Vikas andc Che, and Yoshua Bengio. Residual connections encourage iterative inference. In ICLR, 2018.
+Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. NSML: Meet the MLaaS platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018.
+A. Krizhevsky. Learning multiple layers of features from tiny images. In Tech Report, 2009.
+Hanwen Liang, Shifeng Zhang, Jiacheng Sun, Xingqiu He, Weiran Huang, Kechen Zhuang, and Zhenguo Li. Darts+: Improved differentiable architecture search with early stopping. arXiv preprint arXiv:1909.06035, 2019.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dóllár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
+Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In ICCV, 2017.
+
+Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. In ICLR, 2019.
+Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In *ICLR*, 2017a.
+Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017b.
+Gangzhao Lu, Weizhe Zhang, and Zheng Wang. Optimizing depthwise separable convolution operations on gpus. IEEE Transactions on Parallel and Distributed Systems, 2021.
+Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In ICCV, 2017.
+Wenjie Luo, Yujia Li, Raquel Urtasun, and Richard Zemel. Understanding the effective receptive field in deep convolutional neural networks. In NeurIPS, 2016.
+Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
+Y. E. Nesterov. A method for solving the convex programming problem with convergence rate $\mathcal{O}(1 / k^2)$ . Dokl. Akad. Nauk SSSR, 269:543-547, 1983.
+Jiaxiong Qiu, Cai Chen, Shuaicheng Liu, Heng-Yu Zhang, and Bing Zeng. Slimconv: Reducing channel redundancy in convolutional neural networks by features recombining. IEEE Transactions on Image Processing, 30:6434-6445, 2021.
+Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-252, 2015.
+Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *CVPR*, 2018.
+Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV, 2017.
+Sihyeon Seong, Yegang Lee, Youngwook Kee, Dongyoon Han, and Junmo Kim. Towards flatter loss surface via nonmonotonic learning rate scheduling. In UAI, 2018.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015.
+Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
+Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019.
+Mingxing Tan and Quoc V Le. Efficientnetv2: Smaller models and faster training. In ICML, 2021.
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NeurIPS, 2017.
+
+Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017.
+Andreas Veit, Michael J Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In NeurIPS, 2016.
+Yunhe Wang, Chang Xu, Chunjing Xu, Chao Xu, and Dacheng Tao. Learning versatile filters for efficient convolutional neural networks. NeurIPS, 2018.
+Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR, 2018.
+Saining Xie, Ross Girshick, Piotr Dolkar, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017.
+Jiahui Yu, Linjie Yang, Ning Xu, Jianchao Yang, and Thomas Huang. Slimmable neural networks. In ICLR, 2019.
+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.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
+Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. arXiv preprint arXiv:2106.04560, 2021.
+Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018.
+Pan Zhou and Jiashi Feng. The landscape of deep learning algorithms. arXiv preprint arXiv:1705.07038, 2017.
+Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019.
+
+# APPENDIX
+
+# A DETAILS OF EFFICIENT ARCHITECTURES
+
+We elaborate on the efficient building blocks used in the experiments above. Fig.A.1 shows the schematic illustration of the proposed blocks compared with the original ones. We observe that the modification is simple and readily be applied to any network architecture.
+
+
+(a) Bottleneck (He et al., 2016b)
+
+
+
+
+(c) Efficient Bottleneck
+
+
+(b) Transformer (Dosovitskiy et al., 2021)
+(d) Efficient Transformer
+Figure A.1. Schematic illustration of the efficient building blocks. We visualize (a) the regular bottleneck in ResNets (He et al., 2016b); (b) the regular transformer in ViTs (Dosovitskiy et al., 2021); (c) our efficient bottleneck; (d) our efficient transformer; the eff-layers in (c) and (d) denote the parameter-free operations.
+
+Efficient Bottleneck. We replace the triplet of $3 \times 3$ convolution, BN (Ioffe & Szegedy, 2015), and ReLU (Nair & Hinton, 2010) in the regular bottleneck with a single spatial parameter-free operation (denoted as eff-layer in Fig.A.1c). The fastest architecture in Table 2 and Table 3 fully replace the regular bottlenecks, including the downsampling blocks with the efficient bottlenecks; therefore, the parameter-free operation (here the max-pool operation) plays a role of spatially aggregating the features by reducing the resolution. The hybrid architecture has an almost identical design regime with the most efficient architecture (i.e., $\mathbf{E} \rightarrow \mathbf{E} \rightarrow \mathbf{E} \rightarrow \mathbf{E}$ in Table 2) except for the downsampling blocks. We remain each downsampling block with the regular bottleneck blocks and involve an efficient parameter-free operation before the spatial operation (we assign the avg-pool as the parameter-free operation). We apply the identical bottleneck configuration of the hybrid architecture to the diverse deep convolutional neural networks (CNNs) in Table 4. Note that we do not modify the depth and the width of network architecture, the stem of CNNs that is the first set of layers before the first bottleneck, and the output layer having a fully connected layer with 1000-d output dimension. Furthermore, we do not modify specific architectural elements such as the SE-block of ResNet50-SE (Hu et al., 2017) inside each regular bottleneck but use it in each efficient bottleneck at the same positions.
+
+Efficient Transformer. Designing the efficient vision transformer (ViT) architecture is done by replacing half of the self-attention layers with the spatial parameter-free operation (denoted as eff-layer in Fig.A.1d). In other words, the original transformer block and the efficient transformer block are used alternately. We use the $3 \times 3$ max-pool operation for eff-layer in the efficient transformer block and compare with the variant using the $5 \times 5$ depth-wise convolution for eff-layer. ReLU is added after eff-layer and the first linear layer of the efficient transformer block to give additional non-linearity. For Pooling-based Vision Transformer (PiT) (Heo et al., 2021a) and ViT (Dosovitskiy et al., 2021), we do not modify the architectural elements including 1) the patch size; 2) the stem that patchifies the input for the following transformer; 3) the number of transformers. We only change the classification head position from the classification token to the Global Average Pooling (GAP) at the last layer since the classification token is not compatible with convolutional operations. As reported in Zhai et al. (2021), transformer with GAP shows comparable performance to ViT with the classification token. We also evaluate a more efficient network architecture which is fully equipped with the efficient transformer; it achieves faster speed, but slightly less accurate. We leave further improvements with a parameter-free operation inside the efficient transformer to reach the accuracy of the original transformer as future work.
+
+
+Figure B.1. Comparison of the parameter-free operations. We visualize top-1 accuracy (solid lines) with accuracy per # parameters (dashed lines) similar to Fig.1 with two parameter-free operations. All the settings are identical to the previous study, so we only plot the channel width of 32. We observe the max-pool operation consistently beat the avg-pool operation in a single bottleneck training.
+
+
+
+
+
+# B ON PARAMETER-FREE OPERATIONS
+
+Can We Use Avg-pool as the Spatial Parameter-free Operation? We mainly used the max-pool operation as the spatial parameter-free operation that replaces the regular convolutions and the self-attention layer in experiments. The max-pool operation is expected to have higher expressiveness compared with that of the avg-pool operation. Because the avg-pool operation is a conceptually smoothing operation, and the max-pool operation contains a nonlinearity similar to what ReLU has (i.e., $\max(x)$ and $\max(x,0)$ ). Experimentally, we found low expressiveness of the avg-pool operation in the shallow network study. Fig.B.1 shows the comparison of the max-pool and the avg-pool operations trained in a single bottleneck block. The setting is identical to the previous study in §3, and we only visualize the case of the channel width of 32 because a similar trend with the channel width of 64 was observed. We observe the large accuracy gaps between the two operations. This may be a ground of the search results where few avg-pool operations are chosen in normal cells in the previous NAS experiments in §3.3.
+
+Deformable Avg-pool Operation. We here provide an interesting idea of using the avg-pool operation, which shows inferior outcomes than the max-pool operation in the operation expressiveness. We have proposed the deformable max-pool operation involving a few parameters to improve the parameter-free operation's discriminative power significantly. Using the same idea into the avg-pool operation is available; surprisingly, a downside of the low expressiveness of the avg-pool operation has been vanished, as shown in Table B.1. This result exhibits that even a smoothing operation can be employed to learn discriminative features in a deep neural network.
+
+Table B.1. ImageNet performance of deformable operations. We report the model performance trained on ImageNet for the deformable operations. The new operation, dubbed deformable avg-pool, surprisingly reaches the accuracy of the deformable max-pool operation.
+
+| Network Architecture | Params. (M) | FLOPs (G) | GPU (ms) | Top-1 (%) | Top-5 (%) |
| Ours-R50 (deform_max) | 18.0 | 2.9 | 10.3 | 78.3 | 94.0 |
| Ours-R50 (deform_avg) | 18.0 | 2.9 | 10.3 | 78.3 | 93.9 |
+
+# C DETAILED TRAINING RECIPES
+
+We use the following training recipes to maximize the accuracy of the ResNet-based models. We use the cosine learning rate scheduling (Loshchilov & Hutter, 2017a) with the initial learning rate of 0.5 using four V100 GPUs with batch size of 512. Exponential moving average (Tarvainen & Valpola, 2017) over the network weights is used during training. We use the regularization techniques and data augmentations including label smoothing (Szegedy et al., 2016) (0.1), RandAug (Cubuk et al., 2019) (magnitude of 9), Random Erasing (Hermans et al., 2017) with pixels (0.2), lowered weight decay (1e-5), and a large training epochs (400 epochs). We use the code baseline in the renowned repository for our ImageNet training. The accuracy of the baseline models could reach the known
+
+
+nnd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Ressn50
+Figure D.1. Grad-CAM visualization of the final features. We visualize the highlighted features from the output of the final stage using Gradient-weighted Class Activation Mapping (Grad-CAM) (Selvaraju et al., 2017). The first row shows the original images, which are randomly picked from the ImageNet validation set; the second row shows the visualized features of the ImageNet-pretrained ResNet50; the last row shows the result of our ImageNet-pretrained ResNet50 (hybrid). Ours show similar outputs compared with ResNet50 but seem to capture the foreground with wider regions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+improved accuracy reported in such a paper (Bello et al., 2021) which presents the training recipes for highly improved models.
+
+# D UNDERSTANDING MAX-POOL OPERATION
+
+This section provides intuitive explanations how parameter-free operations such as the max-pool operation could work as replacing a trainable layers in a network.
+
+# D.1 CONNECTION WITH MAXOUT
+
+Maxout (Goodfellow et al., 2013) performs the max operation to a set of the inputs like an activation function with the multiple inputs. Maxout is designed to use after a bunch of linear or convolution layers to ensemble the outputs in a nonlinear manner, which leads to the increase of model capacity. The accuracy improvement in the original paper (Goodfellow et al., 2013) results from the claim that Maxout can approximate any operations, namely perform as a universal approximator. From an architectural point of view, the success of Maxout is probably due to the enhanced model capacity by the increased input dimension with the nonlinearity imposed by the max operation.
+
+For the max-pool operation with the efficient bottleneck mainly used throughout the paper, the relationship between the Maxout operation and ours is worth discussing. Maxout outputs through the max operation of the outputs of multiple linear layers computed from a single input. Otherwise, the max-pool operation in the efficient bottleneck performs the max operation with multiple transformed inputs (i.e., transformed pixels spatially adjacent to each point) by the preceding $1 \times 1$ convolution, which acts as a single linear layer for a given channel. However, if we replace the small variations in neighboring pixels with the perturbations in the weights of the linear layer as claimed in Seong et al. (2018), then we may interpret the max-pool operation performs like Maxout.
+
+# D.2 RECEPTIVE FIELD MATTER
+
+Since the spatial parameter-free operations have the receptive field (Luo et al., 2016) like convolutions, we conjecture such simple operations can capture striking pixels (or patches). We empirically support the conjecture by providing a visualization of the final output features of the ImageNet-pretrained ResNet50 and our ResNet50 (hybrid) in Fig.D.1. We observe that two models successfully localize the foreground object in common for all the images. A noticeable difference is that ResNet50 tends to focus more on specific crucial regions but ResNet50 (hybrid) on wider regions (a similar trend will be observed in Fig.D.2). Note that the area of the highlighted region does not directly link to a model's accuracy (in fact, ResNet50 has higher accuracy). We believe that this indicates how much a model learns localizable features and can be utilized to understand the learning dynamics of various models.
+
+
+Figure D.2. Grad-CAM visualization of intermediate features. We visualize the highlighted features by Grad-CAM of the intermediate features produced by the six successive layers in the last two bottlenecks of the final stage in ResNet50 and ResNet50 (hybrid), respectively. Each visualized feature from left to right gets closer to the final output features of a model. Each feature of conv5_x_y denotes the output features of the y-th layer in the x-th bottleneck, where a bottleneck has the $1 \times 1$ convolutions at the 1st and 3rd layers) and 3x3 convolution/the max-pool operation at the 2nd layer in ResNet50/our ResNet50 (hybrid). The input images are randomly picked from the ImageNet validation set.
+
+We further conjecture that a $1 \times 1$ convolution can complement the expressiveness of a parameter-free operation such as the max-pool operation or avg-pool operation by nonlinearly mixing the features, which is computed by the parameter-free operation. To make a ground for the conjecture, we would like to visualize the intermediate features extracted from 1) each of two $1 \times 1$ convolutions; 2) the spatial operations including the $3 \times 3$ convolution and the max-pool operation in a bottleneck block. We choose the last two bottlenecks in the final stage conv5 and visualize the output features of the aforementioned layers.
+
+Fig.D.2 shows the highlighted features produced by the three different input images randomly picked from the ImageNet validation set. We use the identical models employed to visualize the final features shown in Fig.D.1. We let conv5_x_y denote the output features of the y-th layer in the x-th bottleneck of a specific model; for example, each visualized feature of conv5_2_2 in ResNet50 and our model (ResNet50 (hybrid)) indicates the output features of the $3 \times 3$ convolution and the spatial max-pool operation, respectively. First, we observe the $1 \times 1$ convolutions refine the features to be more discriminative; when comparing the features in conv5_x_2 with those of conv5_x_3, the output features usually get more highlighted on the crucial region in the foreground objects. Furthermore, it seems that the $1 \times 1$ convolutions change more of the previous features in our model, which may come from the different output features by the $3 \times 3$ convolutions and the max-pool operations (compare the output features of ResNet50 with ours in conv5_x_2). Therefore, based on the observations, the $1 \times 1$ convolution performs to make features more discriminative, and they do more with the parameter-free operations like the max-pool operation.
+
+# E MORE VISUALIZATIONS
+
+In this section, we further discuss the studied materials with the additional graphs and figures to provide more detailed information. §E.1 contains extended trade-off graphs of our study in §3.3;
+
+
+(a) Speed (1-image)
+
+
+(b) Speed (256-images)
+
+
+(c) # parameters
+
+
+(d) FLOPs
+
+
+Figure E.1. Multiple bottlenecks study (cont'd). The entire models trained in the multiple bottlenecks study in §3.3 are visualized in the comparison graphs: (a) Accuracy vs. speed with the batch size of 1; (b) Accuracy vs. speed with the batch size of 256; (c) Accuracy vs. # parameters; (d) Accuracy vs. FLOPs. The graphs include the $20\%$ best-performing models plotted in Fig.2. The depthwise convolution (blue dots) shows efficiency again in # parameters and FLOPs, but the max-pool (i.e., red dots) has clear benefits in the speed measures. Note that the speed gap between the two operations gets larger when processing multiple images, as shown through (a) and (b).
+
+
+Figure E.2. Visualization of predicted offsets. We illustrate the predicted offsets by our deformable max-pool operation from the images from the validation set in ImageNet. Each sampled image has two predicted offsets on a foreground object (left) and the background (right). We plot 1) the predicted offsets (red dots); 2) the initial grid-like points (blue dots) with the center (green dots) in each figure.
+
+
+
+
+
+§E.2 discusses predicted offsets by the proposed deformable max-pool operation; finally in §E.3, we discuss the performance trade-offs of the models on the ImageNet datasets in §5.1.
+
+# E.1 MULTIPLE BOTTLENECKS STUDY (CONT'D)
+
+Fig.E.1 shows the performance of the entire models which are trained in §3.3. The graphs include the $20\%$ best-performing models shown in Fig.2. As expected, the models using many max-pool operations have degraded accuracies but show clear speed benefits; there is about a $1.5\%$ accuracy gap between the fastest models using each operation yet more than a 5ms speed gap between them.
+
+# E.2 PREDICTED OFFSETS BY DEFORMABLE MAX-POOL OPERATION
+
+We visualize the predicted offsets by the proposed deformable max-pool operation (deform_max) with the sample images in Fig.E.2. We plot the aggregated offsets of the last two deform_maxs in the final stage of ResNet50 with the initial points, which look like the grid-like offset points of the two successive regular convolutions. We observe the offsets are concentrated on the objects when the center is on each foreground object. The offsets spread widely when the center is on the background, which is similarly observed in the deformable convolution paper (Dai et al., 2017; Zhu et al., 2019). It is surprising that our models only trained with the ImageNet's class labels without strong supervisions (i.e., detection boxes or segmentation masks) show the improved localization capability. Furthermore, albeit our model does not be trained with the background class, each shape of the predicted offsets on foreground and background looks quite different as shown in Fig.E.2.
+
+We would like to stress the main differences of the experimental settings with those in the deformable convolution papers. First, our model is trained on ImageNet only with the class labels without any strong supervision so that the models may have a weaker localization capability than the models trained with more supervision, such as on detection and segmentation tasks. Second, our model incorporates much more deformable operations in the entire stages of a ResNet, so the dynamics of predicting offsets would be different from the deformable convolution where the only later stages have the deformable convolutions.
+
+# E.3 PERFORMANCE TRADE-OFFS
+
+This work presents the potential usefulness of parameter-free operations such as the max-pool as a building block rather than pushing the performance to the limit. We first visualize the ImageNet performance comparison with many efficient models shown in Table 3 in Fig.E.3. Fig.E.3 shows our models have competitive trade-offs between accuracy and speed. Since we do not modify ResNet50 but just replace the spatial operation into parameter-free operations such as the max-pool, our models do not have much benefits in the number of parameters and FLOPs.
+
+Moreover, we visualize the ImageNet results including 1) top-1 accuracy on ImageNet; 2) mean Corruption Error (mCE) on ImageNet-C; 3) Area Under the precision-recall Curve (AUC) on ImageNet-O applying the efficient bottleneck into existing big CNNs, which is shown in Table 4, in Fig.E.4. Fig.E.4 shows our models achieve large improvements on the entire computational costs but show similar trade-offs of the baseline models in top-1 accuracy. This experiment originally aims to investigate the redundancy of using standard building blocks inside heavy CNN models. However, a simple replacement of the operations in existing models achieves significant efficiency; namely, in terms of the model speeds, the number of parameters, and FLOPs, our models reduce meaningful amounts without much accuracy loss. Furthermore, our models significantly outperform the baseline models with efficiency in mCE and AUC measures. Improving the ImageNet top-1 accuracy while having the advantages of the parameters-free operations will be our future work.
+
+
+(a) GPU speed
+
+
+(b) # parameters
+
+
+(c) FLOPs
+
+
+Figure E.3. Performance Trade-offs of the models in Table 3. We visualize the trade-offs between (a) accuracy and speed; (b) accuracy and # parameters; (c) accuracy and FLOPs, respectively. Ours denote the performance of Ours-R50 (max), Ours-R50 (hybrid), and Ours-R50 (deform_max); we also plot the models trained with the further training recipes.
+
+
+
+
+(a) GPU speed
+
+
+
+
+
+
+(b) # parameters
+
+
+
+
+
+
+(c) FLOPs
+Figure E.4. Performance Trade-offs of the models in Table 4. We visualize the trade-offs between accuracy/errand (a) speed; (b) # parameters; (c) FLOPs, respectively. Each row employs 1) Top-1 accuracy on ImageNet; 2) mean Corruption Error (mCE) on ImageNet-C; 3) Area Under the precision-recall Curve (AUC) on ImageNet-O as the performance measure, respectively.
\ No newline at end of file
diff --git a/learningfeatureswithparameterfreelayers/images.zip b/learningfeatureswithparameterfreelayers/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..17e73f1cf80a689b51a242f4a4c34f64c133ad14
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f57a076901451cf0576eda4db5bebef9df0c7b793dc03773cff6a2418201a9a9
+size 1037085
diff --git a/learningfeatureswithparameterfreelayers/layout.json b/learningfeatureswithparameterfreelayers/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ce64fddb44bfe0e002d5925f7700655cacfb3f23
--- /dev/null
+++ b/learningfeatureswithparameterfreelayers/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3908d61487ffe6c254fdad807a5e904fdf81d33f6e0c9e50f38e854537b05104
+size 624979
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_content_list.json b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b4d8ce20ce0fd5cc712c3d7ffa24085f174ec61d
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94d02b619edb0187105d197c255ea9504d12bde5c17e69a2ad8ee4b0602a2321
+size 129501
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_model.json b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b8b370ac868b4f871f5bc3af3e6d31a19d2f2f3f
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f4cbc8f22f4c226da272b3b60b90c7eaa077bae18d4846051a054c57c9cd218b
+size 150183
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_origin.pdf b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f8c12aaa3db4875cd8a14a5f7123021f326497ac
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/2cde5512-6c2c-47bb-8fc2-f754f1cf83e4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0361693260390f8d13f0ed4b3c9b05b8142817b356fc6ece3bdf6bbd877aebbc
+size 22345339
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/full.md b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3d0e2226c3fb40323d2969b2b417476886a9e09d
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/full.md
@@ -0,0 +1,539 @@
+# LEARNING GENERALIZABLE REPRESENTATIONS FOR REINFORCEMENT LEARNING VIA ADAPTIVE META-LEARNER OF BEHAVIORAL SIMILARITIES
+
+Jianda Chen & Sinno Jialin Pan
+
+Nanyang Technological University, Singapore
+
+jianda001@e.ntu.edu.sg, sinnopan@ntu.edu.sg
+
+# ABSTRACT
+
+How to learn an effective reinforcement learning-based model for control tasks from high-level visual observations is a practical and challenging problem. A key to solving this problem is to learn low-dimensional state representations from observations, from which an effective policy can be learned. In order to boost the learning of state encoding, recent works are focused on capturing behavioral similarities between state representations or applying data augmentation on visual observations. In this paper, we propose a novel meta-learner-based framework for representation learning regarding behavioral similarities for reinforcement learning. Specifically, our framework encodes the high-dimensional observations into two decomposed embeddings regarding reward and dynamics in a Markov Decision Process (MDP). A pair of meta-learners are developed, one of which quantifies the reward similarity and the other quantifies dynamics similarity over the correspondingly decomposed embeddings. The meta-learners are self-learning to update the state embeddings by approximating two disjoint terms in on-policy bisimulation metric. To incorporate the reward and dynamics terms, we further develop a strategy to adaptively balance their impacts based on different tasks or environments. We empirically demonstrate that our proposed framework outperforms state-of-the-art baselines on several benchmarks, including conventional DM Control Suite, Distracting DM Control Suite and a self-driving task CARLA.
+
+# 1 INTRODUCTION
+
+Designing effective reinforcement learning algorithms for learning to control from high-dimensional visual observations is crucial and has attracted more and more attention (Yarats et al., 2021; Laskin et al., 2020a; Schwarzer et al., 2021; Lesort et al., 2018). To learn a policy efficiently from high-dimensional observations, prior approaches first learn an encoder to map high-dimensional observations, e.g., images, to low-dimensional representations, and subsequently train a policy from low-dimensional representations to actions based on various RL algorithms. Therefore, how to learn low-dimensional representations, which are able to provide semantic abstraction for high-dimensional observations, plays a key role.
+
+Early works on deep reinforcement learning train encoders based on various reconstruction losses (Lange & Riedmiller, 2010; Watter et al., 2015; Wahlström et al., 2015; Higgins et al., 2017), which aim to enforce the learned low-dimensional representations to reconstruct the original high-dimensional observations after decoding. Promising results have been achieved in some application domains, such as playing video games, simulated tasks, etc. However, the policy learned on state representations trained with a reconstruction loss may not generalize well to complex environments, which are even though semantically similar to the source environment. The reason is that a reconstruction loss is computed over all the pixels, which results in all the details of the high-dimensional images tending to be preserved in the low-dimensional representations. However, some of the observed details, such as complex background objects in an image, are task-irrelevant and highly environment-dependent. Encoding such details in representation learning makes the learned representation less effective for a downstream reinforcement learning task of interest and less generalizable to new environments. To address the aforementioned issue, some data augmentation
+
+techniques have been proposed to make the learned representations more robust (Yarats et al., 2021; Lee et al., 2020b; Laskin et al., 2020b). However, these approaches rarely consider the properties of a Markov Decision Process (MDP), such as conditional transition probabilities between states given an action, in the representation learning procedure.
+
+Recent research (Zhang et al., 2021; Agarwal et al., 2021; Castro, 2020; Ferns et al., 2004) has shown that the bisimulation metric and its variants are potentially effective to be exploited to learn a more generalizable reinforcement learning agent across semantically similar environments. The bisimulation metric measures the "behavioral similarity" between two states based on two terms: 1) reward difference that considers the difference in immediate task-specific reward signals between two states, and 2) dynamics difference that considers the similarity of the long-term behaviors between two states. A general idea of these approaches is to learn an encoder to map observations to a latent space such that the distance or similarity between two states in the latent space approximates their bisimulation metric. In this way, the learned representations (in the latent space) are task-relevant and invariant to environmental details. However, manually specifying a form of distance, e.g., the $L_{1}$ norm as used in (Zhang et al., 2021), in the latent space may limit the approximation precision for the bisimulation metric and potentially discard some state information that is useful for policy learning. Moreover, existing approaches rarely explore how to learn an adaptive combination of reward and dynamics differences in the bisimulation metric, which may vary in different tasks or environments.
+
+We propose a novel framework for learning generalizable state representations for RL, named Adaptive Meta-learner of Behavioral Similarities (AMBS). In this framework, we design a network with two encoders that map the high-dimensional observations to two decomposed representations regarding rewards and dynamics. For the purpose of learning behavioral similarity on state representations, we introduce a pair of meta-learners that learn similarities in order to measure the reward and the dynamics similarity between two states over the corresponding decomposed state representations, respectively. The meta-learners are self-learned by approximating the reward difference and the dynamics difference in the bisimulation metric. Then the meta-learners update the state representations according to their behavioral distance to the other state representations. Previous approaches with a hand-crafted form of distance/similarity evaluating state encoding in the $L_{1}$ space are difficult to minimize the approximation error for the bisimulation metric, which may lead to important side information being discarded, e.g., information regarding to Q-value but not relevant to states distance/similarity. Instead, our learned similarities measure two states representations via a neural architecture, where side information can be preserved for policy learning. Our experiments also showed that a smaller approximation loss for similarity learning can be obtained by using the meta-learners. This demonstrates that the proposed meta-learners can overcome the approximation precision issue introduced by the $L_{1}$ distance in previous approaches and provide more stable gradients for robust learning of state representations for deep RL. Moreover, we explore the impact between the reward and the dynamics terms in the bisimulation metric. We propose a learning-based adaptive strategy to balance the effect between reward and dynamics in different tasks or environments by introducing a learnable importance parameter, which is jointly learned with the state-action value function. Finally, we use a simple but effective data augmentation strategy to accelerate the RL procedure and learn more robust state representations.
+
+The main contributions of our work are 3-fold: 1) we propose a meta-learner-based framework to learn task-relevant and environment-details-invariant state representations; 2) we propose a network architecture that decomposes each state into two different types of representations for measuring the similarities in terms of reward and dynamics, respectively, and design a learnable adaptive strategy to balance them to estimate the bisimulation metric between states; 3) we verify our proposed framework on extensive experiments and demonstrate new state-of-the-art results on background-distraction DeepMind control suite (Tassa et al., 2018; Zhang et al., 2018; Stone et al., 2021) and other visual-based RL tasks.
+
+# 2 RELATED WORK
+
+Representation learning for reinforcement learning from pixels Various existing deep RL methods have been proposed to address the sample-efficiency and the generalization problems for conventional RL from pixel observation. In end-to-end deep RL, neural networks learn representations implicitly by optimizing some RL objective (Mnih et al., 2015; Espeholt et al., 2018). Watter et al.
+
+(2015) and Wahlström et al. (2015) proposed to learn an encoder with training a dynamics model jointly to produce observation representations. Lee et al. (2020a), Hafner et al. (2019), Hafner et al. (2020) and Zhang et al. (2019) aimed to learn an environment dynamics model with the reconstruction loss to compact pixels to latent representations. Gelada et al. (2019) proposed to learn representations by predicting the dynamics model along with the reward, and analyzed its theoretical connection to the bisimulation metric. Agarwal et al. (2021) proposed to learn representations by state distances based on policy distribution. Kemertas & Aumentado-Armstrong (2021) modified the learning of bisimulation metric with intrinsic rewards and inverse dynamics regularization. Castro et al. (2021) replaced the Wasserstein distance in bisimulation metric with a parametrized metric.
+
+Data Augmentation in reinforcement learning Laskin et al. (2020b) and Ye et al. (2020b) explored various data augmentation techniques for deep RL, which are limited to transformations on input images. Cobbe et al. (2019) applied data augmentation to domain transfer. Ye et al. (2020a) studied data augmentation on game environments for zero-shot generalization. RandConv (Lee et al., 2020b) proposed a randomized convolutional neural network to generate randomized observations in order to perform data augmentation. A recent work DrQ (Yarats et al., 2021) performs random crop on image observations and provides regularized formulation for updating Q-function. Raileanu et al. (2021) proposed to use data augmentation for regularizing on-policy actor-critic RL objectives. Pitis et al. (2020) proposed a counterfactual data augmentation technique by swapping observed trajectory pairs.
+
+# 3 PRELIMINARIES
+
+We define an environment as a Markov Decision Process (MDP) described by a tuple $\mathcal{M} = (\mathcal{S},\mathcal{A},\mathcal{P},\mathcal{R},\gamma)$ , where $\mathcal{S}$ is the high-dimensional state space (e.g., images), $\mathcal{A}$ is the action space, $\mathcal{P}(\mathbf{s}'|\mathbf{s},\mathbf{a})$ is the transition dynamics model that captures the probability of transitioning to next state $\mathbf{s}' \in \mathcal{S}$ given current state $s \in \mathcal{S}$ and action $\mathbf{a} \in \mathcal{A}$ , $\mathcal{R}$ is the reward function yielding a reward signal $r = \mathcal{R}(\mathbf{s},\mathbf{a}) \in \mathbb{R}$ , and $\gamma \in [0,1)$ is the discounting factor. The goal of reinforcement learning is to learn a policy $\pi(\mathbf{a}|\mathbf{s})$ that maximizes the expected cumulative rewards: $\max_{\pi} \mathbb{E}[\sum_t \gamma^t r(\mathbf{s}_t, \mathbf{a}_t)|a_t \sim \pi(\cdot|\mathbf{s}_t), \mathbf{s}_t' \sim \mathcal{P}(\mathbf{s}'|\mathbf{s},\mathbf{a})]$ . In the scope of this paper, we do not consider partial observability, and use stacked consecutive frames as the fully observed states.
+
+Soft Actor-Critic (SAC) is a widely used off-policy model-free reinforcement learning algorithm (Haarnoja et al., 2018). SAC aims to maximize the entropy objective (Ziebart, 2010) which is the reinforcement learning objective augmented with an entropy term $J(\pi) = \sum_{t} \mathbb{E}[r(\mathbf{s}_t, \mathbf{a}_t) + \alpha \mathcal{H}(\pi(\cdot | \mathbf{s}_t))]$ . In order to maximize the objective, SAC learns a state-value function $Q_\theta(\mathbf{s}, \mathbf{a})$ , a stochastic policy $\pi_\psi(\mathbf{a} | \mathbf{s})$ and the temperature $\alpha$ , where $\theta$ and $\psi$ are the parameters of $Q_\theta$ and $\pi_\psi$ , respectively. The Q-function is trained by minimizing the squared soft Bellman residual
+
+$$
+J _ {Q} (\theta) = \mathbb {E} _ {\left(\mathbf {s} _ {t}, \mathbf {a} _ {t}\right) \sim \mathcal {D}} \left[ \frac {1}{2} \left(Q _ {\theta} \left(\mathbf {s} _ {t}, \mathbf {a} _ {t}\right) - \left(r \left(\mathbf {s} _ {t}, \mathbf {a} _ {t}\right) + \gamma \mathbb {E} _ {\mathbf {s} _ {t + 1} \sim \mathcal {P} \left(\cdot \mid \mathbf {s} _ {t}, \mathbf {a} _ {t}\right)} \left[ V _ {\bar {\theta}} \left(\mathbf {s} _ {t + 1}\right) \right]\right)\right) ^ {2} \right], \tag {1}
+$$
+
+where $\mathcal{D}$ is the dataset or replay buffer storing the transitions, and $V_{\bar{\theta}}$ is the value function parameterized by $\bar{\theta}$ . The parameters $\psi$ of policy is learned by maximizing the following objective
+
+$$
+J _ {\pi} (\psi) = \mathbb {E} _ {\mathbf {s} _ {t} \sim \mathcal {D}} \left[ \mathbb {E} _ {\mathbf {a} _ {t} \sim \pi_ {\psi}} \left[ \alpha \log \left(\pi_ {\psi} (\mathbf {a} | \mathbf {s})\right) - Q _ {\theta} \left(\mathbf {s} _ {t}, \mathbf {a} _ {t}\right) \right] \right]. \tag {2}
+$$
+
+The Bisimulation Metric defines a pseudometric $d: \mathcal{S} \times \mathcal{S} \to \mathbb{R}$ ,1 where $d$ quantifies the behavioral similarity of two discrete states (Ferns et al., 2004). An extension to both continuous and discrete state spaces has also been developed (Ferns et al., 2011). A variant of the bisimulation metric proposed in Castro (2020) defines a metric w.r.t. a policy $\pi$ , which is known as the on-policy bisimulation metric. It removes the requirement of matching actions in the dynamics model but focuses on the policy $\pi$ , which is able to better capture behavioral similarity for a specific task. Because of this property, in this paper, we focus on the $\pi$ -bisimulation metric (Castro, 2020):
+
+$$
+F ^ {\pi} (d) \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) = (1 - c) \left| \mathcal {R} _ {\mathbf {s} _ {i}} ^ {\pi} - \mathcal {R} _ {\mathbf {s} _ {j}} ^ {\pi} \right| + c W _ {1} (d) \left(\mathcal {P} _ {\mathbf {s} _ {i}} ^ {\pi}, \mathcal {P} _ {\mathbf {s} _ {j}} ^ {\pi}\right). \tag {3}
+$$
+
+where $\mathcal{R}_{\mathbf{s}}^{\pi} \coloneqq \sum_{\mathbf{a}} \pi(\mathbf{a}|\mathbf{s}) \mathcal{R}(\mathbf{s}, \mathbf{a})$ and $\mathcal{P}_{\mathbf{s}}^{\pi} \coloneqq \sum_{\mathbf{a}} \pi(\mathbf{a}|\mathbf{s}) \mathcal{P}(\cdot|\mathbf{s}, \mathbf{a})$ . The mapping $F^{\pi}: \mathfrak{met} \to \mathfrak{met}$ where met denotes the set of all pseudometrics in state space $S$ and $W_{1}(d)(\cdot, \cdot)$ denotes the 1-Wasserstein distance given the pseudometric $d$ . Then $F^{\pi}$ has a least fixed point denoted by $d_{*}$ . Deep
+
+
+Figure 1: Architecture of our AMBS framework. The dotted arrow represents the regression target and the dash arrow means stop gradient. Left: the learning process of meta-learner. Right: the model architecture for SAC with adaptive weight $c$ which is jointly learned with SAC objective.
+
+Bisimulation for Control (DBC) (Zhang et al., 2021) is to learn latent representations such that the $L_{1}$ distances in the latent space are equal to the $\pi$ -bisimulation metric in the state space:
+
+$$
+\arg \min _ {\boldsymbol {\phi}} \left(\| \phi (\mathbf {s} _ {i}) - \phi (\mathbf {s} _ {j}) \| _ {1} - | \mathcal {R} _ {\mathbf {s} _ {i}} ^ {\pi} - \mathcal {R} _ {\mathbf {s} _ {j}} ^ {\pi} | - \gamma W _ {2} (d) (\mathcal {P} _ {\mathbf {s} _ {i}} ^ {\pi}, \mathcal {P} _ {\mathbf {s} _ {j}} ^ {\pi})\right) ^ {2},
+$$
+
+where $\phi$ is the state encoder, and $W_{2}(d)(\cdot ,\cdot)$ denotes the 2-Wasserstein distance. DBC is combined with the reinforcement learning algorithm SAC, where $\phi (\mathbf{s})$ is the input for SAC.
+
+# 4 ADAPTIVE META-LEARNER OF BEHAVIORAL SIMILARITIES
+
+In this section, we propose a framework named Adaptive Meta-learner of Behavioral Similarities (AMBS) to learn generalizable states representation regarding the $\pi$ -bisimulation metric. The learning procedure is demonstrated in Figure 1. Observe that the $\pi$ -bisimulation metric is composed of two terms: $|\mathcal{R}_{\mathbf{s}_i}^\pi - \mathcal{R}_{\mathbf{s}_j}^\pi|$ , which computes the difference of rewards between states, and $W_2(d)(\mathcal{P}_{\mathbf{s}_i}^\pi, \mathcal{P}_{\mathbf{s}_j}^\pi)$ , which computes the difference of the outputs of dynamics model between states. We propose a network architecture which contains encoders to transform the high-dimensional visual observations to two decomposed encodings regarding rewards and dynamics. We develop two meta-learners, one of which quantifies the reward difference on reward representations and the other captures dynamics distance (Section 4.1). Each meta-learner is self-learned to update the corresponding state representations by learning to approximate a term in the $\pi$ -bisimulation metric, respectively. Rather than enforcing the $L_1$ distance between embedded states to be equal to the $\pi$ -bisimulation metric, our meta-learners are able to use a more flexible form of similarity, i.e., a well-designed non-linear neural network, with each similarity evaluates the reward difference or dynamics difference between states beyond the original Euclidean space. Moreover, we propose a strategy for learning to combine the outputs of the two learned similarities in a specific environment (Section 4.2). We introduce a learnable weight for the combination and such weight is adaptively learned together with the policy learning procedure (in this work we use SAC as the base reinforcement learning algorithm). In addition, we also use a data augmentation technique to make the learned representations more robust (Section 4.3). The whole learning procedure is trained in an end-to-end manner.
+
+# 4.1 META-LEARNERS FOR DECOMPOSED REPRESENTATIONS
+
+We design a network architecture with two encoders, $\phi_r$ and $\phi_d$ , to encode decomposed features from visual observations as shown in the left side of Figure 1. Each encoder maps a high-dimensional observation to a low-dimensional representation, i.e., $\phi_r: S \to \mathcal{Z}_r$ capturing reward-relevant features and $\phi_d: S \to \mathcal{Z}_d$ capturing dynamics-relevant features. We design two meta-learners, $f_r$ and $f_d$ , where $f_r$ learns to measure reward difference and $f_d$ aims to measure dynamics difference between two state representations. Specifically, each meta-learner takes two embedded states as input and outputs the corresponding similarity. The procedure is summarized as follows.
+
+$$
+\mathbf {s} _ {i}, \mathbf {s} _ {j} \rightarrow \phi_ {*} (\mathbf {s} _ {i}), \phi_ {*} (\mathbf {s} _ {j}) \rightarrow f _ {*} \left(\phi_ {*} (\mathbf {s} _ {i}), \phi_ {*} (\mathbf {s} _ {j})\right), \text {w h e r e} * \in \{r, d \}.
+$$
+
+Note that the aggregation of the outputs of the two encoders $\phi_r$ and $\phi_d$ of each observation (i.e., state) is also fed into SAC to learn a policy (the right side of Figure 1). Each self-learned metalearner learns to capture similarity by approximating a distance term in the $\pi$ -bisimulation metric, respectively, and provides stable gradients for updating $\phi_r$ or $\phi_d$ according to the distance to the other state representations. The details of network architecture can be found in Appendix B.2.
+
+As discussed in Section 1, restricting the form of distance to be the $L_{1} / L_{2}$ norm in the latent space may limit the approximation precision. As shown in Figure 2, the $L_{1}$ and the $L_{2}$ norm for measuring the distance of two latent representations $\phi (\mathbf{s}_i)$ and $\phi (\mathbf{s}_j)$ lead to large regression losses during RL training, which destabilize the representation learning and consequently decrease final performance. Besides, such hand-crafted distances make semantically similar states encoding close to each other in terms of the $L_{1}$ norm in Euclidean space, which however may lose part of useful information, e.g., policy-relevant information but not immediately regarding to the distance.
+
+To overcome the aforementioned limitations, we propose to exploit meta-learners $f_{r}$ and $f_{d}$ to learn similarities. By learning with a regression target, the similarity learned by $f_{*}$ is easier to converge to the target and leads to faster descent tendency of regression loss (as shown in Figure 2 where y-axis is log-scale). Such a property provides more stable gradients for state representation comparing to the $L_{1} / L_{2}$ norm, and therefore the meta-learner $f_{*}$ is able to guide the process of updating the state encoder. Besides, $f_{*}$ is a non-linear transformation that evaluates the state similarity in a more flexible space instead of the original Euclidean space. Consequently, it is able to preserve more task-relevant information in state representation that is required for further SAC policy learning.
+
+As the goal of meta-learners is to approximate different types of similarities in the $\pi$ -bisimulation metric, we design the loss functions for the meta-learners using the mean squared error:
+
+$$
+\ell \left(f _ {r}, \phi_ {r}\right) = \left(f _ {r} \left(\phi_ {r} \left(\mathbf {s} _ {i}\right), \phi_ {r} \left(\mathbf {s} _ {j}\right)\right) - \left| \mathcal {R} _ {\mathbf {s} _ {i}} ^ {\pi} - \mathcal {R} _ {\mathbf {s} _ {j}} ^ {\pi} \right|\right) ^ {2}, \tag {4}
+$$
+
+$$
+\ell (f _ {d}, \phi_ {d}) = \left(f _ {d} (\phi_ {d} (\mathbf {s} _ {i}), \phi_ {d} (\mathbf {s} _ {j})) - W _ {2} (\mathcal {P} _ {\mathbf {s} _ {i}} ^ {\pi}, \mathcal {P} _ {\mathbf {s} _ {j}} ^ {\pi})\right) ^ {2}. \qquad (5)
+$$
+
+To make the resultant optimization problems compatible with SGD updates with transitions sampled from replay buffer, we replace the reward metric term $|\mathcal{R}_{\mathbf{s}_i}^\pi - \mathcal{R}_{\mathbf{s}_j}^\pi|$ by the distance of rewards in the sampled transi
+
+
+Figure 2: The regression loss among different forms of distances.
+
+tions in (4), and use a learned parametric dynamics model $\hat{\mathcal{P}}$ to approximate the true dynamics model $\mathcal{P}_{\mathbf{s}}^{\pi}$ in (5). We also use 2-Wasserstein distance $W_{2}$ in (5) (as in DBC) because it has a closed form for Gaussian distributions. Denote by $(\mathbf{s}_i,\mathbf{a}_i,r_i,\mathbf{s}_i')$ and $(\mathbf{s}_j,\mathbf{a}_j,r_j,\mathbf{s}_j')$ two transitions sampled from the replay buffer. The loss functions (4) and (5) can be revised as follows,
+
+$$
+\ell \left(f _ {r}, \phi_ {r}\right) = \left(f _ {r} \left(\phi_ {r} \left(\mathbf {s} _ {i}\right), \phi_ {r} \left(\mathbf {s} _ {j}\right)\right) - \left| r _ {i} - r _ {j} \right|\right) ^ {2}, \tag {6}
+$$
+
+$$
+\ell \left(f _ {d}, \phi_ {d}\right) = \left(f _ {d} \left(\phi_ {d} \left(\mathbf {s} _ {i}\right), \phi_ {d} \left(\mathbf {s} _ {j}\right)\right) - W _ {2} \left(\hat {\mathcal {P}} \left(\cdot \mid \phi_ {d} \left(\mathbf {s} _ {i}\right), \mathbf {a} _ {i}\right), \hat {\mathcal {P}} \left(\cdot \mid \phi_ {d} \left(\mathbf {s} _ {j}\right), \mathbf {a} _ {j}\right)\right)\right) ^ {2}, \tag {7}
+$$
+
+where $\hat{\mathcal{P}} (\cdot |\phi_d(\mathbf{s}_*),\mathbf{a}_*)$ is a learned probabilistic dynamics model, which is implemented as a neural network that takes the dynamics representation $\phi_d(\mathbf{s}_*)$ and an action $\mathbf{a}_{*}$ as input, and predicts the distribution of dynamics representation of next state $\mathbf{s}_*^\prime$ . The details of $\hat{\mathcal{P}}$ can be found in Appendix A.
+
+# 4.2 BALANCING IMPACT OF REWARD AND DYNAMICS
+
+The $\pi$ -bisimulation metric (3) is defined as a linear combination of the reward and the dynamics difference. Rather than considering the combination weight as a hyper-parameter, which needs to be tuned in advance, we introduce a learnable parameter $c \in (0,1)$ to adaptively balance the impact of the reward and the dynamics in different environments and tasks.
+
+As the impact factor $c$ should be automatically determined when learning in a specific task or environment, we integrate the learning of $c$ into the update of the Q-function in SAC such that the value of $c$ is learned from the state-action value which is highly relevant to a specific task and environment. To be specific, we concatenate the low-dimensional representations $\phi_r(\mathbf{s})$ and $\phi_d(\mathbf{s})$ weighted by $1 - c$ and $c$ , where $1 - c$ and $c$ are output of a softmax to ensure $c \in (0,1)$ . The loss for the Q-function is revised as follows, which takes $\phi_r(\mathbf{s}), \phi_d(\mathbf{s})$ , weight $c$ and action $a$ as input:
+
+$$
+J _ {Q} (\theta , c, \phi_ {r}, \phi_ {d}) = \mathbb {E} _ {(\mathbf {s}, \mathbf {a}, \mathbf {s} ^ {\prime}) \sim \mathcal {D}} \left[ \right. \frac {1}{2} \left( \right.Q _ {\theta} \left(\phi_ {r} (\mathbf {s}), \phi_ {d} (\mathbf {s}), c, \mathbf {a}\right) - \left(r (\mathbf {s}, \mathbf {a}) + \gamma V (\mathbf {s} ^ {\prime}))\right) ^ {2} \left. \right], \tag {8}
+$$
+
+where $Q_{\theta}$ is the Q-function parameterized by $\theta$ and $V(\cdot)$ is the target value function.
+
+Moreover, to balance the learning of the two meta-learners $f_{r}$ and $f_{d}$ , we jointly minimize the regression losses of $f_{r}$ and $f_{d}$ ((6) and (7), respectively) with the balance factor $c$ . Thus, the loss
+
+function is modified as follows,
+
+$$
+\ell (\Theta) = (1 - c) \ell \left(f _ {r}, \phi_ {r}\right) + c \ell \left(f _ {d}, \phi_ {d}\right), \text {w h e r e} \Theta = \left\{f _ {r}, f _ {d}, \phi_ {r}, \phi_ {d} \right\}. \tag {9}
+$$
+
+Note that $c$ is already learned along with the Q-function, we stop gradient of $c$ when minimizing the loss (9). This is because if we perform gradient descent w.r.t. $c$ , it may only capture which loss $(\ell(f_r, \phi_r)$ or $\ell(f_d, \phi_d))$ is larger/smaller and fail to learn the quantities of their importance. We also stop gradient for the dynamics model $\hat{\mathcal{P}}$ since $\hat{\mathcal{P}}$ only predicts one-step dynamics.
+
+# 4.3 OVERALL OBJECTIVE WITH DATA AUGMENTATION
+
+In this section, we propose to integrate a data augmentation strategy into our proposed framework to learn more robust state representations. We follow the notations of an existing work on data augmentation for reinforcement learning, DrQ (Yarats et al., 2021), and define a state transformation $h: S \times \mathcal{T} \to S$ that maps a state to a data-augmented state, where $\mathcal{T}$ is the space of parameters of $h$ . In practice, we use a random crop as the transformation $h$ in this work. Then $\mathcal{T}$ contains all possible crop positions and $\mathbf{v} \in \mathcal{T}$ is one crop position drawn from $\mathcal{T}$ . We apply DrQ to regularize the objective of the Q-function (see Appendix for the full objective of Q-function).
+
+Besides, by using the augmentation transformation $h$ , we rewrite the loss of representation learning and similarity approximation in (9) as follows,
+
+$$
+\begin{array}{l} \ell (\Theta) = (1 - c) \left(f _ {r} \left(\phi_ {r} (\mathbf {s} _ {i} ^ {(1)}), \phi_ {r} (\mathbf {s} _ {j} ^ {(1)})\right) - | r _ {i} - r _ {j} |\right) ^ {2} \\ + c \left(f _ {d} \left(\phi_ {d} \left(\mathbf {s} _ {i} ^ {(1)}\right), \phi_ {d} \left(\mathbf {s} _ {j} ^ {(1)}\right)\right) - W _ {2} \left(\hat {\mathcal {P}} \left(\cdot \mid \phi_ {d} \left(\mathbf {s} _ {i} ^ {(1)}\right), \mathbf {a} _ {i}\right), \hat {\mathcal {P}} \left(\cdot \mid \phi_ {d} \left(\mathbf {s} _ {j} ^ {(1)}\right), \mathbf {a} _ {j}\right)\right)\right) ^ {2} \tag {10} \\ + (1 - c) \left(f _ {r} \left(\phi_ {r} \left(\mathbf {s} _ {j} ^ {(2)}\right), \phi_ {r} \left(\mathbf {s} _ {i} ^ {(2)}\right)\right) - \left| r _ {i} - r _ {j} \right|\right) ^ {2} \\ + c \left(f _ {d} \left(\phi_ {d} (\mathbf {s} _ {j} ^ {(2)}), \phi_ {d} (\mathbf {s} _ {i} ^ {(2)})\right) - W _ {2} \left(\hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {i} ^ {(1)}), \mathbf {a} _ {i}), \hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {j} ^ {(1)}), \mathbf {a} _ {j})\right)\right) ^ {2}, \\ \end{array}
+$$
+
+where $\mathbf{s}_*^{(k)} = h(\mathbf{s}_*,\mathbf{v}_*^{(k)})$ is the transformed state with parameters $\mathbf{v}_*^{(k)}$ . Specifically, $\mathbf{s}_i^{(1)}$ , $\mathbf{s}_j^{(1)}$ , $\mathbf{s}_i^{(2)}$ and $\mathbf{s}_j^{(2)}$ are transformed states with parameters of $\mathbf{v}_i^{(1)}$ , $\mathbf{v}_j^{(1)}$ , $\mathbf{v}_i^{(2)}$ and $\mathbf{v}_j^{(2)}$ respectively, which are all drawn from $\mathcal{T}$ independently. The first two terms in (10) are similar to the two terms in (9), while the observation $\mathbf{s}_*$ in (9) is transformed to $\mathbf{s}_*^{(1)}$ . For the last two terms in (10), the observation is transformed by
+
+a different parameter $\mathbf{v}_{*}^{(2)}$ except for the last term, where the parameter $\mathbf{v}_{*}^{(1)}$ does not change. The reason why the parameter $\mathbf{v}_{*}^{(1)}$ is used in the last term is that we expect the meta-learner $f_{d}$ is able to make a consensus prediction on $\mathbf{s}_{*}^{(1)}$ and $\mathbf{s}_{*}^{(2)}$ as they are transformed from a same state $\mathbf{s}_{*}$ . Another major difference between the first two terms and the last two terms is the order of the subscripts $i$ and $j$ : $i$ is followed by $j$ in first two terms while $j$ is followed by $i$ in last two terms. The reason behind this is that we aim to make $f_{r}$ and $f_{d}$ to be symmetric.
+
+The loss of the actor of SAC, which is based on the output of the encoder, is
+
+$$
+J _ {\pi} (\psi) = \mathbb {E} _ {(\mathbf {s}, \mathbf {a}) \sim \mathcal {D}} \left[ \alpha \log \left(\pi_ {\psi} (\mathbf {a} | \hat {\phi} (\mathbf {s}))\right) - Q _ {\theta} (\phi (\mathbf {s}), \mathbf {a}) \right], \tag {11}
+$$
+
+where $\hat{\phi}$ denotes the convolutional layers of $\phi$ and $Q_{\theta}(\phi (\mathbf{s}),\mathbf{a})$ is a convenient form of the Q-function with $c$ -weighted state representations input. We also stop gradients for $\hat{\phi}$ and $\phi (\phi_r$ and $\phi_d)$ regarding the actor loss. In other words, the loss in (11) only calculates the gradients w.r.t. $\psi$ .
+
+The overall learning algorithm is summarized in Algorithm 1. Note that due to limit of space, more details can be found in Appendix A. In summary, as illustrated in Figure 1, in AMBS, the convnet is shared by the encoders $\phi_r$ and $\phi_d$ , which consists of 4 convolutional layers. The final output of
+
+the convnet is fed into two branches: 1) one is a fully-connected layer to form reward representation $\phi_r(\mathbf{s})$ , and 2) the other is also a fully-connected layer but forms dynamics representation $\phi_d(\mathbf{s})$ . The meta-learners $f_{r}$ and $f_{d}$ are both MLPs with two layers. More implementation details are provided at Appendix B. Source code is available at https://github.com/jianda-chen/AMBS.
+
+# 5 EXPERIMENTS
+
+The major goal of our proposed AMBS is to learn a generalizable representation for RL from high-dimensional raw data. We evaluate AMBS on two environments: 1) the DeepMind Control (DMC) suite (Tassa et al., 2018) with background distraction; and 2) autonomous driving task on CARLA (Dosovitskiy et al., 2017) simulator. Several baselines methods are compared with AMBS: 1) Deep Bisimulation Control (DBC) (Zhang et al., 2021) which is recent research on RL representation learning by using the $L_{1}$ distance to approximate bisimulation metric; 2) PSEs (Agarwal et al., 2021) which proposes a new state-pair metric called policy similarity metric for representation learning and learns state embedding by incorporating a contrastive learning method SimCLR (Chen et al., 2020); 3) DrQ (Yarats et al., 2021), a state-of-the-art data augmentation method for deep RL; 4) Stochastic Latent Actor-Critic (SLAC) (Lee et al., 2020a), a state-of-the-art approach for partial observability on controlling by learning a sequential latent model with a reconstruction loss; 5) Soft Actor-Critic (SAC) (Haarnoja et al., 2018), a commonly used off-policy deep RL method, upon which above baselines and our approach are built.
+
+# 5.1 DMC SUITE WITH BACKGROUND DISTRACTION
+
+DeepMind Control (DMC) suite (Tassa et al., 2018) is an environment that provides high dimensional pixel observations for RL tasks. DMC suite with background distraction (Zhang et al., 2018; Stone et al., 2021) replaces the background with natural videos which are task-irrelevant to the RL tasks. We perform the comparison experiments in two settings: original background and nature video background. For each setting we evaluate AMBS and baselines in 4 environments, cartpole-swingup, finger-spin, cheetah-run and walker-walk. Results of additional environments are shown in Appendix D.
+
+
+
+
+
+
+
+
+
+
+Figure 3: (a) Pixel observations of DMC suite with original background. (b) Pixel observations of DMC suite with natural video background. Videos are sampled from Kinetics (Kay et al., 2017).
+
+
+(a)
+
+
+(b)
+
+
+
+Original Background. Figure 3a shows the DMC observation of original background which is static and clean. The experiment result is shown in Figure 4. Our method AMBS has comparable learning efficiency and converge scores comparing to state-of-the-art pixel-level RL methods DrQ and SLAC. Note that DBC performs worse in original background setting.
+
+
+Figure 4: Training curves of AMBS and comparison methods. Each curve is average on 5 runs.
+
+
+
+
+
+
+
+
+Figure 5: Training curves of AMBS and comparison methods on natural video background setting. Videos are sampled from Kinetics (Kay et al., 2017) dataset. Each curve is average on 5 runs.
+
+
+
+
+
+
+
+Natural Video Background. Figure 3b shows the DMC observation with natural video background. The background video is sampled from the Kinetics (Kay et al., 2017) dataset under label "driving car". By following the experimental configuration of DBC, we sample 1,000 continuous frames as background video for training, and sample another 1,000 continuous frames for evaluation. The experimental result is shown in Figure 5. Our method AMBS outperforms other baselines in terms of both efficiency and scores. It converges to the scores that are similar to the scores on original background setting within 1 million steps. DrQ can only converge to the same scores on cartpole-swingup and finger-spin but the learning is slightly slower than AMBS. The sequential latent model method SLAC performs badly on this setting. This experiment demonstrates that AMBS is robust to the background task-irrelevant information and the AMBS objectives improve the performance when comparing to other RL representation learning methods, e.g., DBC.
+
+# 5.2 ABLATION STUDY
+
+Our approach AMBS consists of several major components: meta-learners, a factor to balance the impact between reward and dynamics, and data augmentation on representation learning. To evaluate the importance of each component, we eliminate or replace each component by baseline methods. We conduct experiments on cheetah-run and walker-walk under the natural video background setting. Figure 6 shows the performance of AMBS, variants of AMBS and baseline methods. AMBS w/o data aug is constructed by removing data augmentation in AMBS. AMBS w/o $f$ is referred to as replacing the meta-learners $f_{r}$ and $f_{d}$ by the $L_{1}$ distance, as in DBC. AMBS w/o $c$ removes the component of balancing impact between reward and dynamics but encodes the observation into a single embedding. It uses single meta-learner to approximate the sum of reward and dynamics distance. DBC + DrQ is DBC with data augmentation applied on representation learning and SAC. AMBS $c = 0.5$ denotes AMBS with a fixed weight $c = 0.5$ . AMBS w/ $(1, \gamma)$ replaces $c$ in AMBS by freezing the reward weight to 1 and the dynamics weight to $\gamma$ . Such a setting of weights is used in DBC. Figure 6 demonstrates that AMBS performs better than any of its variant. Comparing to DBC that does not utilize data augmentation, our variant AMBS w/o data aug still performs better. This comparison shows that using meta-learners $f_{r}$ and $f_{d}$ to learn reward- and dynamics-relevant representations is able to improve RL performance compared with using the $L_{1}$ distance to approximate the whole $\pi$ -bisimulation metric.
+
+# 5.3 TRANSFER OVER REWARD FUNCTIONS
+
+The environments walker-walk, walker-run and walker-stand share the same dynamics but have different reward functions according to the moving speed. To evaluate the transfer ability of AMBS over reward functions, we transfer the learned model from walker-walk to walker-run and walker-stand. We train agents on walker-run and walker-stand with frozen convolutional layers of encoders that are well trained in walker-walk. The experiments are done under the natural video setting
+
+
+Figure 6: Ablation Study on cheetah-run (left) and walker-walk (right) in natural video setting.
+
+
+Figure 7: Transfer from walker-walk to (left) walker-run and (right) walker-stand.
+
+
+
+
+
+compared with DBC as shown in Figure 7. It shows that the transferring encoder converges faster than training from scratch. Besides our approach has a better transfer ability than DBC.
+
+# 5.4 GENERALIZATION OVER BACKGROUNDVIDEO
+
+We evaluate the generalization ability of our method when background video is changed. We follow the experiment setting of PSE (Agarwal et al., 2021)n. We pick 2 videos, 'bear' and 'bmx-bumps', from the training set of DAVIS 2017 (Pont-Tuset et al., 2018) for training. We randomly sample one video and a frame at each episode start, and then play the video forward and backward until episode ends. The RL agent is evaluated on validation environment where the background video is sampled from validation set of DAVIS 2017. Those validation videos are unseen during the training. The evaluation scores at 500K environment interaction steps is shown in Table 1. The comparison method $\mathrm{DrQ + PSEs}$ is data augmented by $\mathrm{DrQ}$ . AMBS outperforms $\mathrm{DrQ + PSEs}$ on all the 4 tasks. It demonstrates that AMBS is generalizable on unseen background videos.
+
+| Methods | C-swingup | F-spin | C-run | W-walk |
| DrQ + PSEs | 749 ± 19 | 779 ± 49 | 308 ± 12 | 789 ± 28 |
| AMBS | 807 ± 41 | 933 ± 96 | 332 ± 27 | 893 ± 85 |
+
+Table 1: Generalization to unseen background videos sampled from DAVIS 2017 (Pont-Tuset et al., 2018). Scores of $\mathrm{DrQ + PSEs}$ are reported from Agarwal et al. (2021).
+
+
+(a)
+
+
+(b)
+
+# 5.5 AUTONOMOUS DRIVING TASK ON CARLA
+
+CARLA is an autonomous driving simulator that provides a 3D simulation for realistic on-road scenario. In real world cases or in realistic simulation, the learning of RL agents may suffer from complex background that contains task-irrelevant details. To argue that AMBS can address this issue, we perform experiments with CARLA. We follow the setting of DBC to create an autonomous driving task on map "Town04" for controlling a car to drive as far as possible in 1,000 frames. The environment
+
+contains a highway with 20 moving vehicles. The reward function prompts the driving distance and penalizes collisions. The observation shape is $84 \times 420$ pixels which consists of five $84 \times 84$ cameras. Each camera has 60 degrees view, together they produce a 300 degrees first-person view, as shown in Figure 8. The weather, clouds and brightness may change slowly during the simulation. Figure 9 shows the training curves of AMBS and other comparison methods. AMBS performs the best, which provides empirical evidence that AMBS can potentially generalize over task-irrelevant details, e.g., weather and clouds, in real world scenarios.
+
+
+Figure 8: (a) Illustration of a third-person view in "Town4" scenario of CARLA. (b) A first-person observation for RL agent. It concatenates five cameras for 300 degrees view.
+Figure 9: CARLA simulation.
+
+# 6 CONCLUSION
+
+This paper presents a novel framework AMBS with meta-learners for learning task-relevant and environment-detail-invariant state representation for deep RL. In AMBS, we propose state encoders that decompose an observation into rewards and dynamics representations for measuring behavioral similarities by two self-learned meta-learners, and design a learnable strategy to balance the two types of representations. AMBS archives new state-of-the-art results in various environments and demonstrates its transfer ability on RL tasks. Experimental results verify that our framework is able to effectively learn a generalizable state representation.
+
+# ACKNOWLEDGEMENT
+
+This work is supported by Microsoft Research Asia collaborative research grant 2020.
+
+# REFERENCES
+
+Rishabh Agarwal, Marlos C. Machado, Pablo Samuel Castro, and Marc G Bellemare. Contrastive behavioral similarity embeddings for generalization in reinforcement learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=qda7-sVg84.
+Pablo Samuel Castro. Scalable methods for computing state similarity in deterministic markov decision processes. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 10069-10076, 2020.
+Pablo Samuel Castro, Tyler Kastner, Prakash Panangaden, and Mark Rowland. Mico: Improved representations via sampling-based state similarity for markov decision processes. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=wFp6kmQELgu.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. 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. 1597-1607. PMLR, 13-18 Jul 2020. URL http://proceedings.mlr.press/v119/chen20j.html.
+Karl Cobbe, Oleg Klimov, Chris Hesse, Taehoon Kim, and John Schulman. Quantifying generalization in reinforcement learning. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 1282-1289. PMLR, 09-15 Jun 2019. URL http://proceedings.mlr.press/v97/cobbe19a.html.
+Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. CARLA: An open urban driving simulator. In Proceedings of the 1st Annual Conference on Robot Learning, pp. 1-16, 2017.
+Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Vlad Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, Shane Legg, and Koray Kavukcuoglu. IMPALA: Scalable distributed deep-RL with importance weighted actor-learner architectures. 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. 1407-1416. PMLR, 10-15 Jul 2018.
+Norm Ferns, Prakash Panangaden, and Doina Precup. Metrics for finite markov decision processes. In Proceedings of the 20th Conference on Uncertainty in Artificial Intelligence, UAI '04, pp. 162-169, Arlington, Virginia, USA, 2004. AUAI Press. ISBN 0974903906.
+Norm Ferns, Prakash Panangaden, and Doina Precup. Bisimulation metrics for continuous markov decision processes. SIAM J. Comput., 40(6):1662-1714, December 2011. ISSN 0097-5397. doi: 10.1137/10080484X. URL https://doi.org/10.1137/10080484X.
+Carles Gelada, Saurabh Kumar, Jacob Buckman, Ofir Nachum, and Marc G. Bellemare. DeepMDP: Learning continuous latent space models for representation learning. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2170-2179. PMLR, 09-15 Jun 2019. URL http://proceedings.mlr.press/v97/gelada19a.html.
+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. URL http://proceedings.mlr.press/v80/haarnoja18b.html.
+
+Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2555-2565. PMLR, 09-15 Jun 2019. URL http://proceedings.mlr.press/v97/hafner19a.html.
+Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=S11OTC4tDS.
+Irina Higgins, Arka Pal, Andrei Rusu, Loic Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1480-1490. PMLR, 06-11 Aug 2017. URL http://proceedings.mlrpress/v70/higgins17a.html.
+Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natev, Mustafa Suleyman, and Andrew Zisserman. The kinetics human action video dataset. CoRR, abs/1705.06950, 2017.
+Mete Kemertas and Tristan Ty Aumentado-Armstrong. Towards robust bisimulation metric learning. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=ySFGlFjgIfN.
+Sascha Lange and Martin Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In The 2010 International Joint Conference on Neural Networks (IJCNN), pp. 1-8, 2010.
+Michael Laskin, Aravind Srinivas, and Pieter Abbeel. CURL: Contrastive unsupervised representations for reinforcement learning. In Hal Daume III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 5639-5650. PMLR, 13-18 Jul 2020a. URL http://proceedings.mlr.press/v119/laskin20a.html.
+Misha Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 19884-19895. Curran Associates, Inc., 2020b. URL https://proceedings.neurips.cc/paper/2020/file/e615c82aba461681ade82da2da38004a-Paper.pdf.
+Alex X. Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 741-752. Curran Associates, Inc., 2020a. URL https://proceedings.neurips.cc/paper/2020/file/08058bf500242562c0d031ff830ad094-Paper.pdf.
+Kimin Lee, Kibok Lee, Jinwoo Shin, and Honglak Lee. Network randomization: A simple technique for generalization in deep reinforcement learning. In International Conference on Learning Representations, 2020b. URL https://openreview.net/forum?id=HJgcvJBFvB.
+Timothee Lesort, Natalia Diaz-Rodriguez, Jean-Franois Goudou, and David Filliat. State representation learning for control: An overview. *Neural Networks*, 108:379–392, 2018.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529-533, February 2015. ISSN 00280836. URL http://dx.doi.org/10.1038/nature14236.
+
+Marek Petrik and Bruno Scherrer. Biasing approximate dynamic programming with a lower discount factor. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems, volume 21. Curran Associates, Inc., 2009. URL https://proceedings.neurips.cc/paper/2008/file/08c5433a60135c32e34f46a71175850c-Paper.pdf.
+Silviu Pitis, Elliot Creager, and Animesh Garg. Counterfactual data augmentation using locally factored dynamics. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 3976-3990. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/294e09f267683c7ddc6cc5134a7e68a8-Paper.pdf.
+Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alex Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. CoRR, abs/1704.00675, 2018.
+Roberta Raileanu, Max Goldstein, Denis Yarats, Ilya Kostrikov, and Rob Fergus. Automatic data augmentation for generalization in deep reinforcement learning, 2021.
+Max Schwarzer, Ankesh Anand, Rishab Goel, R Devon Hjelm, Aaron Courville, and Philip Bachman. Data-efficient reinforcement learning with self-predictive representations. In International Conference on Learning Representations, 2021.
+Austin Stone, Oscar Ramirez, Kurt Konolige, and Rico Jonschkowski. The distracting control suite - a challenging benchmark for reinforcement learning from pixels. CoRR, abs/2101.02722, 2021.
+Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdelmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite. CoRR, abs/1801.00690, 2018.
+Niklas Wahlström, Thomas B. Schön, and Marc Peter Deisenroth. From pixels to torques: Policy learning with deep dynamical models. CoRR, abs/1502.02251, 2015.
+Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015. URL https://proceedings.neurips.cc/paper/2015/file/alafc58c6ca9540d057299ec3016d726-Paper.pdf.
+Denis Yarats, Ilya Kostrikov, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=GY6-6sTvGaf.
+Chang Ye, Ahmed Khalifa, Philip Bontrager, and Julian Togelius. Rotation, translation, and cropping for zero-shot generalization. In 2020 IEEE Conference on Games (CoG), pp. 57-64, 2020a. doi: 10.1109/CoG47356.2020.9231907.
+Chang Ye, Ahmed Khalifa, Philip Bontrager, and Julian Togelius. Rotation, translation, and cropping for zero-shot generalization. In 2020 IEEE Conference on Games (CoG), pp. 57-64, 2020b. doi: 10.1109/CoG47356.2020.9231907.
+Amy Zhang, Yuxin Wu, and Joelle Pineau. Natural environment benchmarks for reinforcement learning. CoRR, abs/1811.06032, 2018.
+Amy Zhang, Rowan Thomas McAllister, Roberto Calandra, Yarin Gal, and Sergey Levine. Learning invariant representations for reinforcement learning without reconstruction. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=-2FCwDKRREu.
+Marvin Zhang, Sharad Vikram, Laura Smith, Pieter Abbeel, Matthew Johnson, and Sergey Levine. SO-LAR: Deep structured representations for model-based reinforcement learning. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 7444-7453. PMLR, 09-15 Jun 2019. URL http://proceedings.mlr.press/v97/zhang19m.html.
+
+Brian D. Ziebart. *Modeling Purposeful Adaptive Behavior* with the Principle of Maximum Causal Entropy. PhD thesis, USA, 2010. AAI3438449.
+
+# A OBJECTIVES OF ADAPTIVE META-LEARNER OF BEHAVIORAL SIMILARITIES (AMBS)
+
+We denote two encoders $\phi_r$ and $\phi_d$ , where each encoder maps a high-dimensional observation to a low-dimensional representation. The encoder $\phi_r: S \to \mathcal{Z}_r$ captures reward-relevant features and the encoder $\phi_d: S \to \mathcal{Z}_d$ captures dynamics-relevant features, where $\mathcal{Z}_r$ and $\mathcal{Z}_d$ are representation spaces. We design two meta-learners $f_r: \mathcal{Z}_r \times \mathcal{Z}_r \to \mathbb{R}$ and $f_d: \mathcal{Z}_d \times \mathcal{Z}_d \to \mathbb{R}$ to output reward difference and dynamics difference, respectively. We follow DrQ (Yarats et al., 2021) to define the state transformation $h: S \times \mathcal{T} \to S$ that maps a state to a data-augmented state, where $\mathcal{T}$ is the space of parameters of $h$ . In practice, we use random crop as transformation $h$ .
+
+With augmentation transformation $h$ , the loss of representation learning is,
+
+$$
+\begin{array}{l} \ell (\Theta) = (1 - c) \left(f _ {r} \left(\phi_ {r} \left(\mathbf {s} _ {i} ^ {(1)}\right), \phi_ {r} \left(\mathbf {s} _ {j} ^ {(1)}\right)\right) - \left| r _ {i} - r _ {j} \right|\right) ^ {2} \\ + c \left(f _ {d} (\phi_ {d} (\mathbf {s} _ {i} ^ {(1)}), \phi_ {d} (\mathbf {s} _ {j} ^ {(1)})) - W _ {2} (\hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {i} ^ {(1)}), \mathbf {a} _ {i}), \hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {j} ^ {(1)}), \mathbf {a} _ {j}))\right) ^ {2} \\ + (1 - c) \left(f _ {r} \left(\phi_ {r} \left(\mathbf {s} _ {j} ^ {(2)}\right), \phi_ {r} \left(\mathbf {s} _ {i} ^ {(2)}\right)\right) - \left| r _ {i} - r _ {j} \right|\right) ^ {2} \\ + c \left(f _ {d} (\phi_ {d} (\mathbf {s} _ {j} ^ {(2)}), \phi_ {d} (\mathbf {s} _ {i} ^ {(2)})) - W _ {2} (\hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {i} ^ {(1)}), \mathbf {a} _ {i}), \hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} _ {j} ^ {(1)}), \mathbf {a} _ {j}))\right) ^ {2}, \\ \end{array}
+$$
+
+where $\Theta = \{f_r, f_d, \phi_r, \phi_d\}$ , $\mathbf{s}_*^{(l)} = h(\mathbf{s}_*, \mathbf{v}_*^{(l)})$ is the transformed state with parameters $\mathbf{v}_*^{(l)}$ . Specifically, $\mathbf{s}_i^{(1)}, \mathbf{s}_j^{(1)}, \mathbf{s}_i^{(2)}$ and $\mathbf{s}_j^{(2)}$ are transformed states with parameters of $\mathbf{v}_i^{(1)}, \mathbf{v}_j^{(1)}, \mathbf{v}_i^{(2)}$ and $\mathbf{v}_j^{(2)}$ respectively, which are all drawn from $\mathcal{T}$ independently. $\hat{\mathcal{P}}(\cdot|\phi_d(\mathbf{s}_*), \mathbf{a}_*)$ is a learned probabilistic dynamics model, which outputs a Gaussian distribution over $\mathcal{Z}_d$ for predicting dynamics representation of next state $\mathbf{s}_*'$ . $W_2$ denotes the 2-Wasserstein distance which has closed-form for Gaussian distributions: $W_2(\mathcal{N}(\mu_i, \Sigma_i), \mathcal{N}(\mu_j, \Sigma_j))^2 = \| \mu_i - \mu_j \|_2^2 + \| \Sigma_i^{\frac{1}{2}} - \Sigma_j^{\frac{1}{2}} \|_{\mathcal{F}}^2$ , where $\mu_* \in \mathbb{R}^{|Z_d|}$ are the mean vectors of Gaussian distribution, $\Sigma_* \in \mathbb{R}^{|Z_d|}$ are the diagonals of covariance matrices, and $\| \cdot \|_{\mathcal{F}}$ is Frobenius norm. Note that we stop gradients for $c$ as mentioned in Section 4.2.
+
+The adaptive weight $c$ and $(1 - c)$ are the softmax output of corresponding learnable parameter $\eta_c \in \mathbb{R}^2$ . It can be formulated as
+
+$$
+[ c: (1 - c) ] = \operatorname {s o f t m a x} (\eta_ {c}). \tag {13}
+$$
+
+where the operation : denotes concatenation of two vectors/scalers,
+
+We integrate the learning of $c$ into the update of Q-function of SAC. The objective of the Q-function with DrQ augmentation and clipped double trick is
+
+$$
+\begin{array}{l} J _ {Q} (\theta_ {k}, \eta_ {c}) = \mathbb {E} _ {(\mathbf {s}, \mathbf {a}, \mathbf {s} ^ {\prime}) \sim \mathcal {D}} \left[ \frac {1}{2} \left(Q _ {\theta_ {k}} ([ (1 - c) \phi_ {r} (\mathbf {s} ^ {(1)}): c \phi_ {d} (\mathbf {s} ^ {(1)})], \mathbf {a}) - (r (\mathbf {s}, \mathbf {a}) + \gamma V (\mathbf {s} ^ {\prime}))\right) ^ {2} \right. \\ \left. \right.\left. + \frac {1}{2} \left(Q _ {\theta_ {k}} \left([ (1 - c) \phi_ {r} (\mathbf {s} ^ {(2)}): c \phi_ {d} (\mathbf {s} ^ {(2)}) ], \mathbf {a}\right) - \left(r (\mathbf {s}, \mathbf {a}) + \gamma V (\mathbf {s} ^ {\prime}))\right)\right) ^ {2} \right], \tag {14} \\ \end{array}
+$$
+
+where $\mathbf{s}^{(l)} = h(\mathbf{s},\mathbf{v}^{(l)})$ $\mathbf{v}^{(l)}$ are all drawn from $\mathcal{T}$ independently, and $\{Q_{\theta_k}\}_{k = 1}^2$ are the double Q networks. The target value function with DrQ augmentation is
+
+$$
+\begin{array}{l} V (\mathbf {s} ^ {\prime}) = \frac {1}{2} \left(\min _ {k = 1, 2} Q _ {\bar {\theta} _ {k}} \left([ (1 - \bar {c}) \bar {\phi} _ {r} (\mathbf {s} ^ {\prime (1)}): \bar {c} \bar {\phi} _ {d} (\mathbf {s} ^ {\prime (1)}) ], \mathbf {a} ^ {\prime (1)}\right) + \alpha \log \pi_ {\psi} (\mathbf {a} ^ {\prime (1)} | \mathbf {s} ^ {\prime (1)}) \right. \\ \left. + \min _ {k = 1, 2} Q _ {\bar {\theta} _ {k}} \left(\left[ (1 - \bar {c}) \bar {\phi} _ {r} \left(\mathbf {s} ^ {\prime (2)}\right): \bar {c} \bar {\phi} _ {d} \left(\mathbf {s} ^ {\prime (2)}\right) \right], \mathbf {a} ^ {\prime (2)}\right) + \alpha \log \pi_ {\psi} \left(\mathbf {a} ^ {\prime (2)} \mid \mathbf {s} ^ {\prime (2)}\right)\right), \tag {15} \\ \end{array}
+$$
+
+where $\mathbf{s}'(l) = h(\mathbf{s}',\mathbf{v}'(l))$ $\mathbf{a}^{\prime (l)}\sim \pi_{\psi}(\mathbf{a}^{\prime (l)}|\mathbf{s}^{\prime (l)})$ $\bar{\theta}_k$ is the set of parameters of the target Q network, $\bar{\phi}_r$ and $\bar{\phi}_d$ are target encoders specifically for the target Q network and $\bar{c}$ is the adaptive weight for target encoders. The parameters $\bar{\theta}_k,\bar{\phi}_r,\bar{\phi}_d$ and $\bar{\eta}_c$ are softly updated.
+
+The loss of actor of SAC is,
+
+$$
+J _ {\pi} (\psi) = \mathbb {E} _ {(\mathbf {s}) \sim \mathcal {D}} \left[ \mathbb {E} _ {\mathbf {a} \sim \pi_ {\psi}} [ \alpha \log (\pi_ {\psi} (\mathbf {a} | \hat {\phi} (\mathbf {s} ^ {(1)}))) - \min _ {k = 1, 2} Q _ {\theta_ {k}} (\phi (\mathbf {s} ^ {(1)}), \mathbf {a}) ] \right]. \tag {16}
+$$
+
+The loss of $\alpha$ of SAC is,
+
+$$
+J (\alpha) = \mathbb {E} _ {(\mathbf {s}) \sim \mathcal {D}} \left[ \mathbb {E} _ {\mathbf {a} \sim \pi_ {\psi}} [ \alpha \log (\pi_ {\psi} (\mathbf {a} | \hat {\phi} (\mathbf {s} ^ {(1)}))) - \alpha \bar {\mathcal {H}} ] \right], \tag {17}
+$$
+
+where $\bar{\mathcal{H}}\in \mathbb{R}$ is the target entropy hyper-parameter which in practice is $\bar{\mathcal{H}} = -|\mathcal{A}|$ .
+
+The loss for updating of dynamics model $\hat{\mathcal{P}}$ is
+
+$$
+\ell (\hat {\mathcal {P}}) = \mathbb {E} _ {(\mathbf {s}, \mathbf {a}, \mathbf {s} ^ {\prime}) \sim \mathcal {D}} \left[ \left(\frac {\phi_ {d} \left(\mathbf {s} ^ {\prime (1)}\right) - \mu (\hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} ^ {(1)} , \mathbf {a}))}{2 \sigma (\hat {\mathcal {P}} (\cdot | \phi_ {d} (\mathbf {s} ^ {(1)}), \mathbf {a}))}\right) ^ {2} \right], \tag {18}
+$$
+
+where $\mu (\hat{\mathcal{P}} (\cdot))$ and $\sigma (\hat{\mathcal{P}} (\cdot))$ are mean and standard deviation of $\hat{\mathcal{P}}$ output Gaussian distribution, respectively.
+
+Algorithm 2 shows the algorithm at each learning step.
+
+# Algorithm 2 AMBS+SAC
+
+1: Input: Replay Buffer $\mathcal{D}$ , initialized $\Theta = \{f_r, \phi_r, f_d, \phi_d\}$ , Q network $Q_{\theta_k}$ , actor $pi_\psi$ , target Q network $Q_{\bar{\theta}_k}$
+2: Sample a batch with size $B$ : $\{(\mathbf{s}_i, \mathbf{a}_i, r_i, \mathbf{s}_i')\}_{b=1}^B \sim \mathcal{D}$ .
+3: Shuffle batch $\left\{(\mathbf{s}_i,\mathbf{a}_i,r_i,\mathbf{s}_i')\right\}_{b = 1}^B$ to $\left\{(\mathbf{s}_j,\mathbf{a}_j,r_j,\mathbf{s}_j')\right\}_{b = 1}^B$
+4: Update Q network by equation 14 with DrQ augmentation.
+5: Update actor network by equation 16.
+6: Update alpha $\alpha$ by equation 17.
+7: Update encoder $\Theta$ by equation 12
+8: Update dynamics model $\mathcal{P}$ by equation 18.
+9: Softly update target Q network: $\bar{\theta}_k = \tau_Q\theta_k + (1 - \tau_Q)\bar{\theta}_k$
+10: Softly update target encoder: $\bar{\phi} = \tau_{\phi}\phi +(1 - \tau_{\phi})\bar{\phi}$
+11: Softly update target $\bar{c}$ : $\bar{\eta}_c = \tau_\phi \eta_c + (1 - \tau_\phi)\bar{\eta}_c$ .
+
+# B IMPLEMENTATION DETAILS
+
+# B.1 Pixels PROCESSING
+
+We stack 3 consecutive frames as observation, where each frame is $84 \times 84$ RGB images in DeepMind control suite. Each pixel is divided by 255 to down scale to [0, 1]. We consider the stacked frames as fully observed state.
+
+# B.2 NETWORK ARCHITECTURE
+
+We share the convnet for encoder $\phi_r$ and encoder $\phi_d$ . The shared convnet consists of four convolutional layers with $3 \times 3$ kernels and 32 output channels. We set stride to 1 everywhere, except for the first convolutional layer, which has stride 2. We use ReLU activation for each convolutional layer output. The final output of convnet is fed into two branches: 1) one is a fully-connected layer with 50 dimensions to form reward representation $\phi_r(\mathbf{s})$ , and 2) the other one is also a fully-connected layer with 50 dimensions but form dynamics representation $\phi_d(\mathbf{s})$ . The meta-learners $f_r$ and $f_d$ are both MLPs with two layers with 50 hidden dimensions.
+
+The critic network takes $\phi_r(\mathbf{s})$ , $\phi_d(\mathbf{s})$ and action as input, and feeds them into three stacked fully-connected layers with 1024 hidden dimensions. The actor network takes the shared convnet output as input, and feeds it into four fully-connected layers where the first layer has 100 hidden dimensions and other layers have 1024 hidden dimensions. The dynamics model is MLPs with two layers with 512 hidden dimensions. ReLU activations are used in every hidden layer.
+
+# B.3 HYPERPARAMETERS
+
+The hyperparameters used in our algorithm are listed in Table 2.
+
+| Parameter name | Value |
| Replay buffer capacity | 10^6 |
| Discount factor γ | 0.99 |
| Minibatch size | 128 |
| Optimizer | Adam |
| Learning rate for α | 10^-4 |
| Learning rate except α | 5 × 10^-4 |
| Target update frequency | 2 |
| Actor update frequency | 2 |
| Actor log stddev bounds | [-10, 2] |
| τQ | 0.01 |
| τφ | 0.05 |
| Init temperature | 0.1 |
+
+# B.4 ACTION REPEAT FOR DMC
+
+We use different action repeat hyper-parameters for each task in DeepMind control suite, which are listed in Table 3.
+
+Table 2: Hyperparameters used in our algorithm.
+
+| Task name | Action repeat |
| Cartpole Swingup | 8 |
| Finger Spin | 2 |
| Cheetah Run | 4 |
| Walker Walk | 2 |
| Reacher Easy | 4 |
| Ball In Cup Catch | 4 |
+
+Table 3: Action repeat used for each task in DeepMind control suite.
+
+# B.5 SOURCE CODES
+
+Source code of AMBS is available at https://github.com/jianda-chen/AMBS.
+
+# C ANALYSIS
+
+# C.1 REGRESSION LOSSES OF APPROXIMATING BISIMULATION METRIC
+
+We compare the regression losses of approximating the bisimulation metric over RL environment steps among DBC and our AMBS. DBC uses the $L_{1}$ norm to calculate the distances between two states embeddings. AMBS performs meta-learners on state representations to measure the distance with learned similarities. Figure 10 demonstrates that AMBS has smaller regression loss and also faster descent tendency compared to DBC. Meta-learners in AMBS are able to provide more stable gradients to update the state representations.
+
+
+Figure 10: The regression losses over RL environment steps among DBC and AMBS.
+
+
+
+
+
+
+
+# C.2 VISUALIZATIONS OF COMBINATION WEIGHT C
+
+Figure 11 shows the values of combination weight $c$ in AMBS trained on DMC with origin background and Figure 11 is on DMC with video background setting. The values of $c$ at 1M steps vary in different tasks. The common trend is that they increase at the beginning of training. In original background setting $c$ changes slowly after the beginning. In natural video background setting, $c$ has a fast drop after the beginning. In the beginning, agent learns a large weight $c$ for dynamics feature that may boost the learning of RL agent. Then it drops for natural video background setting because it learns that the video background is distracting the agent. Lower weight is learned for the dynamics features.
+
+
+Figure 11: The value of combination weight $c$ over environment steps. AMBS is trained on DMC on Original background.
+
+
+Figure 12: The value of combination weight $c$ over environment steps. AMBS is trained on DMC on video background.
+
+# C.3 NORMS OF STATE EMBEDDINGS
+
+We record the $L_{1}$ norms of reward representation $\phi_r(s)$ and dynamics representation $\phi_d(s)$ during training. We record $\frac{1}{n_r} ||\phi_r(s)||_1$ for reward representation where $n_r$ is the number of dimensions of $\phi_r(s)$ , and $\frac{1}{n_d} ||\phi_d(s)||_1$ for dynamics representation where $n_r$ is the number of dimensions of $\phi_d(s)$ . Figure 13 shows the values averaged on each sampled training batch. Although the $L_{1}$ norm of $\phi_d(s)$ decreases during training, it converges around 0.4-0.5. The $L_{1}$ norm of $\phi_r(s)$ also decreases in the training procedure. It can verify that dynamics representation $\phi_d(s)$ will not converge to all zeros.
+
+
+Figure 13: Norms of state embeddings: $\frac{1}{n_r} ||\phi_r(s)||_1$ and $\frac{1}{n_d} ||\phi_d(s)||_1$ .
+
+# C.4 SHARING ENCODERS BETWEEN ACTOR AND CRITIC
+
+In AMBS, we share only the convolutional layers $\hat{\phi}$ of encoders between actor and critic network. We compare to sharing the whole encoders $\phi_r$ and $\phi_d$ in this experiment. Figure 14 shows the raining curves on Walker-Walk with natural video background. Sharing full encoder $\phi_r$ and $\phi_d$ is worse than sharing only CNN $\hat{\phi}$ .
+
+
+Figure 14: Training curves of different ways of sharing encoder. Experiments on Walker-Walk with natural video background.
+
+# D ADDITIONAL EXPERIMENTAL RESULTS
+
+# D.1 ADDITIONAL RESULT OF DMC SUITE WITH AND W/O BACKGROUND DISTRACTION
+
+Figure 15 shows the training curves on original background setting. Figure 16 shows the training curves on Kinetics (Kay et al., 2017) video background setting.
+
+
+Figure 15: Training curves of AMBS and comparison methods. Each curve is average on 3 runs.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 16: Training curves of AMBS and comparison methods on natural video background setting. Videos are sampled from Kinetics (Kay et al., 2017) dataset. Each curve is average on 3 runs.
+
+
+
+
+
+# D.2 ADDITIONAL RESULT OF GENERALIZATION OVER BACKGROUND VIDEO
+
+Table 4 shows the scores on DAVIS video background setting comparing to PSEs (Agarwal et al., 2021).
+
+| Methods | C-swingup | F-spin | C-run | W-walk | R-easy | BiC-catch |
| DrQ + PSEs | 749 ± 19 | 779 ± 49 | 308 ± 12 | 789 ± 28 | 955 ± 10 | 821 ± 17 |
| AMBS | 807 ± 41 | 933 ± 96 | 332 ± 27 | 893 ± 85 | 980 ± 11 | 944 ± 59 |
+
+Table 4: Generalization with unseen background videos sampled from DAVIS 2017 (Pont-Tuset et al., 2018) dataset. We evaluate the agents at 500K environment steps. Scores of $\mathrm{DrQ} +$ PSEs are reported from Agarwal et al. (2021).
+
+# D.3 ADDITIONAL RESULT ON CARLA
+
+The CARLA experiment is to learn an autonomous driving RL agent to avoid collisions with other moving vehicles and drive as far as possible on a highway within 1000 frames. Those vehicles are randomly generated, including vehicles' types, colors and initial positions. We raise the number of generated vehicles from 20 to 40 so that the road becomes more crowded for RL agent. Besides, we also extend the training steps to 2e5 for AMBS and DBC. Figure 17 shows the training curve on CARLA. AMBS and DBC run on the precious setting of CARLA, while AMBS40 and DBC40 run on the highway with 40 generated vehicles. When increasing the number of vehicles from 20 to 40, DBC becomes more difficult to learn but AMBS is just slightly slower. DBC still doesn't achieve high scores after 1e5 steps.
+
+
+Figure 17: Training curve on CARLA environment.
+
+# E PROOFS
+
+# E.1 VALUE-FUNCTION BOUND
+
+Theorem E.1 (Value function difference bound for different discounting factors (Petrik & Scherrer, 2009; Kemertas & Aumentado-Armstrong, 2021)). Consider two identical MDPs except for different discounting factors $\gamma_{1}$ and $\gamma_{2}$ , where $\gamma_{1} \leq \gamma_{2}$ and reward $r \in [0,1]$ . Let $V_{\gamma}^{\pi}$ denotes the value function for MDP with discounting factor $\gamma$ given policy $\pi$ .
+
+$$
+\left| V _ {\gamma_ {1}} ^ {\pi} (\mathbf {s}) - V _ {\gamma_ {2}} ^ {\pi} (\mathbf {s}) \right| \leq \frac {\gamma_ {2} - \gamma_ {1}}{(1 - \gamma_ {1}) (1 - \gamma_ {2})} \tag {19}
+$$
+
+Definition E.1 ( $c$ -weighted on policy bisimulation metric). Given a policy $\pi$ , and $c \in (0, 1)$ , the on-policy bisimulation metric exists,
+
+$$
+d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) = (1 - c) \left| \mathcal {R} _ {\mathbf {s} _ {i}} ^ {\pi} - \mathcal {R} _ {\mathbf {s} _ {j}} ^ {\pi} \right| + c W _ {1} (d) \left(\mathcal {P} _ {\mathbf {s} _ {i}} ^ {\pi}, \mathcal {P} _ {\mathbf {s} _ {j}} ^ {\pi}\right). \tag {20}
+$$
+
+Theorem E.2 (Value difference bound). For any $c \in [\gamma, 1)$ , given two state $\mathbf{s}_i$ and $\mathbf{s}_j$ ,
+
+$$
+(1 - c) \left| V ^ {\pi} \left(\mathbf {s} _ {i}\right) - V ^ {\pi} \left(\mathbf {s} _ {j}\right) \right| \leq d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) \tag {21}
+$$
+
+Proof. Lemma 6 of Kemertas & Aumentado-Armstrong (2021).
+
+Theorem E.3 (Generalized value difference bound). For any $c \in (0,1)$ , given two states $\mathbf{s}_i$ and $\mathbf{s}_j$ ,
+
+$$
+(1 - c) \left| V ^ {\pi} \left(\mathbf {s} _ {i}\right) - V ^ {\pi} \left(\mathbf {s} _ {j}\right) \right| \leq d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) + \frac {2 (1 - c) (\gamma - \min (c , \gamma))}{(1 - \gamma) (1 - c)} \tag {22}
+$$
+
+Proof. We follow the proof of Theorem 1 in Kemertas & Aumentado-Armstrong (2021). Suppose another MDP with discounting factor $\gamma' = c$ exists. From Theorem E.2 we have
+
+$$
+(1 - c) \left| V _ {\gamma^ {\prime}} ^ {\pi} \left(\mathbf {s} _ {i}\right) - V _ {\gamma^ {\prime}} ^ {\pi} \left(\mathbf {s} _ {j}\right) \right| \leq d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right). \tag {23}
+$$
+
+Then,
+
+$$
+\begin{array}{l} (1 - c) \left| V ^ {\pi} (\mathbf {s} _ {i}) - V ^ {\pi} (\mathbf {s} _ {j}) \right| \\ = (1 - c) \left| V ^ {\pi} (\mathbf {s} _ {i}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {i}) + V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {i}) - V ^ {\pi} (\mathbf {s} _ {j}) + V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {j}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {j}) \right| \\ \leq (1 - c) \left(\left| V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {i}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {j}) \right| + \left| V ^ {\pi} (\mathbf {s} _ {i}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {i}) \right| + \left| V ^ {\pi} (\mathbf {s} _ {j}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {j}) \right|\right) \tag {24} \\ \leq d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) + (1 - c) \left(| V ^ {\pi} (\mathbf {s} _ {i}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {i}) | + | V ^ {\pi} (\mathbf {s} _ {j}) - V _ {\gamma^ {\prime}} ^ {\pi} (\mathbf {s} _ {j}) |\right) \\ \leq d (\mathbf {s} _ {i}, \mathbf {s} _ {j}) + \frac {2 (1 - c) (\gamma - \min (\gamma^ {\prime} , \gamma))}{(1 - \gamma) (1 - \gamma^ {\prime})} \\ \end{array}
+$$
+
+Replace $\gamma^\prime$ by $c$ , finally we have
+
+$$
+(1 - c) \left| V ^ {\pi} \left(\mathbf {s} _ {i}\right) - V ^ {\pi} \left(\mathbf {s} _ {j}\right) \right| \leq d \left(\mathbf {s} _ {i}, \mathbf {s} _ {j}\right) + \frac {2 (1 - c) (\gamma - \min (c , \gamma))}{(1 - \gamma) (1 - c)}. \tag {25}
+$$
\ No newline at end of file
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/images.zip b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..44f5ffc1c40d6e075bdd03002eb10b6588a9a5e7
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0838dd1e1818511257747add76ecf2a6e753205bb445f596312b88a902d3a465
+size 980049
diff --git a/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/layout.json b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..4f7e20224a2f283a494966edee0cab2f2fabcca6
--- /dev/null
+++ b/learninggeneralizablerepresentationsforreinforcementlearningviaadaptivemetalearnerofbehavioralsimilarities/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:77faabca938029b2b83d0f4e011f2c05e6e83ecc9eae24434cf5596c1adc69e1
+size 776032
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_content_list.json b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4ed25c2277ad48d77a60c94e5f13d26531ef555c
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ef4c9de4100bace3830ab54cb00d20c77ba7d172e629e0e53226bd9b074cd45
+size 239823
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_model.json b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a0d1c419c150339bce3598b5c66f97f583ecc542
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33459d7a393707a0580eeb244da5f9e13cda5890e1cdc6063ae9b6820fb3ea27
+size 276603
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_origin.pdf b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..70467d246970ce1c2250aad77b1b046e509912c6
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/5ef90137-9f95-41f5-adf5-904cdc7b441f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f30b2b1708c7b41238ab364340b530977810e8ce74048158bf6f7dcbcd9e62ed
+size 2879171
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/full.md b/learninggraphonmeanfieldgamesandapproximatenashequilibria/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..732f53b29ba1a5532c739dbde0d596bd7993778a
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/full.md
@@ -0,0 +1,1106 @@
+# LEARNING GRAPHON MEAN FIELD GAMES AND APPROXIMATE NASH EQUILIBRIA
+
+Kai Cui & Heinz Koeppl
+
+Department of Electrical Engineering, Technische Universität Darmstadt, Germany {kai.cui, heinz.koeppl}@bcs.tu-darmstadt.de
+
+# ABSTRACT
+
+Recent advances at the intersection of dense large graph limits and mean field games have begun to enable the scalable analysis of a broad class of dynamical sequential games with large numbers of agents. So far, results have been largely limited to graphon mean field systems with continuous-time diffusive or jump dynamics, typically without control and with little focus on computational methods. We propose a novel discrete-time formulation for graphon mean field games as the limit of non-linear dense graph Markov games with weak interaction. On the theoretical side, we give extensive and rigorous existence and approximation properties of the graphon mean field solution in sufficiently large systems. On the practical side, we provide general learning schemes for graphon mean field equilibria by either introducing agent equivalence classes or reformulating the graphon mean field system as a classical mean field system. By repeatedly finding a regularized optimal control solution and its generated mean field, we successfully obtain plausible approximate Nash equilibria in otherwise infeasible large dense graph games with many agents. Empirically, we are able to demonstrate on a number of examples that the finite-agent behavior comes increasingly close to the mean field behavior for our computed equilibria as the graph or system size grows, verifying our theory. More generally, we successfully apply policy gradient reinforcement learning in conjunction with sequential Monte Carlo methods.
+
+# 1 INTRODUCTION
+
+Today, reinforcement learning (RL) finds application in various application areas such as robotics (Kober et al., 2013), autonomous driving (Kiran et al., 2021) or navigation of stratospheric balloons (Bellemare et al., 2020) as a method to realize effective sequential decision-making in complex problems. RL remains a very active research area, and there remain many challenges in multi-agent reinforcement learning (MARL) as a generalization of RL such as learning goals, non-stationarity and scalability of algorithms (Zhang et al., 2021). Nonetheless, potential applications for MARL are manifold and include e.g. teams of unmanned aerial vehicles (Tožicka et al., 2018; Pham et al., 2018) or video games (Berner et al., 2019; Vinyals et al., 2017). While the domain of MARL is somewhat empirically successful, problems quickly become intractable as the number of agents grows, and methods in MARL typically miss a theoretical foundation. A recent tractable approach to handling the scalability problem in MARL are competitive mean field games and cooperative mean field control (Gu et al., 2021). Instead of considering generic multi agent Markov games, one considers many agents under the weak interaction principle, i.e. each agent alone has a negligible influence on all other agents. This class of models naturally contains a large number of real world scenarios and can find application e.g. in analysis of power network resilience (Bagagiolo & Bauso, 2014), smart heating (Kizilkale & Malhame, 2014), edge computing (Banez et al., 2019) or flocking (Perrin et al., 2021b). See also Djehiche et al. (2017) for a review of other engineering applications.
+
+Mean field games. Mean field games (MFGs) were first popularized in the independent seminal works of Huang et al. (2006) and Lasry & Lions (2007) for the setting of differential games with diffusion-type dynamics given by stochastic differential equations. See also Guéant et al. (2011); Bensoussan et al. (2013) for a review. Since then, extensions have been manifold and include e.g. discrete-time (Saldi et al., 2018), partial observability (Saldi et al., 2019), major-minor formulations
+
+(Nourian & Caines, 2013) and many more. In the learning community, there has been immense recent interest in finding and analyzing solution methods for mean field equilibria (Cardaliaguet & Hadikhanloo, 2017; Mguni et al., 2018; Guo et al., 2019; Subramanian & Mahajan, 2019; Elie et al., 2020; Cui & Koeppl, 2021; Pasztor et al., 2021; Perolat et al., 2021; Perrin et al., 2021a), solving the inverse reinforcement learning problem (Yang et al., 2018a) or applying related approximations directly to MARL (Yang et al., 2018b). In contrast to our work, Yang et al. (2018a) consider states instead of agents on a graph, while Yang et al. (2018b) requires restrictive assumptions and only considers averages instead of distributions of the neighbors. Recently, focus increased also on the cooperative case of mean field control (Carmona et al., 2019b; Mondal et al., 2021), for which dynamic programming holds on an enlarged state space, resulting in a high-dimensional Markov decision process (Pham & Wei, 2018; Motte & Pham, 2019; Gu et al., 2020; Cui et al., 2021).
+
+Mean field systems on graphs. For mean field systems on dense graphs, prior work mostly considers mean field systems without control (Vizuete et al., 2020) or time-dynamics, i.e. the static case (Parise & Ozdaglar, 2019; Carmona et al., 2019a). To the best of our knowledge, Gao & Caines (2017) and Caines & Huang (2019) are the first to consider general continuous-time diffusion-type graphon mean field systems with control, the latter proposing many clusters of agents as well as proving an approximate Nash property as the number of clusters and agents grows. There have since been efforts to control cooperative graphon mean field systems with diffusive linear dynamics using spectral methods (Gao & Caines, 2019a;b). On the other hand, Bayraktar et al. (2020); Bet et al. (2020) consider large non-clustered systems in a continuous-time diffusion-type setting without control, while Aurell et al. (2021b) and Aurell et al. (2021a) consider continuous-time linear-quadratic systems and continuous-time jump processes respectively. To the best of our knowledge, only Vasal et al. (2021) have considered solving and formulating a graphon mean field game in discrete time, though requiring analytic computation of an infinite-dimensional value function defined over all mean fields and thus being inapplicable to arbitrary problems in a black-box, learning manner. In contrast, we give a general learning scheme and also provide extensive theoretical analysis of our algorithms and (slightly different) model. Finally, for sparse graphs there exist preliminary results (Gkogkas & Kuehn, 2020; Lacker & Soret, 2020), though the setting remains to be developed.
+
+Our contribution. In this work, we propose a dense graph limit extension of MFGs in discrete time, combining graphon mean field systems with mean field games. More specifically, we consider limits of many-agent systems with discrete-time graph-based dynamics and weak neighbor interactions. In contrast to prior works, we consider one of the first general discrete-time formulations as well as its controlled case, which is a natural setting for many problems that are inherently discrete in time or to be controlled digitally at discrete decision times. Our contribution can be summarized as: (i) formulating one of the first general discrete-time graphon MFG frameworks for approximating otherwise intractable large dense graph games; (ii) providing an extensive theoretical analysis of existence and approximation properties in such systems; (iii) providing general learning schemes for finding graphon mean field equilibria, and (iv) empirically evaluating our proposed approach with verification of theoretical results in the finite $N$ -agent graph system, finding plausible approximate Nash equilibria for otherwise infeasible large dense graph games with many agents.
+
+# 2 DENSE GRAPH MEAN FIELD GAMES
+
+In the following, we will give a dense graph $N$ -agent model as well as its corresponding mean field system, where agents are affected only by the overall state distribution of all neighbors, as visualized in Figure 1. As a result of the law of large numbers, this distribution will become deterministic – the mean field – as $N \to \infty$ . We begin with graph-theoretical preliminaries, see also Lovász (2012) for a review. The study of dense large graph limits deals with the limiting representation of adjacency matrices called graphons. Define $\mathcal{I} \coloneqq [0,1]$ and $\mathcal{W}_0$ as the space of all bounded, symmetric and measurable functions (graphons) $W \in \mathcal{W}_0$ , $W \colon \mathcal{I} \times \mathcal{I} \to \mathbb{R}$ bounded by $0 \leq W \leq 1$ . For any simple graph $G = (\{1,\dots,N\},\mathcal{E})$ , we define its step-graphon a.e. uniquely by
+
+$$
+W _ {G} (x, y) = \sum_ {i, j \in \{1, \dots , N \}} \mathbf {1} _ {(i, j) \in \mathcal {E}} \cdot \mathbf {1} _ {x \in (\frac {i - 1}{N}, \frac {i}{N} ]} \cdot \mathbf {1} _ {y \in (\frac {j - 1}{N}, \frac {j}{N} ]}, \tag {1}
+$$
+
+
+
+
+Figure 1: Graphical model visualization. (a): A graph with 5 nodes; (b): The associated step graphon of the graph in (a) as a continuous domain version of its adjacency matrix; (c): A visualization of the dynamics, i.e. the center agent is affected only by its neighbors (grey).
+
+
+
+see e.g. Figure 1. We equip $\mathcal{W}_0$ with the cut (semi-)norm $\| \cdot \| _0$ and cut (pseudo-)metric $\delta_{\square}$
+
+$$
+\| W \| _ {\square} := \sup _ {S, T} \left| \int_ {S \times T} W (x, y) \mathrm {d} x \mathrm {d} y \right|, \quad \delta_ {\square} \left(W, W ^ {\prime}\right) := \inf _ {\varphi} \| W - W _ {\varphi} ^ {\prime} \| _ {\square}, \tag {2}
+$$
+
+for graphons $W, W' \in \mathcal{W}_0$ and $W_{\varphi}'(x,y) \coloneqq W'(\varphi(x), \varphi(y))$ , where the supremum is over all measurable subsets $S, T \subseteq \mathcal{I}$ and the infimum is over measure-preserving bijections $\varphi \colon \mathcal{I} \to \mathcal{I}$ .
+
+To provide motivation, note that convergence in $\delta_{\square}$ is equivalent to e.g. convergence of probabilities of locally encountering any fixed subgraph by randomly sampling a subset of nodes. Many such properties of graph sequences $(G_N)_{N\in \mathbb{N}}$ converging to some graphon $W\in \mathcal{W}_0$ can then be described by $W$ , and we point to Lovász (2012) for details. In this work, we will primarily use the analytical fact that for converging graphon sequences $\| W_{G_N} - W\|_{\square}\to 0$ , we equivalently have
+
+$$
+\left\| W _ {G _ {N}} - W \right\| _ {L _ {\infty} \rightarrow L _ {1}} = \sup _ {\| g \| _ {\infty} \leq 1} \int_ {\mathcal {I}} \left| \int_ {\mathcal {I}} \left(W _ {G _ {N}} (\alpha , \beta) - W (\alpha , \beta)\right) g (\beta) d \beta \right| d \alpha \rightarrow 0 \tag {3}
+$$
+
+under the operator norm of operators $L_{\infty}\rightarrow L_1$ , see e.g. Lovasz (2012), Lemma 8.11.
+
+By Lovász (2012), Theorem 11.59, the above is equivalent to convergence in the cut metric $\delta_{\square}(W_{G_N}, W) \to 0$ up to relabeling. In the following, we will therefore assume sequences of simple graphs $G_N = (\mathcal{V}_N, \mathcal{E}_N)$ with vertices $\mathcal{V}_N = \{1, \dots, N\}$ , edge sets $\mathcal{E}_N$ , edge indicator variables $\xi_{i,j}^N := \mathbf{1}_{(i,j) \in \mathcal{E}_N}$ for all nodes $i, j \in \mathcal{V}_N$ , and associated step graphons $W_N$ converging in cut norm.
+
+Assumption 1. The sequence of step-graphons $(W_{N})_{N\in \mathbb{N}}$ converges in cut norm $\| \cdot \| _{\square}$ or equivalently in operator norm $\| \cdot \|_{L_{\infty}\to L_1}$ as $N\rightarrow \infty$ to some graphon $W\in \mathcal{W}_0$ , i.e.
+
+$$
+\left\| W _ {N} - W \right\| _ {\square} \rightarrow 0, \quad \left\| W _ {N} - W \right\| _ {L _ {\infty} \rightarrow L _ {1}} \rightarrow 0. \tag {4}
+$$
+
+Next, we define $W$ -random graphs to consist of vertices $\mathcal{V}_N \coloneqq \{1, \dots, N\}$ with adjacency matrices $\pmb{\xi}^N$ generated by sampling graphon indices $\alpha_i$ uniformly from $\mathcal{I}$ and edges $\xi_{i,j}^N \sim$ Bernoulli $(W(\alpha_i, \alpha_j))$ for all vertices $i, j \in \mathcal{V}_N$ . For experiments, by Lovász (2012), Lemma 10.16, we can thereby generate a.s. converging graph sequences by sampling $W$ -random graphs for any fixed graphon $W \in \mathcal{W}_0$ . In principle, one could also consider arbitrary graph generating processes whenever a valid relabeling function $\varphi$ is known.
+
+In our work, the usage of graphons enables us to find mean field systems on dense graphs and to extend the expressiveness of classical MFGs. As examples, we will use the limiting graphons of uniform attachment, ranked attachment and $p$ -Erdős-Rényi (ER) random graphs given by $W_{\mathrm{unif}}(x,y) = 1 - \max(x,y)$ , $W_{\mathrm{rank}}(x,y) = 1 - xy$ and $W_{\mathrm{er}}(x,y) = p$ respectively (Borgs et al., 2011; Lovász, 2012), each of which exhibits different node connectivities as shown in Figure 2.
+
+
+Figure 2: Three graphons used in our experiments. (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): Erdős–Rényi (ER) graphon with edge probability 0.5.
+
+
+
+
+
+Finite agent graph game. For simplicity of analysis, we consider finite state and action spaces $\mathcal{X},\mathcal{U}$ as well as times $\mathcal{T} \coloneqq \{0,1,\dots,T - 1\}$ . On a metric space $\mathcal{A}$ , define the spaces of all Borel probability measures $\mathcal{P}(\mathcal{A})$ and all Borel measures $\mathcal{B}_1(\mathcal{A})$ bounded by 1, equipped with the $L_{1}$ norm. For simplified notation, we denote both a measure $\nu$ and its probability mass function by $\nu(\cdot)$ . Define the space of policies $\Pi \coloneqq \mathcal{P}(\mathcal{U})^{\mathcal{T} \times \mathcal{X}}$ , i.e. agents apply Markovian feedback policies $\pi^i = (\pi_t^i)_{t \in \mathcal{T}} \in \Pi$ that act on local state information. This allows for the definition of weakly interacting agent state and action random variables
+
+$$
+X _ {0} ^ {i} \sim \mu_ {0}, \quad U _ {t} ^ {i} \sim \pi_ {t} ^ {i} (\cdot | X _ {t} ^ {i}), \quad X _ {t + 1} ^ {i} \sim P (\cdot | X _ {t} ^ {i}, U _ {t} ^ {i}, \mathbb {G} _ {t} ^ {i}), \quad \forall t \in \mathcal {T}, \forall i \in \mathcal {V} _ {N} \tag {5}
+$$
+
+under some transition kernel $P\colon \mathcal{X}\times \mathcal{U}\times \mathcal{B}_1(\mathcal{X})\to \mathcal{P}(\mathcal{X})$ , where the empirical neighborhood mean field $\mathbb{G}_t^i$ of agent $i$ is defined as the $\mathcal{B}_1(\mathcal{X})$ -valued (unnormized) neighborhood state distribution
+
+$$
+\mathbb {G} _ {t} ^ {i} := \frac {1}{N} \sum_ {j \in \mathcal {V} _ {N}} \xi_ {i, j} ^ {N} \delta_ {X _ {t} ^ {j}}, \tag {6}
+$$
+
+where $\delta$ is the Dirac measure, i.e. each agent affects each other at most negligibly with factor $1 / N$ . Finally, for each agent $i$ we define separate, competitive objectives
+
+$$
+J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right) := \mathbb {E} \left[ \sum_ {t = 0} ^ {T - 1} r \left(X _ {t} ^ {i}, U _ {t} ^ {i}, \mathbb {G} _ {t} ^ {i}\right) \right] \tag {7}
+$$
+
+to be maximized over $\pi^i$ , where $r: \mathcal{X} \times \mathcal{U} \times \mathcal{B}_1(\mathcal{X}) \to \mathbb{R}$ is an arbitrary reward function.
+
+Remark 1. We can also consider infinite horizons, $\tilde{J}_i^N (\pi^1,\dots ,\pi^N)\equiv \mathbb{E}\left[\sum_{t = 0}^\infty \gamma^t r(X_t^i,U_t^i,\mathbb{G}_t^i)\right]$ with all results but Theorem 4 holding. One may also extend to state-action distributions, heterogeneous starting conditions and time-dependent $r$ , $P$ , though we avoid this for expositional simplicity.
+
+Remark 2. Note that it is straightforward to extend to heterogeneous agents by modelling agent types as part of the agent state, see also e.g. Mondal et al. (2021). It is only required to model agent states in a unified manner, which does not imply that there can be no heterogeneity.
+
+With this, we can give a typical notion of Nash equilibria as found e.g. in Saldi et al. (2018). However, under graph convergence in Assumption 1, it is always possible for a finite number of nodes to have an arbitrary neighborhood differing from the graphon as $N \to \infty$ . Thus, it is impossible to show approximate optimality for all nodes and only possible to show for an increasingly large fraction $1 - p \to 1$ of nodes. For this reason, we slightly weaken the notion of Nash equilibria by restricting to a fraction $1 - p$ of agents, as e.g. considered in (Carmona, 2004; Elie et al., 2020).
+
+Definition 1. An $(\varepsilon, p)$ -Markov-Nash equilibrium (almost Markov-Nash equilibrium) for $\varepsilon, p > 0$ is defined as a tuple of policies $(\pi^1, \ldots, \pi^N) \in \Pi^N$ such that for any $i \in \mathcal{W}_N$ , we have
+
+$$
+J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right) \geq \sup _ {\pi \in \Pi} J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - \varepsilon , \tag {8}
+$$
+
+for some set $\mathcal{W}_N\subseteq \mathcal{V}_N$ containing at least $\lfloor (1 - p)N\rfloor$ agents, i.e. $|\mathcal{W}_N|\geq \lfloor (1 - p)N\rfloor$
+
+The minimal such $\varepsilon > 0$ for any fixed policy tuple (and typically $p = 0$ ) is also called its exploitability. Whilst we ordain $\varepsilon$ -optimality only for a fraction $1 - p$ of agents, if the fraction $p$ is negligible, it will have negligible impact on other agents as a result of the weak interaction property. Thus, the solution will remain approximately optimal for almost all agents for sufficiently small $p$ regardless of the behavior of that fraction $p$ of agents. In the following, we will give a limiting system that shall provide $(\varepsilon, p)$ -Markov-Nash equilibria with $\varepsilon, p \to 0$ as $N \to \infty$ .
+
+Graphon mean field game. The formal $N\to \infty$ limit of the $N$ -agent game constitutes its graphon mean field game (GMFG), which shall be rigorously justified in Section 3. We define the space of measurable state marginal ensembles $\mathcal{M}_t\coloneqq \mathcal{P}(\mathcal{X})^{\mathcal{I}}$ and measurable mean field ensembles $\mathcal{M}\coloneqq \mathcal{P}(\mathcal{X})^{\mathcal{T}\times \mathcal{I}}$ , in the sense that $\alpha \mapsto \mu_t^\alpha (x)$ is measurable for any $\pmb {\mu}\in \mathcal{M}$ , $t\in \mathcal{T}$ , $x\in \mathcal{X}$ . Similarly, we define the space of measurable policy ensembles $\Pi \subseteq \Pi^{\mathcal{I}}$ , i.e. with measurable $\alpha \mapsto \pi_t^\alpha (u\mid x)$ for any $\pi \in \Pi , t\in \mathcal{T}, x\in \mathcal{X}, u\in \mathcal{U}$ .
+
+In the GMFG, we will consider infinitely many agents $\alpha \in \mathcal{I}$ instead of the finitely many $i \in \mathcal{V}_N$ . As a result, we will have infinitely many policies $\pi^{\alpha} \in \Pi$ - one for each agent $\alpha$ - through some measurable policy ensemble $\pi \in \Pi$ . We again define state and action random variables
+
+$$
+X _ {0} ^ {\alpha} \sim \mu_ {0}, \quad U _ {t} ^ {\alpha} \sim \pi_ {t} ^ {\alpha} (\cdot \mid X _ {t} ^ {\alpha}), \quad X _ {t + 1} ^ {\alpha} \sim P (\cdot \mid X _ {t} ^ {\alpha}, U _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha}), \quad \forall (\alpha , t) \in \mathcal {I} \times \mathcal {T} \tag {9}
+$$
+
+where we introduce the (now deterministic) $\mathcal{B}_1(\mathcal{X})$ -valued neighborhood mean field of agents $\alpha$ as
+
+$$
+\mathbb {G} _ {t} ^ {\alpha} := \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta \tag {10}
+$$
+
+for some deterministic $\pmb{\mu} \in \mathcal{M}$ . Under fixed $\pi \in \Pi$ , $\mu_t^\alpha$ should be understood as the law of $X_t^\alpha$ , $\mu_t^\alpha \equiv \mathcal{L}(X_t^\alpha)$ . Finally, define the maximization objective of agent $\alpha$ over $\pi^\alpha$ for fixed $\pmb{\mu} \in \mathcal{M}$ as
+
+$$
+J _ {\alpha} ^ {\boldsymbol {\mu}} \left(\pi^ {\alpha}\right) \equiv \mathbb {E} \left[ \sum_ {t = 0} ^ {T - 1} r \left(X _ {t} ^ {\alpha}, U _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha}\right) \right]. \tag {11}
+$$
+
+To formulate the limiting version of Nash equilibria, we define a map $\Psi: \Pi \to \mathcal{M}$ mapping from a policy ensemble $\pi \in \Pi$ to the corresponding generated mean field ensemble $\mu = \Psi(\pi) \in \mathcal{M}$ by
+
+$$
+\mu_ {0} ^ {\alpha} \equiv \mu_ {0}, \quad \mu_ {t + 1} ^ {\alpha} \left(x ^ {\prime}\right) \equiv \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) P \left(x ^ {\prime} \mid x, u, \mathbb {G} _ {t} ^ {\alpha}\right), \quad \forall \alpha \in \mathcal {I} \tag {12}
+$$
+
+where integrability in (10) holds by induction, and note how then $\mu_t^\alpha = \mathcal{L}(X_t^\alpha)$ .
+
+Similarly, let $\Phi \colon \mathcal{M} \to 2^{\Pi}$ map from a mean field ensemble $\pmb{\mu}$ to the set of optimal policy ensembles $\pi$ characterized by $\pi^{\alpha} \in \arg \max_{\pi \in \Pi} J_{\alpha}^{\mu}(\pi)$ for all $\alpha \in \mathcal{I}$ , which is particularly fulfilled if $\pi_t^\alpha(u|x) > 0 \Rightarrow u \in \arg \max_{u' \in \mathcal{U}} Q_\alpha^\mu(t,x,u')$ for all $\alpha \in \mathcal{I}$ , $t \in \mathcal{T}$ , $x \in \mathcal{X}$ , $u \in \mathcal{U}$ , where $Q_\alpha^\mu$ is the optimal action value function under fixed $\pmb{\mu} \in \mathcal{M}$ following the Bellman equation
+
+$$
+Q _ {\alpha} ^ {\mu} (t, x, u) = r \left(x, u, \mathbb {G} _ {t} ^ {\alpha}\right) + \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \mathbb {G} _ {t} ^ {\alpha}\right) \underset {u ^ {\prime} \in \mathcal {U}} {\arg \max } Q _ {\alpha} ^ {\mu} \left(t + 1, x ^ {\prime}, u ^ {\prime}\right) \tag {13}
+$$
+
+with $Q_{\alpha}^{\mu}(T,x,u)\equiv 0$ and generally time-dependent, see Puterman (2014) for a review.
+
+We can now define the GMFG version of Nash equilibria as policy ensembles $\pi$ generating mean field ensembles $\mu$ under which they are optimal, as $\mu_t^\alpha = \mathcal{L}(X_t^\alpha)$ if all agents $\alpha \in \mathcal{I}$ follow $\pi^\alpha$ .
+
+Definition 2. A Graphon Mean Field Equilibrium (GMFE) is a pair $(\pi, \mu) \in \Pi \times \mathcal{M}$ such that $\pi \in \Phi(\mu)$ and $\mu = \Psi(\pi)$ .
+
+# 3 THEORETICAL ANALYSIS
+
+To obtain meaningful optimality results beyond empirical mean field convergence, we will need a Lipschitz assumption as in the uncontrolled, continuous-time case (cf. Bayraktar et al. (2020), Condition 2.3) and typical in mean field theory (Huang et al., 2006).
+
+Assumption 2. Let $r, P, W$ be Lipschitz continuous with Lipschitz constants $L_{r}, L_{P}, L_{W} > 0$ .
+
+Note that all proofs but Theorem 1 also hold for only block-wise Lipschitz continuous $W$ , see Appendix A.1. Since $\mathcal{X} \times \mathcal{U} \times B_1(\mathcal{X})$ is compact, $r$ is bounded by the extreme value theorem.
+
+Proposition 1. Under Assumption 2, $r$ will be bounded by $|r| \leq M_r$ for some constant $M_r > 0$ .
+
+We then obtain existence of a GMFE by reformulating the GMFG as a classical MFG and applying existing results from Saldi et al. (2018). More precisely, we consider the equivalent MFG with extended state space $\mathcal{X} \times \mathcal{I}$ , action space $\mathcal{U}$ , policy $\tilde{\pi} \in \mathcal{P}(\mathcal{U})^{\mathcal{T} \times \mathcal{X} \times \mathcal{I}}$ , mean field $\tilde{\mu} \in \mathcal{P}(\mathcal{X} \times \mathcal{I})^{\mathcal{T}}$ , reward function $\tilde{r}((x, \alpha), u, \tilde{\mu}) := r(x, u, \int_{\mathcal{I}} W(\alpha_t, \beta) \tilde{\mu}_t(\cdot, \beta) \mathrm{d}\beta)$ and transition dynamics such that the states $(\tilde{X}_t, \alpha_t)$ follow $(\tilde{X}_0, \alpha_0) \sim \tilde{\mu}_0 := \mu_0 \otimes \mathrm{Unif}([0, 1])$ and
+
+$$
+\tilde {U} _ {t} \sim \tilde {\pi} _ {t} (\cdot \mid \tilde {X} _ {t}, \alpha_ {t}), \quad \tilde {X} _ {t + 1} \sim P (\cdot \mid \tilde {X} _ {t}, \tilde {U} _ {t}, \int_ {\mathcal {I}} W (\alpha_ {t}, \beta) \tilde {\mu} _ {t} (\cdot , \beta) \mathrm {d} \beta), \quad \alpha_ {t + 1} = \alpha_ {t}. \tag {14}
+$$
+
+Theorem 1. Under Assumption 2, there exists a $GMFE(\pi ,\mu)\in \Pi \times \mathcal{M}$
+
+Meanwhile, in finite games, even showing the existence of Nash equilibria in local feedback policies is problematic (Saldi et al., 2018). Note however, that while this reformulation will be useful for learning and existence, it does not allow us to conclude that the finite graph game is well approximated, as classical MFG approximation theorems e.g. in Saldi et al. (2018) do not consider the graph structure and directly use the limiting graphon $W$ in the dynamics (14).
+
+As our next main result, we shall therefore show rigorously that the GMFE can provide increasingly good approximations of the $N$ -agent finite graph game as $N \to \infty$ . As mentioned, the following also holds for only block-wise Lipschitz continuous $W$ instead of fully Lipschitz continuous $W$ . Complete mathematical proofs together with additional theoretical supplements can be found in Appendix A.1 and A.2. To obtain joint $N$ -agent policies as approximate Nash equilibria from a GMFE $(\pi, \mu)$ , we define the map $\Gamma_N(\pi) \coloneqq (\pi^1, \pi^2, \ldots, \pi^N) \in \Pi^N$ , where
+
+$$
+\pi_ {t} ^ {i} (u \mid x) := \pi_ {t} ^ {\alpha_ {i}} (u \mid x), \quad \forall (\alpha , t, x, u) \in \mathcal {I} \times \mathcal {T} \times \mathcal {X} \times \mathcal {U} \tag {15}
+$$
+
+with $\alpha_{i} = \frac{i}{N}$ , as by Assumption 1 the agents are correctly labeled such that they match up with their limiting graphon indices $\alpha_{i} \in \mathcal{I}$ . In our experiments, we use the $\alpha_{i}$ generated during the generation process of the $W$ -random graphs, though for arbitrary finite systems one would have to first identify the graphon as well as an appropriate assignment of agents to graphon indices $\alpha_{i} \in \mathcal{I}$ , which is a separate, non-trivial problem requiring at least graphon estimation, e.g. Xu (2018).
+
+For theoretical analysis, we propose to lift the empirical distributions and policy tuples to the continuous domain $\mathcal{I}$ , i.e. under an $N$ -agent policy tuple $(\pi^1,\dots ,\pi^N)\in \Pi^N$ , we define the step policy ensemble $\pi^N\in \Pi$ and the random empirical step measure ensemble $\pmb{\mu}^{N}\in \mathcal{M}$ by
+
+$$
+\pi_ {t} ^ {N, \alpha} := \sum_ {i \in \mathcal {V} _ {N}} \mathbf {1} _ {\alpha \in (\frac {i - 1}{N}, \frac {i}{N} ]} \cdot \pi_ {t} ^ {i}, \quad \mu_ {t} ^ {N, \alpha} := \sum_ {i \in \mathcal {V} _ {N}} \mathbf {1} _ {\alpha \in (\frac {i - 1}{N}, \frac {i}{N} ]} \cdot \delta_ {X _ {t} ^ {j}}, \quad \forall (\alpha , t) \in \mathcal {I} \times \mathcal {T}. \tag {16}
+$$
+
+In the following, we consider deviations of the $i$ -th agent from $(\pi^1,\pi^2,\ldots ,\pi^N) = \Gamma_N(\pi)\in \Pi^N$ to $(\pi^{1},\dots ,\pi^{i - 1},\hat{\pi},\pi^{i + 1},\dots ,\pi^{N})\in \Pi^{N}$ , i.e. the $i$ -th agent deviates by instead applying $\hat{\pi}\in \Pi$ . Note that this includes the special case of no agent deviations. For any $f\colon \mathcal{X}\times \mathcal{I}\to \mathbb{R}$ and state marginal ensemble $\pmb {\mu}_t\in \mathcal{M}_t$ , define $\pmb {\mu}_t(f)\coloneqq \int_{\mathcal{I}}\sum_{x\in \mathcal{X}}f(x,\alpha)\mu_t^\alpha (x)\mathrm{d}\alpha$ . We are now ready to state our first result of convergence of empirical state distributions to the mean field, potentially at the classical rate $\mathcal{O}(1 / \sqrt{N})$ and consistent with results in uncontrolled, continuous-time diffusive graphon mean field systems (cf. Bayraktar et al. (2020), Theorem 3.2).
+
+Theorem 2. Consider Lipschitz continuous $\pi \in \Pi$ up to a finite number of discontinuities $D_{\pi}$ with associated mean field ensemble $\pmb{\mu} = \Psi(\pmb{\pi})$ . Under Assumption 1 and the $N$ -agent policy $(\pi^1, \dots, \pi^{i-1}, \hat{\pi}, \pi^{i+1}, \dots, \pi^N) \in \Pi^N$ with $(\pi^1, \pi^2, \dots, \pi^N) = \Gamma_N(\pi) \in \Pi^N$ , $\hat{\pi} \in \Pi$ , $t \in \mathcal{T}$ , we have for all measurable functions $f: \mathcal{X} \times \mathcal{I} \to \mathbb{R}$ uniformly bounded by some $M_f > 0$ , that
+
+$$
+\mathbb {E} \left[\left| \boldsymbol {\mu} _ {t} ^ {N} (f) - \boldsymbol {\mu} _ {t} (f) \right|\right]\rightarrow 0 \tag {17}
+$$
+
+uniformly over all possible deviations $\hat{\pi} \in \Pi, i \in \mathcal{V}_N$ . Furthermore, if the graphon convergence in Assumption 1 is at rate $\mathcal{O}(1 / \sqrt{N})$ , then this rate of convergence is also $\mathcal{O}(1 / \sqrt{N})$ .
+
+In particular, the technical Lipschitz requirement of $\pi$ typically holds for neural-network-based policies (Mondal et al., 2021; Pasztor et al., 2021) and includes also the case of finitely many optimality regimes over all graphon indices $\alpha \in \mathcal{I}$ , which is sufficient to achieve arbitrarily good approximate Nash equilibria through our algorithms as shown in Section 4. We would like to remark that the above result generalizes convergence of state histograms to the mean field solution, since the state marginals of agents are additionally close to each of their graphon mean field equivalents. The above will be necessary to show convergence of the dynamics of a deviating agent to
+
+$$
+\hat {X} _ {0} ^ {\frac {i}{N}} \sim \mu_ {0}, \quad \hat {U} _ {t} ^ {\frac {i}{N}} \sim \hat {\pi} _ {t} (\cdot | \hat {X} _ {t} ^ {\frac {i}{N}}), \quad \hat {X} _ {t + 1} ^ {\frac {i}{N}} \sim P (\cdot | \hat {X} _ {t} ^ {\frac {i}{N}}, \hat {U} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {t} ^ {\frac {i}{N}}), \quad \forall t \in \mathcal {T} \tag {18}
+$$
+
+for almost all agents $i$ , i.e. the dynamics are approximated by using the limiting deterministic neighborhood mean field $\mathbb{G}^{\frac{i}{N}}$ , see Appendix A.1. This will imply the approximate Nash property:
+
+Theorem 3. Consider a GMFE $(\pi, \mu)$ with Lipschitz continuous $\pi$ up to a finite number of discontinuities $D_{\pi}$ . Under Assumptions 1 and 2, for any $\varepsilon, p > 0$ there exists $N'$ such that for all $N > N'$ , the policy $(\pi^1, \ldots, \pi^N) = \Gamma_N(\pi) \in \Pi^N$ is an $(\varepsilon, p)$ -Markov Nash equilibrium, i.e.
+
+$$
+J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right) \geq \max _ {\pi \in \Pi} J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - \varepsilon \tag {19}
+$$
+
+for all $i\in \mathcal{W}_N$ and some $\mathcal{W}_N\subseteq \mathcal{V}_N\colon |\mathcal{W}_N|\geq \lfloor (1 - p)N\rfloor$
+
+In general, Nash equilibria are highly intractable (Daskalakis et al., 2009). Therefore, solving the GMFG allows obtaining approximate Nash equilibria in the $N$ -agent system for sufficiently large $N$ , since $\varepsilon, p \to 0$ as $N \to \infty$ . As a side result, we also obtain first results for the uncontrolled discrete-time case by considering trivial action spaces with $|\mathcal{U}| = 1$ , see Corollary A.2 in the Appendix.
+
+# 4 LEARNING GRAPHON MEAN FIELD EQUILIBRIA
+
+By learning GMFE, one may potentially solve otherwise intractable large $N$ -agent games. For learning, we can apply any existing techniques for classical MFGs (e.g. Mguni et al. (2018); Subramanian & Mahajan (2019); Guo et al. (2019)), since by (14) we have reformulated the GMFG as a classical MFG with extended state space. Nonetheless, it may make sense to treat the graphon index $\alpha \in \mathcal{I}$ separately, e.g. when treating special cases such as block graphons, or by grouping graphically similar agents. We repeatedly apply two functions $\hat{\Phi}, \hat{\Psi}$ by beginning with the mean field $\pmb{\mu}^{0} = \hat{\Psi}(\pmb{\pi}^{0})$ generated by the uniformly random policy $\pmb{\pi}^{0}$ , and computing $\pmb{\pi}^{n+1} = \hat{\Phi}(\pmb{\mu}^{n})$ , $\pmb{\mu}^{n+1} = \hat{\Psi}(\pmb{\pi}^{n+1})$ for $n = 0, 1, \ldots$ until convergence using one of the following two approaches:
+
+- Equivalence classes method. We introduce agent equivalence classes, or discretization, of $\mathcal{I}$ for the otherwise uncountably many agents $\alpha \in \mathcal{I}$ by partitioning $\mathcal{I}$ into $M$ subsets. For example, in the special case of block graphons (block-wise constant $W$ ), one can solve separately for each block equivalence class (type) of agents, since all agents in the class share the same dynamics. Note that in contrast to multi-class MFGs (Huang et al., 2006), GMFGs are rigorously connected to finite graph games and can handle an uncountable number of classes $\alpha$ . To deal with general graphons, we choose equidistant representatives $\alpha_{i} \in \mathcal{I}, i = 1, \ldots, M$ covering the whole interval $\mathcal{I}$ , and approximate each agent $\alpha \in \tilde{\mathcal{I}}_i$ by the nearest $\alpha_{i}$ for the intervals $\tilde{\mathcal{I}}_i \subseteq \mathcal{I}$ of points closest to that $\alpha_{i}$ to obtain $M$ approximate equivalence classes. Formally, we approximate mean fields $\hat{\Psi}(\pi) = \sum_{i=1}^{M} \mathbf{1}_{\alpha \in \tilde{\mathcal{I}}_i} \hat{\mu}^{\alpha_i}$ recursively computed over all times for any fixed policy ensemble $\pi$ , and similarly policies $\hat{\Phi}(\boldsymbol{\mu}) = \sum_{i=1}^{M} \mathbf{1}_{\alpha \in \tilde{\mathcal{I}}_i} \pi^{\alpha_i}$ where $\pi^{\alpha_i}$ is the optimal policy of $\alpha_{i}$ for fixed $\boldsymbol{\mu}$ . We solve the optimal control problem for each equivalence class using backwards induction (alternatively, one may use reinforcement learning), and solve the evolution equation for the representatives $\alpha_{i}$ of the equivalence classes recursively. For space reasons, the details are found in Appendix A.3. Note that this does not mean that we consider the $N$ -agent problem with $N = M$ , but instead we approximate the limiting problem with the limiting graphon $W$ , and the solution will be near-optimal for all sufficiently large finite systems at once.
+
+- Direct reinforcement learning. We directly apply RL as $\hat{\Phi}$ . The central idea is to consider the GMFG as a classical MFG with extended state space $\mathcal{X} \times \mathcal{I}$ , i.e. for fixed mean fields, we solve the MDP defined by (14). Agents condition their policy not only on their own state, but also their node index $\alpha \in \mathcal{I}$ and the current time $t \in \mathcal{T}$ , since the mean fields are non-stationary in general and require time-dependent policies for optimality. Here, we assume that we can sample from a simulator of (9) for a given fixed mean field as commonly assumed in MFG learning literature (Guo et al., 2019; Subramanian & Mahajan, 2019). For application to arbitrary finite systems, one could apply a model-based RL approach coupled with graphon estimation, though this remains outside the scope of this work. For solving the mean field evolution equation (12), we can again use any applicable numerical method and choose a conventional sequential Monte Carlo method for $\hat{\Psi}$ . While it is possible to exactly solve optimal control problems for each agent equivalence class with finite state-action spaces, this is generally not the case for e.g. continuous state-action spaces. Here, a general reinforcement learning solution can solve otherwise intractable problems in an elegant manner, since the graphon index $\alpha$ simply becomes part of a continuous state space.
+
+For convergence, we begin by stating the classical feedback regularity condition (Huang et al., 2006; Guo et al., 2019) after equipping $\Pi$ , $\mathcal{M}$ e.g. with the supremum metric.
+
+Proposition 2. Assume that the maps $\tilde{\Psi},\tilde{\Phi}$ are Lipschitz with constants $c_{1},c_{2}$ and $c_{1}\cdot c_{2} < 1$ . Then the fixed point iteration $\pmb{\mu}^{n + 1} = \hat{\Psi} (\tilde{\Phi} (\pmb{\mu}^n))$ converges.
+
+Feedback regularity is not assured, and thus there is no general convergence guarantee. Whilst one could attempt to apply fictitious play (Mguni et al., 2018), additional assumptions will be needed for convergence. Instead, whenever necessary for convergence, we regularize by introducing Boltzmann policies $\pi_t^\alpha(u|x) \propto \exp\left(\frac{1}{\eta} Q_\alpha^\mu(t,x,u)\right)$ with temperature $\eta$ , provably converging to an approximation for sufficiently high temperatures (Cui & Koepl, 2021).
+
+Theorem 4. Under Assumptions 1 and 2, the equivalence classes algorithm with Boltzmann policies $\hat{\Phi}(\pmb{\mu})_t^\alpha(u|x) \propto \exp\left(\frac{1}{\eta} Q_\alpha^\mu(t,x,u)\right)$ converges for sufficiently high temperatures $\eta > 0$ .
+
+
+Figure 3: Achieved equilibrium via $M = 100$ approximate equivalence classes in SIS-Graphon, plotted for each agent $\alpha \in \mathcal{I}$ . Top: Probability of taking precautions when healthy. Bottom: Probability of being infected. It can be observed that agents with less connections (higher $\alpha$ ) will take less precautions. (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): ER graphon.
+
+
+
+
+
+Importantly, even an exact solution of the GMFG only constitutes an approximate Nash equilibrium in the finite-graph system. Furthermore, even the existence of exact finite-system Nash equilibria in local feedback policies is not guaranteed, see the discussion in Saldi et al. (2018) and references therein. Therefore, little is lost by introducing slight additional approximations for the sake of a tractable solution, if at all needed (e.g. the Investment-Graphon problem in the following converges without introducing Boltzmann policies), since near optimality holds for small temperatures (Cui & Koepl, 2021). Indeed, we find that we can show optimality of the equivalence classes approach for sufficiently fine partitions of $\mathcal{I}$ , giving us a theoretical foundation for our proposed algorithms.
+
+Theorem 5. Under Assumptions 1 and 2, for a solution $(\pi, \mu) \in \Pi \times \mathcal{M}$ , $\pi \in \tilde{\Phi}(\mu)$ , $\mu = \tilde{\Psi}(\pi)$ of the $M$ equivalence classes method and for any $\varepsilon, p > 0$ there exists $N'$ , $M \in \mathbb{N}$ such that for all $N > N'$ , the policy $(\pi^1, \ldots, \pi^N) = \Gamma_N(\pi) \in \Pi^N$ is an $(\varepsilon, p)$ -Markov Nash equilibrium.
+
+A theoretically rigorous analysis of the elegant direct reinforcement learning approach is beyond our scope and deferred to future works, though we empirically find that both methods agree.
+
+# 5 EXPERIMENTS
+
+In this section, we will give an empirical verification of our theoretical results. As we are unaware of any prior discrete-time GMFGs (except for the example in Vasal et al. (2021), which is similar to the first problem in the following), we propose two problems adapted from existing non-graph-based works on the three graphons in Figure 2. For space reasons, we defer detailed descriptions of problems and algorithms, plots as well as further analysis, including exploitability and a verification of stability of our solution with respect to the number of equivalence classes – to Appendix A.3.
+
+The SIS-Graphon problem was considered in Cui & Koeppl (2021) as a classical discrete-time MFG. We impose an epidemics scenario where people (agents) are infected with probability proportional to the number of infected neighbors and recover with fixed probability. People may choose to take precautions (e.g. social distancing), avoiding potential costly infection periods at a fixed cost.
+
+In the Investment-Graphon problem – an adaptation of a problem studied by Chen et al. (2021), where it was in turn adapted from Weintraub et al. (2010) – we consider many firms maximizing profits, where profits are proportional to product quality and decrease with total neighborhood product quality, i.e. the graph models overlap in e.g. product audience or functionality. Firms can invest to improve quality, though it becomes more unlikely to improve quality as their quality rises.
+
+Learned equilibrium behavior. For the SIS-Graphon problem, we apply softmax policies for each approximate equivalence class to achieve convergence, see Appendix A.3 for details on temperature choice and influence. In Figure 3, the learned behavior can be observed for various $\alpha$ . As expected, in the ER graphon case, behavior is identical over all $\alpha$ . Otherwise, we find that agents take more precautions with many connections (low $\alpha$ ) than with few connections (high $\alpha$ ). For the uniform attachment graphon, we observe no precautions in case of negligible connectivity ( $\alpha \to 1$ ), while for the ranked attachment graphon there is no such $\alpha \in \mathcal{I}$ (cf. Figure 2). Further, the fraction of infected agents at stationarity rises as $\alpha$ falls. A similar analysis holds for Investment-Graphon without need for regularization, see Appendix A.3.
+
+
+
+
+
+
+
+
+Figure 4: Decreasing maximum deviation between average $N$ -agent objective and mean field objective over all agents for the GMFE policy and 5 W-random graph sequences. (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): ER graphon.
+
+
+
+
+
+Note that the specific method of solution is not of central importance here, as in general any RL and filtering method can be substituted to handle 1. otherwise intractable or 2. inherently sample-based settings. Indeed, we achieve similar results using PPO (Schulman et al., 2017) in Investment-Graphon, enabling a general RL-based methodology for GMFGs. In Appendix A.3, we find that PPO achieves qualitatively and quantitatively similar behavior to the equivalence classes method, with slight deviations due to the approximations from PPO and Monte Carlo. In particular, the PPO exploitability $\varepsilon \approx 2$ remains low compared to $\varepsilon > 30$ for the uniform random policy, see Appendix A.3. In Appendix A.3, we also show how, due to the non-stationarity of the environment, a naive application of MARL (Yu et al., 2021) fails to converge, while existing mean field MARL techniques (Yang et al., 2018b) remain incomparable as agents must observe the average actions of all neighbors. On SIS-Graphon, we require softmax policies to achieve convergence, which is not possible with PPO as no $Q$ -function is learned. In general, one could use entropy regularized policies, e.g. SAC (Haarnoja et al., 2018), or alternatively use any value-based reinforcement learning method, though an investigation of the best approach is outside of our scope.
+
+Quantitative verification of the mean field approximation. To verify the rigorously established accuracy of our mean field system empirically, we will generate $W$ -random graphs. Note that there are considerable difficulties associated with an empirical verification of (19), since 1. for any $N$ one must check the Nash property for (almost) all $N$ agents, 2. finding optimal $\hat{\pi}$ is intractable, as no dynamic programming principle holds on the non-Markovian local agent state, while acting on the full state fails by the curse of dimensionality, and 3. the inaccuracy from estimating all $J_{i}^{N}$ , $i = 1,\dots ,N$ at once increases with $N$ due to variance, i.e. cost scales fast with $N$ for fixed variance. Instead, we verify (26) in Appendix A.1 using the GMFE policy on systems of up to $N = 100$ agents, i.e. $\hat{\pi} = \pi^{\alpha_i}$ for the closest $\alpha_{i}$ and comparing for all agents at once $(p = 0)$ . Shown in Figure 4, for $W$ -random graph sequences, at each $N$ we performed 10000 runs to estimate $\max_i|J_i^N -J_{\alpha_i}|$ . We find that the maximum deviation between achieved returns and mean field return decreases as $N\to \infty$ , verifying that we obtain an increasingly good approximation of the finite $N$ -agent graph system. The oscillations in Figure 4 stem from the randomly sampled graphs.
+
+# 6 CONCLUSION
+
+In this work, we have formulated a new framework for dense graph-based dynamical games with the weak interaction property. On the theoretical side, we have given one of the first general discrete-time GMFG formulations with existence conditions and approximate Nash property of the finite graph system, thus extending classical MFGs and allowing for a tractable, theoretically well-founded solution of competitive large-scale graph-based games on large dense graphs. On the practical side, we have proposed a number of computational methods to tractably compute GMFE and experimentally verified the plausibility of our methodology on a number of examples. Venues for further extensions are manifold and include extensions of theory to e.g. continuous spaces, partial observability or common noise. So far, graphons assume dense graphs and cannot properly describe sparse graphs ( $W = 0$ ), which remain an active frontier of research. Finally, real-world application scenarios may be of interest, where estimation of agent graphon indices becomes important for model-based MARL. We hope that our work inspires further applications and research into scalable MARL using graphical dynamical systems based on graph limit theory and mean field theory.
+
+# ACKNOWLEDGMENTS
+
+This work has been funded by the LOEWE initiative (Hesse, Germany) within the emergenCITY center. The authors also acknowledge support by the German Research Foundation (DFG) via the Collaborative Research Center (CRC) 1053 - MAKI.
+
+# ETHICS STATEMENT
+
+Existing mean field methodologies, including ours, currently require manual modeling and have not been applied in a model-based reinforcement learning setting for given finite agent systems. As a result, we do not foresee any immediate ethical issues stemming from this work.
+
+# REPRODUCIBILITY STATEMENT
+
+For reproducibility, in the supplement we provide all code required to reproduce all results in this work. This includes but is not limited to our models and problems, algorithms as well as all plotting scripts for all of the figures found in this work.
+
+# REFERENCES
+
+Alexander Aurell, Rene Carmona, Gokce Dayanikli, and Mathieu Lauriere. Finite state graphon games with applications to epidemics. arXiv preprint arXiv:2106.07859, 2021a.
+Alexander Aurell, Rene Carmona, and Mathieu Lauriere. Stochastic graphon games: II. the linear-quadratic case. arXiv preprint arXiv:2105.12320, 2021b.
+Fabio Bagagiolo and Dario Bauso. Mean-field games and dynamic demand management in power grids. Dynamic Games and Applications, 4(2):155-176, 2014.
+Reginald A Banez, Lixin Li, Chungang Yang, Lingyang Song, and Zhu Han. A mean-field-type game approach to computation offloading in mobile edge computing networks. In ICC 2019-2019 IEEE International Conference on Communications (ICC), pp. 1-6. IEEE, 2019.
+Erhan Bayraktar, Suman Chakraborty, and Ruoyu Wu. Graphon mean field systems. arXiv preprint arXiv:2003.13180, 2020.
+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.
+Alain Bensoussan, Jens Frehse, and Phillip Yam. Mean field games and mean field type control theory, volume 101. Springer, 2013.
+Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław Debiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, et al. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019.
+Gianmarco Bet, Fabio Coppini, and Francesca R Nardi. Weakly interacting oscillators on dense random graphs. arXiv preprint arXiv:2006.07670, 2020.
+Christian Borgs, Jennifer Chayes, László Lovász, Vera Sós, and Katalin Vesztergombi. Limits of randomly grown graph sequences. European Journal of Combinatorics, 32(7):985-999, 2011.
+Peter E Caines and Minyi Huang. Graphon mean field games and the gmfg equations: $\varepsilon$ -nash equilibria. In 2019 IEEE 58th Conference on Decision and Control (CDC), pp. 286-292. IEEE, 2019.
+Pierre Cardaliaguet and Saeed Hadikhanloo. Learning in mean field games: the fictitious play. ESAIM: Control, Optimisation and Calculus of Variations, 23(2):569-591, 2017.
+Guilherme Carmona. Nash equilibria of games with a continuum of players, 2004.
+
+René Carmona, Daniel Cooney, Christy Graves, and Mathieu Lauriere. Stochastic graphon games: I. the static case. arXiv preprint arXiv:1911.10664, 2019a.
+René Carmona, Mathieu Laurière, and Zongjun Tan. Model-free mean-field reinforcement learning: mean-field mdp and mean-field q-learning. arXiv preprint arXiv:1910.12802, 2019b.
+Yang Chen, Jiamou Liu, and Bakhadyr Khoussainov. Agent-level maximum entropy inverse reinforcement learning for mean field games. arXiv preprint arXiv:2104.14654, 2021.
+Kai Cui and Heinz Koeppl. Approximately solving mean field games via entropy-regularized deep reinforcement learning. In International Conference on Artificial Intelligence and Statistics, pp. 1909-1917. PMLR, 2021.
+Kai Cui, Anam Tahir, Mark Sinzger, and Heinz Koeppl. Discrete-time mean field control with environment states. arXiv preprint arXiv:2104.14900, 2021.
+Constantinos Daskalakis, Paul W Goldberg, and Christos H Papadimitriou. The complexity of computing a nash equilibrium. SIAM Journal on Computing, 39(1):195-259, 2009.
+Boualem Djehiche, Alain Tcheukam, and Hamidou Tembine. Mean-field-type games in engineering [j]. AIMS Electronics and Electrical Engineering, 1(1):18-73, 2017.
+Romuald Elie, Julien Perolat, Mathieu Laurière, Matthieu Geist, and Olivier Pietquin. On the convergence of model free learning in mean field games. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 7143-7150, 2020.
+Shuang Gao and Peter E Caines. The control of arbitrary size networks of linear systems via graphon limits: An initial investigation. In 2017 IEEE 56th Annual Conference on Decision and Control (CDC), pp. 1052-1057. IEEE, 2017.
+Shuang Gao and Peter E Caines. Graphon control of large-scale networks of linear systems. IEEE Transactions on Automatic Control, 65(10):4090-4105, 2019a.
+Shuang Gao and Peter E Caines. Spectral representations of graphons in very large network systems control. In 2019 IEEE 58th Conference on Decision and Control (CDC), pp. 5068-5075. IEEE, 2019b.
+Marios-Antonios Gkogkas and Christian Kuehn. Graphop mean-field limits for kuramoto-type models. arXiv preprint arXiv:2007.02868, 2020.
+Haotian Gu, Xin Guo, Xiaoli Wei, and Renyuan Xu. Mean-field controls with q-learning for cooperative marl: Convergence and complexity analysis. arXiv preprint arXiv:2002.04131, 2020.
+Haotian Gu, Xin Guo, Xiaoli Wei, and Renyuan Xu. Mean-field multi-agent reinforcement learning: A decentralized network approach. arXiv preprint arXiv:2108.02731, 2021.
+Olivier Guéant, Jean-Michel Lasry, and Pierre-Louis Lions. Mean field games and applications. In Paris-Princeton lectures on mathematical finance 2010, pp. 205-266. Springer, 2011.
+Xin Guo, Anran Hu, Renyuan Xu, and Junzi Zhang. Learning mean-field games. In Advances in Neural Information Processing Systems, pp. 4966-4976, 2019.
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning, pp. 1861-1870. PMLR, 2018.
+Minyi Huang, Roland P Malhamé, and Peter E Caines. Large population stochastic dynamic games: closed-loop mckean-vlasov systems and the nash certainty equivalence principle. Communications in Information & Systems, 6(3):221-252, 2006.
+B Ravi Kiran, Ibrahim Sobh, Victor Talpaert, Patrick Mannon, Ahmad A Al Sallab, Senthil Yogamani, and Patrick Pérez. Deep reinforcement learning for autonomous driving: A survey. IEEE Transactions on Intelligent Transportation Systems, 2021.
+
+Arman C Kizilkale and Roland P Malhame. Collective target tracking mean field control for electric space heaters. In 22nd Mediterranean Conference on Control and Automation, pp. 829-834. IEEE, 2014.
+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.
+Daniel Lacker and Agathe Soret. A case study on stochastic games on large graphs in mean field and sparse regimes. arXiv preprint arXiv:2005.14102, 2020.
+Jean-Michel Lasry and Pierre-Louis Lions. Mean field games. Japanese journal of mathematics, 2 (1):229-260, 2007.
+Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph Gonzalez, Michael Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning, pp. 3053-3062. PMLR, 2018.
+László Lovász. Large networks and graph limits, volume 60. American Mathematical Soc., 2012.
+David Mguni, Joel Jennings, and Enrique Munoz de Cote. Decentralised learning in systems with many, many strategic agents. Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+Washim Uddin Mondal, Mridul Agarwal, Vaneet Aggarwal, and Satish V Ukkusuri. On the approximation of cooperative heterogeneous multi-agent reinforcement learning (marl) using mean field control (mfc). arXiv preprint arXiv:2109.04024, 2021.
+Médéric Motte and Huyen Pham. Mean-field markov decision processes with common noise and open-loop controls. arXiv preprint arXiv:1912.07883, 2019.
+Mojtaba Nourian and Peter E Caines. $\epsilon$ -nash mean field game theory for nonlinear stochastic dynamical systems with major and minor agents. SIAM Journal on Control and Optimization, 51 (4):3302-3331, 2013.
+Francesca Parise and Asuman Ozdaglar. Graphon games. In Proceedings of the 2019 ACM Conference on Economics and Computation, pp. 457-458, 2019.
+Barna Pasztor, Ilija Bogunovic, and Andreas Krause. Efficient model-based multi-agent mean-field reinforcement learning. arXiv preprint arXiv:2107.04050, 2021.
+Julien Perolat, Sarah Perrin, Romuald Elie, Mathieu Laurière, Georgios Piliouras, Matthieu Geist, Karl Tuys, and Olivier Pietquin. Scaling up mean field games with online mirror descent. arXiv preprint arXiv:2103.00623, 2021.
+Sarah Perrin, Mathieu Laurière, Julien Pérolat, Romuald Élie, Matthieu Geist, and Olivier Pietquin. Generalization in mean field games by learning master policies. arXiv preprint arXiv:2109.09717, 2021a.
+Sarah Perrin, Mathieu Laurière, Julien Pérolat, Matthieu Geist, Romuald Élie, and Olivier Pietquin. Mean field games flock! the reinforcement learning way. arXiv preprint arXiv:2105.07933, 2021b.
+Huy Xuan Pham, Hung Manh La, David Feil-Seifer, and Aria Nefian. Cooperative and distributed reinforcement learning of drones for field coverage. arXiv preprint arXiv:1803.07250, 2018.
+Huyen Pham and Xiaoli Wei. Bellman equation and viscosity solutions for mean-field stochastic control problem. ESAIM: Control, Optimisation and Calculus of Variations, 24(1):437-461, 2018.
+Martin L Puterman. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
+Naci Saldi, Tamer Basar, and Maxim Raginsky. Markov-nash equilibria in mean-field games with discounted cost. SIAM Journal on Control and Optimization, 56(6):4256-4287, 2018.
+
+Naci Saldi, Tamer Başar, and Maxim Raginsky. Approximate nash equilibria in partially observed stochastic games with mean-field interactions. Mathematics of Operations Research, 44(3):1006-1033, 2019.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+Jayakumar Subramanian and Aditya Mahajan. Reinforcement learning in stationary mean-field games. In Proceedings of the 18th International Conference on Autonomous Agents and Multi-Agent Systems, pp. 251-259, 2019.
+Jan Tožicka, Benedek Szulyovszky, Guillaume de Chambrier, Varun Sarwal, Umar Wani, and Mantas Gribulis. Application of deep reinforcement learning to uav fleet control. In Proceedings of SAI Intelligent Systems Conference, pp. 1169-1177. Springer, 2018.
+Deepanshu Vasal, Rajesh Mishra, and Sriram Vishwanath. Sequential decomposition of graphon mean field games. In 2021 American Control Conference (ACC), pp. 730-736. IEEE, 2021.
+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.
+Renato Vizuete, Paolo Frasca, and Federica Garin. Graphon-based sensitivity analysis of sis epidemics. IEEE Control Systems Letters, 4(3):542-547, 2020.
+Gabriel Y Weintraub, C Lanier Benkard, and Benjamin Van Roy. Computational methods for oblivious equilibrium. Operations research, 58(4-part-2):1247-1265, 2010.
+Jiaming Xu. Rates of convergence of spectral methods for graphon estimation. In International Conference on Machine Learning, pp. 5433-5442. PMLR, 2018.
+Jiachen Yang, Xiaojing Ye, Rakshit Trivedi, Huan Xu, and Hongyuan Zha. Learning deep mean field games for modeling large population behavior. In International Conference on Learning Representations, 2018a.
+Yaodong Yang, Rui Luo, Minne Li, Ming Zhou, Weinan Zhang, and Jun Wang. Mean field multiagent reinforcement learning. In International Conference on Machine Learning, pp. 5571-5580. PMLR, 2018b.
+James J Yeh. Real Analysis: Theory Of Measure And Integration. World Scientific Publishing Company, 2014.
+Chao Yu, Akash Velu, Eugene Vinitsky, Yu Wang, Alexandre Bayen, and Yi Wu. The surprising effectiveness of mappo in cooperative, multi-agent games. arXiv preprint arXiv:2103.01955, 2021.
+Kaiqing Zhang, Zhuoran Yang, and Tamer Başar. Multi-agent reinforcement learning: A selective overview of theories and algorithms. Handbook of Reinforcement Learning and Control, pp. 321-384, 2021.
+
+# A APPENDIX
+
+# A.1 THEORETICAL DETAILS
+
+In this section, we will give all intermediate results required to prove the results in the main text, as well as additional results, e.g. for the uncontrolled case. For convenience, we first state all obtained theoretical result. Proofs for each of the theorems and corollaries can be found in their own sections further below.
+
+Note that except for Theorem 1, as mentioned in the main text we can also slightly weaken Assumption 2 to block-wise Lipschitz continuous $W$ , i.e. there exist $L_{W} > 0$ and disjoint intervals $\{\mathcal{I}_1,\ldots ,\mathcal{I}_Q\} ,\cup_i\mathcal{I}_i = \mathcal{I}$ s.t. $\forall i,j\in \{1,\dots ,Q\}$
+
+$$
+\left| W (x, y) - W (\tilde {x}, \tilde {y}) \right| \leq L _ {W} \left(\left| x - \tilde {x} \right| + \left| y - \tilde {y} \right|\right), \quad \forall (x, y), (\tilde {x}, \tilde {y}) \in \mathcal {I} _ {i} \times \mathcal {I} _ {j} \tag {20}
+$$
+
+which is fulfilled e.g. for block-wise Lipschitz-continuous or block-wise constant graphons.
+
+For $\alpha \in \mathcal{I}$ , define the $\alpha$ -neighborhood maps $\mathbb{G}^{\alpha} \colon \mathcal{M}_t \to \mathcal{P}(\mathcal{X})$ and empirical $\alpha$ -neighborhood maps $\mathbb{G}_N^\alpha \colon \mathcal{M}_t \to \mathcal{P}(\mathcal{X})$ as
+
+$$
+\mathbb {G} ^ {\alpha} \left(\boldsymbol {\mu} _ {t}\right) := \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta , \quad \mathbb {G} _ {N} ^ {\alpha} \left(\boldsymbol {\mu} _ {t}\right) := \int_ {\mathcal {I}} W _ {N} (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta \tag {21}
+$$
+
+and note how we naturally have $\mathbb{G}_t^\alpha = \mathbb{G}^\alpha (\pmb {\mu}_t)$ in the mean field system and $\mathbb{G}_t^i = \mathbb{G}_N^{\frac{i}{N}}(\pmb {\mu}_t^N)$ in the finite system. Finally, for $\pmb {\nu},\pmb{\nu}^{\prime}\in \mathcal{M}_{t}$ , $\pmb {\pi}\in \pmb{\Pi}$ and graphon $W$ , define the ensemble transition kernel operator $P_{t,\nu ,W}^{\pi}\colon \mathcal{M}_t\to \mathcal{M}_t$ via
+
+$$
+\left(\nu P _ {t, \nu^ {\prime}, W} ^ {\pi}\right) ^ {\alpha} \equiv \sum_ {x \in \mathcal {X}} \nu^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) P \left(\cdot \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \nu^ {\prime \beta} d \beta\right) \tag {22}
+$$
+
+and note how we have $\pmb{\mu}_{t + 1} = \pmb{\mu}_tP_{t,\pmb{\mu}_{t,W}}^\pi$ in the mean field system.
+
+After showing Theorem 2, we continue by showing convergence of the law of deviating agent state $X_{t}^{i}$ to the law of the corresponding auxiliary mean field systems given by
+
+$$
+\hat {X} _ {0} ^ {\frac {i}{N}} \sim \mu_ {0}, \quad \hat {U} _ {t} ^ {\frac {i}{N}} \sim \hat {\pi} _ {t} (\cdot | \hat {X} _ {t} ^ {\frac {i}{N}}), \quad \hat {X} _ {t + 1} ^ {\frac {i}{N}} \sim P (\cdot | \hat {X} _ {t} ^ {\frac {i}{N}}, \hat {U} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {t} ^ {\frac {i}{N}}), \quad \forall t \in \mathcal {T} \tag {23}
+$$
+
+for almost all agents $i$ as $N\to \infty$
+
+Lemma A.1. Consider Lipschitz continuous $\pi \in \Pi$ up to a finite number of discontinuities $D_{\pi}$ with associated mean field ensemble $\pmb{\mu} = \Psi(\pmb{\pi})$ . Under Assumptions 1 and 2 and the $N$ -agent policy $(\pi^1, \dots, \pi^{i-1}, \hat{\pi}, \pi^{i+1}, \dots, \pi^N) \in \Pi^N$ where $(\pi^1, \pi^2, \dots, \pi^N) = \Gamma_N(\pi) \in \Pi^N$ , $\hat{\pi} \in \Pi$ arbitrary, for any uniformly bounded family of functions $\mathcal{G}$ from $\mathcal{X}$ to $\mathbb{R}$ and any $\varepsilon, p > 0$ , $t \in \mathcal{T}$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\sup _ {g \in \mathcal {G}} \left| \mathbb {E} \left[ g \left(X _ {t} ^ {i}\right) \right] - \mathbb {E} \left[ g \left(\hat {X} _ {t} ^ {\frac {i}{N}}\right) \right] \right| < \varepsilon \tag {24}
+$$
+
+uniformly over $\hat{\pi} \in \Pi, i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \left\lfloor (1 - p)N\right\rfloor$ .
+
+Similarly, for any uniformly Lipschitz, uniformly bounded family of measurable functions $\mathcal{H}$ from $\mathcal{X} \times \mathcal{B}_1(\mathcal{X})$ to $\mathbb{R}$ and any $\varepsilon, p > 0$ , $t \in \mathcal{T}$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\sup _ {h \in \mathcal {H}} \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) \right] - \mathbb {E} \left[ h \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {\sigma} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| < \varepsilon \tag {25}
+$$
+
+uniformly over $\hat{\pi} \in \Pi, i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \left\lfloor (1 - p)N\right\rfloor$ .
+
+As a direct implication of the above results, the objective functions of almost all agents converge uniformly to the mean field objectives.
+
+Corollary A.1. Consider Lipschitz continuous $\pi \in \Pi$ up to a finite number of discontinuities $D_{\pi}$ with associated mean field ensemble $\pmb{\mu} = \Psi(\pmb{\pi})$ . Under Assumptions 1 and 2 and the $N$ -agent policy $(\pi^1, \dots, \pi^{i-1}, \hat{\pi}, \pi^{i+1}, \dots, \pi^N) \in \Pi^N$ where $(\pi^1, \pi^2, \dots, \pi^N) = \Gamma_N(\pi) \in \Pi^N$ , $\hat{\pi} \in \Pi$ arbitrary, for any $\varepsilon, p > 0$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\left| J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \hat {\pi}, \pi^ {i + 1}, \dots , \pi^ {N}\right) - J _ {\frac {i}{N}} ^ {\mu} (\hat {\pi}) \right| < \varepsilon \tag {26}
+$$
+
+uniformly over $\hat{\pi} \in \Pi, i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \left\lfloor (1 - p)N \right\rfloor$ .
+
+The approximate Nash property (Theorem 3) of a GMFE $(\pi, \mu)$ then follows immediately from the definition of a GMFE, since $\pi$ is by definition optimal under $\mu$ .
+
+As a corollary, we also obtain results for the uncontrolled case without actions, which is equivalent to the case where $|\mathcal{U}| = 1$ , i.e. there being only one trivial policy that is always optimal.
+
+Corollary A.2. Under Assumption 1 and $|\mathcal{U}| = 1$ , we have for all measurable functions $f: \mathcal{X} \times \mathcal{T} \to \mathbb{R}$ uniformly bounded by $|f| \leq M_f$ and all $t \in \mathcal{T}$ that
+
+$$
+\mathbb {E} \left[\left| \boldsymbol {\mu} _ {t} ^ {N} (f) - \boldsymbol {\mu} _ {t} (f) \right|\right]\rightarrow 0. \tag {27}
+$$
+
+Furthermore, if the convergence in Assumption 1 is at rate $\mathcal{O}(1 / \sqrt{N})$ , the rate of convergence is also at $\mathcal{O}(1 / \sqrt{N})$ .
+
+If further Assumption 2 holds, then for any uniformly bounded family of functions $\mathcal{G}$ from $\mathcal{X}$ to $\mathbb{R}$ and any $\varepsilon, p > 0, t \in \mathcal{T}$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\sup _ {g \in \mathcal {G}} \left| \mathbb {E} \left[ g \left(X _ {t} ^ {i}\right) \right] - \mathbb {E} \left[ g \left(\hat {X} _ {t} ^ {\frac {i}{N}}\right) \right] \right| < \varepsilon \tag {28}
+$$
+
+uniformly over $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \lfloor (1 - p)N \rfloor$ , and similarly for any uniformly Lipschitz, uniformly bounded family of measurable functions $\mathcal{H}$ from $\mathcal{X} \times \mathcal{B}_1(\mathcal{X})$ to $\mathbb{R}$ and any $\varepsilon, p > 0$ , $t \in \mathcal{T}$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\sup _ {h \in \mathcal {H}} \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) \right] - \mathbb {E} \left[ h \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| < \varepsilon \tag {29}
+$$
+
+uniformly over $i\in \mathcal{W}_N$ for some $\mathcal{W}_N\subseteq \mathcal{V}_N$ with $|\mathcal{W}_N|\geq \lfloor (1 - p)N\rfloor$
+
+# A.2 PROOFS
+
+In this section, we will give full proofs to the statements made in the main text and in Appendix A.1.
+
+# A.2.1 PROOF OF THEOREM 1
+
+Proof. First, we will verify Saldi et al. (2018), Assumption 1 for the MFG with dynamics given by (14). For this purpose, as in Saldi et al. (2018) let us metrize the product space with the sup-metric, and equip the space $\mathcal{P}(\mathcal{X}\times \mathcal{I})$ with the weak topology. Note that the results hold for both the finite and infinite horizon setting, see Saldi et al. (2018), Remark 6.
+
+(a) The reward function $\tilde{r}((x, \alpha), u, \tilde{\mu}) \coloneqq r(x, u, \int_{\mathcal{I}} W(\alpha_t, \beta) \tilde{\mu}_t(\cdot, \beta) \mathrm{d}\beta)$ is continuous, since for $((x_n, \alpha_n), u_n, \tilde{\mu}_n) \to ((x, \alpha), u, \tilde{\mu})$ we have
+
+$$
+\int_ {\mathcal {I}} W (\alpha_ {n}, \beta) \tilde {\mu} _ {n} (\cdot , \beta) \mathrm {d} \beta \rightarrow \int_ {\mathcal {I}} W (\alpha , \beta) \tilde {\mu} (\cdot , \beta) \mathrm {d} \beta
+$$
+
+by Lipschitz continuity of $W$ and weak convergence of $\tilde{\mu}_n$ , and therefore
+
+$$
+r \left(x _ {n}, u _ {n}, \int_ {\mathcal {I}} W \left(\alpha_ {n}, \beta\right) \tilde {\mu} _ {n} (\cdot , \beta) \mathrm {d} \beta\right)\rightarrow r (x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \tilde {\mu} (\cdot , \beta) \mathrm {d} \beta)
+$$
+
+by Assumption 2.
+
+(b) The action space is compact and the state space is locally compact.
+(c) Consider the moment function $w(x, \alpha) \equiv 2$ . In this case, we can choose $\zeta = 1$ (we use $\zeta$ instead of $\alpha$ in Saldi et al. (2018)).
+(d) The stochastic kernel $\tilde{P}$ that fulfills (14) such that $(\tilde{X}_{t + 1},\alpha_{t + 1})\sim \tilde{P} (\cdot \mid (\tilde{X}_t,\alpha_t),\tilde{U}_t,\tilde{\mu}_t)$ is weakly continuous, since for $((x_n,\alpha_n),u_n,\tilde{\mu}_n)\to ((x,\alpha),u,\tilde{\mu})$ we again have
+
+$$
+\int_ {\mathcal {I}} W (\alpha_ {n}, \beta) \tilde {\mu} _ {n} (\cdot , \beta) d \beta \rightarrow \int_ {\mathcal {I}} W (\alpha , \beta) \tilde {\mu} (\cdot , \beta) d \beta
+$$
+
+and therefore for any continuous bounded $f\colon \mathcal{X}\times \mathcal{I}\to \mathbb{R}$
+
+$$
+\begin{array}{l} \int_ {\mathcal {X} \times \mathcal {I}} f \mathrm {d} \tilde {P} (\cdot | (x _ {n}, \alpha_ {n}), u _ {n}, \tilde {\mu} _ {n}) = \int_ {\mathcal {I}} \int_ {\mathcal {X}} f \mathrm {d} P ^ {\alpha} (\cdot | (x _ {n}, \alpha), u _ {n}, \tilde {\mu} _ {n}) \delta_ {\alpha_ {n}} (\mathrm {d} \alpha) \\ = \int_ {\mathcal {X}} f d P (\cdot | x _ {n}, u _ {n}, \int_ {\mathcal {I}} W (\alpha_ {n}, \beta) \tilde {\mu} _ {n} (\cdot , \beta) d \beta) \\ \rightarrow \int_ {\mathcal {X}} f d P (\cdot | x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \tilde {\mu} (\cdot , \beta) d \beta) \\ = \int_ {\mathcal {X} \times \mathcal {I}} f d \tilde {P} (\cdot | (x, \alpha), u, \tilde {\mu}) \\ \end{array}
+$$
+
+by disintegration of $\tilde{P}$ and (14).
+
+(e) By boundedness of $r$ , we trivially have $v(x)\equiv 1\leq \infty$
+(f) By boundedness of $r$ , we can trivially choose $\beta = 1$ (we flip the usage of $\beta$ and $\gamma$ ).
+(g) As a result of the above choices, $\zeta \gamma \beta = \gamma < 1$ trivially.
+
+By Saldi et al. (2018), Theorem 3.3 we have the existence of a mean field equilibrium $(\tilde{\pi},\tilde{\mu})$ with some Markovian feedback policy $\tilde{\pi}$ acting on the state $(\tilde{X}_t,\alpha_t)$ . By defining the mean field and policy ensembles $\pmb{\pi}$ , $\pmb{\mu}$ via $\pi_t^\alpha (u\mid x) = \tilde{\pi}_t(u\mid x,\alpha)$ , $\mu_t^\alpha = \tilde{\mu}_t(\cdot ,\alpha)$ , we obtain existence of the $\alpha$ -a.e. optimal policy ensemble $\pmb{\pi}$ , since at any time $t\in \mathcal{T}$ , the joint state-action distribution $\tilde{\mu}_t\otimes \tilde{\pi}_t$ puts mass 1 on optimal state-action pairs (see Saldi et al. (2018), Theorem 3.6), implying that for a.e. $\alpha$ the policy must be optimal, as otherwise there exists a non-null set $\tilde{\mathcal{I}}_0\subseteq \mathcal{I}$ such that for all $\alpha \in \tilde{\mathcal{I}}_0$ , there is some suboptimality $\varepsilon >0$ , which directly contradicts the prequel.
+
+For the remaining suboptimal $\alpha \in \mathcal{I}_0$ in the null set $\mathcal{I}_0 \subseteq \mathcal{I}$ , we redefine $\pi$ optimally for those $\alpha$ (always possible in our case, see e.g. Puterman (2014)). This policy ensemble generates $\mu = \Psi(\pi)$ $\alpha$ -a.e. uniquely, and we need only consider its $\alpha$ -a.e. unique equivalence class for optimality, implying $\pi \in \Phi(\mu)$ . Furthermore, $\mu$ is always measurable by definition, whereas $\pi$ is measurable because $\tilde{\pi}_t$ is by definition a Markov kernel, and thus $\tilde{\pi}_t(u | \cdot, \cdot) = \tilde{\pi}_t(\{u\} | \cdot, \cdot)$ for Borel set $\{u\}$ is a measurable function, which implies measurability of $\tilde{\pi}_t(u | x, \cdot)$ (see e.g. Yeh (2014), Appendix E). Therefore, we have proven existence of the GMFE $(\pi, \mu)$ .
+
+# A.2.2 PROOF OF THEOREM 2
+
+Proof. The proof is by induction as follows.
+
+Initial case. For $t = 0$ , we trivially have for all measurable functions $f\colon \mathcal{X}\times \mathcal{I}\to \mathbb{R}$ uniformly bounded by $|f|\leq M_f$ a law of large numbers result
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {0} ^ {N} (f) - \boldsymbol {\mu} _ {0} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {0} ^ {N, \alpha} (x) f (x, \alpha) - \sum_ {x \in \mathcal {X}} \mu_ {0} ^ {\alpha} (x) f (x, \alpha) d \alpha \right| \right] \\ = \mathbb {E} \left[ \left| \frac {1}{N} \sum_ {i \in \mathcal {V} _ {N}} \left(\int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f (X _ {0} ^ {i}, \alpha) \mathrm {d} \alpha - \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f (X _ {0} ^ {i}, \alpha) \mathrm {d} \alpha\right)\right) \right| \right] \\ \leq \left(\mathbb {E} \left[ \left(\frac {1}{N} \sum_ {i \in \mathcal {V} _ {N}} \left(\int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {0} ^ {i}, \alpha\right) \mathrm {d} \alpha - \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {0} ^ {i}, \alpha\right) \mathrm {d} \alpha \right]\right)\right) ^ {2} \right]\right) ^ {\frac {1}{2}} \\ = \left(\frac {1}{N ^ {2}} \sum_ {i \in \mathcal {V} _ {N}} \mathbb {E} \left[ \left(\int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {0} ^ {i}, \alpha\right) \mathrm {d} \alpha - \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {0} ^ {i}, \alpha\right) \mathrm {d} \alpha \right]\right) ^ {2} \right]\right) ^ {\frac {1}{2}} \leq \frac {2 M _ {f}}{\sqrt {N}} \\ \end{array}
+$$
+
+by definition of $\pmb{\mu}_t^N$ , independence of $\{X_0^i\}_{i\in \mathcal{V}_N}$ and $X_0^i\sim \mu_0 = \mu_0^\alpha$ for all $i\in \mathcal{V}_N,\alpha \in \mathcal{I}$ , where the second equality follows from Fubini's theorem.
+
+Induction step. Assume that the induction assumption holds at $t$ . Then by definition of $\pmb{\mu}_t^N$ , for all bounded function $f: \mathcal{X} \times \mathcal{I} \to \mathbb{R}$ with $|f| \leq M_f$ ,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t + 1} ^ {N} (f) - \boldsymbol {\mu} _ {t + 1} (f) \right| \right] \leq \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t + 1} ^ {N} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W _ {N}} ^ {\boldsymbol {\pi} ^ {N}} (f) \right| \right] \\ + \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W _ {N}} ^ {\boldsymbol {\pi} ^ {N}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi} ^ {N}} (f) \right| \right] \\ + \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi} ^ {N}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi}} (f) \right| \right] \\ + \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t}, W} ^ {\boldsymbol {\pi}} (f) \right| \right] \\ + \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t}, W} ^ {\pi} (f) - \boldsymbol {\mu} _ {t + 1} (f) \right| \right]. \\ \end{array}
+$$
+
+First term. We have by definition of $\pmb{\mu}_t^N$
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t + 1} ^ {N} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W _ {N}} ^ {\pi^ {N}} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t + 1} ^ {N, \alpha} (x) f (x, \alpha) d \alpha \right. \right. \\ \left. - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {N, \alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W _ {N} (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right] \\ = \mathbb {E} \left[ \left| \frac {1}{N} \sum_ {i \in \mathcal {V} _ {N}} \left(\int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {t + 1} ^ {i}, \alpha\right) \mathrm {d} \alpha - \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f \left(X _ {t + 1} ^ {i}, \alpha\right) \mathrm {d} \alpha \mid \mathbf {X} _ {t} \right]\right) \right| \right] \\ \leq \left( \right.\mathbb {E} \left[ \right.\left( \right.\frac {1}{N} \sum_ {i \in \mathcal {V} _ {N}} \left( \right.\int_ {\left( \right.\frac {i - 1}{N}, \frac {i}{N} \left. \right]} f \left(X _ {t + 1} ^ {i}, \alpha\right) \mathrm {d} \alpha - \mathbb {E} \left[ \right. \int_ {\left( \right.\frac {i - 1}{N}, \frac {i}{N} \left. \right]} f \left(X _ {t + 1} ^ {i}, \alpha\right) \mathrm {d} \alpha \mid \mathbf {X} _ {t} \left. \right]\left. \right)\left. \right)\left. \right) ^ {2} \left. \right]\left. \right) ^ {\frac {1}{2}} \\ = \left(\frac {1}{N ^ {2}} \sum_ {i \in \mathcal {V} _ {N}} \mathbb {E} \left[ \left(\int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f (X _ {t + 1} ^ {i}, \alpha) d \alpha - \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} f (X _ {t + 1} ^ {i}, \alpha) d \alpha \mid \mathbf {X} _ {t} \right]\right) ^ {2} \right]\right) ^ {\frac {1}{2}} \\ \leq \frac {2 M _ {f}}{\sqrt {N}} \\ \end{array}
+$$
+
+where the last equality follows from conditional independence of $\{X_{t + 1}^i\}_{i\in \nu_N}$ given $\mathbf{X}_t\equiv$ $\{X_t^i\}_{i\in \nu_N}$ and the law of total expectation.
+
+# Second term. We have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W _ {N}} ^ {\boldsymbol {\pi} ^ {N}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi} ^ {N}} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {N, \alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W _ {N} (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right. \right. \\ \left. - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {N, \alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right] \\ \leq | \mathcal {X} | M _ {f} L _ {P} \mathbb {E} \left[ \int_ {\mathcal {I}} \left\| \int_ {\mathcal {I}} W _ {N} (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta - \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta \right\| d \alpha \right] \\ \leq \left| \mathcal {X} \right| ^ {2} M _ {f} L _ {P} \sup _ {x \in \mathcal {X}} \mathbb {E} \left[ \int_ {\mathcal {I}} \left| \int_ {\mathcal {I}} W _ {N} (\alpha , \beta) \mu_ {t} ^ {N, \beta} (x) - W (\alpha , \beta) \mu_ {t} ^ {N, \beta} (x) \mathrm {d} \beta \right| \mathrm {d} \alpha \right]\rightarrow 0 \\ \end{array}
+$$
+
+by Assumption 1 and $\mu_t^{N,\beta}(x)$ trivially being bounded by 1. If the convergence in Assumption 1 is at rate $\mathcal{O}(1 / \sqrt{N})$ , then this convergence is also at rate $\mathcal{O}(1 / \sqrt{N})$ .
+
+Third term. We have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi} ^ {N}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi}} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {N, \alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right. \right. \\ \left. - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right] \\ \leq | \mathcal {X} | | \mathcal {U} | M _ {f} \mathbb {E} \left[ \int_ {\mathcal {I}} \left| \pi_ {t} ^ {N, \alpha} (u \mid x) - \pi_ {t} ^ {\alpha} (u \mid x) \right| d \alpha \right] \\ = | \mathcal {X} | | \mathcal {U} | M _ {f} \mathbb {E} \left[ \sum_ {j \in \mathcal {V} _ {N} \backslash \{i \}} \int_ {\left(\frac {j - 1}{N}, \frac {j}{N} \right]} \left| \pi_ {t} ^ {\frac {[ N \alpha ]}{N}} (u \mid x) - \pi_ {t} ^ {\alpha} (u \mid x) \right| d \alpha \right] \\ + | \mathcal {X} | | \mathcal {U} | M _ {f} \mathbb {E} \left[ \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} | \hat {\pi} _ {t} (u \mid x) - \pi_ {t} ^ {\alpha} (u \mid x) | d \alpha \right] \\ \leq | \mathcal {X} | | \mathcal {U} | M _ {f} \cdot \frac {L _ {\pi}}{N} + | \mathcal {X} | | \mathcal {U} | M _ {f} \cdot \frac {2 | D _ {\pi} |}{N} + | \mathcal {X} | | \mathcal {U} | M _ {f} \cdot \frac {2}{N} \\ \end{array}
+$$
+
+by assumption of Lipschitz continuous $\pi$ up to a finite number of discontinuities $D_{\pi}$ as well as the deviating agent $i$ 's error term, for which the integrands are bounded by 2.
+
+Fourth term. We have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t} ^ {N}, W} ^ {\boldsymbol {\pi}} (f) - \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t}, W} ^ {\boldsymbol {\pi}} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right. \right. \\ \left. - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right] \\ \leq M _ {f} | \mathcal {X} | \mathbb {E} \left[ \sup _ {x, u} \int_ {\mathcal {I}} \right| P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} \mathrm {d} \beta\right) \\ \left. - P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta\right) \Bigg | \mathrm {d} \alpha \right] \\ \leq M _ {f} | \mathcal {X} | L _ {P} \sum_ {x ^ {\prime} \in \mathcal {X}} \mathbb {E} \left[ \int_ {\mathcal {I}} \left| \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} \left(x ^ {\prime}\right) \mathrm {d} \beta - \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \left(x ^ {\prime}\right) \mathrm {d} \beta \right| \mathrm {d} \alpha \right] \\ \leq M _ {f} | \mathcal {X} | ^ {2} L _ {P} \cdot \frac {C ^ {\prime} (1)}{\sqrt {N}} \\ \end{array}
+$$
+
+in the case of rate $\mathcal{O}(1 / \sqrt{N})$ , or uniformly to zero otherwise, from Lipschitz $P$ by defining the functions $f_{x',\alpha}'(x,\beta) = W(\alpha,\beta)\cdot \mathbf{1}_{x=x'}$ for any $(x',\alpha) \in \mathcal{X} \times \mathcal{I}$ and using the induction assumption on $f_{x',\alpha}'$ to obtain
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \int_ {\mathcal {I}} \left| \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} \left(x ^ {\prime}\right) \mathrm {d} \beta - \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \left(x ^ {\prime}\right) \mathrm {d} \beta \right| \mathrm {d} \alpha \right] \\ = \int_ {\mathcal {I}} \mathbb {E} \left[ \left| \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {N, \beta} \left(x ^ {\prime}\right) \mathrm {d} \beta - \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \left(x ^ {\prime}\right) \mathrm {d} \beta \right| \right] \mathrm {d} \alpha \\ = \int_ {\mathcal {I}} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} \left(f _ {x ^ {\prime}, \alpha} ^ {\prime}\right) - \boldsymbol {\mu} _ {t} \left(f _ {x ^ {\prime}, \alpha} ^ {\prime}\right) \right| \right] d \alpha \leq \frac {C ^ {\prime} (1)}{\sqrt {N}} \\ \end{array}
+$$
+
+for some $C'(1) > 0$ uniformly over all $f'$ bounded by 1 if the convergence in Assumption 1 is at rate $\mathcal{O}(1 / \sqrt{N})$ , or uniformly to zero otherwise.
+
+Fifth term. We have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} P _ {t, \boldsymbol {\mu} _ {t}, W} ^ {\boldsymbol {\pi}} (f) - \boldsymbol {\mu} _ {t} P _ {t, \boldsymbol {\mu} _ {t}, W} ^ {\boldsymbol {\pi}} (f) \right| \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta\right) f (x ^ {\prime}, \alpha) \mathrm {d} \alpha \right. \right. \\ \left. - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} d \beta\right) f (x ^ {\prime}, \alpha) d \alpha \right] \\ = \mathbb {E} \left[ \left| \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {N, \alpha} (x) f ^ {\prime} (x, \alpha) d \alpha - \int_ {\mathcal {I}} \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha} (x) f ^ {\prime} (x, \alpha) d \alpha \right| \right] \\ = \mathbb {E} \left[ \left| \boldsymbol {\mu} _ {t} ^ {N} \left(f ^ {\prime}\right) - \boldsymbol {\mu} _ {t} \left(f ^ {\prime}\right) \right| \right] \leq \frac {C ^ {\prime} \left(M _ {f}\right)}{\sqrt {N}}. \\ \end{array}
+$$
+
+in the case of rate $\mathcal{O}(1 / \sqrt{N})$ , or uniformly to zero otherwise, again by induction assumption applied to the function
+
+$$
+f ^ {\prime} (x, \alpha) = \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \int_ {\mathcal {I}} W (\alpha , \beta) \mu_ {t} ^ {\beta} \mathrm {d} \beta\right) f (x ^ {\prime}, \alpha)
+$$
+
+bounded by $M_{f}$ . This completes the proof by induction.
+
+
+
+# A.2.3 PROOF OF LEMMA A.1
+
+Proof. First, we will show that (24) implies (25).
+
+Proof of (24) $\Longrightarrow$ (25). We consider a uniformly Lipschitz, uniformly bounded family of measurable functions $\mathcal{H}$ from $\mathcal{X} \times \mathcal{B}_1(\mathcal{X})$ to $\mathbb{R}$ . Let $M_h$ be the uniform bound of functions in $\mathcal{H}$ and $L_h$ be the uniform Lipschitz constant. Then, for arbitrary $h \in \mathcal{H}$ we have
+
+$$
+\begin{array}{l} \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) \right] - \mathbb {E} \left[ h \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ = \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) \right] - \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ + \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] - \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ + \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] - \mathbb {E} \left[ h \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ \end{array}
+$$
+
+which we will analyze in the following.
+
+First term. We have
+
+$$
+\begin{array}{l} \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) \right] - \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ \leq \mathbb {E} \left[ \mathbb {E} \left[ \left| h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right) - h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right| \mid X _ {t} ^ {i} \right] \right. \\ \leq L _ {h} \mathbb {E} \left[ \left\| \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right) - \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right) \right\| \right] \\ = L _ {h} \sum_ {x \in \mathcal {X}} \mathbb {E} \left[ \left| \int_ {\mathcal {I}} W _ {N} \left(\frac {i}{N}, \beta\right) \mu_ {t} ^ {N, \beta} (x) \mathrm {d} \beta - \int_ {\mathcal {I}} W _ {N} \left(\frac {i}{N}, \beta\right) \mu_ {t} ^ {\beta} (x) \mathrm {d} \beta \right| \right] \leq \frac {C (1)}{\sqrt {N}} \\ \end{array}
+$$
+
+by Theorem 2 applied to the functions $f_{N,i,x}^{\prime}(x^{\prime},\beta) = W_{N}\left(\frac{i}{N},\beta\right)\cdot \mathbf{1}_{x = x^{\prime}}$ uniformly bounded by 1.
+
+Second term. Similarly, we have
+
+$$
+\begin{array}{l} \left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] - \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right) \right] \right| \\ \leq L _ {h} \| \mathbb {G} _ {N} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t}) - \mathbb {G} _ {\mathfrak {V}} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t}) \| _ {1} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \leq L _ {h} \sum_ {x \in \mathcal {X}} \left| \int_ {\mathcal {I}} \left(W _ {N} \left(\frac {i}{N}, \beta\right) - W \left(\frac {i}{N}, \beta\right)\right) \mu_ {t} ^ {\beta} (x) d \beta \right| \\ \leq L _ {h} \sum_ {x \in \mathcal {X}} \left| \int_ {\mathcal {I}} \left(W _ {N} (\frac {i}{N}, \beta) - N \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} W (\alpha , \beta) \mathrm {d} \alpha\right) \mu_ {t} ^ {\beta} (x) \mathrm {d} \beta \right| \\ + L _ {h} \sum_ {x \in \mathcal {X}} \left| \int_ {\mathcal {I}} \left(N \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} W (\alpha , \beta) d \alpha - W \left(\frac {i}{N}, \beta\right)\right) \mu_ {t} ^ {\beta} (x) d \beta \right| \\ \end{array}
+$$
+
+where the latter term can be bounded as
+
+$$
+\begin{array}{l} L_{h}\sum_{x\in \mathcal{X}}\left|\int_{\mathcal{I}}\left(N\int_{(\frac{i - 1}{N},\frac{i}{N} ]}W(\alpha ,\beta) \mathrm{d}\alpha -W(\frac{i}{N},\beta)\right)\mu_{t}^{\beta}(x) \mathrm{d}\beta \right| \\ \leq L_{h}\sum_{x\in \mathcal{X}}\left|\int_{\mathcal{I}}N\int_{(\frac{i - 1}{N},\frac{i}{N} ]}\left(W(\alpha ,\beta) - W(\frac{\lceil N\alpha\rceil}{N},\beta)\right)\mu_{t}^{\beta}(x)\mathrm{d}\alpha \mathrm{d}\beta \right| \\ \leq L _ {h} | \mathcal {X} | N \cdot \frac {1}{N} \cdot \frac {L _ {W}}{N} = \frac {L _ {W} L _ {h} | \mathcal {X} |}{N} \\ \end{array}
+$$
+
+by Assumption 2.
+
+Alternatively, if we assumed the weaker block-wise Lipschitz condition on $W$ in (20), we can obtain the same result for almost all $i \in \mathcal{V}_N$ , i.e. for any $p_0 > 0$ there exists $N' \in \mathbb{N}$ such that for any $N > N'$ , there exists a set $\mathcal{W}_N^0$ , $|\mathcal{W}_N^0| \geq \lfloor (1 - p_0)N \rfloor$ such that for all $i \in \mathcal{W}_N^0$ the above is true: Since by (20) there exist only a finite number $Q$ of intervals and therefore jumps, there can be only $Q$ many $i$ for which the above fails, while for all other $i$ we again have
+
+$$
+\begin{array}{l} \left| \int_ {\mathcal {I}} N \int_ {(\frac {i - 1}{N}, \frac {i}{N} ]} \left(W (\alpha , \beta) - W (\frac {\lceil N \alpha \rceil}{N}, \beta)\right) \mu_ {t} ^ {\beta} (x) \mathrm {d} \alpha \mathrm {d} \beta \right| \\ \leq \sum_ {j \in \{1, \dots , Q \}} \left| \int_ {\mathcal {I} _ {j}} N \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} \left(W (\alpha , \beta) - W \left(\frac {\lceil N \alpha \rceil}{N}, \beta\right)\right) \mu_ {t} ^ {\beta} (x) d \alpha d \beta \right| \\ \leq N \cdot \frac {1}{N} \cdot \frac {L _ {W}}{N} = \frac {L _ {W} L _ {h} | \mathcal {X} |}{N} \\ \end{array}
+$$
+
+by (20), as $\left(\frac{i - 1}{N},\frac{i}{N}\right]\times \mathcal{I}_j\subseteq \mathcal{I}_k\times \mathcal{I}_j$ for some $k\in \{1,\ldots ,Q\}$
+
+For the former term we observe that
+
+$$
+\begin{array}{l} L_{h}\sum_{x\in \mathcal{X}}\left|\int_{\mathcal{I}}\left(W_{N}(\frac{i}{N},\beta) - N\int_{(\frac{i - 1}{N},\frac{i}{N} ]}W(\alpha ,\beta)\mathrm{d}\alpha\right)\mu_{t}^{\beta}(x)\mathrm{d}\beta \right| \\ \leq L _ {h} \sum_ {x \in \mathcal {X}} N \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} \left| \int_ {\mathcal {I}} \left(W _ {N} (\alpha , \beta) - W (\alpha , \beta)\right) \mu_ {t} ^ {\beta} (x) d \beta \right| d \alpha \\ \end{array}
+$$
+
+and by defining for any $x\in \mathcal{X}$ the terms $I_i^N (x)$ via
+
+$$
+I _ {i} ^ {N} (x) := N \int_ {\left(\frac {i - 1}{N}, \frac {i}{N} \right]} \left| \int_ {\mathcal {I}} \left(W _ {N} (\alpha , \beta) - W (\alpha , \beta)\right) \mu_ {t} ^ {\beta} (x) \mathrm {d} \beta \right| \mathrm {d} \alpha
+$$
+
+and noticing that we have
+
+$$
+\frac {1}{N} \sum_ {i = 1} ^ {N} I _ {i} ^ {N} (x) = \int_ {\mathcal {I}} \left| \int_ {\mathcal {I}} \left(W _ {N} (\alpha , \beta) - W (\alpha , \beta)\right) \mu_ {t} ^ {\beta} (x) \mathrm {d} \beta \right| \mathrm {d} \alpha \rightarrow 0
+$$
+
+by Assumption 1, we can conclude that for any $\varepsilon_1,p_1 > 0$ there exists $N^{\prime}\in \mathbb{N}$ such that for any $N > N^{\prime}$ , there exists a set $\mathcal{W}_N^1$ , $|\mathcal{W}_N^1 |\geq \lfloor (1 - p_1)N\rfloor$ such that for all $i\in \mathcal{W}_N^1$ we have
+
+$$
+I _ {i} ^ {N} (x) < \varepsilon_ {1},
+$$
+
+since by the above we can choose $N' \in \mathbb{N}$ such that for any $N > N'$ we have $\frac{1}{N} \sum_{i=1}^{N} I_i^N(x) < \varepsilon_1 p_1$ , and from $I_i^N(x) \geq 0$ it would otherwise follow that $\frac{1}{N} \sum_{i=1}^{N} I_i^N(x) \geq \frac{1}{N} \cdot \lceil p_1 N \rceil \varepsilon_1 \geq \varepsilon_1 p_1$ which would be a direct contradiction. Therefore, for all $i \in \mathcal{W}_N^1$ , we have uniformly
+
+$$
+L_{h}\sum_{x\in \mathcal{X}}N\int_{(\frac{i - 1}{N},\frac{i}{N} ]}\left|\int_{\mathcal{I}}\bigl(W_{N}(\alpha ,\beta) - W(\alpha ,\beta)\bigr)\mu_{t}^{\beta}(x)\mathrm{d}\beta \right| \mathrm{d}\alpha = L_{h}\sum_{x\in \mathcal{X}}I_{i}^{N}(x)\to 0.
+$$
+
+Third term. By (24), for any $\varepsilon_2, p_2 > 0$ there exists a set $\mathcal{W}_N^2$ , $|\mathcal{W}_N^2| \geq \lfloor (1 - p_2)N \rfloor$ such that for all $i \in \mathcal{W}_N^2$ we have
+
+$$
+\left| \mathbb {E} \left[ h \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] - \mathbb {E} \left[ h \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] \right| < \varepsilon_ {2}
+$$
+
+independent of $\hat{\pi}\in \Pi$
+
+The intersection of $\mathcal{W}_N^0$ , $\mathcal{W}_N^1$ , $\mathcal{W}_N^2$ has at least $N - \lceil p_0N \rceil - \lceil p_1N \rceil - \lceil p_2N \rceil$ agents fulfilling (25), which completes the proof of (24) $\Rightarrow$ (25) for almost all agents by choosing $\varepsilon_1, \varepsilon_2$ sufficiently small and $p_0, p_1, p_2 < \frac{p}{3}$ such that $N - \lceil p_0N \rceil - \lceil p_1N \rceil - \lceil p_2N \rceil \geq \lfloor (1 - p)N \rfloor$ , which is equivalent to $1 - \frac{\lceil p_0N \rceil}{N} - \frac{\lceil p_1N \rceil}{N} - \frac{\lceil p_2N \rceil}{N} \geq \frac{\lfloor (1 - p)N \rfloor}{N}$ and is true for sufficiently large $N$ , since in the limit, $1 - \frac{\lceil p_0N \rceil}{N} - \frac{\lceil p_1N \rceil}{N} - \frac{\lceil p_2N \rceil}{N} \to 1 - p_0 - p_1 - p_2$ and $\frac{\lfloor (1 - p)N \rfloor}{N} \to 1 - p$ as $N \to \infty$ .
+
+Proof of (24). All that remains is to show (24), which will automatically imply (25) at all times $t \in \mathcal{T}$ by the prequel. We will show (24) by induction.
+
+Initial case. At $t = 0$ , $\mathcal{L}(X_t^i) = \mu_0 = \mathcal{L}(\hat{X}_t^{\frac{1}{N}})$ by definition. Thus, trivially
+
+$$
+\left| \mathbb {E} \left[ g (X _ {0} ^ {i}) \right] - \mathbb {E} \left[ g (\hat {X} _ {0} ^ {\frac {i}{N}}) \right] \right| = 0 < \varepsilon .
+$$
+
+Induction step. For any uniformly bounded family of functions $\mathcal{G}$ from $\mathcal{X}$ to $\mathbb{R}$ with bound $M_g$ , we will show that for any $\varepsilon, p > 0$ , there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\left. \right.\left| \mathbb {E} \left[ g (X _ {t + 1} ^ {i}) \right] - \mathbb {E} \left[ g (\hat {X} _ {t + 1} ^ {\frac {i}{N}}) \right]\right| < \varepsilon
+$$
+
+uniformly over $\hat{\pi} \in \Pi$ , $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \left\lfloor (1 - p)N \right\rfloor$ . Observe that
+
+$$
+\left. \right.\left| \mathbb {E} \left[ g \left(X _ {t + 1} ^ {i}\right)\right] - \mathbb {E} \left[ g \left(\hat {X} _ {t + 1} ^ {\frac {i}{N}}\right)\right]\right| = \left| \mathbb {E} \left[ l _ {N, t} \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right)\right] - \mathbb {E} \left[ l _ {N, t} \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right)\right]\right|
+$$
+
+where we defined the uniformly bounded, uniformly Lipschitz functions
+
+$$
+l _ {N, t} (x, \nu) \equiv \sum_ {u \in \mathcal {U}} \hat {\pi} _ {t} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \nu\right) g \left(x ^ {\prime}\right)
+$$
+
+with Lipschitz constant $|\mathcal{X}|M_gL_P$ and uniform bound $M_{g}$ . By the induction assumption and (24) $\Rightarrow$ (25) from the prequel, there exists $N^{\prime}\in \mathbb{N}$ such that for all $N > N^{\prime}$ we have
+
+$$
+\left. \right.\left| \mathbb {E} \left[ l _ {N, t} \left(X _ {t} ^ {i}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t} ^ {N}\right)\right)\right] - \mathbb {E} \left[ l _ {N, t} \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} _ {N} ^ {\frac {i}{N}} \left(\boldsymbol {\mu} _ {t}\right)\right)\right]\right| < \varepsilon
+$$
+
+uniformly over $\hat{\pi} \in \Pi$ , $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \lfloor (1 - p)N \rfloor$ , which completes the proof by induction.
+
+# A.2.4 PROOF OF COROLLARY A.1
+
+Proof. Define the uniformly bounded, uniformly Lipschitz functions
+
+$$
+r _ {\hat {\pi}} (x, \nu) \equiv \sum_ {u \in \mathcal {U}} r (x, u, \nu) \hat {\pi} _ {t} (u \mid s)
+$$
+
+with Lipschitz constant $|U|L_{r}$ and uniform bound $M_{r}$ such that by Lemma A.1 and Fubini's theorem, there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\left| J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \hat {\pi}, \pi^ {i + 1}, \dots , \hat {\pi}\right) - J _ {\frac {i}{N}} ^ {\mu} \left(\hat {\pi}\right) \right|
+$$
+
+$$
+\leq \sum_ {t = 0} ^ {T - 1} \left| \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] - \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] \right| < \varepsilon .
+$$
+
+uniformly over $\hat{\pi} \in \Pi$ , $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \lfloor (1 - p)N \rfloor$ by choosing the maximum over all $N'$ at each finite time step from Lemma A.1.
+
+In case of the infinite horizon discounted objective, we instead first cut off at a time $T > \frac{\log \frac{\varepsilon(1 - \gamma)}{4M_r}}{\log \gamma}$ such that trivially
+
+$$
+\begin{array}{l} \sum_ {t = 0} ^ {T - 1} \gamma^ {t} \left| \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] - \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] \right| \\ + \gamma^ {T} \sum_ {t = T} ^ {\infty} \gamma^ {t - T} \left| \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} (X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})) \right] - \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} (\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})) \right] \right| \\ < \sum_ {t = 0} ^ {T - 1} \gamma^ {t} \left| \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(X _ {t} ^ {i}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] - \mathbb {E} \left[ r _ {\hat {\pi} _ {t}} \left(\hat {X} _ {t} ^ {\frac {i}{N}}, \mathbb {G} ^ {\frac {i}{N}} (\boldsymbol {\mu} _ {t})\right) \right] \right| + \frac {\varepsilon}{2} \\ \end{array}
+$$
+
+and then handle the remaining term analogously to the finite horizon case.
+
+
+
+# A.2.5 PROOF OF THEOREM 3
+
+Proof. By Corollary A.1, for any $\varepsilon > 0$ there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\begin{array}{l} \max _ {\pi \in \Pi} \left(J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right)\right) \\ \leq \max _ {\pi \in \Pi} \left(J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - J _ {\frac {i}{N}} ^ {\mu} (\pi)\right) \\ + \max _ {\pi \in \Pi} \left(J _ {\frac {i}{N}} ^ {\boldsymbol {\mu}} (\pi) - J _ {\frac {i}{N}} ^ {\boldsymbol {\mu}} \left(\pi^ {\frac {i}{N}}\right)\right) \\ + \left(J _ {\frac {i}{N}} ^ {\mu} \left(\pi^ {\frac {i}{N}}\right) - J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right)\right) \\ < \frac {\varepsilon}{2} + 0 + \frac {\varepsilon}{2} = \varepsilon \\ \end{array}
+$$
+
+uniformly over $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \lfloor (1 - p)N \rfloor$ , since $\pi^{\frac{i}{N}} \in \arg \max_{\pi} J_{\frac{i}{N}}^{\mu}(\pi)$ by definition of a GMFE. Reordering completes the proof.
+
+# A.2.6 PROOF OF COROLLARY A.2
+
+Proof. The proof follows immediately from Theorem 2 and Lemma A.1 by considering the trivial policy $\pi$ that always chooses the only action available together with its generated mean field $\mu = \Psi(\pi)$ .
+
+# A.2.7 PROOF OF PROPOSITION 2
+
+Proof. The set $\Pi$ is a complete metric space, since existence of limits follows from completeness of $\mathbb{R}$ , pointwise limits of measurable functions are measurable, and policies will remain normalized. Banach's fixed point theorem applied to $\hat{\Phi} \circ \hat{\Psi}$ gives us the desired result.
+
+# A.2.8 PROOF OF THEOREM 4
+
+Proof. Formally, we approximate mean fields by $\hat{\Psi}(\pi) = \sum_{i=1}^{M} \mathbf{1}_{\alpha \in \tilde{\mathcal{I}}_i} \hat{\mu}^{\alpha_i}$ for any fixed policy ensemble $\pi$ , and similarly policies $\hat{\Phi}(\boldsymbol{\mu}) = \sum_{i=1}^{M} \mathbf{1}_{\alpha \in \tilde{\mathcal{I}}_i} \pi^{\alpha_i}$ where $\pi^{\alpha_i}$ is the softmax policy of $\alpha_i$ for fixed $\boldsymbol{\mu}$ , i.e.
+
+$$
+\pi_ {t} ^ {\alpha} (u \mid x) = \frac {\exp \left(\frac {Q _ {\alpha} ^ {\mu} (t , x , u)}{\eta}\right)}{\sum_ {u \in \mathcal {U}} \exp \left(\frac {Q _ {\alpha} ^ {\mu} (t , x , u)}{\eta}\right)}. \tag {30}
+$$
+
+By the Bellman equation (13), $Q_{\alpha}^{\mu}(t,x,u)$ is Lipschitz in $\pmb{\mu}$ for all $(t,x,u)\in \mathcal{T}\times \mathcal{X}\times \mathcal{U}$ under Assumption 2. Since the Lipschitz constants are shared over all $\alpha$ , by Cui & Koeppl (2021), Lemma B.7.5, (30) is therefore Lipschitz with Lipschitz constant proportional to $1 / \eta$ , which immediately implies that $\hat{\Phi}$ is also Lipschitz with Lipschitz constant $c_{1} / \eta$ . By its recursive definition as compositions of Lipschitz functions, $\hat{\Psi}$ is Lipschitz as well with some constant $c_{2}$ . Therefore, the composition of both functions $\hat{\Psi}\circ \hat{\Phi}$ is Lipschitz with constants $c_{1}c_{2} / \eta$ , which will be less than 1 for sufficiently large $\eta$ . By Proposition 2, the equivalence classes algorithm $\hat{\Psi}\circ \hat{\Phi}$ converges to a fixed point.
+
+# A.2.9 PROOF OF THEOREM 5
+
+Proof. First, note that under the equivalence classes method, the distance between any $\alpha$ and its representant $\alpha_{i}$ uniformly shrinks to zero as $M\to \infty$ , i.e. $\max_{i = 1,\ldots ,M}\sup_{\alpha \in \tilde{\mathcal{L}}_i}|\alpha -\alpha_i|\to 0$
+
+We begin by showing that a solution of the $M$ equivalence classes method $(\pi, \mu) \in \Pi \times \mathcal{M}$ , $\pi \in \hat{\Phi}(\mu)$ , $\mu = \hat{\Psi}(\pi)$ following (31), (32) fulfills approximate optimality, i.e. for any $\varepsilon > 0$ there exists $M'$ s.t. for all $M > M'$
+
+$$
+\sup _ {\alpha \in \mathcal {I}} \max _ {\pi \in \Pi} \left(J _ {\alpha} ^ {\bar {\mu}} (\pi) - J _ {\alpha} ^ {\bar {\mu}} \left(\pi^ {\alpha}\right)\right) < \varepsilon ,
+$$
+
+where we introduced the true, exact mean field ensemble $\bar{\mu} = \Psi(\pi)$ following (12) generated by the block-wise solution policy $\sum_{i=1}^{M} \mathbf{1}_{\alpha \in \tilde{\mathcal{I}}_i} \pi^{\alpha_i}$ of the $M$ equivalence classes method, as well as the true mean field system under $\bar{\mu}$ and any policy $\pi \in \Pi$
+
+$$
+\bar {X} _ {0} ^ {\alpha} \sim \mu_ {0}, \quad \bar {U} _ {t} ^ {\alpha} \sim \pi_ {t} (\cdot | \bar {X} _ {t} ^ {\alpha}), \quad \bar {X} _ {t + 1} ^ {\alpha} \sim P (\cdot | \bar {X} _ {t} ^ {\alpha}, \bar {U} _ {t} ^ {\alpha}, \bar {\mathbb {G}} _ {t} ^ {\alpha}), \quad \forall (\alpha , t) \in \mathcal {I} \times \mathcal {T}
+$$
+
+with $\mathcal{B}_1(\mathcal{X})$ -valued $\bar{\mathbb{G}}_t^\alpha \coloneqq \int_{\mathcal{I}} W(\alpha, \beta) \bar{\mu}_t^\beta \, \mathrm{d}\beta$ and $J_\alpha^\bar{\mu}(\pi) \equiv \mathbb{E}\left[\sum_{t=0}^{T-1} r(\bar{X}_t^\alpha, \bar{U}_t^\alpha, \bar{\mathbb{G}}_t^\alpha)\right]$ , while system (9) is to be understood as the system under the approximate mean field ensemble $\pmb{\mu}$ .
+
+To see this, we will analyze
+
+$$
+\begin{array}{l} \sup _ {\alpha \in \mathcal {I}} \max _ {\pi \in \Pi} \left(J _ {\alpha} ^ {\bar {\mu}} (\pi) - J _ {\alpha} ^ {\bar {\mu}} (\pi^ {\alpha})\right) \leq \max _ {i = 1, \dots , M} \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \max _ {\pi \in \Pi} \left(J _ {\alpha} ^ {\bar {\mu}} (\pi) - J _ {\alpha} ^ {\mu} (\pi)\right) \\ + \max _ {i = 1, \dots , M} \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \max _ {\pi \in \Pi} \left(J _ {\alpha} ^ {\mu} (\pi) - J _ {\alpha_ {i}} ^ {\mu} (\pi)\right) \\ + \max _ {i = 1, \dots , M} \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \max _ {\pi \in \Pi} \left(J _ {\alpha_ {i}} ^ {\boldsymbol {\mu}} (\pi) - J _ {\alpha_ {i}} ^ {\boldsymbol {\mu}} \left(\pi^ {\alpha_ {i}}\right)\right) \\ + \max _ {i = 1, \dots , M} \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \left(J _ {\alpha_ {i}} ^ {\boldsymbol {\mu}} \left(\pi^ {\alpha_ {i}}\right) - J _ {\alpha} ^ {\boldsymbol {\mu}} \left(\pi^ {\alpha_ {i}}\right)\right) \\ + \max _ {i = 1, \dots , M} \sup _ {\alpha \in \hat {\mathcal {I}} _ {i}} \left(J _ {\alpha} ^ {\mu} (\pi^ {\alpha}) - J _ {\alpha} ^ {\bar {\mu}} (\pi^ {\alpha})\right). \\ \end{array}
+$$
+
+First term. For any $\pi \in \Pi$ , define the uniformly bounded, uniformly Lipschitz functions
+
+$$
+r _ {\pi} (x, \nu) \equiv \sum_ {u \in \mathcal {U}} r (x, u, \nu) \pi_ {t} (u \mid s)
+$$
+
+with Lipschitz constant $|U|L_{r}$ and uniform bound $M_{r}$ such that for the first term, we have
+
+$$
+\begin{array}{l} \left(J _ {\alpha} ^ {\bar {\mu}} (\pi) - J _ {\alpha} ^ {\mu} (\pi)\right) \leq \left| J _ {\alpha} ^ {\bar {\mu}} (\pi) - J _ {\alpha} ^ {\mu} (\pi) \right| \\ \leq \sum_ {t = 0} ^ {T - 1} \left| \mathbb {E} \left[ r _ {\pi} \left(\bar {X} _ {t} ^ {\alpha}, \bar {\mathbb {G}} _ {t} ^ {\alpha}\right) \right] - \mathbb {E} \left[ r _ {\pi} \left(X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \right. \right\rvert \right. \\ \leq \sum_ {t = 0} ^ {T - 1} \left| \right. \mathbb {E} \left[ \right. r _ {\pi} \left(\bar {X} _ {t} ^ {\alpha}, \bar {\mathbb {G}} _ {t} ^ {\alpha}\right) - r _ {\pi} \left( \right.\bar {X} _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \left. \right]\left. \right\rvert + \sum_ {t = 0} ^ {T - 1} \left| \right. \mathbb {E} \left[ \right. r _ {\pi} \left( \right.\bar {X} _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \left. \right] - \mathbb {E} \left[ \right. r _ {\pi} \left( \right.X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \left. \right]\left. \right.\left. \right.\left. \right. \\ \leq \sum_ {t = 0} ^ {T - 1} | U | L _ {r} \left\| \right. \int_ {\mathcal {I}} W (\alpha , \beta) \left(\bar {\mu} _ {t} ^ {\beta} - \mu_ {t} ^ {\beta}\right) \mathrm {d} \beta\left. \right) \| + \sum_ {t = 0} ^ {T - 1} \left| \right. \mathbb {E} \left[ \right. r _ {\pi} \left( \right.\bar {X} _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \left. \right] - \mathbb {E} \left[ \right. r _ {\pi} \left( \right.X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha} \left. \right]\left. \right.\left. \right|. \\ \end{array}
+$$
+
+For the former term, note that
+
+$$
+\begin{array}{l} \left\| \int_ {\mathcal {I}} W (\alpha , \beta) \left(\bar {\mu} _ {t} ^ {\beta} - \mu_ {t} ^ {\beta}\right) \mathrm {d} \beta) \right\| = \left\| \sum_ {i} \int_ {\tilde {\mathcal {I}} _ {i}} W (\alpha , \beta) \left(\bar {\mu} _ {t} ^ {\beta} - \mu_ {t} ^ {\alpha_ {i}}\right) \mathrm {d} \beta) \right\| \\ \leq \max _ {i = 1, \dots , M} \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} | \mathcal {X} | \| \bar {\mu} _ {t} ^ {\alpha} - \mu_ {t} ^ {\alpha_ {i}} \| \\ \end{array}
+$$
+
+and we will show by induction over $t = 0,1,\ldots ,T$ that $\sup_{\alpha \in \tilde{\mathcal{I}}_i}\| \bar{\mu}_t^\alpha -\mu_t^{\alpha_i}\| \to 0$ over all $\alpha$ uniformly over all equivalence classes $\tilde{\mathcal{I}}_i$ . At $t = 0$ , we have trivially $\bar{\mu}_0 = \mu_0$ . Assume that $\sup_{\alpha \in \tilde{\mathcal{I}}_i}\| \bar{\mu}_t^\alpha -\mu_t^{\alpha_i}\| \to 0$ . Then for $t + 1$ , we have
+
+$$
+\begin{array}{l} \sup _ {\alpha \in \hat {\mathcal {I}} _ {i}} \left\| \bar {\mu} _ {t + 1} ^ {\alpha} - \mu_ {t + 1} ^ {\alpha_ {i}} \right\| \\ = \sup _ {\alpha \in \bar {\mathcal {I}} _ {i}} \left\| \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u \mid x) P (\cdot \mid x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha}) - \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u \mid x) P (\cdot \mid x, u, \mathbb {G} _ {t} ^ {\alpha_ {i}}) \right\| \\ \leq \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \left\| \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u | x) P (\cdot | x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha}) - \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u | x) P (\cdot | x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha_ {i}}) \right\| \\ + \left\| \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u \mid x) P (\cdot \mid x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha_ {i}}) - \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u \mid x) P (\cdot \mid x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha_ {i}}) \right\| \\ + \left\| \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u \mid x) P (\cdot \mid x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha_ {i}}) - \sum_ {x \in \mathcal {X}} \mu_ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u \mid x) P (\cdot \mid x, u, \mathbb {G} _ {t} ^ {\alpha_ {i}}) \right\| \\ \leq \sup _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \left\| \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha} (u | x) P (\cdot | x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha}) - \sum_ {x \in \mathcal {X}} \bar {\mu} _ {t} ^ {\alpha_ {i}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {i}} (u | x) P (\cdot | x, u, \bar {\mathbb {G}} _ {t} ^ {\alpha_ {i}}) \right\| \\ + | \mathcal {X} | ^ {2} \| \bar {\mu} _ {t} ^ {\alpha_ {i}} - \mu_ {t} ^ {\alpha_ {i}} \| + | \mathcal {X} | ^ {2} | \mathcal {U} | L _ {P} \| \bar {\mu} _ {t} ^ {\alpha_ {i}} - \mu_ {t} ^ {\alpha_ {i}} \| \rightarrow 0 \\ \end{array}
+$$
+
+as $M \to \infty$ , since the first term is uniformly Lipschitz in $\alpha$ by (12) as a recursive composition, finite multiplication and addition of Lipschitz functions, whereas the other terms tend to zero by induction hypothesis. Since the Lipschitz constants do not depend on $\tilde{\mathcal{I}}_i$ , the convergence is uniform.
+
+To bound the latter term, we first note that $r_{\pi}(\cdot ,\mathbb{G}_t^\alpha)$ is always bounded by $M_r$ regardless of $t,\alpha ,\pi$ i.e. it again suffices to show that for any family of functions $\mathcal{G}$ from $\mathcal{X}$ to $\mathbb{R}$ uniformly bounded by $M_r$ , we have
+
+$$
+\sup _ {g \in \mathcal {G}} \left| \mathbb {E} \left[ g (\bar {X} _ {t} ^ {\alpha}) \right] - \mathbb {E} \left[ g (X _ {t} ^ {\alpha}) \right] \right| \to 0.
+$$
+
+The proof is by induction. At $t = 0$ , we trivially have $\mathcal{L}(\bar{X}_t^\alpha) = \mu_0 = \mathcal{L}(X_t^\alpha)$ . Assuming that the induction hypothesis holds at $t$ , then at $t + 1$ we have
+
+$$
+\sup _ {g \in \mathcal {G}} \left| \mathbb {E} \left[ g \left(\bar {X} _ {t + 1} ^ {\alpha}\right)\right] - \mathbb {E} \left[ g \left(X _ {t + 1} ^ {\alpha}\right)\right]\right| = \sup _ {g \in \mathcal {G}} \left| \right. \mathbb {E} \left[ \right. l _ {t} \left(\bar {X} _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha}\right)\left. \right) - \mathbb {E} \left[ l _ {t} \left(X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha}\right)\right]\left. \right|\rightarrow 0
+$$
+
+by the induction hypothesis, where we defined the uniformly bounded functions
+
+$$
+l _ {t} (x, \nu) \equiv \sum_ {u \in \mathcal {U}} \pi_ {t} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \nu\right) g \left(x ^ {\prime}\right)
+$$
+
+with uniform bound $M_r$ . Therefore, $|J_{\alpha}^{\bar{\mu}}(\pi) - J_{\alpha}^{\mu}(\pi)| \to 0$ uniformly over all $\alpha, \pi$ .
+
+Second term. For the second term, we analogously have
+
+$$
+\begin{array}{l} \left(J _ {\alpha} ^ {\mu} (\pi) - J _ {\alpha_ {i}} ^ {\mu} (\pi)\right) \leq \left| J _ {\alpha} ^ {\mu} (\pi) - J _ {\alpha_ {i}} ^ {\mu} (\pi) \right| \\ \leq \sum_ {t = 0} ^ {T - 1} | U | L _ {r} \left\| \int_ {\mathcal {I}} (W (\alpha , \beta) - W (\alpha_ {i}, \beta)) \mu_ {t} ^ {\beta} \mathrm {d} \beta) \right\| + \sum_ {t = 0} ^ {T - 1} | \mathbb {E} [ r _ {\pi} (X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha_ {i}} ] - \mathbb {E} [ r _ {\pi} (X _ {t} ^ {\alpha_ {i}}, \mathbb {G} _ {t} ^ {\alpha_ {i}} ] | \\ \end{array}
+$$
+
+where the former term uniformly tends to zero as $M \to \infty$ over all $\alpha$ by Lipschitz $W$ from Assumption 2 and increasingly fine partition intervals $\tilde{\mathcal{I}}_i$ , while for the latter term we again show that for any family of functions $\mathcal{G}$ from $\mathcal{X}$ to $\mathbb{R}$ uniformly bounded by $M_r$ , we have
+
+$$
+\sup_{g\in \mathcal{G}}|\mathbb{E}\left[ g(X_{t}^{\alpha})\right] - \mathbb{E}\left[ g(X_{t}^{\alpha_{i}})\right]| \to 0 .
+$$
+
+The proof is by induction. At $t = 0$ , we trivially have $\mathcal{L}(X_t^\alpha) = \mu_0 = \mathcal{L}(X_t^{\alpha_i})$ . Assuming that the induction hypothesis holds at $t$ , then at $t + 1$ we have
+
+$$
+\sup _ {g \in \mathcal {G}} \left| \mathbb {E} \left[ g \left(X _ {t + 1} ^ {\alpha}\right)\right] - \mathbb {E} \left[ g \left(X _ {t + 1} ^ {\alpha_ {i}}\right)\right]\right| = \sup _ {g \in \mathcal {G}} \left| \right. \mathbb {E} \left[ \right. l _ {t} \left(X _ {t} ^ {\alpha}, \mathbb {G} _ {t} ^ {\alpha_ {i}}\right)\left. \right)\left. \right] - \mathbb {E} \left[ l _ {t} \left(X _ {t} ^ {\alpha_ {i}}, \mathbb {G} _ {t} ^ {\alpha_ {i}}\right)\right] | \rightarrow 0
+$$
+
+by the induction hypothesis, where we defined the uniformly bounded functions
+
+$$
+l _ {t} (x, \nu) \equiv \sum_ {u \in \mathcal {U}} \pi_ {t} (u \mid x) \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \nu\right) g \left(x ^ {\prime}\right)
+$$
+
+with uniform bound $M_r$ . Therefore, $\left|J_{\alpha}^{\mu}(\pi) - J_{\alpha_i}^{\mu}(\pi)\right| \to 0$ uniformly over all $\alpha, \pi$ .
+
+Third term. By definition, we have optimality of $\pi \in \hat{\Phi}(\mu)$ under the approximate mean field $\pmb{\mu}$ at each representative $\alpha_{i}$ . Therefore, the term $\max_{\pi \in \Pi}\left(J_{\alpha_{i}}^{\pmb{\mu}}(\pi) - J_{\alpha_{i}}^{\pmb{\mu}}(\pi^{\alpha_{i}})\right)$ is upper bounded by 0, as there is no policy $\pi$ that improves over $\pi^{\alpha_{i}}$ .
+
+Fourth and fifth term. The results follow from the first and second term by inserting $\pi^{\alpha}$ for $\pi$ .
+
+Variations on the setting. The infinite horizon discounted case is handled as in the proof of Corollary A.1, i.e. repeating the above up to some chosen time horizon $T$ and trivially bounding all terms with $t \geq T$ . The block-wise Lipschitz graphon case (20) is handled by choosing the equivalence classes $\mathcal{I}_i \subseteq \mathcal{I}_j$ such that they are part of at most one block $\mathcal{I}_j$ of the graphon.
+
+Proof of Theorem 5. Now fix any $\varepsilon, p > 0$ . As a result of the prequel, we have that there exists $M'$ s.t. for all $M > M'$
+
+$$
+\sup _ {\alpha \in \mathcal {I}} \max _ {\pi \in \Pi} \left| J _ {\alpha} ^ {\mu} \left(\pi^ {\alpha}\right) - J _ {\alpha} ^ {\mu} (\pi) \right| < \frac {\varepsilon}{3}.
+$$
+
+Pick any such $M > M'$ . By Corollary A.1 (for the first and third term, since $\pi$ is constant with at most $M$ discontinuities) and the prequel (for the second term), there exists $N' \in \mathbb{N}$ such that for all $N > N'$ we have
+
+$$
+\begin{array}{l} \max _ {\pi \in \Pi} \left(J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right)\right) \\ \leq \max _ {\pi \in \Pi} \left(J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {i - 1}, \pi , \pi^ {i + 1}, \dots , \pi^ {N}\right) - J _ {\frac {i}{N}} ^ {\bar {\mu}} (\pi)\right) \\ + \max _ {\pi \in \Pi} \left(J _ {\frac {i}{N}} ^ {\bar {\mu}} (\pi) - J _ {\frac {i}{N}} ^ {\bar {\mu}} \left(\pi^ {\frac {i}{N}}\right)\right) \\ + \left(J _ {\frac {i}{N}} ^ {\bar {\mu}} \left(\pi^ {\frac {i}{N}}\right) - J _ {i} ^ {N} \left(\pi^ {1}, \dots , \pi^ {N}\right)\right) \\ < \frac {\varepsilon}{3} + \frac {\varepsilon}{3} + \frac {\varepsilon}{3} = \varepsilon \\ \end{array}
+$$
+
+which holds uniformly over $i \in \mathcal{W}_N$ for some $\mathcal{W}_N \subseteq \mathcal{V}_N$ with $|\mathcal{W}_N| \geq \lfloor (1 - p)N \rfloor$ , since $\pi^{\frac{i}{N}} \in \arg \max_{\pi} J_{\frac{i}{N}}^{\mu}(\pi)$ by definition of a GMFE. Reordering completes the proof.
+
+# A.3 EXPERIMENTAL DETAILS
+
+In this section, we will give a full description of all the algorithms and hyperparameters we used during our experiments. For reinforcement learning, we use PPO (Schulman et al., 2017).
+
+For the approximate equivalence classes, we shall consider grids $(\alpha_{m}\in [0,1])_{m = 1,\ldots ,M}$ with associated policies $(\pi^{\alpha_m}\in \Pi)_{m = 1,\dots ,M}$ and mean fields $(\mu^{\alpha_{m}}\in \mathcal{P}(\mathcal{X})^{\mathcal{T}})_{m = 1,\dots ,M}$ . For the grid, we
+
+# Algorithm 1 Fixed point iteration
+
+1: Initialize $\mu^0$ as the mean field induced by the uniformly random policy $\mathbf{q}$ .
+2: for $k = 0,1,\ldots$ do
+3: Compute $\pi^k\in \Pi$ either directly by PPO on (14), or by computing $\mathbf{Q}^{\mu}$ via Algorithm 2 and using (38) to obtain a softmax policy.
+4: Compute $\pmb{\mu}^{k + 1}$ induced by $\pi^k$ using Algorithm 3, or for RL the neighborhood mean fields $\mathbb{G}_t^\alpha$ directly using Algorithm 4.
+5: end for
+
+# Algorithm 2 Backwards induction
+
+1: Input: Grid $(\alpha_{m}\in [0,1])_{m = 1,\dots ,M}$ mean field $\pmb {\mu}\in \mathcal{M}$
+2: for $m = 1,\dots ,M$ do
+3: Initialize terminal condition $Q_{\alpha}^{\mu}(T,x,u) \equiv 0$ for all $(x,u) \in \mathcal{X} \times \mathcal{U}$ .
+4: for $t = T - 1, \dots, 0$ do
+5: for $(x,u)\in \mathcal{X}\times \mathcal{U}$ do
+6: $Q_{\alpha_m}^\mu (t,x,u)\gets r(x,u,\mathbb{G}_t^{\alpha_m}) + \sum_{x'\in \mathcal{X}}P(x'|\textbf{x},u,\mathbb{G}_t^{\alpha_m})\max_{u'\in \mathcal{U}}Q_{\alpha_m}^\mu (t + 1,x',u').$
+7: end for
+8: end for
+9: end for
+10: Return $(Q_{\alpha_m}^{\mu})_{m = 1,\dots ,M}$
+
+choose the points $\alpha_{m} = \frac{m}{100}$ with $m = 0, \ldots, 100$ . Here, an agent $\alpha$ shall use the policy $\pi^{\alpha_{m}}$ with the closest $\alpha_{m}$ .
+
+To be precise, for the approximate mean field $\pmb{\mu} = \hat{\Psi}(\pmb{\pi})$ we define $\mu^{\alpha} \equiv \hat{\mu}^{\alpha_m}$ for the $\alpha_m$ closest to $\alpha$ , i.e. formally, we thus have
+
+$$
+\hat {\Psi} (\boldsymbol {\pi}) = \sum_ {m = 1} ^ {M} \mathbf {1} _ {\alpha \in \tilde {\mathcal {I}} _ {m}} \hat {\mu} ^ {\alpha_ {m}} \tag {31}
+$$
+
+for any fixed policy ensemble $\pi$ , with $\hat{\mu}$ defined through the recursive equation
+
+$$
+\hat {\mu} _ {0} ^ {\alpha_ {m}} \equiv \mu_ {0}, \quad \hat {\mu} _ {t + 1} ^ {\alpha_ {m}} \left(x ^ {\prime}\right) \equiv \sum_ {x \in \mathcal {X}} \hat {\mu} _ {t} ^ {\alpha_ {m}} (x) \sum_ {u \in \mathcal {U}} \pi_ {t} ^ {\alpha_ {m}} (u \mid x) P \left(x ^ {\prime} \mid x, u, \hat {\mathbb {G}} _ {t} ^ {\alpha_ {m}}\right), \quad m = 1, \dots , M \tag {32}
+$$
+
+where under the assumption of equivalence classes $\tilde{\mathcal{I}}_m\equiv [a_m,b_m]$ of size $(b_{m} - a_{m})$ , we obtain neighborhood mean fields via
+
+$$
+\hat {\mathbb {G}} _ {t} ^ {\alpha} = \sum_ {m = 1} ^ {M} \left(b _ {m} - a _ {m}\right) W (\alpha , \alpha_ {m}) \hat {\mu} _ {t} ^ {\alpha_ {m}}. \tag {33}
+$$
+
+Note that in our algorithms, we shall assume equisized partitions and use $(b_m - a_m) = \frac{1}{M}$ . Similarly, the policy ensemble is approximated by
+
+$$
+\hat {\Phi} (\boldsymbol {\mu}) = \sum_ {i = 1} ^ {M} \mathbf {1} _ {\alpha \in \tilde {\mathcal {I}} _ {i}} \pi^ {\alpha_ {i}} \tag {34}
+$$
+
+where $\pi^{\alpha_i}$ is the optimal policy of $\alpha_{i}$ for any fixed $\mu$ , i.e. the optimal policy and mean field of each $\alpha$ is approximated by the optimal solution and mean field of the closest $\alpha_{i}$ , which is an increasingly good approximation for sufficiently fine grids under the standing Lipschitz assumptions. In the case of block-wise Lipschitz continuous graphons via (20), a similar justification holds as long as each equivalence class remains constrained to one of the blocks of the graphon, see Theorem 5.
+
+In Algorithm 1, the learning scheme is described on a high level. In our experiments, we either use approximate equivalence classes via Algorithms 2 and 3, or reinforcement learning in the form of PPO together with sequential Monte Carlo in Algorithm 4, though in principle one can mix arbitrary methods.
+
+Algorithm 3 Forward simulation
+1: Input: Grid $(\alpha_{m}\in [0,1])_{m = 1,\dots ,M}$ policy $\pi \in \Pi$
+2: Initialize starting condition $\mu_0^{\alpha_m}\equiv \mu_0$ for all $m = 1,\ldots ,M$
+3: for $t = 0,\dots ,T - 2$ do
+4: for $m = 1,\dots ,M$ do
+5: $\mu_{t + 1}^{\alpha_m}\gets \sum_{x\in \mathcal{X}}\mu_t^{\alpha_m}(x)\sum_{u\in \mathcal{U}}\pi_t^{\alpha_m}(u\mid x)P(\cdot \mid x,u,\frac{1}{M}\sum_{n = 1}^{M}W(\alpha_m,\alpha_n)\mu_t^{\alpha_n})$
+6: end for
+7: end for
+8: Return $(\mu^{\alpha_m})_{m = 1,\dots ,M}$
+
+Algorithm 4 Sequential Monte Carlo
+1: Input: Number of trajectories $K = 5$ , number of particles $L = 200$ , policy $\pi \in \Pi$ .
+2: for $k = 1, \ldots, K$ do
+3: Initialize particles $\alpha_{m} \sim \mathrm{Unif}([0,1])$ , $x_0^{m,k} \sim \mu_0$ for all $m = 1, \ldots, L$ .
+4: for $t = 1, \ldots, T - 1$ do
+5: for $m = 1, \ldots, L$ do
+6: Sample action $u \sim \pi_t^{\alpha_m}(\cdot \mid x_t^{m,k})$ .
+7: Sample new particle state $x_{t + 1}^{m,k} \sim P(\cdot \mid x_t^{m,k}, u, \frac{1}{L}\sum_{n = 1}^L W(\alpha_m, \alpha_n)\delta_{x_t^{n,k}})$ .
+8: end for
+9: end for
+10: end for
+11: return neighborhood mean fields $\mathbb{G}_t^\alpha \approx \frac{1}{K}\sum_{k = 1}^K\frac{1}{L}\sum_{m = 1}^L W(\alpha, \alpha_m)\delta_{x_t^{m,k}}$ .
+
+We ran each trial of our experiments on a single conventional CPU core, with typical wall-clock times reaching up to at most a few days. We estimate the required compute to approximately 6500 core hours. We did not use any GPUs or TPUs. More specifically, the training of our approximate equivalence class approach took on average approximately 24 hours for 250 iterations in SIS and 50 iterations in Investment. As a result, Figure 5 for the selection of appropriate temperatures took around 2500 core hours. The PPO experiments took approximately 3 days for each configuration, resulting in approximately 200 core hours for Figure 7. Finally, for the $N$ -agent evaluations in Figure 4, each run up to 100 agents takes up to 4 core hours. Adding on top of that around 250 core hours for the rest of the experiments results in a total of approximately 4000 core hours.
+
+For PPO, we used the RLlib implementation by Liang et al. (2018) (version 1.2.0, Apache-2.0 license). To allow for time-dependent policies, we append the current time to the network inputs. Further, discrete-valued observations are one-hot encoded. Any other parameter configurations are given in Algorithms 1, 2, 3 and 4, as well as in Table 2.
+
+As for the specific configurations used in the PPO experiments, we give the hyperparameters in Table 1 and used with a feedforward neural network policy consisting of two hidden layers with 256 nodes and tanh activations, outputting a softmax policy over all actions.
+
+# A.3.1 PROBLEM DEFINITIONS
+
+For each possible problem setting, we list the applied temperature setting in Table 2. In the following, let $\mathbb{G} \in \mathcal{P}(\mathcal{X})$ .
+
+SIS-Graphon. In the SIS-Graphon game as described in the main text, we have $\mathcal{X} = \{S,I\}$ , $\mathcal{U} = \{U,D\}$ , $\mu_0(I) = 0.5$ , $r(x,u,\mathbb{G}) = -2 \cdot \mathbf{1}_{\{I\}}(x) - 0.5 \cdot \mathbf{1}_{\{D\}}(u)$ and $\mathcal{T} = \{0,\dots,49\}$ . Similar parameters produce similar results, and we set the transition probabilities as
+
+$$
+\mathbb {P} (S \mid I, \cdot , \cdot) = 0. 2,
+$$
+
+$$
+\mathbb {P} (I \mid S, U, \mathbb {G}) = 0. 8 \cdot \mathbb {G} (I),
+$$
+
+$$
+\mathbb {P} (I \mid S, D, \cdot) = 0.
+$$
+
+Investment-Graphon. Similarly, in the Investment-Graphon game we have $\mathcal{X} = \{0,1,\ldots 9\}$ , $\mathcal{U} = \{I,O\}$ , $\mu_0(0) = 1$ , $r(x,u,\mathbb{G}) = \frac{0.3x}{1 + \sum_{x'\in\mathcal{X}}x' \mathbb{G}(x')} - 2 \cdot \mathbf{1}_{\{I\}}(u)$ and $\mathcal{T} = \{0,\dots ,49\}$ . We set
+
+Table 1: PPO Hyperparameters
+
+| Symbol | Function | Value |
| lr | Learning rate | 0.00005 |
| γ | Discount rate | 1 |
| λ | GAE lambda | 0.99 |
| cKL | KL coefficient | 0.2 |
| β | KL target | 0.006 |
| cent | Entropy coefficient | 0.01 |
| ε | Clip parameter | 0.2 |
| B | Training batch size | 4000 |
| Bm | Mini batch size | 128 |
| ISGD | SGD iterations per training batch | 30 |
+
+Table 2: Temperature configurations
+
+| Experiment | η for approximate equivalence classes |
| SIS-Graphon, Wunif | 0.101 |
| SIS-Graphon, Wrank | 0.3 |
| SIS-Graphon, Wer | 0.101 |
| Investment-Graphon, Wunif | 0 |
| Investment-Graphon, Wrank | 0 |
| Investment-Graphon, Wer | 0.05 |
+
+the transition probabilities for $x = 0,1,\ldots ,8$ as
+
+$$
+\mathbb {P} (x + 1 \mid x, I, \cdot) = \frac {9 - x}{1 0},
+$$
+
+$$
+\mathbb {P} (x \mid x, I, \cdot) = \frac {1 + x}{1 0},
+$$
+
+$$
+\mathbb {P} (x \mid x, O, \cdot) = 1,
+$$
+
+while for $x = 9$ the next state is always $x = 9$ .
+
+# A.3.2 EXPLOITABILITY AND TEMPERATURE CHOICE
+
+In the following, we will explain our choice of temperatures in Table 2 by approximately evaluating the average exploitability of GMFE candidates $(\pi, \mu)$ - as it is intractable to approximately evaluate the maximum exploitability over all $\alpha \in \mathcal{I}$ - defined by
+
+$$
+\Delta J (\boldsymbol {\pi}, \boldsymbol {\mu}) = \int_ {\mathcal {I}} \sup _ {\pi^ {*} \in \Pi} J _ {\alpha} ^ {\boldsymbol {\mu}} \left(\pi^ {*}\right) - J _ {\alpha} ^ {\boldsymbol {\mu}} \left(\pi^ {\alpha}\right) d \alpha . \tag {35}
+$$
+
+More specifically, when using approximate equivalence classes, we compute the exploitability of some policy $\pi$ by computing the optimal policy $\pi^{*}$ obtained via Algorithm 2, under the fixed mean field $\mu$ generated by $\pi$ via Algorithm 3, inserting $\pi^{*,\alpha}$ into (35) and then approximating by
+
+$$
+\int_ {\mathcal {I}} J _ {\alpha} ^ {\boldsymbol {\mu}} (\pi) \mathrm {d} \alpha \approx \frac {1}{M} \sum_ {m = 1, \dots , M} \sum_ {x \in \mathcal {X}} \mu_ {0} (x) \sum_ {u \in \mathcal {U}} \pi_ {0} (u \mid x) Q _ {\alpha_ {m}} ^ {\boldsymbol {\mu}, \pi} (0, x, u). \tag {36}
+$$
+
+Here, we defined for any policy $\pi \in \Pi$ and $\alpha \in \mathcal{I}$ the policy evaluation functions $Q_{\alpha}^{\mu,\pi}$ as usual via
+
+$$
+Q _ {\alpha} ^ {\mu , \pi} (t, x, u) = r (x, u, \mathbb {G} _ {t} ^ {\alpha}) + \sum_ {x ^ {\prime} \in \mathcal {X}} P \left(x ^ {\prime} \mid x, u, \mathbb {G} _ {t} ^ {\alpha}\right) \sum_ {u ^ {\prime} \in \mathcal {U}} \pi_ {0} \left(u ^ {\prime} \mid x\right) Q _ {\alpha} ^ {\mu , \pi} (t + 1, x ^ {\prime}, u ^ {\prime}) \tag {37}
+$$
+
+with terminal condition $Q_{\alpha}^{\mu, \pi}(T, x, u) \equiv 0$ , which can be computed as in Algorithm 2, see also Puterman (2014) for a review.
+
+To achieve convergence of fixed point iterations to approximate equilibria, for previous $\pmb{\mu}^n\in \mathcal{M}$ we compute the action value function $Q_{\alpha}^{\pmb{\mu}_n}$ via Algorithm 2 using approximate equivalence classes
+
+
+Figure 5: Final approximate exploitability mean and its minimum / maximum (shaded region) over the last 10 iterations for various temperatures $\eta$ . We can see convergence for sufficiently high temperatures and choose the lowest temperature such that we still have convergence with low exploitability. Furthermore, compared to the uniformly random policy, our approximate exploitability is significantly lower, indicating a good approximate GMFE. For the Investment-Graphon problem, the approximate exploitability of the uniform policy is not shown, as it is above 30. (a): SIS-Graphon; (b): Investment-Graphon.
+
+
+
+and then define the next policy $\pi^{n + 1} = \hat{\Phi} (\pmb{\mu}^n)$ for every $\alpha \in \mathcal{I}$ via the softmax function
+
+$$
+\pi_ {t} ^ {n + 1, \alpha_ {i}} (u \mid x) = \frac {\exp \left(\frac {Q _ {\alpha_ {i}} ^ {\mu^ {n}} (t , x , u)}{\eta}\right)}{\sum_ {u \in \mathcal {U}} \exp \left(\frac {Q _ {\alpha_ {i}} ^ {\mu^ {n}} (t , x , u)}{\eta}\right)} \tag {38}
+$$
+
+for the closest $\alpha_{i}$ with some temperature $\eta >0$ chosen minimally for convergence.
+
+For choosing the temperature, we evaluate the approximate final exploitability at various temperatures. The results can be seen in Figure 5, where we plot the average, minimum and maximum exploitability over the last 10 iterations of the fixed point learning scheme. The reasoning behind choosing our temperatures as in Table 2 is that we can see no fluctuations (indicating convergence of our learning scheme) together with a low approximate exploitability at the indicated temperatures.
+
+# A.3.3 ADDITIONAL EXPERIMENTS
+
+In Figure 6, we plot investment behavior at quality $x = 0$ as well as expected quality for each $\alpha$ of the approximate equivalence class solution, and similarly in Figure 7 for the PPO solution with sequential Monte Carlo. Here, for each $\alpha$ we averaged quality over all particles within a distance of 0.05 to $\alpha$ . We can see that PPO achieves qualitatively and quantitatively similar behavior, deviating slightly due to the approximate optimality of the PPO algorithm. To be precise, when evaluating exploitability via either solution, we find that the learned policy exploitability remains around $\varepsilon \approx 2$ , compared to $\varepsilon > 30$ for the uniform random policy.
+
+In Figure 8 the equilibrium behavior is shown for the Investment-Graphon problem without softmax policy regularization (except for the ER graphon case), as we find that the problem already converges to a very good equilibrium with low approximate exploitability, see Figure 5. In this problem, we find that the resulting (deterministic without regularization) policy will let agents invest up to a certain quality, after which any further investment is avoided. The agents with higher connectivity will invest up to a lower quality, as they are in competition with more products.
+
+In Figure 9 and 10, we have performed ablations over the number of equivalence classes for the SIS-Graphon problem. As can be observed, the solution obtained by approximate equivalence classes remains stable regardless of the particular number of equivalence classes, showing the stability of discretization approach and supporting Theorem 5.
+
+Finally, in Figure 11 we exemplarily show training results of applying state-of-the-art multi-agent reinforcement learning methods such as multi-agent PPO (MAPPO, Yu et al. (2021)) on the finite-agent system with observed, randomized-per-episode graphon indices and $W$ -random graphs. Here, we use the same hyperparameters as shown in Table 1. As can be seen, due to the non-stationarity of the other agents, a naive application of MARL techniques fails to converge at all.
+
+
+
+
+
+
+
+
+Figure 6: The $M = 100$ approximate equivalence classes solution of Investment-Graphon. We plot the probability of investing at state $x = 0$ (top) together with the evolution of average quality (bottom). (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): ER graphon.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: The probability of investing at state $x = 0$ (top) together with the evolution of average quality (bottom) for PPO. The solution is similar to Figure 6, though slightly different due to the approximations stemming from PPO and sequential Monte Carlo. (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): ER graphon.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Achieved equilibrium via $M = 100$ approximate equivalence classes in Investment-Graphon. Top: Maximum quality $\hat{x}$ up to which agents will invest $(\pi_t^\alpha (I\mid \hat{x}) > 0.5)$ , shown for each $\alpha \in \mathcal{I}, t \in \mathcal{T}$ . Bottom: Expected quality versus time of each agent $\alpha \in \mathcal{I}$ . It can be observed that agents with less connections (higher $\alpha$ ) will invest more. (a): Uniform attachment graphon; (b): Ranked attachment graphon; (c): ER graphon.
+
+
+
+
+
+
+t
+
+
+t
+
+
+t
+
+
+Figure 9: Achieved equilibrium via approximate equivalence classes in SIS-Graphon for the uniform attachment graphon, plotted for each representative $\alpha_{i}\in \mathcal{I}$ . Top: Probability of taking precautions when healthy. Bottom: Probability of being infected. (a): $M = 10$ ; (b): $M = 30$ ; (c): $M = 50$ .
+
+
+
+
+
+
+
+
+
+
+
+
+1
+Figure 10: Achieved equilibrium via approximate equivalence classes in SIS-Graphon for the ranked attachment graphon, plotted for each representative $\alpha_{i}\in \mathcal{I}$ . Top: Probability of taking precautions when healthy. Bottom: Probability of being infected. (a): $M = 10$ ; (b): $M = 20$ ; (c): $M = 30$ .
+
+
++
+
+
+
+
+Figure 11: Learning curve and results for an exemplary straightforward application of multi-agent PPO (MAPPO, Yu et al. (2021)). Left: Sum of expected agent objectives over learning iterations; Right: Final policy probability of taking precautions when healthy.
+
+
\ No newline at end of file
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/images.zip b/learninggraphonmeanfieldgamesandapproximatenashequilibria/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ae6949ac6831156a9a5d7290a7c1015cc941324c
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e46917ddec635a0bd0b6556ef81f80812fc00324284d9ab9e12a99a13970d590
+size 1751149
diff --git a/learninggraphonmeanfieldgamesandapproximatenashequilibria/layout.json b/learninggraphonmeanfieldgamesandapproximatenashequilibria/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb04f26cd9925a05bcd8bdc48e4209d4ed810f10
--- /dev/null
+++ b/learninggraphonmeanfieldgamesandapproximatenashequilibria/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:68d763bedad52d9264b63bfceb731ad06c92c561cba6009536d297ab2afd690e
+size 1569887
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_content_list.json b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..02ab3114859d27067c2a81bedb1e2650d70766b8
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ef77ead61a23c33ed96a47aecc41e9bc7f713df4dc49a8b87024f586afd0db8
+size 229260
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_model.json b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..58b6f1e07a3faa266a7e041851cf87bc0f022772
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b9dda40fb51bc112583aa9f849e5dd4fd97556b3b46069aafe7287a80d0ef3a
+size 255706
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_origin.pdf b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3ad78c6dcce394565de591a6f234481b67fbbe3c
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/8e8a2393-432b-4324-9fe6-e1dec5c01c15_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8610d785c88e0a19a63fed92b1385d7b20ec923733bc1a0f40c858415f891c30
+size 783996
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/full.md b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..fa735693cd7a1656401f2e4440b1c9eb3e6e0f20
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/full.md
@@ -0,0 +1,1384 @@
+# LEARNING GUARANTEES FOR GRAPH CONVOLUTIONAL NETWORKS ON THE STOCHASTIC BLOCK MODEL
+
+Wei Lu
+
+Department of Mathematics
+
+Brandeis University
+
+Waltham, MA 02453, USA
+
+luwei@brandeis.edu
+
+# ABSTRACT
+
+An abundance of neural network models and algorithms for diverse tasks on graphs have been developed in the past five years. However, very few provable guarantees have been available for the performance of graph neural network models. This state of affairs is in contrast with the steady progress on the theoretical underpinnings of traditional dense and convolutional neural networks. In this paper we present the first provable guarantees for one of the best-studied families of graph neural network models, Graph Convolutional Networks (GCNs), for semi-supervised community detection tasks. We show that with high probability over the initialization and training data, a GCN will efficiently learn to detect communities on graphs drawn from a stochastic block model. Our proof relies on a fine-grained analysis of the training dynamics in order to overcome the complexity of a nonconvex optimization landscape with many poorly-performing local minima.
+
+# 1 INTRODUCTION
+
+There is presently a large gap between what can be accomplished in practice using deep learning, and what can be satisfactorily explained and predicted by the theory of deep learning. Nevertheless, the past several years have seen substantial developments in the theory of deep learning (Ge et al., 2017; Brutzkus & Globerson, 2017; Zhang et al., 2019a; Goel et al., 2020; Chen et al., 2020a).
+
+One factor contributing to the gap between the theory and practice of traditional NNs is that real-world data sets tend to have complex structure that is difficult to capture with formal definitions. For example, popular image classification models are capable of memorizing arbitrary data (Zhang et al., 2016), and yet they exhibit astonishing generalization performance on accurately-labeled natural images. Hence, any rigorous proof of the observed generalization performance of deep learning models on image classification tasks will necessarily require assumptions about the data that are sharp enough to separate random inputs from natural images. Because of the difficulty of giving an adequate characterization of real-world data, much of the recent progress in deep learning theory has instead focused on proving results using very simple (e.g. Gaussian) input distributions or in distribution-free settings (Ge et al., 2017; Brutzkus & Globerson, 2017; Zhang et al., 2019a; Vempala & Wilmes, 2019).
+
+Compared to traditional feed-forward (dense, convolutional, etc.) NNs, the theory of graph neural networks (GNNs) is still in its infancy. On the other hand, it appears substantially easier to give plausible descriptions of the combinatorial structure of real-world graph data sets than, e.g., to characterize the distribution of natural images (Drobyshevskiy & Turdakov, 2019). We therefore believe that GNNs offer a natural setting for developing provable guarantees that are able to capture the power of deep learning on real-world datasets. In this paper, we contribute to that goal by giving the first rigorous guarantees of efficient semi-supervised learning of stochastic block models via a GNN.
+
+# 1.1 GRAPH NEURAL NETWORKS
+
+Many natural datasets for diverse machine learning problems have a graph structure, including social networks, molecular structures, and transit networks. In order to efficiently exploit such combinatorial structure, a variety of GNN models have been proposed, tuned for different kinds of tasks. A number of taxonomies of GNN models have been proposed (Zhou et al., 2018; Wu et al., 2021); one of the most essential differences between different GNN models is whether they are meant to label the graph as a whole, or to label individual components of the graph, particularly vertices.
+
+From a theoretical perspective, the best understood tasks for GNNs concern labeling the graph as a whole, for example for the task of classifying a graph by its isomorphism type (Sato, 2020). In particular, it has been established that many GNN models are of comparable power to various versions of the Weisfeiler-Leman hierarchy1 (Xu et al., 2018; Morris et al., 2019).
+
+Some progress has also been made on the theory of GNNs for vertex-labeling tasks. Recent works by Sato et al. describe the representational power of certain GNN models for tasks such as computing minimum vertex covers (Sato et al., 2019). Garg et al. also give bounds on the representational power of GNN models, as well as using Rademacher bounds to estimate the generalization ability of GNNs (Garg et al., 2020).
+
+Our results concern the task of semi-supervised community detection. In this problem, each vertex belongs to one community, and some subset of the vertices are labeled according to their community membership. The task is to classify the community membership of the remaining vertices. This task has been one of the most intensively studied problems in the GNN literature, but there have not yet been any provable guarantees on the performance of proposed models.
+
+We study (spatial-based) graph convolutional models similar to the GCN model proposed in Kipf & Welling (2017). A single layer of such a model computes weights at each node by aggregating the weights at neighboring nodes and applying an activation function with learned parameters, e.g., a linear map followed by a ReLU. Many variations on this theme, including various sophisticated training regimes, have been proposed (Chen et al., 2017; Gao et al., 2018; Li et al., 2018; Zhang et al., 2019b; Chen et al., 2018), but no provable guarantees have been available for the performance of such models on natural data distributions, until the present work.
+
+# 2 MAIN RESULTS
+
+One motivation for GNNs as a target for progress in deep learning theory is that there are well-studied graph distributions that plausibly capture some of the structure of real-world data (Drobyshevskiy & Turdakov, 2019). For example, even fairly simple preferential attachment models plausibly capture some of the essential structure of the web (Kumar et al., 2000). Other graph models naturally capture community structures, the simplest of which is the Stochastic Block Model (SBM) (Holland et al., 1983). A graph is sampled from a SBM by first partitioning vertices into communities (with fixed or random sizes). Two vertices are connected with probability $p$ if they belong to the same community and probability $q$ if they belong to different communities.
+
+In this paper, we consider the case of an SBM with two equal-sized communities in which vertices have label 0 and 1 respectively. We denote the label of vertex $x$ by $\ell(x) \in \{0,1\}$ . The graphs are parameterized as $\mathrm{SBM}(n,p,q)$ where $n$ is the number of vertices, $p$ is the probability of an intra-community connection, and $q$ is the probability of a cross-community connection. We allow $n$ to vary (but will require it to be sufficiently large), while $p$ and $q$ are of the form $p = \frac{a\log^3n}{n}$ and $q = \frac{b\log^3n}{n}$ for some fixed constants $a > b$ . In the semi-supervised setting, the community labels of some portion of the labels are revealed. We assume the label of each vertex is revealed independently with probability $\lambda$ . The input-layer features at a vertex $x$ is $(0,0)$ if its label is not revealed, $(1,0)$ if its label is revealed to be 0, and $(0,1)$ if its label is revealed to be 1.
+
+Assumption 2.1 (Sparse Stochastic Block Model). The probabilities of intra and cross-community connections are $p = \frac{a\log^3n}{n}$ and $q = \frac{b\log^3n}{n}$ , where $a > b$ are constants.
+
+We study the problem of recovering the communities from such graphs using GNN models. Of course, recovering the communities of an SBM graph has been well-studied and its computational complexity is fully understood in most cases (Abbe & Sandon, 2015; Kawamoto et al., 2019). SBM models are therefore a natural test-case for understanding the power of GNN models for learning community structure, and experimental studies have been done in this setting (Chen et al., 2020b; Yadav et al., 2019). (Abbe et al., 2014) shows a sharp threshold in the task of community recovery: $(\sqrt{p} - \sqrt{q})\sqrt{\frac{n}{\log n}} > \sqrt{2}$ . This threshold clearly holds for our case (at sufficiently large values of $n$ ), since $p = \frac{a\log^3n}{n}$ , $q = \frac{b\log^3n}{n}$ and $a > b$ . The contribution here is not to learn the community models. Rather it's showing that (multi-layer) GCNs solve the classification problem, which is very much not trivial (it is non-convex, and the training loss curve is empirically non-monotonic).
+
+Our GNN models will be trained on a graph or several graphs generated by the $\mathrm{SBM}(n,p,q)$ model, and seek to understand their accuracy on arbitrary $\mathrm{SBM}(n,p,q)$ graphs not necessarily in the training set but with the same parameters $a,b$ determining $p$ and $q$ (with $n$ allowed to vary).
+
+In particular, we study spatial-based graph convolutional models along the lines of the Graph Convolutional Networks (GCN) introduced in (Kipf & Welling, 2017). Each layer of the model computes a feature vector at every vertex of an input graph based on features of nearby vertices in the previous layer. A typical layer-wise update rule is of the form
+
+$$
+X ^ {(k + 1)} = \phi \big (\hat {A} X ^ {(k)} W ^ {(k)} \big),
+$$
+
+where
+
+- $\hat{A}$ is a suitably-normalized adjacency matrix of shape $n \times n$ where $n$ is the number of vertices. Usually $\hat{A}$ includes self-loops.
+- $X^{(k)}$ gives the feature vector in the $k$ -th layer at each vertex as a matrix of shape $n \times m_k$ , where $m_k$ is the number of features in layer $k$ .
+- $\phi$ is an activation function, such as the ReLU.
+- $W^{(k)}$ are the trainable weights in the $k$ -th layer, a matrix of shape $m_k \times m_{k+1}$ .
+
+In our version of this model, we define $\hat{A} = \frac{1}{\frac{n}{2}(p + q)}\tilde{A}$ , where $\tilde{A} = A + I$ , $A$ is the adjacency matrix of a given graph, and $I$ is the identity matrix. For the given $\operatorname{SBM}(n,p,q)$ , a randomly selected vertex has $\frac{n}{2}(p + q)$ neighbors in expectation, so $\hat{A}$ is obtained by normalizing each row of $A + I$ with the average size of a neighborhood. Since very deep GCN models seem to provide little empirical benefit (Li et al., 2018), we use a single hidden layer with a softmax output layer. Furthermore, we introduce a bias term $B$ at the second layer. So the model has the following form:
+
+$$
+\begin{array}{l} f (X, A) = \operatorname {s o f t m a x} \left(\hat {A} \phi \left(\hat {A} X W ^ {(0)}\right) W ^ {(1)} + B\right) \\ = \operatorname {s o f t m a x} \left(\frac {4}{n ^ {2} (p + q) ^ {2}} \tilde {A} \phi (\tilde {A} X W ^ {(0)}) W ^ {(1)} + B\right), \tag {1} \\ \end{array}
+$$
+
+where $X$ is the input feature of the graph and $W^{(0)}, W^{(1)}$ and $B$ are trainable parameters. Let $h$ denote the number of hidden features, which equals the number of columns of $W^{(0)}$ and the number of rows of $W^{(1)}$ .
+
+We define the accuracy of the model as the probability of predicting correctly the label of a single vertex in a randomly generated $\mathrm{SBM}(n,p,q)$ graph where the label of each vertex is revealed with probability $\lambda$ . We can now state our main result.
+
+Theorem 2.2. For any $\epsilon >0$ and $\delta >0$ , given a GCN model with $\frac{1}{\delta}\leq h\leq n$ hidden features and with parameters initialized independently from $N(0,1)$ , if training graphs are sampled from $SBM(n,p,q)$ with $n\geq \max (\Omega (\frac{1}{\epsilon})^2,\Omega (\frac{1}{\delta}))$ and the label of each vertex revealed with probability $\lambda$ , and if the model is trained by coordinate descent for $k = O(\log \log \frac{1}{\epsilon})$ epochs, then with probability $\geq 1 - \delta$ , the model achieves accuracy $\geq 1 - 4\epsilon$ .
+
+Remark. We treat $\lambda$ as constants, so it is omitted in the big O and $\Omega$ notation in the sampling and training complexity.
+
+We emphasize that the novelty of this theorem is not in learning two-class SBM models as such; this is a long-solved problem. Instead, this is the first proof of efficient learning for a GCN on semi-supervised community detection tasks using a natural family of random graph models.
+
+# 3 PRELIMINARIES
+
+In this section, we first introduce notations (a table of notations is also shown in the appendix for readers' convenience) and some interpretations. Then we introduce the structure of the paper. Given a vertex $y$ , denote the row of $\tilde{A} X$ corresponding to $y$ as $(t_0^y, t_1^y)$ , so $t_0^y$ and $t_1^y$ give the numbers of neighbors of $y$ (including perhaps $y$ itself) with revealed labels in class 0 and class 1 respectively. Let
+
+$$
+W ^ {(0)} = \left( \begin{array}{c c c} \alpha_ {1} & \alpha_ {2} & \dots \\ \alpha_ {1} ^ {\prime} & \alpha_ {2} ^ {\prime} & \dots \end{array} \right), W ^ {(1)} = \left( \begin{array}{c c} \beta_ {1} & \beta_ {1} ^ {\prime} \\ \beta_ {2} & \beta_ {2} ^ {\prime} \\ \vdots & \vdots \\ \beta_ {h} & \beta_ {h} ^ {\prime} \end{array} \right), B = \left( \begin{array}{c c} b _ {0} & b _ {1} \\ b _ {0} & b _ {1} \\ \vdots & \vdots \\ b _ {0} & b _ {1} \end{array} \right).
+$$
+
+Then $\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y}, 1 \leq i \leq h$ gives $h$ features of vertex $y$ in the hidden layer. The inner product of the $y$ -th row of $\phi(\tilde{A}XW^{(0)})$ and the columns of $W^{(1)}$ gives weighted sums of features of $y: \sum_{i=1}^{h}\beta_{i}\phi(\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ and $\sum_{i=1}^{h}\beta_{i}^{\prime}\phi(\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ , where $\phi$ represents the ReLU function.
+
+Given a vertex $x$ , the row of $\hat{A}\phi(\hat{A}XW^{(0)})W^{(1)}$ corresponding to $x$ is denoted by $(f_0(x), f_1(x))$ and is of the form
+
+$$
+\left(\frac {4}{n ^ {2} (p + q) ^ {2}} \sum_ {y \in G} \mathbb {1} [ y \sim x ] \sum_ {i = 1} ^ {h} \beta_ {i} \phi \left(\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}\right), \frac {4}{n ^ {2} (p + q) ^ {2}} \sum_ {y \in G} \mathbb {1} [ y \sim x ] \sum_ {i = 1} ^ {h} \beta_ {i} ^ {\prime} \phi \left(\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}\right)\right), \tag {2}
+$$
+
+where $\mathbb{1}[y\sim x]$ is equal to 1 if $y$ and $x$ are connected, 0 otherwise. Denote
+
+$$
+f _ {0} ^ {i} (x) := \frac {4 \beta_ {i}}{n ^ {2} (p + q) ^ {2}} \sum_ {y \in G} \mathbb {1} [ y \sim x ] \phi (\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}) f _ {1} ^ {i} (x) := \frac {4 \beta_ {i} ^ {\prime}}{n ^ {2} (p + q) ^ {2}} \sum_ {y \in G} \mathbb {1} [ y \sim x ] \phi (\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}),
+$$
+
+so $f_0(x) = \sum_{i=1}^{h} f_0^i(x)$ and $f_1(x) = \sum_{i=1}^{h} f_1^i(x)$ .
+
+Denote $g_{j}(x) \coloneqq f_{j}(x) + b_{j}, j = 0,1$ , where $(g_0(x), g_1(x))$ represents the logit of the model corresponding to $x$ . Denote $\Delta(x) \coloneqq g_0(x) - g_1(x)$ . In order to make correct predictions, we need $\Delta(x) > 0$ when $\ell(x) = 0$ and $\Delta(x) < 0$ when $\ell(x) = 1$ .
+
+The bias term $B$ is useful in our analysis because its derivative controls how imbalanced the current loss is between the classes. In training we consider the cross-entropy loss denoted as $L$ , and have
+
+$$
+\mathbb {E} [ \frac {\partial L}{\partial b _ {0}} ] = - \mathbb {E} [ \frac {\partial L}{\partial b _ {1}} ] = - \frac {1}{2} (\mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ]),
+$$
+
+where $Z = \frac{\exp(g_{1 - \ell(x)}(x))}{\exp(g_0(x)) + \exp(g_1(x))}$ . $Z$ can be regarded as a measure of wrong prediction: the numerator is the exponential of the output corresponding to the wrong label and the denominator is a normalizer. It is easy to see that $Z > \frac{1}{2}$ if the prediction is wrong; $Z < \frac{1}{2}$ if prediction is correct. When $\left|\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right]\right| \approx 0$ , the model's loss is balanced in the sense of that $\left|\mathbb{E}[Z|\ell (x) = 0] - \mathbb{E}[Z|\ell (x) = 1]\right| \approx 0$ . In order to have balanced performance in every epoch, we train the model through coordinate descent instead of conventional gradient descent. Specifically, in each epoch we first update $b_{0}$ and $b_{1}$ until $\left|\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right]\right|$ is smaller than some threshold. Then we update the other parameters.
+
+In order to make a learning guarantee of the model, we need a high probability estimation of $\Delta(x)$ . In Section 4, we show that $\Delta(x)$ is concentrated at one of two values, denoted by $\mu_0$ and $\mu_1$ , for $\ell(x) = 0$ and 1 respectively. The proof depends on different parameter regimes of hidden neurons. Furthermore, to avoid the overlap between the concentration range of $\Delta(x)$ , we also show the separation between $\mu_0$ and $\mu_1$ . In Section 5, we analyze the dynamics of hidden neurons throughout training to show that the concentration and separation improve at a controlled rate. Based on this information, in Section 6 we prove the main theorem. Section 7 shows some experimental results to verify our theory. The paper ends with future directions in Section 8.
+
+# 4 CONCENTRATION AND SEPARATION OF OUTPUT
+
+In this section we show that $\Delta(x)$ is concentrated at $\mu_0$ and $\mu_1$ and their separation. The difference of the logits is
+
+$$
+\Delta (x) = g _ {0} (x) - g _ {1} (x) = f _ {0} (x) - f _ {1} (x) + b _ {0} - b _ {1} = \sum_ {i = 1} ^ {h} \Delta_ {i} (x) + b _ {0} - b _ {1},
+$$
+
+where
+
+$$
+\Delta_ {i} (x) = f _ {0} ^ {i} (x) - f _ {1} ^ {i} (x) = \frac {4 (\beta_ {i} - \beta_ {i} ^ {\prime})}{n ^ {2} (p + q) ^ {2}} \sum_ {y \in G} \mathbb {1} [ y \sim x ] \phi (\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}).
+$$
+
+For brevity, we write $\Delta (x)$ as $\Delta$ and $\Delta_{i}(x)$ as $\Delta_{i}$ . In order to estimate $\Delta$ , we need to estimate each $\Delta_{i}, 1 \leq i \leq h$ .
+
+We denote the high probability estimate of $\Delta$ as $\mu_0$ and $\mu_{1}$ for $\ell (x) = 0$ and 1 respectively. Our fine-grained analysis of the dynamics of coordinate descent on GCNs relies on a classification of neurons into three families based on the sign and scale of the parameters: "good type", "bad type" and "harmless type". The names also indicate whether the neuron has positive contribution to the value of $\mu_0 - \mu_1$ . We show that "good type" neuron makes positive contribution; the contribution of "bad type" neuron is negative but lower bounded; "harmless type" neuron's contribution is non negative (see Corollary A.4 and the remark following it). We will specifically describe parameter regime of each type in the following subsections. We analyze the dynamics of these types throughout coordinate descent in the next section. First we give some definitions.
+
+Definition 1. For $1 \leq i \leq h$ , we call $(\alpha_{i}, \alpha_{i}^{\prime}, \beta_{i}, \beta_{i}^{\prime})$ the $i$ -th neuron of the model, where $(\alpha_{i}, \alpha_{i}^{\prime})^{\top}$ is the $i$ -th column of $W^{(0)}$ , $(\beta_{i}, \beta_{i}^{\prime})$ is the $i$ -th row of $W^{(1)}$ .
+
+Definition 2. We say that the $i$ -th neuron is order-aligned if $(\alpha_{i} - \alpha_{i}^{\prime})(\beta_{i} - \beta_{i}^{\prime}) > 0$ , otherwise we say it is order-misaligned.
+
+# 4.1 CLASSIFICATION OF NEURON PARAMETER REGIMES
+
+We say the $i$ -th neuron is of "good type" if it satisfies either $(G_{1})$ or $(G_{2})$ below. (There is also the symmetric case obtained by switching $\alpha_{i}$ with $\alpha_{i}^{\prime}$ and $\beta_{i}$ with $\beta_{i}^{\prime}$ . For brevity, we only consider the cases that $\alpha_{i} > \alpha_{i}^{\prime}$ . This applies to the "bad" and "harmless" types below as well). Neurons in this type are order-aligned and both $\alpha_{i}$ and $\alpha_{i}^{\prime}$ are positive or the ratio between $\alpha_{i}$ and $\alpha_{i}^{\prime}$ is large enough.
+
+$$
+\alpha_ {i} > \alpha_ {i} ^ {\prime} > 0 \text {a n d} \beta_ {i} > \beta_ {i} ^ {\prime} \tag {G1}
+$$
+
+$$
+\alpha_ {i} > 0 > \alpha_ {i} ^ {\prime}, \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| > 1 \text {a n d} \beta_ {i} > \beta_ {i} ^ {\prime} \tag {G2}
+$$
+
+We say the $i$ -th neuron is of "bad type" if it satisfies either $(B_1)$ , $(B_2)$ or $(B_3)$ . Neurons in this type are order-misaligned and $\alpha_i, \alpha_i'$ are either both positive or have the opposite signs.
+
+$$
+\alpha_ {i} > \alpha_ {i} ^ {\prime} > 0 \text {a n d} \beta_ {i} < \beta_ {i} ^ {\prime} \tag {B1}
+$$
+
+$$
+\alpha_ {i} > 0 > \alpha_ {i} ^ {\prime}, \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| > \frac {q}{p} \left(1 + \log^ {- \frac {1}{3}} n\right) \text {a n d} \beta_ {i} < \beta_ {i} ^ {\prime} \tag {B2}
+$$
+
+$$
+\alpha_ {i} > 0 > \alpha_ {i} ^ {\prime}, \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| \leq \frac {q}{p} \left(1 + \log^ {- \frac {1}{3}} n\right) \tag {B3}
+$$
+
+We say that the $i$ -th neuron is of "harmless type" if it satisfies either $(H_1)$ or $(H_2)$ :
+
+$$
+\alpha_ {i} > 0 > \alpha_ {i} ^ {\prime}, \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| \in \left(\frac {q}{p} \left(1 + \log^ {- \frac {1}{3}} n\right), 1 \right] \text {a n d} \beta_ {i} > \beta_ {i} ^ {\prime} \tag {H1}
+$$
+
+$$
+\alpha_ {i} \leq 0 \text {a n d} \alpha_ {i} ^ {\prime} \leq 0 \tag {H2}
+$$
+
+# 4.2 CONCENTRATION AND SEPARATION
+
+Theorem 4.1. If the $i$ -th neuron is of "good type" satisfying $(G_1)$ or of "bad type" satisfying $(B_1)$ , then for $\ell(x) = 0$ :
+
+$$
+\begin{array}{l} \mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ (p ^ {2} + q ^ {2}) \alpha_ {i} + 2 p q \alpha_ {i} ^ {\prime} ] \big | \leq \\ (\alpha_ {i} - \alpha_ {i} ^ {\prime}) (\beta_ {i} - \beta_ {i} ^ {\prime}) O (\log^ {- \frac {1}{2}} n) | \ell (x) = 0 ] \geq 1 - O \big (\frac {1}{n ^ {2}} \big), \\ \end{array}
+$$
+
+$$
+f o r \ell (x) = 1:
+$$
+
+$$
+\mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ 2 p q \alpha_ {i} + (p ^ {2} + q ^ {2}) \alpha_ {i} ^ {\prime} ] \big | \leq
+$$
+
+$$
+\left. \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) \mid \ell (x) = 1 \right] \geq 1 - O \left(\frac {1}{n ^ {2}}\right).
+$$
+
+Similar concentration hold for neurons satisfying $(G_{2})$ , $(B_{2})$ and $(B_{3})$ , and for neurons of "harmless type."
+
+We apply the method of bounded differences to show the concentration. The details are shown in the appendix.
+
+Given the concentration of $\Delta_{i}$ for each type of neurons, we estimate the concentration of the output $\Delta = \sum_{i=1}^{h} \Delta_{i} + b_{0} - b_{1}$ . For the $i$ -th neuron, we denote the high-probability estimate of $\Delta_{i}$ given in the statement of Theorem 4.1 as $m_{0}^{i}$ when $\ell(x) = 0$ and $m_{1}^{i}$ when $\ell(x) = 1$ . By union bound, we have the following corollary.
+
+Corollary 4.2. Given a vertex $x \in G$ with label unrevealed, we have
+
+$$
+\mathbb {P} [ | \Delta - \mu_ {j} | \leq \delta | \ell (x) = j ] \geq 1 - O (\frac {1}{n}), \tag {3}
+$$
+
+where
+
+$$
+\mu_ {j} = \left(\sum_ {i = 1} ^ {h} m _ {j} ^ {i}\right) + b _ {0} - b _ {1}, j = 0, 1 \quad \delta = \sum_ {i = 1} ^ {h} \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| O \left(\log^ {- \frac {1}{2}} n\right).
+$$
+
+For any $\epsilon > 0$ , we require the probability of concentration in (3) to be at least $1 - \tilde{\epsilon}$ , where $\tilde{\epsilon} = o(\epsilon)$ . If we choose $\tilde{\epsilon} = \epsilon^2$ , then we set $1 - O\left(\frac{1}{n}\right) \geq 1 - \epsilon^2$ , i.e. $n \geq \Omega\left(\frac{1}{\epsilon}\right)^2$ . Our following analysis will be based on this condition.
+
+From Theorem 4.1, we have the following result about the value of $m_0^i - m_1^i$ .
+
+Corollary 4.3. If the $i$ -th neuron is of "good type" and satisfies $(G_1)$ , then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | \left(\frac {p - q}{p + q}\right) ^ {2}.
+$$
+
+- If the $i$ -th neuron is of "bad type" and satisfies $(B_1)$ , then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} = - \lambda | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | \left(\frac {p - q}{p + q}\right) ^ {2}.
+$$
+
+- If the $i$ -th neuron is of "harmless type" and satisfies $(H_1)$ , then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda | \beta_ {i} - \beta_ {i} ^ {\prime} | | p \alpha_ {i} + q \alpha_ {i} ^ {\prime} | \frac {p - q}{(p + q) ^ {2}}.
+$$
+
+Similar results for neurons satisfying $(G_{2}),(B_{2}),(B_{3})$ and $(H_{1})$ are stated in the appendix, along with the proof.
+
+Remark. As we can see from Corollary 4.3, the value of $m_0^i - m_1^i$ is positive for "good type" neurons, non-negative for "harmless type" neurons and may be negative (but lower bounded) for "bad type" neurons. Since positive values of $m_0^i - m_1^i$ decrease the loss of the model, this explains the names for the types of neurons.
+
+- $m_0^i - m_1^i$ is proportional to $|\alpha_i - \alpha_i'| |\beta_i - \beta_i'|$ . In the next section, we analyze the dynamics of the parameters $\alpha_i, \alpha_i', \beta_i, \beta_i'$ . Using our understanding of these dynamics, in Theorem 6.2 we present a refined result about the separation of output which only depends on the initialization of parameters.
+
+- Let $c \coloneqq \mu_0 - \mu_1 = \sum_{i=1}^{h} (m_0^i - m_1^i)$ . By the two corollaries above, we have $\delta = o(|c|)$ . The balanced loss guaranteed by the bias term and the coordinate descent scheme ensure that $\mu_0 = \Omega(c)$ and $\mu_1 = \Omega(c)$ . It then follows that if the loss is sufficiently small, both $\mu_0$ and $\mu_1$ have correct sign, i.e. $\mu_0 > 0 > \mu_1$ . (Otherwise, due to concentration of the output, the model makes wrong prediction and the loss is large). So we will eventually have $\delta = o(\mu_0)$ and $\delta = o(|\mu_1|)$ .
+
+# 5 DYNAMICS OF PARAMETERS
+
+In this section, we describe the dynamics of each type of neurons through coordinate descent, which can be visualized in the following figure in which the arrows indicate movement between types that can happen with non-negligible probability.
+
+
+Figure 1: Dynamics of hidden neurons
+
+There are two noteworthy points from this figure. First, "good type" parameters are preserved under coordinate descent. Second, there are no arrows coming into "bad type" except from itself.
+
+These dynamics are proved by estimating the gradient with respect to the loss function for each type of neuron. Because of the non-linearity of the activation, we rely heavily on the concentration result proved above to get tight estimates. Without these concentration results, even estimating the sign of the gradient seems difficult. The proof and experiments about the dynamics of hidden neurons are deferred to the appendix.
+
+# 6 LEARNING GUARANTEE
+
+In this section, we prove our main result which states that with high probability a trained GCN can detect communities in SBM with any desired accuracy. The proof is based on the following theorem which shows that if $\mu_0$ and $\mu_{1}$ are separated enough, then the model achieves high accuracy.
+
+Theorem 6.1. $\forall \epsilon >0$ , provided that the difference between $\mu_0$ and $\mu_{1}$ is large enough: $\sigma (-\frac{\mu_0 - \mu_1}{2}) < \frac{\epsilon}{2}$ , if $|\mathbb{E}[\frac{\partial L}{\partial b_0} ]| < \frac{\epsilon}{4}$ , then $\mathbb{P}[\Delta < 0|\ell (x) = 0] < 4\epsilon ,\mathbb{P}[\Delta >0|\ell (x) = 1] < 4\epsilon ,$ where $\sigma (x)\coloneqq 1 / (1 + \exp (-x))$ represents the sigmoid function.
+
+Next we show that the model can achieve such separation between $\mu_0$ and $\mu_{1}$ through coordinate descent. In order to make constant update of parameters at every epoch, we set an adaptive learning rate $\eta_{k} = \frac{1}{\mathbb{E}[Z^{(k)}]}$ where $Z^{(k)}$ is the value of $Z$ at the $k$ -th epoch. We first refine Corollary 4.3 about the separation of output for each type of neuron ( $m_0^i - m_1^i$ ) using the dynamics of parameters.
+
+Theorem 6.2 (separation of output). Let $m_0^i$ and $m_1^i$ be defined as in Section 4, train the model for $k$ epochs by the defined coordinate descent with adaptive learning rate $\eta_k = \frac{1}{\mathbb{E}[Z^{(k)}]}$ ,
+
+- if the $i$ -th neuron is of "good type", then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} \geq A _ {i} ^ {(0)} B _ {i} ^ {(0)} \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \left(1 + \frac {\sqrt {2} \lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2}\right) ^ {2 k}
+$$
+
+- if the $i$ -th neuron is of "bad type", then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} \geq - k \big (\big (A _ {i} ^ {(0)} \big) ^ {2} + \big (B _ {i} ^ {(0)} \big) ^ {2} \big) \frac {\lambda p (p - q)}{(p + q) ^ {2}},
+$$
+
+- if the $i$ -th neuron is of "harmless type", then
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} \geq 0,
+$$
+
+where $A_{i}^{(0)} = \alpha_{i}^{(0)} - \alpha_{i}^{\prime (0)},B_{i}^{(0)} = \beta_{i}^{(0)} - \beta_{i}^{\prime (0)}$
+
+Next we present a result about initialization, which shows that with high probability, there are enough "good type" neurons and parameters have appropriate scale.
+
+Lemma 6.3. Suppose all parameters in $W^{(0)}$ and $W^{(1)}$ are initialized independently following standard normal distribution. Then the number $h_g$ of neurons initialized as "good type" satisfies $\mathbb{P}[h_g \geq \frac{h}{8}] \geq 1 - \exp\left(-\frac{h}{64}\right)$ . Furthermore,
+
+$$
+\mathbb{P}[\sum_{i = 1}^{h}(\alpha_{i} - \alpha_{i}^{\prime})^{2} + (\beta_{i} - \beta_{i}^{\prime})^{2}\leq 5h]\geq 1 - O\big(\frac{1}{h}\big),\qquad \mathbb{P}[\sum_{\substack{i - thneuron\\ initializedas\\ "good type}}|\alpha_{i} - \alpha_{i}^{\prime}||\beta_{i} - \beta_{i}^{\prime}|\geq \frac{h}{80} ]\geq 1 - O\big(\frac{1}{h}\big).
+$$
+
+Now we can prove the final result.
+
+Proof of Theorem 2.2. First we show that if the loss $\mathbb{E}[Z]$ is small enough, the model achieves desired accuracy. Indeed, if $\mathbb{E}[Z] < 2\epsilon$ , since
+
+$\mathbb{E}[Z] = \mathbb{E}[Z|\mathrm{pred~is~wrong}]\mathbb{P}[\mathrm{pred~is~wrong}] + \mathbb{E}[Z|\mathrm{pred~is~correct}]\mathbb{P}[\mathrm{pred~is~correct}] \geq \frac{1}{2}\mathbb{P}[\mathrm{pred~is~wrong}],$ we have $\mathbb{P}[\mathrm{pred~is~wrong}] \leq 4\epsilon$ , i.e., $\mathbb{P}[\mathrm{pred~is~correct}] > 1 - 4\epsilon$ .
+
+Otherwise, $\mathbb{E}[Z] \geq 2\epsilon$ , since $\mathbb{E}[Z] = \frac{1}{2} (\mathbb{E}[Z|\ell(z) = 0] + \mathbb{E}[Z|\ell(z) = 1])$ , we have $\mathbb{E}[Z|\ell(z) = 0] + \mathbb{E}[Z|\ell(z) = 1] \geq 4\epsilon$ . On the other hand, $|\mathbb{E}[\frac{\partial L}{\partial b_0}]| < \epsilon$ implies that $|\mathbb{E}[Z|\ell(z) = 0] - \mathbb{E}[Z|\ell(z) = 1]| < 2\epsilon$ .
+
+By Theorem 6.2,
+
+$$
+\begin{array}{l} \mu_ {0} - \mu_ {1} = \sum_ {i = 1} ^ {h} (m _ {0} ^ {i} - m _ {1} ^ {i}) = \sum_ {i \in “ \mathrm {g o o d}"} (m _ {0} ^ {i} - m _ {1} ^ {i}) + \sum_ {i \in “ \mathrm {b a d}"} (m _ {0} ^ {i} - m _ {1} ^ {i}) + \sum_ {i \in “ \mathrm {h a r m l e s s}"} (m _ {0} ^ {i} - m _ {1} ^ {i}) \\ \geq \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \left(1 + \frac {\sqrt {2} \lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2}\right) ^ {2 k} \sum_ {i \in “ \mathrm {g o o d} ”} A _ {i} ^ {(0)} B _ {i} ^ {(0)} - k \frac {\lambda p (p - q)}{(p + q) ^ {2}} \sum_ {i \in “ \mathrm {b a d} ”} \left(\left(A _ {i} ^ {(0)}\right) ^ {2} + \left(B _ {i} ^ {(0)}\right) ^ {2}\right). \\ \end{array}
+$$
+
+By Lemma 6.3, with probability $\geq 1 - O\left(\frac{1}{h}\right)$
+
+$$
+\sum_ {i \in “ \text {g o o d} ”} A _ {i} ^ {(0)} B _ {i} ^ {(0)} \geq \frac {h}{8 0}, \quad \sum_ {i \in “ \text {b a d} ”} \left(\left(A _ {i} ^ {(0)}\right) ^ {2} + \left(B _ {i} ^ {(0)}\right) ^ {2}\right) \leq 5 h.
+$$
+
+Since $h \geq \frac{1}{\delta}$ , then with probability $\geq 1 - \delta$
+
+$$
+\begin{array}{l} \mu_ {0} - \mu_ {1} \geq h \left(\frac {\lambda}{1 6 0} \left(\frac {p - q}{p + q}\right) ^ {2} \left(1 + \frac {\sqrt {2} \lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2}\right) ^ {2 k} - k \frac {5 \lambda p (p - q)}{(p + q) ^ {2}}\right) \\ \geq h \left(C _ {1} \left(1 + C _ {2}\right) ^ {2 k} - C _ {3} k\right), \tag {4} \\ \end{array}
+$$
+
+where $C_1, C_2$ and $C_3$ are constants determined by $p, q$ and $\lambda$ .
+
+By Theorem 6.1, if $(4) \geq 2\log \frac{2}{\epsilon}$ (then $\sigma\left(-\frac{\mu_0 - \mu_1}{2}\right) \leq \frac{\epsilon}{2}$ ), then the model achieves accuracy $\geq 1 - 4\epsilon$ . It's sufficient to have
+
+$$
+C _ {1} (1 + C _ {2}) ^ {2 k} - C _ {3} k \geq 2 \log \frac {2}{\epsilon},
+$$
+
+i.e. $k = O(\log \log \frac{1}{\epsilon})$ .
+
+# 7 EXPERIMENTS
+
+We show some experiments verifying Theorem 2.2. In particular, our experiments demonstrate that accuracy increases with $n$ , the probability of high-accuracy models increases with $h$ , and coordinate descent is able to recovery high-accuracy models in the sparse regime of Assumption 2.1. Additional plots demonstrating the dynamics of hidden neurons with their ratios and differences can be seen in the appendix.
+
+Experiment 1 In this experiment, we plot the an estimate of the accuracy versus epoch for varying $n$ . The parameters $p, q$ of SBM follow Assumption 2.1, where we choose $a = 1.0$ and $b = 0.7$ . We set $h = 20, \lambda = 0.3$ and run 40 independent experiments for $n = 250, 500$ and 1000 respectively. In each experiment we train the model for 100 epochs. The training set has 40 randomly generated graphs from $\mathrm{SBM}(n, p, q)$ . We validate the performance by the percentage of correct predictions on 200 random vertices, each from a randomly generated graph. The result is shown in Figure 2. The shaded region for each $n$ is obtained from the max, min and mean percentage of the 40 experiments. The result verifies Theorem 2.2 which shows that the accuracy of the model increases with $n$ .
+
+Experiment 2 In this experiment, we show the effect of the number of hidden neurons $h$ . The parameters of SBM are the same as Experiment 1. We set $h = 2,5,20$ . For each pair of $(n,h)$ we run 40 independent experiments and show the distribution of validation in Figure 3. From the top row to the bottom, $n$ increases from 250 to 1000. From the left column to the right, $h$ increases from 2 to 20. In each plot, the x-axis represents the accuracy, while y-axis represents the count of experiments. According to Theorem 2.2, the probability of achieving high accuracy is $1 - O(1 / h)$ and the accuracy increases with $n$ . We can see that in each row of Figure 3, as $h$ increases, we have larger probability to achieve high accuracy; in each column, as $n$ increases, the model achieves higher accuracy. The results verify our theory in the paper.
+
+# 8 FUTURE DIRECTIONS
+
+Graph neural networks offer a promising setting for progress on the more general theory of deep learning, because random graph models more plausibly capture the structure of real-world data
+
+compared to, e.g., the Gaussian inputs often used to prove deep learning guarantees for traditional feed-forward neural networks. This paper has initiated the project of proving training guarantees for semi-supervised learning using GCNs on SBM models, but much more work remains to be done. Arguably the sparsest SBM models (expected constant degree) are the most compelling from the perspective of modeling real-world communities, so it would be interesting to extend these results to that setting. Models with more than two blocks, or overlapping communities (Petti & Vempala, 2018) would be even closer to real-world structure. We hope this initial step spurs further interest in provable guarantees for training neural networks using plausible models of real-world data as the input distribution.
+
+# 9 ACKNOWLEDGEMENT
+
+This research was supported in part by NSF Grant 1849796. The author would like to thank Prof. John Wilmes for guiding the research, and also thank Prof. Tyler Maunu and Prof. Pengyu Hong for making the results more generalized and designing the experiments.
+
+
+
+
+Figure 2: Display of accuracy versus epoch for varying $n$ . Accuracy is computed on vertices drawn from random SBM graphs. The accuracy increases with epoch, and we also see that the lower bound on the accuracy increases with $n$ , as expected from our theory.
+
+
+
+
+Figure 3: Display of accuracy for varying $n$ and $h$ . For each row, $n$ is set to be 250 (top), 500 (middle), 1000 (bottom); for each column, $h$ is set to be 2 (left), 5 (middle), 20 (right). Probability of failure decreases as $h$ increases, and accuracy increases with $n$ .
+
+and to prove deep learning guarantees for traditional initiated the project of proving training guarantees for models, but much more work remains to be done. (constant degree) are the most compelling from the 1s, so it would be interesting to extend these results 1ks, or overlapping communities (Petti & Vempala, 3e. We hope this initial step spurs further interest in 1s using plausible models of real-world data as the
+
+# REFERENCES
+
+Emmanuel Abbe and Colin Sandon. Recovering communities in the general stochastic block model without knowing the parameters. arXiv preprint arXiv:1506.03729, 2015.
+Emmanuel Abbe, Afonso S. Bandeira, and Georgina Hall. Exact recovery in the stochastic block model, 2014.
+Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. In International conference on machine learning, pp. 605-614. PMLR, 2017.
+Jianfei Chen, Jun Zhu, and Le Song. Stochastic training of graph convolutional networks with variance reduction. arXiv preprint arXiv:1710.10568, 2017.
+Jie Chen, Tengfei Ma, and Cao Xiao. Fastgen: fast learning with graph convolutional networks via importance sampling. arXiv preprint arXiv:1801.10247, 2018.
+Sitan Chen, Adam R. Klivans, and Raghu Meka. Learning deep relu networks is fixed-parameter tractable, 2020a.
+Zhengdao Chen, Xiang Li, and Joan Bruna. Supervised community detection with line graph neural networks, 2020b.
+Mikhail Drobyshevskiy and Denis Turdakov. Random graph modeling: A survey of the concepts. ACM Comput. Surv., 52(6):1-36, December 2019.
+D.P. Dubhashi and A. Panconesi. Concentration of Measure for the Analysis of Randomized Algorithms. Cambridge University Press, 2009. ISBN 9781139480994. URL https://books.google.com/books?id=UUohAwAAQBAJ.
+Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1416-1424, 2018.
+Vikas Garg, Stefanie Jegelka, and Tommi Jaakkola. Generalization and representational limits of graph neural networks. In International Conference on Machine Learning, pp. 3419-3430. PMLR, 2020.
+Rong Ge, Jason D. Lee, and Tengyu Ma. Learning one-hidden-layer neural networks with landscape design. CoRR, abs/1711.00501, 2017.
+Surbhi Goel, Aravind Gollakota, Zhihan Jin, Sushrut Karmalkar, and Adam Klivans. Superpolynomial lower bounds for learning one-layer neural networks using gradient descent. In International Conference on Machine Learning, pp. 3587-3596. PMLR, 2020.
+Paul W Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social networks, 5(2):109-137, 1983.
+Tatsuro Kawamoto, Masashi Tsubaki, and Tomoyuki Obuchi. Mean-field theory of graph neural networks in graph partitioning. Journal of Statistical Mechanics: Theory and Experiment, 2019(12): 124007, dec 2019. doi: 10.1088/1742-5468/ab3456. URL https://doi.org/10.1088/1742-5468/ab3456.
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks, 2017.
+R. Kumar, P. Raghavan, S. Rajagopalan, D. Sivakumar, A. Tomkins, and E. Upfal. Stochastic models for the web graph. In Proceedings 41st Annual Symposium on Foundations of Computer Science, pp. 57-65, 2000. doi: 10.1109/SFCS.2000.892065.
+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.
+
+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, pp. 4602-4609, 2019.
+Samantha Petti and Santosh S. Vempala. Approximating sparse graphs: The random overlapping communities model, 2018.
+Ryoma Sato. A survey on the expressive power of graph neural networks, 2020.
+Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Approximation ratios of graph neural networks for combinatorial problems. arXiv preprint arXiv:1905.10261, 2019.
+Santosh Vempala and John Wilmes. Gradient descent for one-hidden-layer neural networks: Polynomial convergence and sq lower bounds. In Conference on Learning Theory, pp. 3115-3117. PMLR, 2019.
+Z. Wu, S. Pan, F. Chen, G. Long, C. Zhang, and P. S. Yu. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 32(1):4-24, 2021.
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
+Prateek Yadav, Madhav Nimishakavi, Naganand Yadati, Shikhar Vashishth, Arun Rajkumar, and Partha Talukdar. Lovasz convolutional networks. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 1978-1987. PMLR, 2019.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
+Xiao Zhang, Yaodong Yu, Lingxiao Wang, and Quanquan Gu. Learning one-hidden-layer relu networks via gradient descent. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 1524-1534. PMLR, 2019a.
+Yingxue Zhang, Soumyasundar Pal, Mark Coates, and Deniz Ustebay. Bayesian graph convolutional neural networks for semi-supervised classification. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01):5829-5836, 2019b.
+Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
+
+# A CONCENTRATION AND SEPARATION OF OUTPUT
+
+Let $N(x,0), N(x,1)$ denote the neighborhood of vertex $x$ with label 0 and 1 respectively, i.e. $N(x,0) = \{y \in G, y \sim x, \ell(y) = 0\}$ , $N(x,1) = \{y \in G, y \sim x, \ell(y) = 1\}$ . By the definition of SBM, both $|N(x,0)|$ and $|N(x,1)|$ are binomial random variables. For $\ell(x) = 0$ , $|N(x,0)| \sim B(\frac{n}{2}, p)$ , $|N(x,1)| \sim B(\frac{n}{2}, q)$ and for $\ell(x) = 1$ , $|N(x,0)| \sim B(\frac{n}{2}, q)$ , $|N(x,1)| \sim B(\frac{n}{2}, p)$ . Moreover, $t_0^y$ and $t_1^y$ are also binomial random variables, for $\ell(y) = 0$ , $t_0^y \sim B(\frac{n\lambda}{2}, p)$ , $t_1^y \sim B(\frac{n\lambda}{2}, q)$ , similarly for $\ell(y) = 1$ . Our following analysis is based on the condition that $|N(x,0)|$ , $|N(x,1)|$ , $t_0^x$ and $t_1^x$ are in their high probability range for all $x \in G$ . Specifically we require the condition that for all $\ell(x) = 0$ , (similar conditions for $\ell(x) = 1$ are omitted):
+
+$$
+\left| \left| N (x, 0) \right| - \frac {n p}{2} \right| \leq O (n p) ^ {\frac {5}{6}}, \left| \left| N (x, 1) \right| - \frac {n q}{2} \right| \leq O (n q) ^ {\frac {5}{6}}; \tag {Cond}
+$$
+
+$$
+\left| t _ {0} ^ {x} - \frac {n \lambda p}{2} \right| \leq O (n p) ^ {\frac {5}{6}}, \left| t _ {1} ^ {x} - \frac {n \lambda q}{2} \right| \leq O (n q) ^ {\frac {5}{6}}.
+$$
+
+By tail bound of binomial random variables and union bound, we have
+
+$$
+\mathbb {P} [ (C o n d) ] \geq 1 - \frac {1}{n ^ {2}}.
+$$
+
+Under this condition, we show the concentration of $\Delta_{i}$ for each type.
+
+# A.1 "GOOD TYPE" NEURONS
+
+For convenience, according to the activation pattern of $\phi (\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ , we further divide $(G_{2})$ into subcases $(G_{2,1})$ , $(G_{2,2})$ and $(G_{2,3})$ by the ratio of $\left|\frac{\alpha_i}{\alpha_i'}\right|$ . For example, in $(G_{1})$ and $(G_{2,1})$ , $\phi (\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ is active for both $\ell (y) = 0$ and $\ell (y) = 1$ ; in $(G_{2,1})$ , it is only active for $\ell (y) = 0$ .
+
+$$
+\left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| > \frac {p}{q} \left(1 + \log^ {- \frac {1}{3}} n\right) \tag {G2,1}
+$$
+
+$$
+1 < \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| < \frac {p}{q} \left(1 - \log^ {- \frac {1}{3}} n\right) \tag {G2,2}
+$$
+
+$$
+\frac {p}{q} \left(1 - \log^ {- \frac {1}{3}} n\right) \leq \left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| \leq \frac {p}{q} \left(1 + \log^ {- \frac {1}{3}} n\right) \tag {G2,3}
+$$
+
+We have the following estimation of $\Delta_{i}$ in "good type".
+
+Theorem A.1 (concentration of output from "good type" neurons). If the $i$ -th neuron is of "good type", then
+
+- in both $(G_{1})$ and $(G_{2,1})$ :
+
+$$
+\begin{array}{l} \mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ (p ^ {2} + q ^ {2}) \alpha_ {i} + 2 p q \alpha_ {i} ^ {\prime} ] \big | \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) (\beta_ {i} - \beta_ {i} ^ {\prime}) O (\log^ {- \frac {1}{2}} n) | \ell (x) = 0 \big ] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ 2 p q \alpha_ {i} + (p ^ {2} + q ^ {2}) \alpha_ {i} ^ {\prime} ] \big | \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) (\beta_ {i} - \beta_ {i} ^ {\prime}) O (\log^ {- \frac {1}{2}} n) | \ell (x) = 1 \big ] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+- in $(G_{2,2})$ :
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) p}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 0 \right] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) q}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 1 \right] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+in $(G_{2,3})$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) p}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 0 \right] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) q}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 1 \right] \\ \geq 1 - O (\frac {1}{n ^ {2}}). \\ \end{array}
+$$
+
+Proof. We have $\Delta_{i} = (\beta_{i} - \beta_{i}^{\prime})\sum_{y\in G}\mathbb{1}[y\sim x]\frac{4\phi(\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})}{n^{2}(p + q)^{2}}$ . We apply the method of averaged bounded difference (Dubhashi & Panconesi, 2009) to estimate $\Delta_{i}$ . In different parameter regimes, $\phi (\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ has different activation patterns.
+
+In $(G_{1})$ and $(G_{2,1})$ , $\phi (\alpha_{i}t_{0}^{y} + \alpha_{i}^{\prime}t_{1}^{y})$ is active with probability $1 - O\left(\frac{1}{n^{2}}\right)$ for both $\ell (y) = 0$ and $\ell (y) = 1$ . For $\ell (x) = 0$ , at first we estimate $\mathbb{E}[\Delta_i]$ . By condition (Cond):
+
+$$
+\left| \mathbb {E} [ \Delta_ {i} ] - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right)}{(p + q) ^ {2}} [ (p ^ {2} + q ^ {2}) \alpha_ {i} + 2 p q \alpha_ {i} ^ {\prime} ] \right| \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) (\beta_ {i} - \beta_ {i} ^ {\prime}) O (\log^ {- 1} n).
+$$
+
+Let $Y_{j} = \frac{4\phi(\alpha_{i}t_{0}^{y_{j}} + \alpha_{i}^{\prime}t_{1}^{y_{j}})}{n^{2}(p + q)^{2}}$ , then $\Delta_{i} = (\beta_{i} - \beta_{i}^{\prime})\sum_{j}Y_{j}$ . Based on condition (Cond), $|Y_{j} - \frac{2\lambda(p\alpha_{i} + q\alpha_{i}^{\prime})}{n(p + q)^{2}}|\leq (\alpha_{i} - \alpha_{i}^{\prime})O(\log^{-\frac{7}{2}}n)$ for $\ell (y_j) = 0$ . For any $a_{k},a_{k}^{\prime}$
+
+$$
+\left| \mathbb {E} [ Y _ {k} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ] - \mathbb {E} [ Y _ {k} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ^ {\prime} ] \right| \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) O \left(\log^ {- \frac {7}{2}} n\right).
+$$
+
+Moreover, when the number of vertices with revealed labels are fixed,
+
+$$
+\left| \mathbb {E} [ Y _ {j} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ] - \mathbb {E} [ Y _ {j} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ^ {\prime} ] \right| \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) O \left(\log^ {- 6} n\right),
+$$
+
+for $j \geq k$ . By condition (Cond), there are at most $O(\log^3 n)$ non-zero terms for $Y_k, 1 \leq k \leq n$ . So
+
+$$
+\left| \mathbb {E} \left[ \sum_ {j} Y _ {j} \mid Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} \right] - \mathbb {E} \left[ \sum_ {j} Y _ {j} \mid Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ^ {\prime} \right] \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {7}{2}} n\right),
+$$
+
+for $1 \leq k \leq n$ . By the method of averaged bounded difference, we have
+
+$$
+\mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ (p ^ {2} + q ^ {2}) \alpha_ {i} + 2 p q \alpha_ {i} ^ {\prime} ] \big | \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) (\beta_ {i} - \beta_ {i} ^ {\prime}) O (\log n) ^ {- \frac {1}{2}} | \ell (x) = 0 \big ] \geq 1 - O (\frac {1}{n ^ {2}}).
+$$
+
+Other regimes can be proved similarly.
+
+
+
+# A.2 "BAD TYPE" NEURONS
+
+For convenience of our analysis, we further divide $(B_{2})$ into subcases $(B_{2,1})$ , $(B_{2,2})$ and $(B_{2,3})$ according to the ratio of $\left|\frac{\alpha_i}{\alpha_i'}\right|$
+
+$$
+\left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| > \frac {p}{q} \left(1 + \log^ {- \frac {1}{3}} n\right) \tag {B2,1}
+$$
+
+$$
+\left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| \in \left(\frac {q}{p} \left(1 + \log^ {- \frac {1}{3}} n\right), \frac {p}{q} \left(1 - \log^ {- \frac {1}{3}} n\right) \right] \tag {B2,2}
+$$
+
+$$
+\left| \frac {\alpha_ {i}}{\alpha_ {i} ^ {\prime}} \right| \in \left(\frac {p}{q} \left(1 - \log^ {- \frac {1}{3}} n\right), \frac {p}{q} \left(1 + \log^ {- \frac {1}{3}} n\right) \right] \tag {B2,3}
+$$
+
+We have the following estimation of $\Delta_{i}$ in "bad type".
+
+Theorem A.2 (concentration of output from "bad type" neurons). If the $i$ -th neuron is of "bad type", we have:
+
+- in $(B_{1})$ and $(B_{2,1})$ :
+
+$$
+\begin{array}{l} \mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ (p ^ {2} + q ^ {2}) \alpha_ {i} + 2 p q \alpha_ {i} ^ {\prime} ] \big | \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | O (\log^ {- \frac {1}{2}} n) | \ell (x) = 0 \big ] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \big [ \big | \Delta_ {i} - \frac {\lambda (\beta_ {i} - \beta_ {i} ^ {\prime})}{(p + q) ^ {2}} [ 2 p q \alpha_ {i} + (p ^ {2} + q ^ {2}) \alpha_ {i} ^ {\prime} ] \big | \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | O (\log^ {- \frac {1}{2}} n) | \ell (x) = 1 ] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+- in $(B_{2,2})$ :
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) p}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| O \left(\log^ {- \frac {1}{2}} n\right) \mid \ell (x) = 0 \right] \\ \geq 1 - O \left(\frac {1}{n ^ {2}}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) q}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 1 \right] \\ \geq 1 - O (\frac {1}{n ^ {2}}) \\ \end{array}
+$$
+
+- in $(B_{2,3})$ :
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) p}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| O \left(\log^ {- \frac {1}{2}} n\right) \mid \ell (x) = 0 \right] \\ \geq 1 - O \left(\frac {1}{n ^ {2}}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) q}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 1 \right] \\ \geq 1 - O \left(\frac {1}{n ^ {2}}\right). \\ \end{array}
+$$
+
+- in $(B_3)$ :
+
+$$
+\mathbb {P} \big [ \big | \Delta_ {i} \big | \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | O (\log^ {- \frac {1}{2}} n) | \ell (x) = 0 o r 1 ] \geq 1 - O (\frac {1}{n ^ {2}}).
+$$
+
+Proof. The proof is similar as Theorem A.1.
+
+
+
+# A.3 "HARMLESS TYPE" NEURONS
+
+We have the following estimation of $\Delta_{i}$ in "harmless type".
+
+Theorem A.3 (concentration of output from "harmless type" neurons). If the $i$ -th neuron is of "harmless type", we have:
+
+- in $(H_1)$ :
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) p}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 0 \right] \\ \geq 1 - O \left(\frac {1}{n ^ {2}}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {P} \left[ \left| \Delta_ {i} - \frac {\lambda \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) q}{(p + q) ^ {2}} \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right) \right| \leq \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) O \left(\log^ {- \frac {1}{2}} n\right) | \ell (x) = 1 \right] \\ \geq 1 - O \left(\frac {1}{n ^ {2}}\right) \\ \end{array}
+$$
+
+- in $(H_2)$ : $\Delta_i = 0$ for both $\ell(x) = 0$ and $1$ .
+
+# A.4 SEPARATION OF OUTPUT
+
+Previous subsections have shown the concentration of $\Delta_{i}$ for each type of neurons. For the $i$ -th neuron, we write the concentrated value as $m_0^i$ if $\ell(x) = 0$ and $m_1^i$ if $\ell(x) = 1$ . From Theorem A.1, A.2 and A.3, we have the following result about the value of $m_0^i - m_1^i$ by straightforward computation.
+
+Corollary A.4. We have the following result about $m_0^i - m_1^i$ for $1 \leq i \leq h$ :
+
+- if the $i$ -th neuron is of "good type":
+
+$$
+i n \left(G _ {1}\right) a n d \left(G _ {2, 1}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \left(\frac {p - q}{p + q}\right) ^ {2}
+$$
+
+$$
+\begin{array}{l} i n \left(G _ {2, 2}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda | \beta_ {i} - \beta_ {i} ^ {\prime} | | p \alpha_ {i} + q \alpha_ {i} ^ {\prime} | \frac {p - q}{(p + q) ^ {2}} \\ \geq \frac {\lambda}{2} | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | \left(\frac {p - q}{p + q}\right) ^ {2} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} i n \left(G _ {2, 3}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda | \beta_ {i} - \beta_ {i} ^ {\prime} | | p \alpha_ {i} + q \alpha_ {i} ^ {\prime} | \frac {p - q}{(p + q) ^ {2}} \\ \geq \lambda | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | \frac {(p - q) \Lambda_ {3}}{(p + q) ^ {2}}, \\ \end{array}
+$$
+
+$$
+w h e r e \Lambda_ {3} = \frac {(1 - \log^ {- \frac {1}{3}} n) p ^ {2} - q ^ {2}}{(1 - \log^ {- \frac {1}{3}} n) p + q}.
+$$
+
+- if the $i$ -the neuron is of "bad type":
+
+$$
+i n \left(B _ {1}\right) a n d \left(B _ {2, 1}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = - \lambda \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \left(\frac {p - q}{p + q}\right) ^ {2}
+$$
+
+$$
+\begin{array}{l} i n \left(B _ {2, 2}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = - \lambda | \beta_ {i} - \beta_ {i} ^ {\prime} | | p \alpha_ {i} + q \alpha_ {i} ^ {\prime} | \frac {p - q}{(p + q) ^ {2}} \\ \geq - \lambda \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \frac {(p - q) \Lambda_ {3}}{(p + q) ^ {2}} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} i n \left(B _ {2, 3}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = - \lambda \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \left| p \alpha_ {i} + q \alpha_ {i} ^ {\prime} \right| \frac {p - q}{(p + q) ^ {2}} \\ \geq - \lambda | \alpha_ {i} - \alpha_ {i} ^ {\prime} | | \beta_ {i} - \beta_ {i} ^ {\prime} | \frac {(p - q) \Lambda_ {1}}{(p + q) ^ {2}} \\ \end{array}
+$$
+
+$$
+i n \left(B _ {3}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = 0,
+$$
+
+$$
+w h e r e \Lambda_ {1} = \frac {(1 + \log^ {- \frac {1}{3}} n) p ^ {2} - q ^ {2}}{(1 + \log^ {- \frac {1}{3}} n) p + q}, \Lambda_ {3} = \frac {(1 - \log^ {- \frac {1}{3}} n) p ^ {2} - q ^ {2}}{(1 - \log^ {- \frac {1}{3}} n) p + q}.
+$$
+
+- if the $i$ -the neuron is of "harmless type":
+
+$$
+\begin{array}{l} i n \left(H _ {1}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = \lambda \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right\lVert p \alpha_ {i} + q \alpha_ {i} ^ {\prime} \left| \frac {p - q}{(p + q) ^ {2}} \right. \\ \geq \lambda \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \frac {(p - q) \Lambda_ {5}}{(p + q) ^ {2}} \\ \end{array}
+$$
+
+$$
+i n \left(H _ {2}\right): m _ {0} ^ {i} - m _ {1} ^ {i} = 0,
+$$
+
+$$
+w h e r e \Lambda_ {5} = \frac {p q \log^ {- \frac {1}{3}}}{p + (1 + \log^ {- \frac {1}{3}}) q}.
+$$
+
+# B DYNAMICS OF PARAMETERS
+
+We consider the cross-entropy loss in training. The loss on a particular vertex $x$ is
+
+$$
+L (x) = - \log O _ {\ell (x)} (x),
+$$
+
+where $O_0(x)$ and $O_1(x)$ are the first and second component of the output respectively, i.e.
+
+$$
+O _ {0} (x) = \frac {\exp (g _ {0} (x))}{\exp (g _ {0} (x)) + \exp (g _ {1} (x))}, O _ {1} (x) = \frac {\exp (g _ {1} (x))}{\exp (g _ {0} (x)) + \exp (g _ {1} (x))}.
+$$
+
+For a given graph $G$ generated by SBM, we set the objective function $L(G)$ as the average loss over all the vertices with revealed labels2, i.e.
+
+$$
+L (G) = \frac {1}{\# \{x \in G : \ell (x) \text {i s r e v e a l e d} \}} \sum_ {x: \ell (x) \text {r e v e a l e d}} L (x).
+$$
+
+We first show the partial derivatives of parameters.
+
+Theorem B.1 (derivatives of parameters). For $1 \leq i \leq h$ , let $x$ be a vertex, $\ell(x)$ its true label, $L(x) = -\log O_{\ell(x)}(x)$ , then
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} (\beta_ {i} - \beta_ {i} ^ {\prime}) Z (- 1) ^ {1 - \ell (x)} \sum_ {y} \mathbb {1} [ y \sim x ] \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {0} ^ {y}
+$$
+
+$$
+\frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} = \frac {4}{n ^ {2} (p + q) ^ {2}} (\beta_ {i} - \beta_ {i} ^ {\prime}) Z (- 1) ^ {1 - \ell (x)} \sum_ {y} \mathbb {1} [ y \sim x ] \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {1} ^ {y}
+$$
+
+$$
+\frac {\partial L}{\partial \beta_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} Z (- 1) ^ {1 - \ell (x)} \sum_ {y} \mathbb {1} [ y \sim x ] \phi \left(\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}\right)
+$$
+
+$$
+\frac {\partial L}{\partial \beta_ {i} ^ {\prime}} = - \frac {4}{n ^ {2} (p + q) ^ {2}} Z (- 1) ^ {1 - \ell (x)} \sum_ {y} \mathbb {1} [ y \sim x ] \phi \left(\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}\right)
+$$
+
+$$
+\frac {\partial L}{\partial b _ {0}} = (- 1) ^ {1 - \ell (x)} Z
+$$
+
+$$
+\frac {\partial L}{\partial b _ {1}} = (- 1) ^ {\ell (x)} Z,
+$$
+
+where $Z = \frac{\exp(g_{1 - \ell(x)}(x))}{\exp(g_0(x)) + \exp(g_1(x))}$ , $t_0^y$ and $t_1^y$ are the numbers of neighbors of $y$ (including perhaps $y$ itself) with revealed labels in class 0 and class 1 respectively.
+
+Proof. We compute $\frac{\partial L}{\partial \alpha_i}, \frac{\partial L}{\partial \beta_i}$ and $\frac{\partial L}{\partial b_0}$ , others can be computed symmetrically. We have
+
+$$
+L (x) = - \log O _ {\ell (x)} (x) = \log (\exp (g _ {0} (x)) + \exp (g _ {1} (x))) - g _ {\ell (x)} (x),
+$$
+
+since $O_{j}(x) = \frac{\exp(g_{j}(x))}{\exp(g_{0}(x)) + \exp(g_{1}(x))}, j = 0,1.$ So
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i}} = \frac {e ^ {g _ {0} (x)} \frac {\partial g _ {0} (x)}{\partial \alpha_ {i}} + e ^ {g _ {1} (x)} \frac {\partial g _ {1} (x)}{\partial \alpha_ {i}}}{e ^ {g _ {0} (x)} + e ^ {g _ {1} (x)}} - \frac {\partial g _ {\ell (x)} (x)}{\partial \alpha_ {i}} \\ = (- 1) ^ {1 - \ell (x)} Z \big (\frac {\partial g _ {0} (x)}{\partial \alpha_ {i}} - \frac {\partial g _ {1} (x)}{\partial \alpha_ {i}} \big). \\ \end{array}
+$$
+
+Since $g_{j}(x) = f_{j}(x) + b_{j},\frac{\partial g_{j}(x)}{\partial\alpha_{i}} = \frac{\partial f_{j}(x)}{\partial\alpha_{i}},j = 0,1.$ By (2)
+
+$$
+\frac {\partial f _ {0} (x)}{\partial \alpha_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} \sum_ {y} \mathbb {1} [ y \sim x ] \beta_ {i} \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {0} ^ {y}
+$$
+
+$$
+\frac {\partial f _ {1} (x)}{\partial \alpha_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} \sum_ {y} \mathbb {1} [ y \sim x ] \beta_ {i} ^ {\prime} \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {0} ^ {y}.
+$$
+
+Therefore
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} (- 1) ^ {1 - \ell (x)} Z (\beta_ {i} - \beta_ {i} ^ {\prime}) \sum_ {y} \mathbb {1} [ y \sim x ] \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {0} ^ {y}.
+$$
+
+Next we compute $\frac{\partial L}{\partial \beta_i}$ . Similar as above, $\frac{\partial L}{\partial \beta_i} = (-1)^{1 - \ell(x)} Z\left(\frac{\partial f_0(x)}{\partial \beta_i} - \frac{\partial f_1(x)}{\partial \beta_i}\right)$ . By (2)
+
+$$
+\frac {\partial f _ {0} (x)}{\partial \beta_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} \sum_ {y} \mathbb {1} [ y \sim x ] \phi (\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y})
+$$
+
+$$
+\frac {\partial f _ {1} (x)}{\partial \alpha_ {i}} = 0.
+$$
+
+So
+
+$$
+\frac {\partial L}{\partial \beta_ {i}} = \frac {4}{n ^ {2} (p + q) ^ {2}} (- 1) ^ {1 - \ell (x)} Z \sum_ {y} \mathbb {1} [ y \sim x ] \phi (\alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y}).
+$$
+
+Lastly,
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial b _ {0}} = (- 1) ^ {1 - \ell (x)} Z \left(\frac {\partial g _ {0} (x)}{\partial b _ {0}} - \frac {\partial g _ {1} (x)}{\partial b _ {0}}\right) \\ = (- 1) ^ {1 - \ell (x)} Z, \\ \end{array}
+$$
+
+since $\frac{\partial g_0(x)}{\partial b_0} = 1, \frac{\partial g_1(x)}{\partial b_0} = 0$ .
+
+
+
+In the following, we will use Theorem B.1 to analyze the dynamics of neurons of each type. As we can see, all of $\frac{\partial L}{\partial \alpha_i}, \frac{\partial L}{\partial \alpha_i'}, \frac{\partial L}{\partial \beta_i}$ and $\frac{\partial L}{\partial \beta_i'}$ have the form $YZ$ . In order to estimate these derivatives, we show the concentration of $Y$ and $Z$ respectively. To estimate the concentration of $Z$ , we need the concentration of output obtained in Section 4. For any $\epsilon > 0$ , we require the probability of concentration in (3) to be at least $1 - \tilde{\epsilon}$ , where $\tilde{\epsilon} = o(\epsilon)$ . In particular, if we choose $\tilde{\epsilon} = \epsilon^2$ , then we set $1 - O\left(\frac{1}{n}\right) \geq 1 - \epsilon^2$ , i.e.
+
+$$
+n \geq \Omega \left(\frac {1}{\epsilon}\right) ^ {2}. \tag {5}
+$$
+
+Our following analysis will be based on this condition.
+
+Meanwhile in order to have balanced performance in each epoch of coordinate descent, we require $\left|\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right]\right| < \frac{\epsilon}{2}$ . Since $\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right] = \frac{1}{2} (-\mathbb{E}[Z|\ell(x) = 0] + \mathbb{E}[Z|\ell(x) = 1])$ , we have
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ] \right| < \tilde {\epsilon}. \tag {6}
+$$
+
+We have the following relation between $\mu_0$ and $\mu_{1}$ . In the following, $\sigma$ represents the sigmoid function: $\sigma (x) = \frac{1}{1 + e^{-x}}$ .
+
+Proposition B.2. If $\left|\mathbb{E}[Z|\ell(x) = 0] - \mathbb{E}[Z|\ell(x) = 1]\right| < \tilde{\epsilon}$ , then $|\sigma(-\mu_0) - \sigma(\mu_1)| \leq \sigma'(\mu_0 - \delta)\delta + \sigma'(\mu_1 + \delta)\delta + 3\tilde{\epsilon}$ , where $\delta$ is as shown in Corollary 4.2.
+
+Proof. We have
+
+$$
+Z = \left\{ \begin{array}{l l} \sigma (- \Delta), & \ell (x) = 0 \\ \sigma (\Delta), & \ell (x) = 1 \end{array} \right.
+$$
+
+For $\ell(x) = 0$ , by Lagrange mean value theorem, $|\sigma(-\mu_0) - Z| = |\sigma(-\mu_0) - \sigma(-\Delta)| = \sigma'(\xi)(\Delta - \mu_0)$ , where $\xi$ is between $-\mu_0$ and $-\Delta$ . By Corollary 4.2 and the condition of $n$ , $|\Delta - \mu_0| \leq \delta$ with probability $\geq 1 - \tilde{\epsilon}$ . From the remark following Corollary A.4, we have $\sigma'(\xi) \leq \sigma'(-\mu_0 + \delta) = \sigma'(\mu_0 - \delta)$ , with probability $\geq 1 - \tilde{\epsilon}$ . Then we have
+
+$$
+\mathbb {P} [ | \sigma (- \mu_ {0}) - Z | \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta | \ell (x) = 0 ] \geq 1 - \tilde {\epsilon}.
+$$
+
+Since
+
+$$
+\begin{array}{l} \mathbb {E} [ Z | \ell (x) = 0 ] = \mathbb {E} [ Z | | \sigma (- \mu_ {0}) - Z | \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta ] \mathbb {P} [ | \sigma (- \mu_ {0}) - Z | \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta ] \\ + \mathbb {E} [ Z | | \sigma (- \mu_ {0}) - Z | > \sigma^ {\prime} (\mu_ {0} - \delta) \delta ] \mathbb {P} [ | \sigma (- \mu_ {0}) - Z | > \sigma^ {\prime} (\mu_ {0} - \delta) \delta ], \\ \end{array}
+$$
+
+then (note that $0 < Z < 1$ )
+
+$$
+\mathbb {E} [ Z | \ell (x) = 0 ] \leq \sigma (- \mu_ {0}) + \sigma^ {\prime} (\mu_ {0} - \delta) \delta + \tilde {\epsilon}
+$$
+
+and
+
+$$
+\mathbb {E} [ Z | \ell (x) = 0 ] \geq (\sigma (- \mu_ {0}) - \sigma^ {\prime} (\mu_ {0} - \delta) \delta) (1 - \tilde {\epsilon}),
+$$
+
+i.e.
+
+$$
+\mathbb {E} [ Z | \ell (x) = 0 ] - \sigma (- \mu_ {0}) \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta + \tilde {\epsilon}
+$$
+
+and
+
+$$
+\begin{array}{l} \mathbb {E} [ Z | \ell (x) = 0 ] - \sigma (- \mu_ {0}) \geq - \sigma^ {\prime} (\mu_ {0} - \delta) \delta - \tilde {\epsilon} (\sigma (- \mu_ {0}) - \sigma^ {\prime} (\mu_ {0} - \delta) \delta) \\ = - \sigma^ {\prime} (\mu_ {0} - \delta) \delta (1 - \tilde {\epsilon}) - \tilde {\epsilon} \sigma (- \mu_ {0}) \\ \geq - \sigma^ {\prime} (\mu_ {0} - \delta) \delta - \tilde {\epsilon}. \\ \end{array}
+$$
+
+So
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 0 ] - \sigma (- \mu_ {0}) \right| \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta + \tilde {\epsilon}.
+$$
+
+Similarly
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 1 ] - \sigma (\mu_ {1}) \right| \leq \sigma^ {\prime} (\mu_ {1} + \delta) \delta + \tilde {\epsilon}.
+$$
+
+By triangle inequality,
+
+$$
+\begin{array}{l} \left| \sigma (- \mu_ {0}) - \sigma (\mu_ {1}) \right| \leq \left| \sigma (- \mu_ {0}) - \mathbb {E} [ Z | \ell (x) = 0 ] \right| + \left| \mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ] \right| \\ + \left| \mathbb {E} [ Z | \ell (x) = 1 ] - \sigma (\mu_ {1}) \right| \\ \leq \sigma^ {\prime} (\mu_ {0} - \delta) \delta + \sigma^ {\prime} (\mu_ {1} + \delta) \delta + 3 \tilde {\epsilon}. \\ \end{array}
+$$
+
+
+
+From the proof above, we can directly obtain the following corollary about $Z$ .
+
+Corollary B.3.
+
+$$
+\mathbb {P} \left[ \left| Z - \mathbb {E} [ Z | \ell (x) = 0 ] \right| \leq 2 \sigma^ {\prime} (\mu_ {0} - \delta) \delta + \tilde {\epsilon} | \ell (x) = 0 \right] \geq 1 - \tilde {\epsilon}
+$$
+
+$$
+\mathbb {P} \big [ \big | Z - \mathbb {E} [ Z | \ell (x) = 1 ] \big | \leq 2 \sigma^ {\prime} (\mu_ {1} + \delta) \delta + \tilde {\epsilon} | \ell (x) = 1 \big ] \geq 1 - \tilde {\epsilon}.
+$$
+
+In order to obtain the concentration of $Z$ , we need to estimate $\sigma'(\mu_0 - \delta)\delta$ and $\sigma'(\mu_1 + \delta)\delta$ . The following proposition is based on the condition that $|\mu_0 + \mu_1| \geq 4\delta$ . If $|\mu_0 + \mu_1| < 4\delta$ , set $c \coloneqq \mu_0 - \mu_1$ , we have $\mu_0 > \frac{c}{2} - 2\delta$ and $\mu_1 < -\frac{c}{2} + 2\delta$ . Then the concentration of output shown in Corollary 4.2 can guarantee $1 - \epsilon$ accuracy of the model for any $\epsilon > 0$ . In fact, from $|\Delta - \mu_0| < \delta$ , we have $\Delta > \mu_0 - \delta > \frac{c}{2} - 3\delta > 0$ , due to $\delta = o(c)$ . So
+
+$$
+\mathbb {P} [ \Delta > 0 | \ell (x) = 0 ] \geq \mathbb {P} [ | \Delta - \mu_ {0} | < \delta | \ell (x) = 0 ] \geq 1 - \tilde {\epsilon}.
+$$
+
+Similarly,
+
+$$
+\mathbb {P} [ \Delta < 0 | \ell (x) = 1 ] \geq \mathbb {P} [ | \Delta - \mu_ {0} | < \delta | \ell (x) = 1 ] \geq 1 - \tilde {\epsilon}.
+$$
+
+Since $\tilde{\epsilon} = o(\epsilon)$ , the model achieves overall accuracy $\geq 1 - \epsilon$ .
+
+Proposition B.4. If $|\mu_0 + \mu_1| \geq 4\delta$ , then $\sigma'(\mu_0 - \delta)\delta = O(\tilde{\epsilon})$ , $\sigma'(\mu_1 + \delta)\delta = O(\tilde{\epsilon})$ .
+
+Proof. First, we estimate the lower bound of $|\sigma(-\mu_0) - \sigma(\mu_1)|$ via the Fundamental Theorem of Calculus. We have $|\sigma(-\mu_0) - \sigma(\mu_1)| = \left| \int_{-\mu_0}^{\mu_1} \sigma'(t) dt \right|$ .
+
+If $-\mu_0 < \mu_1 < 0$ , since $\mu_0 + \mu_1 \geq 4\delta$ , we divide the interval $[- \mu_0, \mu_1]$ into $[- \mu_0, -\mu_0 + 2\delta] \cup [-\mu_0 + 2\delta, \mu_1 - 2\delta] \cup [\mu_1 - 2\delta, \mu_1]$ and estimate the lower bound of the integral. Since $\sigma'(x)$ is increasing on $(- \infty, 0]$ , we have
+
+$$
+\int_ {- \mu_ {0}} ^ {\mu_ {1}} \sigma^ {\prime} (t) d t \geq \sigma^ {\prime} (- \mu_ {0}) \cdot 2 \delta + I _ {1} + \sigma^ {\prime} (\mu_ {1} - 2 \delta) \cdot 2 \delta , \tag {7}
+$$
+
+where $I_{1} = \int_{-\mu_{0} + 2\delta}^{\mu_{1} - 2\delta}\sigma^{\prime}(t)dt.$ If $\mu_{1} < - \mu_{0} < 0$ , similarly we have
+
+$$
+\int_ {\mu_ {1}} ^ {- \mu_ {0}} \sigma^ {\prime} (t) d t \geq \sigma^ {\prime} (\mu_ {1}) \cdot 2 \delta + I _ {2} + \sigma^ {\prime} (- \mu_ {0} - 2 \delta) \cdot 2 \delta , \tag {8}
+$$
+
+where $I_{2} = \int_{\mu_{1} + 2\delta}^{-\mu_{0} - 2\delta}\sigma^{\prime}(t)dt$ . We have a uniform lower bound from (7) and (8):
+
+$$
+\left| \int_ {- \mu_ {0}} ^ {\mu_ {1}} \sigma^ {\prime} (t) d t \right| \geq \sigma^ {\prime} (- \mu_ {0} - 2 \delta) \cdot 2 \delta + \sigma^ {\prime} (\mu_ {1} - 2 \delta) \cdot 2 \delta + I, \tag {9}
+$$
+
+where $I = \min \{I_1,I_2\}$
+
+Furthermore, by Proposition B.2,
+
+$$
+\left| \sigma \left(- \mu_ {0}\right) - \sigma \left(\mu_ {1}\right) \right| \leq \sigma^ {\prime} \left(\mu_ {0} - \delta\right) \delta + \sigma^ {\prime} \left(\mu_ {1} + \delta\right) \delta + 3 \tilde {\epsilon}. \tag {10}
+$$
+
+Combine (9) and (10):
+
+$$
+2 \sigma^ {\prime} (- \mu_ {0} - 2 \delta) \delta + 2 \sigma^ {\prime} (\mu_ {1} - 2 \delta) \delta \leq \sigma^ {\prime} (- \mu_ {0} + \delta) \delta + \sigma^ {\prime} (\mu_ {1} + \delta) \delta + 3 \tilde {\epsilon}. \tag {11}
+$$
+
+By Lagrange mean value theorem,
+
+$$
+\sigma^ {\prime} (- \mu_ {0} - 2 \delta) = \sigma^ {\prime} (- \mu_ {0} + \delta) - 3 \sigma^ {\prime \prime} (\xi_ {0}) \delta
+$$
+
+$$
+\sigma^ {\prime} \left(\mu_ {1} - 2 \delta\right) = \sigma^ {\prime} \left(\mu_ {1} + \delta\right) - 3 \sigma^ {\prime \prime} \left(\xi_ {1}\right) \delta ,
+$$
+
+where $\xi_0\in (-\mu_0 - 2\delta , - \mu_0 + \delta),\xi_1\in (\mu_1 - 2\delta ,\mu_1 + \delta)$ . Plug these into (11):
+
+$$
+\sigma^ {\prime} (\mu_ {0} - \delta) \delta + \sigma^ {\prime} (\mu_ {1} + \delta) \delta - 6 \delta^ {2} \left(\sigma^ {\prime \prime} \left(\xi_ {0}\right) + \sigma^ {\prime \prime} \left(\xi_ {1}\right)\right) \leq 3 \tilde {\epsilon}.
+$$
+
+Since $\delta^2 (\sigma ''(\xi_0) + \sigma ''(\xi_1)) = o(\sigma '(\mu_0 - \delta)\delta)$ and $o(\sigma^{\prime}(\mu_{1} + \delta)\delta)$ , we have
+
+$$
+\sigma^ {\prime} (\mu_ {0} - \delta) \delta = O (\bar {\epsilon})
+$$
+
+$$
+\sigma^ {\prime} (\mu_ {1} + \delta) \delta = O (\tilde {\epsilon}).
+$$
+
+
+
+Combine Proposition B.4 and Corollary B.3, we have the following concentration of $Z$ .
+
+Proposition B.5.
+
+$$
+\mathbb {P} \left[ \left| Z - \mathbb {E} [ Z | \ell (x) = 0 ] \right| \leq O (\tilde {\epsilon}) | \ell (x) = 0 \right] \geq 1 - \tilde {\epsilon}
+$$
+
+$$
+\mathbb {P} \left[ \left| Z - \mathbb {E} [ Z | \ell (x) = 1 ] \right| \leq O (\tilde {\epsilon}) | \ell (x) = 1 \right] \geq 1 - \tilde {\epsilon}.
+$$
+
+Under the condition of balanced performance, we have the following corollary about the concentration of $Z$ independent of the label of $x$ .
+
+Corollary B.6. If $\left|\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right]\right| \leq \frac{\epsilon}{2}$ , then $\mathbb{P}\left[\left|Z - \mathbb{E}[Z]\right| \leq O(\tilde{\epsilon})\right] \geq 1 - \tilde{\epsilon}$ .
+
+Proof. Since $\mathbb{E}[\frac{\partial L}{\partial b_0}] = \frac{1}{2} (\mathbb{E}[Z|\ell (x) = 0] - \mathbb{E}[Z|\ell (x) = 1])$ , we have
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ] \right| \leq \tilde {\epsilon}.
+$$
+
+On the other hand,
+
+$$
+\mathbb {E} [ Z ] = \frac {1}{2} \big (\mathbb {E} [ Z | \ell (x) = 0 ] + \mathbb {E} [ Z | \ell (x) = 1 ] \big).
+$$
+
+So we have $\left|\mathbb{E}[Z] - \mathbb{E}[Z|\ell (x) = 0]\right|\leq \frac{\tilde{\epsilon}}{2}$ . By Proposition B.5, $\mathbb{P}[|Z - \mathbb{E}[Z]|\leq O(\tilde{\epsilon})]\geq 1 - \tilde{\epsilon}$ .
+
+Now we can derive the estimation of the derivatives.
+
+Theorem B.7 (concentration of derivatives). For loss on the whole graph $L = L(G)$ , with probability $\geq 1 - O\left(\frac{1}{n}\right)$ , we have
+
+1. If $\alpha_{i} > \alpha_{i}^{\prime} > 0$ or $\alpha_{i} > 0 > \alpha_{i}^{\prime}, |\frac{\alpha_{i}}{\alpha_{i}^{\prime}}| \geq \frac{p}{q}(1 + \log^{-\frac{1}{3}}n)$ , then
+
+$$
+\left| \frac {\partial L}{\partial \alpha_ {i}} + \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \mathbb {E} [ Z ] \right| \leq \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right) \tag {12}
+$$
+
+$$
+\left| \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} - \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \mathbb {E} [ Z ] \right| \leq | \beta_ {i} - \beta_ {i} ^ {\prime} | \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right) \tag {13}
+$$
+
+$$
+\left| \frac {\partial L}{\partial \beta_ {i}} + \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \mathbb {E} [ Z ] \right| \leq \left| \alpha_ {i} - \alpha_ {i} ^ {\prime} \right| \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right). \tag {14}
+$$
+
+Since $\frac{\partial L}{\partial \beta_i'} = -\frac{\partial L}{\partial \beta_i}$ (see Theorem B.1), we only need to estimate $\frac{\partial L}{\partial \beta_i}$ .
+
+2. If $\alpha_{i} > 0 > \alpha_{i}^{\prime}, |\frac{\alpha_{i}}{\alpha_{i}^{\prime}}| \in [\frac{q}{p}(1 + \gamma), \frac{p}{q}(1 - \log^{-\frac{1}{3}}n)]$ , where $\gamma \in [\log^{-\frac{1}{3}}n, (\frac{p}{q})^{2}(1 - \log^{-\frac{1}{3}}n) - 1]$ , then
+
+$$
+\left| \frac {\partial L}{\partial \alpha_ {i}} + \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \frac {\lambda p (p - q)}{2 (p + q) ^ {2}} \mathbb {E} [ Z ] \right| \leq \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right) \tag {15}
+$$
+
+$$
+\left| \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} + \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \frac {\lambda q (p - q)}{2 (p + q) ^ {2}} \mathbb {E} [ \mathbb {Z} ] \right| \leq \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right) \tag {16}
+$$
+
+$$
+\left| \frac {\partial L}{\partial \beta_ {i}} + \frac {\lambda (p - q) \left(p \alpha_ {i} + q \alpha_ {i} ^ {\prime}\right)}{2 (p + q) ^ {2}} \mathbb {E} [ Z ] \right| \leq | \alpha_ {i} - \alpha_ {i} ^ {\prime} | \mathbb {E} [ Z ] O \left(\log^ {- \frac {1}{2}} n\right). \tag {17}
+$$
+
+3. If $\alpha_{i} > 0 > \alpha_{i}^{\prime}$ , $|\frac{\alpha_i}{\alpha_i'}| \in \left(\frac{p}{q}(1 - \log^{-\frac{1}{3}}n), \frac{p}{q}(1 + \log^{-\frac{1}{3}}n)\right)$ , then
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \beta_ {i}} \in [ - (\alpha_ {i} - \alpha_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda (p - q) \Lambda_ {1}}{2 (p + q) ^ {2}} + O (\log^ {- \frac {1}{2}} n)\right), \\ - \left. \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda (p - q) \left(\Lambda_ {3} - \Lambda_ {2}\right)}{2 (p + q) ^ {2}} - O \left(\log^ {- \frac {1}{2}} n\right)\right) \right], \tag {18} \\ \end{array}
+$$
+
+$$
+w h e r e \Lambda_ {1} = \frac {(1 + \log^ {- \frac {1}{3}} n) p ^ {2} - q ^ {2}}{(1 + \log^ {- \frac {1}{3}} n) p + q}, \Lambda_ {2} = \frac {p q \log^ {- \frac {1}{3}} n}{(1 + \log^ {- \frac {1}{3}} n) p + q} a n d \Lambda_ {3} = \frac {(1 - \log^ {- \frac {1}{3}} n) p ^ {2} - q ^ {2}}{(1 - \log^ {- \frac {1}{3}} n) p + q};
+$$
+
+$$
+\bullet \text {i f} \beta_ {i} > \beta_ {i} ^ {\prime},
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda p (p - q)}{2 (p + q) ^ {2}} + O (\log^ {- \frac {1}{2}} n)\right), \\ \left. - \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} - O \left(\log^ {- \frac {1}{2}} n\right)\right) \right] \tag {19} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda q (p - q)}{2 (p + q) ^ {2}} + O (\log^ {- \frac {1}{2}} n)\right), \\ \left. \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} + O \left(\log^ {- \frac {1}{2}} n\right)\right) \right] \tag {20} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\lambda \left(\frac {p - q}{p + q}\right) ^ {2} + O (\log^ {- \frac {1}{2}} n)\right), \\ \left. - \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} - O \left(\log^ {- \frac {1}{2}} n\right)\right) \right], \tag {21} \\ \end{array}
+$$
+
+$$
+\bullet \text {i f} \beta_ {i} \leq \beta_ {i} ^ {\prime},
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} - O (\log^ {- \frac {1}{2}} n)\right), \\ \left. - \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda p (p - q)}{2 (p + q) ^ {2}} + O \left(\log^ {- \frac {1}{2}} n\right)\right) \right] \tag {22} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} + O \left(\log^ {- \frac {1}{2}} n\right)\right), \\ \left. \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\frac {\lambda q (p - q)}{2 (p + q) ^ {2}} + O \left(\log^ {- \frac {1}{2}} n\right)\right) \right] \tag {23} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \frac {\partial L}{\partial \alpha_ {i}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \in [ - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} - O \left(\log^ {- \frac {1}{2}} n\right)\right), \\ \left. - \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) \mathbb {E} [ Z ] \left(\lambda \left(\frac {p - q}{p + q}\right) ^ {2} + O \left(\log^ {- \frac {1}{2}} n\right)\right) \right] \tag {24} \\ \end{array}
+$$
+
+4. If $\alpha_{i} > 0 > \alpha_{i}^{\prime}$ , $|\frac{\alpha_{i}}{\alpha_{i}^{\prime}}| \leq \frac{q}{p} (1 + \log^{-\frac{1}{3}}n)$ , $\beta_{i} < \beta_{i}^{\prime}$ , then
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \geq - \left| \beta_ {i} - \beta_ {i} ^ {\prime} \right| O (\tilde {\epsilon}) \tag {25}
+$$
+
+$$
+\frac {\partial L}{\partial \beta_ {i}} \leq O (\tilde {\epsilon}). \tag {26}
+$$
+
+Proof. We show the proof for item 1, other items can be proved similarly. Since $L(G)$ is the average of the losses over revealed vertices, we first show the concentration of $\frac{\partial L(x)}{\partial \alpha_i}$ , then we show the concentration of $\frac{\partial L(G)}{\partial \alpha_i}$ using union bound. Since
+
+$$
+\frac {\partial L (x)}{\partial \alpha_ {i}} = (- 1) ^ {1 - \ell (x)} 4 (\beta_ {i} - \beta_ {i} ^ {\prime}) Z \sum_ {y} \frac {\mathbb {1} [ y \sim x ] \mathbb {1} [ \alpha_ {i} t _ {0} ^ {y} + \alpha_ {i} ^ {\prime} t _ {1} ^ {y} \geq 0 ] t _ {0} ^ {y}}{n ^ {2} (p + q) ^ {2}},
+$$
+
+we first show the concentration of $Y := (-1)^{1 - \ell(x)} \sum_{y \sim x} \frac{4\mathbb{1}[\alpha_i t_0^y + \alpha_i' t_1^y \geq 0]t_0^y}{n^2(p + q)^2}$ using the method of averaged bounded difference. Similar as the proof of Theorem A.1, let $Y_j = (-1)^{1 - \ell(x)} \frac{4\mathbb{1}[\alpha_i t_0^{y_j} + \alpha_i' t_1^{y_j} \geq 0]t_0^{y_j}}{n^2(p + q)^2}$ . Based on Condition (Cond), for $\ell(x) = 0$ , $|Y_j + \frac{2\lambda p}{n(p + q)^2}| \leq O(\log^{-\frac{7}{2}} n)$ for $\ell(y_j) = 0$ . Similar results hold for $\ell(y_j) = 1$ , $\ell(x) = 1$ . So for any $a_k, a_k'$ ,
+
+$$
+\left| \mathbb {E} [ \sum_ {j} Y _ {j} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ] - \mathbb {E} [ \sum_ {j} Y _ {j} | Y _ {1}, \dots , Y _ {k - 1}, Y _ {k} = a _ {k} ^ {\prime} ] \right| \leq (\alpha_ {i} - \alpha_ {i} ^ {\prime}) O (\log^ {- \frac {7}{2}} n).
+$$
+
+By method of averaged bounded difference, for $\ell (x) = 0$
+
+$$
+\mathbb {P} \bigg [ \sum_ {\ell (y _ {j}) = 0} Y _ {j} + \lambda \big (\frac {p}{p + q} \big) ^ {2} \bigg | \leq O (\log^ {- \frac {1}{2}} n) \big ] \geq 1 - \exp (- 2 \log^ {3} n) \geq 1 - \frac {1}{n ^ {2}}.
+$$
+
+Similarly
+
+$$
+\mathbb {P} \bigg [ \sum_ {\ell (y _ {j}) = 1} Y _ {j} + \lambda \left(\frac {q}{p + q}\right) ^ {2} \bigg | \leq O (\log^ {- \frac {1}{2}} n) ] \geq 1 - \frac {1}{n ^ {2}}.
+$$
+
+Hence
+
+$$
+\mathbb {P} \left[ \left| Y + \frac {\lambda \left(p ^ {2} + q ^ {2}\right)}{\left(p + q\right) ^ {2}} \right| \leq O \left(\log^ {- \frac {1}{2}} n\right) \right] \geq 1 - \frac {1}{n ^ {2}}.
+$$
+
+By Corollary B.6, $\mathbb{P}[|Z - \mathbb{E}[Z]|\leq O(\tilde{\epsilon})]\geq 1 - \tilde{\epsilon}$ , so we have
+
+$$
+\mathbb {P} [ \left| \frac {\partial L (x)}{\partial \alpha_ {i}} + (\beta_ {i} - \beta_ {i} ^ {\prime}) \lambda \frac {p ^ {2} + q ^ {2}}{(p + q) ^ {2}} \mathbb {E} [ Z ] \right| \leq | \beta_ {i} - \beta_ {i} ^ {\prime} | \mathbb {E} [ Z ] O (\log^ {- \frac {1}{2}} n) | \ell (x) = 0 ] \geq 1 - O (\frac {1}{n ^ {2}}).
+$$
+
+For $\ell (x) = 1$ , similarly we have
+
+$$
+\mathbb {P} \bigg [ \bigg | \frac {\partial L (x)}{\partial \alpha_ {i}} - (\beta_ {i} - \beta_ {i} ^ {\prime}) \lambda \frac {2 p q}{(p + q) ^ {2}} \mathbb {E} [ Z ] \bigg | \leq | \beta_ {i} - \beta_ {i} ^ {\prime} | \mathbb {E} [ Z ] O (\log^ {- \frac {1}{2}} n) | \ell (x) = 1 ] \geq 1 - O (\frac {1}{n ^ {2}}).
+$$
+
+By union bound, we have (12). (13) and (14) can be proved similarly.
+
+
+
+Using Theorem B.7, we can analyze dynamics of neurons of each type. First, we introduce some notations. Let $\eta_{k}$ denote the learning rate at the $k$ -th epoch, $Z^{(k)}$ be the value of $Z$ at the $k$ -th epoch, $\alpha_{i}^{(k)}$ be the value of $\alpha_{i}$ at the $k$ -th epoch, similar for $\alpha_{i}^{\prime (k)},\beta_{i}^{(k)}$ and $\beta_i^{\prime (k)}$ . In particular, $\alpha_{i}^{(0)},\alpha_{i}^{\prime (0)},\beta_{i}^{(0)}$ and $\beta_i^{\prime (0)}$ represent the values at initialization.
+
+# B.1 "GOOD TYPE" NEURONS
+
+In this section, we show that "good type" neurons stay in the "good type" regime throughout coordinate descent (Theorem B.8) using Theorem B.7.
+
+Theorem B.8. "Good type" neurons are preserved in the "good type" throughout coordinate descent with probability $\geq 1 - O\left(\frac{1}{n^2}\right)$ over the SBM randomness.
+
+Proof. As shown in Section 4, "good type" regime is composed of $(G_{1})$ and $(G_{2})$ , we show the dynamics of neurons in $(G_{1})$ and $(G_{2})$ respectively.
+
+Assume that neuron $(\alpha_{i}^{(k)},\alpha_{i}^{\prime (k)},\beta_{i}^{(k)},\beta_{i}^{\prime (k)})$ is in $(G_{1})$ , we show that it either stays in $(G_{1})$ or moves into $(G_{2})$ throughout coordinate descent. In fact, by (14), with probability $\geq 1 - O(\frac{1}{n^2}),\frac{\partial L}{\partial\beta_i^{(k)}} < 0 < \frac{\partial L}{\partial\beta_i^{\prime(k)}}$ , so $\beta_{i}^{(k + 1)} > \beta_{i}^{(k)},\beta_{i}^{\prime (k + 1)} < \beta_{i}^{\prime (k)}$ and hence $\beta_{i}^{(k + 1)} - \beta_{i}^{\prime (k + 1)} > \beta_{i}^{(k)} - \beta_{i}^{\prime (k)} > 0$ . By (12) and (13), $\frac{\partial L}{\partial\alpha_i^{(k)}} < 0 < \frac{\partial L}{\partial\alpha_i^{\prime(k)}}$ , so $\alpha_{i}^{(k + 1)} > \alpha_{i}^{(k)},\alpha_{i}^{\prime (k + 1)} < \alpha_{i}^{\prime (k)}$ . If $\alpha_{i}^{\prime (k + 1)} > 0$ , this neuron stays in $(G_{1})$ . If $\alpha_{i}^{\prime (k + 1)} < 0$ , since
+
+$$
+\left| \frac {\alpha_ {i} ^ {(k + 1)}}{\alpha_ {i} ^ {\prime (k + 1)}} \right| = \left| \frac {\alpha_ {i} ^ {(k)} - \eta_ {k} \frac {\partial L}{\partial \alpha_ {i} ^ {(k)}}}{\alpha_ {i} ^ {\prime (k)} - \eta_ {k} \frac {\partial L}{\partial \alpha_ {i} ^ {\prime (k)}}} \right| > 1,
+$$
+
+the neuron moves into $(G_{2})$
+
+Assume that neuron is in $(G_{2})$ , we also show that it either moves into $(G_{1})$ or stays in $(G_{2})$ . As shown in section 3.2, $(G_{2}) = (G_{2,1}) \cup (G_{2,2}) \cup (G_{2,3})$ . If the neuron is in $(G_{2,1})$ , again by (12), (13) and (14), $\alpha_{i}^{(k + 1)} > \alpha_{i}^{(k)} > 0 > \alpha_{i}^{\prime (k)} > \alpha_{i}^{\prime (k + 1)}, \left|\frac{\alpha_{i}^{(k + 1)}}{\alpha_{i}^{\prime (k + 1)}}\right| > 1, \beta_{i}^{(k + 1)} > \beta_{i}^{(k)} > \beta_{i}^{\prime (k)} > \beta_{i}^{\prime (k + 1)}$ , so the neuron stays in $G_{2,2}$ . If the neuron is in $G_{2,2}$ , by (15), (16) and (17), $\frac{\partial L}{\partial \beta_{i}^{(k)}} < 0 < \frac{\partial L}{\partial \beta_{i}^{\prime(k)}}$ , so $\beta_{i}^{(k + 1)} > \beta_{i}^{\prime (k + 1)}$ . Also, $\frac{\partial L}{\partial \alpha_{i}^{(k)}} < \frac{\partial L}{\partial \alpha_{i}^{\prime(k)}} < 0$ , so $\alpha_{i}^{(k + 1)} > \alpha_{i}^{\prime (k + 1)}, \left|\frac{\alpha_{i}^{(k + 1)}}{\alpha_{i}^{\prime (k + 1)}}\right| > \left|\frac{\alpha_{i}^{(k)}}{\alpha_{i}^{\prime(k)}}\right| > 1$ . If $\alpha_{i}^{\prime (k + 1)} < 0$ , the neuron stays in $G_{2}$ . If $\alpha_{i}^{\prime (k + 1)} > 0$ , it moves into $G_{1}$ . If the neuron is in $G_{2,3}$ , by (18) and (21), $\frac{\partial L}{\partial \beta_{i}^{(k)}} < 0 < \frac{\partial L}{\partial \beta_{i}^{\prime(k)}}$ , $\frac{\partial L}{\partial \alpha_{i}^{(k)}} - \frac{\partial L}{\partial \alpha_{i}^{\prime(k)}} < 0$ , so $\beta_{i}^{(k + 1)} > \beta_{i}^{(k)} > \beta_{i}^{\prime (k)} > \beta_{i}^{\prime (k + 1)}, \alpha_{i}^{(k + 1)} - \alpha_{i}^{\prime (k + 1)} > \alpha_{i}^{(k)} - \alpha_{i}^{\prime (k)} > 0$ . By (19) and (20),
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} \leq - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} - O (\log^ {- \frac {1}{2}} n)\right),
+$$
+
+$$
+\frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \leq (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \bigg (\frac {\lambda}{2} \bigg (\frac {p - q}{p + q} \bigg) ^ {2} + O (\log^ {- \frac {1}{2}} n) \bigg).
+$$
+
+Similar as in $(G_{2,2})$ , if $\alpha_i^{\prime(k+1)} < 0$ , the neuron stays in $(G_2)$ . If $\alpha_i^{\prime(k+1)} > 0$ , it moves into $(G_1)$ .
+
+# B.2 "BAD TYPE" NEURONS
+
+As shown in Section 4, neurons of "bad type" consist of two cases: $B_{1}$ and $B_{2}$ , where $B_{2} = B_{2,1} \cup B_{2,2} \cup B_{2,3} \cup B_{3}$ . Since the output in $B_{3}$ is concentrated at 0 (see Theorem A.2), we don't need to worry if neurons move into this region. Neurons in $B_{1} \cup B_{2,1} \cup B_{2,2} \cup B_{2,3}$ might exit "bad type" regime and become "harmless" or "good" (if the neuron becomes order-aligned), which will do no harm to the performance of the model. If they stay in $B_{1} \cup B_{2,1} \cup B_{2,2} \cup B_{2,3}$ , the following theorem shows that the separation $m_0^i - m_1^i$ can be upper bounded by initialization. In fact, Theorem A.4 shows that $m_0^i - m_1^i$ is proportional to $|\alpha_i - \alpha_i'| |\beta_i - \beta_i'|$ . The next theorem shows that both $|\alpha_i - \alpha_i'|$ and $|\beta_i - \beta_i'|$ shrink throughout coordinate descent. The worst situation is that the magnitude of $|\alpha_i - \alpha_i'|$ and $|\beta_i - \beta_i'|$ of neurons in $B_{3}$ increase and move into $B_{1}$ or $B_{2}$ at certain epoch. From Theorem B.7 we see that the magnitude can only increase by a limited rate (we can see this more explicitly in Theorem 6.2).
+
+Theorem B.9. If $(\alpha_{i}^{(k)},\alpha_{i}^{\prime (k)},\beta_{i}^{(k)},\beta_{i}^{\prime (k)})$ is in $B_{1}\cup B_{2,1}\cup B_{2,2}\cup B_{2,3}$ then with probability $\geq 1 - O(\frac{1}{n^2})$ over the SBM randomness, $|\alpha_i^{(k + 1)} - \alpha_i^{\prime (k + 1)}|\leq |\alpha_i^{(k)} - \alpha_i^{\prime (k)}|,|\beta_i^{(k + 1)} - \beta_i^{\prime (k + 1)}|\leq$ $|\beta_i^{(k)} - \beta_i^{\prime (k)}|$
+
+Proof. In $B_{1}$ and $B_{2,1}$ , by (12) and (13), $\frac{\partial L}{\partial \alpha_{i}^{(k)}} > 0 > \frac{\partial L}{\partial \alpha_{i}^{'(k)}}$ , then $\alpha_{i}^{(k+1)} < \alpha_{i}^{(k)}, \alpha_{i}^{'(k+1)} > \alpha_{i}^{'(k)}$ , so $|\alpha_{i}^{(k+1)} - \alpha_{i}^{'(k+1)}| \leq |\alpha_{i}^{(k)} - \alpha_{i}^{'(k)}|$ . Similarly, by (14), $\frac{\partial L}{\partial \beta_{i}^{(k)}} = -\frac{\partial L}{\partial \beta_{i}^{'(k)}} < 0$ , so $|\beta_{i}^{(k+1)} - \beta_{i}^{'(k+1)}| \leq |\beta_{i}^{(k)} - \beta_{i}^{'(k)}|$ (Note that $\alpha_{i}^{(k)} > \alpha_{i}^{'(k)}, \beta_{i}^{(k)} < \beta_{i}^{'(k)}$ ).
+
+In $B_{2,2}$ , from (15) and (16), we have $\frac{\partial L}{\partial \alpha_i^{(k)}} > \frac{\partial L}{\partial \alpha_i'^{(k)}} > 0$ , so $|\alpha_i^{(k+1)} - \alpha_i'^{(k+1)}| \leq |\alpha_i^{(k)} - \alpha_i'^{(k)}|$ . On the other hand, $\frac{\partial L}{\partial \beta_i^{(k)}} < 0 < \frac{\partial L}{\partial \beta_i'^{(k)}}$ , so $\beta_i^{(k+1)} > \beta_i^{(k)}$ , $\beta_i'^{(k+1)} < \beta_i'^{(k)}$ and $|\beta_i^{(k+1)} - \beta_i'^{(k+1)}| \leq |\beta_i^{(k)} - \beta_i'^{(k)}|$ . In $B_{2,3}$ , by (24), $\frac{\partial L}{\partial \alpha_i^{(k)}} - \frac{\partial L}{\partial \alpha_i'^{(k)}} > 0$ , so $|\alpha_i^{(k+1)} - \alpha_i'^{(k+1)}| \leq |\alpha_i^{(k)} - \alpha_i'^{(k)}|$ . By (18), $\frac{\partial L}{\partial \beta_i^{(k)}} < 0 < \frac{\partial L}{\partial \beta_i'^{(k)}}$ , so $|\beta_i^{(k+1)} - \beta_i'^{(k+1)}| \leq |\beta_i^{(k)} - \beta_i'^{(k)}|$ .
+
+# B.3 "HARMLESS TYPE" NEURONS
+
+Section 4 shows that there are two cases of "harmless type": $H_{1}$ and $H_{2}$ . For neurons in $H_{1}$ , the derivatives of parameters are estimated in (15), (16) and (17) (same as in $G_{2,2}$ ). We can have similar analysis as in $G_{2,2}$ and show that the inequality $\alpha_{i} > 0 > \alpha_{i}^{\prime}, \beta_{i} > \beta_{i}^{\prime}$ can be preserved. Moreover $\left|\frac{\alpha_i}{\alpha_i^l}\right|$ increases. So the neurons either stay in $H_{1}$ or become "good type" if $\left|\frac{\alpha_i}{\alpha_i^l}\right| > 1$ . In particular, neurons in $H_{1}$ do no harm to the performance of the model.
+
+For neurons in $H_{2}$ , $\mathbb{1}[\alpha_{i}t_{0}^{y} + \alpha_{i}'t_{1}^{y} \geq 0] = 0$ , so the derivatives are all equal to 0. Therefore they are never updated. Meanwhile they don't affect the performance of the model since $\phi(\alpha_{i}t_{0}^{y} + \alpha_{i}'t_{1}^{y}) = 0$ and $\Delta_{i} = 0$ .
+
+# C LEARNING GUARANTEE
+
+In this section, we prove Theorem 6.1, 6.2 and Lemma 6.3.
+
+Proof of Theorem 6.1. We prove by contradiction. Suppose
+
+$$
+\mathbb {P} [ \Delta < 0 | \ell (x) = 0 ] \geq 4 \epsilon , \tag {27}
+$$
+
+then
+
+$$
+\begin{array}{l} \mathbb {E} [ Z | \ell (x) = 0 ] = \mathbb {E} [ Z | \ell (x) = 0, \Delta < 0 ] \mathbb {P} [ \Delta < 0 | \ell (x) = 0 ] \\ + \mathbb {E} [ Z | \ell (x) = 0, \Delta \geq 0 ] \mathbb {P} [ \Delta \geq 0 | \ell (x) = 0 ] \\ \geq \frac {1}{2} \cdot 4 \epsilon = 2 \epsilon . \tag {28} \\ \end{array}
+$$
+
+Furthermore, we claim that $\mu_0 < \delta$ . In fact, if $\mu_0 \geq \delta$ , since $\mathbb{P}[|\Delta - \mu_0| \leq \delta | \ell(x) = 0] \geq 1 - \epsilon$ by Corollary 4.2, and $\Delta \geq \mu_0 - \delta \geq 0$ , we have
+
+$$
+\mathbb {P} [ \Delta \geq 0 | \ell (x) = 0 ] \geq \mathbb {P} [ | \Delta - \mu_ {0} | \leq \delta | \ell (x) = 0 ] \geq 1 - \epsilon ,
+$$
+
+i.e. $\mathbb{P}[\Delta < 0|\ell (x) = 0]\leq \epsilon$ , which contradicts (27).
+
+Let $c\coloneqq \mu_0 - \mu_1$ , then $\mu_{1} = \mu_{0} - c < \delta -c$ . Again, by Corollary 4.2, for $\ell (x) = 1,\Delta < \mu_1 + \delta$ with probability $\geq 1 - \epsilon$ , we have $Z = \sigma (\Delta) < \sigma (\mu_1 + \delta) < \sigma (-c + 2\delta)$ . Then
+
+$$
+\begin{array}{l} \mathbb {E} [ Z | \ell (x) = 1 ] = \mathbb {E} [ Z | \ell (x) = 1, | \Delta - \mu_ {1} | < \delta ] \mathbb {P} [ | \Delta - \mu_ {1} | < \delta | \ell (x) = 1 ] \\ + \mathbb {E} [ Z | \ell (x) = 1, | \Delta - \mu_ {1} | \geq \delta ] \mathbb {P} [ | \Delta - \mu_ {1} | \geq \delta | \ell (x) = 1 ] \\ < \sigma (- c + 2 \delta) \cdot 1 + 1 \cdot \epsilon \\ < \sigma \left(- \frac {c}{2}\right) + \epsilon . \\ \end{array}
+$$
+
+The last step is due to $\delta = o(c)$ . Since $\sigma(-\frac{c}{2}) < \frac{\epsilon}{2}$ , $\mathbb{E}[Z|\ell(x) = 1] < \frac{3\epsilon}{2}$ . Combine with (28),
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ] \right| > \frac {\epsilon}{2}.
+$$
+
+On the other hand, $\left|\mathbb{E}\left[\frac{\partial L}{\partial b_0}\right]\right| < \frac{\epsilon}{4}$ implies
+
+$$
+\left| \mathbb {E} [ Z | \ell (x) = 0 ] - \mathbb {E} [ Z | \ell (x) = 1 ] \right| < \frac {\epsilon}{2},
+$$
+
+which is a contradiction. So $\mathbb{P}[\Delta < 0|\ell (x) = 0] < 4\epsilon$ . Similarly, $\mathbb{P}[\Delta >0|\ell (x) = 1] < 4\epsilon$ .
+
+
+
+Proof of Theorem 6.2. If the $i$ -th neuron is of "good type", from Corollary A.4, we find a uniform lower bound of $m_0^i - m_1^i$ in "good type" regimes. We have $\min \left\{\frac{p - q}{2}, \Lambda_3\right\} = \frac{p - q}{2}$ . Next we estimate $\alpha_i - \alpha_i'$ and $\beta_i - \beta_i'$ . Let $A_i^{(k)} := \alpha_i^{(k)} - \alpha_i'^{(k)}, B_i^{(k)} := \beta_i^{(k)} - \beta_i'^{(k)}$ . We have
+
+$$
+A _ {i} ^ {(k)} = \alpha_ {i} ^ {(k)} - \alpha_ {i} ^ {\prime (k)} = \alpha_ {i} ^ {(k - 1)} - \alpha_ {i} ^ {\prime (k - 1)} - \eta_ {k} \bigg (\frac {\partial L}{\partial \alpha_ {i} ^ {(k - 1)}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime (k - 1)}} \bigg)
+$$
+
+$$
+B _ {i} ^ {(k)} = \beta_ {i} ^ {(k)} - \beta_ {i} ^ {\prime (k)} = \beta_ {i} ^ {(k - 1)} - \beta_ {i} ^ {\prime (k - 1)} - \eta_ {k} \bigg (\frac {\partial L}{\partial \beta_ {i} ^ {(k - 1)}} - \frac {\partial L}{\partial \beta_ {i} ^ {\prime (k - 1)}} \bigg),
+$$
+
+By Theorem B.7, in $G_{1}$ and $G_{2,1}$ , with probability $\geq 1 - O\left(\frac{1}{n}\right)$ ,
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \leq - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\left(\frac {p - q}{p + q}\right) ^ {2} \lambda - O (\log^ {- \frac {1}{2}} n))\right) \leq - (\beta_ {i} - \beta_ {i} ^ {\prime}) \mathbb {E} [ Z ] \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2}
+$$
+
+$$
+\frac {\partial L}{\partial \beta_ {i}} - \frac {\partial L}{\partial \beta_ {i} ^ {\prime}} \leq - (\alpha_ {i} - \alpha_ {i} ^ {\prime}) \mathbb {E} [ Z ] \left(\left(\frac {p - q}{p + q}\right) ^ {2} \lambda - O \left(\log^ {- \frac {1}{2}} n\right)\right) \leq - (\alpha_ {i} - \alpha_ {i} ^ {\prime}) \mathbb {E} [ Z ] \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2}
+$$
+
+so
+
+$$
+\begin{array}{l} A _ {i} ^ {(k)} = A _ {i} ^ {(k - 1)} - \eta_ {k} \bigg (\frac {\partial L}{\partial \alpha_ {i} ^ {(k - 1)}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime (k - 1)}} \bigg) \geq A _ {i} ^ {(k - 1)} + \eta_ {k} \mathbb {E} [ Z ^ {(k)} ] \frac {\lambda}{2} \bigg (\frac {p - q}{p + q} \bigg) ^ {2} B _ {i} ^ {(k - 1)} \\ = A _ {i} ^ {(k - 1)} + \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} B _ {i} ^ {(k - 1)} \\ \end{array}
+$$
+
+$$
+\begin{array}{l} B _ {i} ^ {(k)} = B _ {i} ^ {(k - 1)} - \eta_ {k} \bigg (\frac {\partial L}{\partial \beta_ {i} ^ {(k - 1)}} - \frac {\partial L}{\partial \beta_ {i} ^ {\prime (k - 1)}} \bigg) \geq B _ {i} ^ {(k - 1)} + \eta_ {k} \mathbb {E} [ Z ^ {(k)} ] \frac {\lambda}{2} \bigg (\frac {p - q}{p + q} \bigg) ^ {2} A _ {i} ^ {(k - 1)} \\ = B _ {i} ^ {(k - 1)} + \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} A _ {i} ^ {(k - 1)}. \\ \end{array}
+$$
+
+In matrix form:
+
+$$
+\binom {A _ {i} ^ {(k)}} {B _ {i} ^ {(k)}} \succeq \left( \begin{array}{c c} 1 & \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} \\ \frac {\lambda}{2} \left(\frac {p - q}{p + q}\right) ^ {2} & 1 \end{array} \right) \binom {A _ {i} ^ {(k - 1)}} {B _ {i} ^ {(k - 1)}} \tag {29}
+$$
+
+Similarly, in $G_{2,2}$ :
+
+$$
+\binom {A _ {i} ^ {(k)}} {B _ {i} ^ {(k)}} \succeq \left( \begin{array}{c c} 1 & \frac {\lambda}{4} \left(\frac {p - q}{p + q}\right) ^ {2} \\ \frac {\lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2} & 1 \end{array} \right) \binom {A _ {i} ^ {(k - 1)}} {B _ {i} ^ {(k - 1)}} \tag {30}
+$$
+
+in $G_{2,3}$
+
+$$
+\binom {A _ {i} ^ {(k)}} {B _ {i} ^ {(k)}} \succeq \left( \begin{array}{c c} 1 & \frac {\lambda}{4} \left(\frac {p - q}{p + q}\right) ^ {2} \\ \frac {\lambda \left(\Lambda_ {3} - \Lambda_ {2}\right)}{2 (p - q)} \left(\frac {p - q}{p + q}\right) ^ {2} & 1 \end{array} \right) \binom {A _ {i} ^ {(k - 1)}} {B _ {i} ^ {(k - 1)}} \tag {31}
+$$
+
+where $\Lambda_{2} = \frac{pq\log^{-\frac{1}{3}}n}{(1 + \log^{-\frac{1}{3}}n)p + q}$ , $\Lambda_{3} = \frac{(1 - \log^{-\frac{1}{3}}n)p^{2} - q^{2}}{(1 - \log^{-\frac{1}{3}}n)p + q}$ . A uniform relation among (29), (30) and (31) can be given by (30). By eigenvalue decomposition, we have
+
+$$
+\begin{array}{l} A _ {i} ^ {(k)} B _ {i} ^ {(k)} \geq \frac {1}{4} \left(1 + \frac {\sqrt {2} \lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2}\right) ^ {2 k} \left(2 ^ {- \frac {1}{8}} A _ {i} ^ {(0)} + 2 ^ {\frac {1}{8}} B _ {i} ^ {(0)}\right) ^ {2} \\ \geq A _ {i} ^ {(0)} B _ {i} ^ {(0)} \left(1 + \frac {\sqrt {2} \lambda}{8} \left(\frac {p - q}{p + q}\right) ^ {2}\right) ^ {2 k}. \\ \end{array}
+$$
+
+Therefore we have a uniform lower bound of $m_0^i - m_1^i$ at the $k$ -th epoch in "good type" regime:
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} \geq A _ {i} ^ {(0)} B _ {i} ^ {(0)} \frac {\lambda}{2} \bigg (\frac {p - q}{p + q} \bigg) ^ {2} \bigg (1 + \frac {\sqrt {2} \lambda}{8} \bigg (\frac {p - q}{p + q} \bigg) ^ {2} \bigg) ^ {2 k}.
+$$
+
+Next we consider the "bad type" regime. By Corollary A.4, we have lower bound of $m_0^i - m_1^i$ in $B_1$ , $B_2$ and $B_3$ respectively. By Theorem B.9, in $B_1$ and $B_2$ , $|\alpha_i - \alpha_i'|$ and $|\beta_i - \beta_i'|$ shrink. Moreover, since $\Lambda_1 > \Lambda_3^5$ , we have a uniform lower bound of $m_0^i - m_1^i$ in $B_1$ and $B_2$ :
+
+$$
+m _ {0} ^ {i} - m _ {1} ^ {i} \geq - \left| A _ {i} ^ {(0)} B _ {i} ^ {(0)} \right| \frac {\lambda (p - q) \Lambda_ {1}}{(p + q) ^ {2}} \geq - \left| A _ {i} ^ {(0)} B _ {i} ^ {(0)} \right| \frac {\lambda p (p - q)}{(p + q) ^ {2}},
+$$
+
+since $\Lambda_{1} = \frac{(1 + \log^{-\frac{1}{3}}n)p^{2} - q^{2}}{(1 + \log^{-\frac{1}{3}}n)p + q}\leq \frac{2p^{2} - q^{2}}{2p + q}\leq p.$
+
+Next we show that $|\alpha_i - \alpha_i'|$ and $|\beta_i - \beta_i'|$ can only increase by a limited rate in $B_3$ . From item 4 of Theorem B.7, we have
+
+$$
+\frac {\partial L}{\partial \alpha_ {i}} - \frac {\partial L}{\partial \alpha_ {i} ^ {\prime}} \geq - | \beta_ {i} - \beta_ {i} ^ {\prime} | O (\tilde {\epsilon})
+$$
+
+$$
+\frac {\partial L}{\partial \beta_ {i}} - \frac {\partial L}{\partial \beta_ {i} ^ {\prime}} = 2 \frac {\partial L}{\partial \beta_ {i}} \leq O (\tilde {\epsilon}).
+$$
+
+Therefore (note that $\beta_{i} < \beta_{i}^{\prime}$ )
+
+$$
+A _ {i} ^ {(k)} \leq A _ {i} ^ {(k - 1)} + \eta_ {k} | B _ {i} ^ {(k - 1)} | O (\tilde {\epsilon})
+$$
+
+$$
+\left| B _ {i} ^ {(k)} \right| \leq \left| B _ {i} ^ {(k - 1)} \right| + \eta_ {k} O (\tilde {\epsilon}).
+$$
+
+Since $\mathbb{E}[Z^{(k)}] \geq \Omega(\epsilon)^6$ , and $\tilde{\epsilon} = o(\epsilon), \epsilon^2 = O\left(\frac{1}{n}\right)$ , so $\eta_k O(\tilde{\epsilon}) \leq \eta_k \mathbb{E}[Z^{(k)}]\frac{1}{n} = \frac{1}{n}$ . Suppose $A_i^{(k)} \geq O(1)$ , otherwise, $A_i^{(k)}$ and $|B_i^{(k)}|$ increase by an even smaller rate. So we have
+
+$$
+\left( \begin{array}{c} A _ {i} ^ {(k)} \\ | B _ {i} ^ {(k)} | \end{array} \right) \preceq \left( \begin{array}{c c} 1 & \frac {1}{n} \\ \frac {1}{n} & 1 \end{array} \right) \left( \begin{array}{c} A _ {i} ^ {(k - 1)} \\ | B _ {i} ^ {(k - 1)} | \end{array} \right).
+$$
+
+By eigenvalue decomposition, we have
+
+$$
+| A _ {i} ^ {(k)} B _ {i} ^ {(k)} | \leq \frac {1}{2} (1 + \frac {1}{n}) ^ {2 k} \big (| A _ {i} ^ {(0)} | + | B _ {i} ^ {(0)} | \big) ^ {2} \leq k \big ((A _ {i} ^ {(0)}) ^ {2} + (B _ {i} ^ {(0)}) ^ {2} \big) \quad (n \to \infty).
+$$
+
+We obtained the result for "harmless type" neurons directly from Corollary 4.3.
+
+Proof of Lemma 6.3. Since all parameters are independent standard normal random variables, we have
+
+$$
+\mathbb {E} [ (\alpha - \alpha^ {\prime}) ^ {2} ] = \mathbb {E} [ (\beta - \beta^ {\prime}) ^ {2} ] = 2,
+$$
+
+$$
+\operatorname {V a r} \left[ \left(\alpha - \alpha^ {\prime}\right) ^ {2} \right] = \operatorname {V a r} \left[ \left(\beta - \beta^ {\prime}\right) ^ {2} \right] = 8.
+$$
+
+By Chebyshev's inequality we have
+
+$$
+\mathbb {P} \left[ \sum_ {i = 1} ^ {h} \left(\alpha_ {i} - \alpha_ {i} ^ {\prime}\right) ^ {2} + \left(\beta_ {i} - \beta_ {i} ^ {\prime}\right) ^ {2} \leq 5 h \right] \geq 1 - O \left(\frac {1}{h}\right).
+$$
+
+For neurons initialized as "good type", we have
+
+$$
+\mathbb {E} [ \alpha - \alpha^ {\prime} | \alpha > \alpha^ {\prime}, \alpha + \alpha^ {\prime} > 0 ] = \frac {2}{\sqrt {\pi}}
+$$
+
+$$
+\operatorname {V a r} \left[ \alpha - \alpha^ {\prime} \mid \alpha > \alpha^ {\prime}, \alpha + \alpha^ {\prime} > 0 \right] = 2 - \frac {1}{4 \pi}
+$$
+
+$$
+\mathbb {E} [ \beta - \beta^ {\prime} | \beta > \beta^ {\prime} ] = \frac {1}{\sqrt {\pi}}
+$$
+
+$$
+\operatorname {V a r} \left[ \beta - \beta^ {\prime} \mid \beta > \beta^ {\prime} \right] = 2 - \frac {1}{\pi}.
+$$
+
+Let $\rho$ denote the probability that a neuron is initialized as "good type". By $G_{1}$ , $G_{2}$ and symmetry, $\rho = 2\mathbb{P}[\alpha > \alpha', \alpha + \alpha' > 0, \beta > \beta']$ . Since
+
+$$
+\mathbb {P} [ \alpha > \alpha^ {\prime}, \alpha + \alpha^ {\prime} ] = \frac {1}{4}, \mathbb {P} [ \beta > \beta^ {\prime} ] = \frac {1}{2},
+$$
+
+we have $\rho = \frac{1}{4}$ . By Chernoff bound, $\mathbb{P}[h_g\geq \frac{\rho}{2} h]\geq 1 - \exp (-\frac{\rho^2}{4} h)$ , so $\mathbb{P}[h_g\geq \frac{h}{8} ]\geq 1 - \exp (-\frac{h}{64})$ . Also by Chebyshev's inequality,
+
+$$
+\mathbb{P}[\sum_{\substack{\text{the $i$ - th neuron}\\ \text{initialized as}\\ "good type}}|\alpha_{i} - \alpha^{\prime}_{i}||\beta_{i} - \beta^{\prime}_{i}|\geq h_{g}\big(\frac{1}{2\pi} -k\big)|h_{g}\geq \frac{h}{8} ]\geq 1 - \frac{4 - \frac{1}{4\pi^{2}}}{h_{g}k^{2}}.
+$$
+
+Set $k = \frac{1}{10\pi}$
+
+$$
+\mathbb{P}[\sum_{\substack{\text{the $i$ - th neuron}\\ \text{initialized as}\\ "good type"}}|\alpha_{i} - \alpha_{i}^{\prime}||\beta_{i} - \beta_{i}^{\prime}|\geq \frac{h}{80}|h_{g}\geq \frac{h}{8} ]\geq 1 - O\big(\frac{1}{h}\big).
+$$
+
+So we have
+
+$$
+\begin{array}{l} \mathbb{P}[\sum_{\substack{\text{the $i$ - th neuron}\\ \text{initialized as}\\ "good type"}}|\alpha_{i} - \alpha^{\prime}_{i}||\beta_{i} - \beta^{\prime}_{i}|\geq \frac{h}{80} ] \\ \geq \mathbb{P}[\sum_{\substack{\text{the $i$ - th neuron}\\ \text{initialized as}\\ "good type"}}|\alpha_{i} - \alpha_{i}^{\prime}||\beta_{i} - \beta_{i}^{\prime}|\geq \frac{h}{80}\big|h_{g}\geq \frac{h}{8} ]\mathbb{P}[h_{g}\geq \frac{h}{8} ] \\ \geq \left(1 - O \left(\frac {1}{h}\right)\right) \left(1 - \exp \left(- \frac {h}{6 4}\right)\right) \\ \geq 1 - O \left(\frac {1}{h}\right). \\ \end{array}
+$$
+
+
+
+# D EXPERIMENTS ON DYNAMICS OF HIDDEN NEURONS
+
+This experiment verifies our argument in Sections B.1, B.2, B.3 and Theorem 6.2 about the dynamics of hidden neurons. We set $h = 5$ , $\lambda = 0.3$ and train the model on graphs sampled from SBM with $n = 1000$ , $a = 1.0$ , $b = 0.7$ . The plot of accuracy and its distribution can be seen in Section 7. Here we plot the dynamics of all the 5 hidden neurons in Figure 4, with each row corresponding to one hidden neuron. In each plot, $x$ -axis represents epoch and $y$ -axis represents the value of neurons. The first column depicts $\alpha_{i}$ and $\alpha_{i}'$ , the second column $|\frac{\alpha_{i}}{\alpha_{i}'}|$ , the third column $|\alpha_{i} - \alpha_{i}'|$ , the fourth column $\beta_{i}, \beta_{i}'$ and the last column $|\beta_{i} - \beta_{i}'|$ . As shown in the figure, the first, second and fourth neurons are of "good" type satisfying $(G_2)$ . Throughout training these neurons are preserved as "good" type: they're order-aligned, $|\frac{\alpha_{i}}{\alpha_{i}'}|$ is lowered bounded by 1, and both $|\alpha_{i} - \alpha_{i}'|, |\beta_{i} - \beta_{i}'|$ keeps increasing. All of these verify our argument in B.1. The third neuron is "harmless" satisfying $(H_2)$ . As shown
+
+in B.3, this neuron isn't updated and doesn't make contribution to the output. The fifth neuron is of "bad" type satisfying $(B_{2})$ . Although $|\alpha_{i} - \alpha_{i}^{\prime}|$ and $|\beta_{i} - \beta_{i}^{\prime}|$ increase, but by comparing with the first, second and fourth row ("good" neurons), they increase at a much smaller rate. This verifies our result in Theorem 6.2.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Dynamics of neurons of different types. The 1st, 2nd and 4th row correspond to neurons of "good" type satisfying $(G_{2})$ . The 3rd row corresponds to "harmless" satisfying $(H_{2})$ . The 5th row corresponds to "bad" type satisfying $(B_{2})$ . Their dynamics verify our results in Sections B.1, B.2, B.3 and Theorem 6.2.
+
+
+
+
+
+
+
+
+
+# E TABLE OF NOTATIONS
+
+We list the notations used in this paper for readers' convenience.
+
+| Notation | Definition |
| n | number of vertices in a graph |
| p | probability of intra-community connection |
| q | probability of cross-community connection |
| a | parameter for p with p = a log3 n/n |
| b | parameter for q with q = b log3 n/n |
| λ | probability of revealing the label of a vertex |
| l(x) | label of vertex x |
| A | adjacency matrix of a graph |
| ˆA | normalized adjacency matrix with self loopˆA = 2/n(p+q) (A + I) |
| X | input feature of a graph |
| W(0) | trainable weights in the first layer of GCN |
| W(1) | trainable weights in the second layer of GCN |
| B | bias matrix of GCN with each row of B being [b0, b1] |
| b0 | bias in the first component |
| b1 | bias in the second component |
| h | number of hidden features |
| f0 | logit in the first component without bias |
| f1 | logit in the second component without bias |
| g0 | logit in the first component, g0 = f0 + b0 |
| g1 | logit in the second component, g1 = f1 + b1 |
| Δ | difference between logit, Δ = g0 - g1 = f0 - f1 + b0 - b1 |
\ No newline at end of file
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/images.zip b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..43c67b51ddae8bd2d182ecb04b02c3ff8183e9b2
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2fa46120f77734b36d51f5e4aae0b4fc9aaa1e099b208156016121af97fab11c
+size 1894559
diff --git a/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/layout.json b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f658eb6509265c6e5d7cb57be97053355370aadc
--- /dev/null
+++ b/learningguaranteesforgraphconvolutionalnetworksonthestochasticblockmodel/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f031aa37b10cb32f476a3b8552024b9904e4eaace6a82f9bcccc3a09c7231d76
+size 1471567
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_content_list.json b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..da90d1002b8cef2b6ddafea25eb3a6347675ae39
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c214d8cceb6c23e221f408c86a8538eff1e0c985f327360dd8d7217fcf6c4025
+size 142692
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_model.json b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9de4c5357a1d4bc6ff7113a6dc0e9356e8f5be6c
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c006d4429064fe5f35cae4432ab4dd35e4075ec13f68d1c30b32cc64584fb4e
+size 165136
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_origin.pdf b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0695cdefc545e8ae0d365bdb526997a8c5e3d616
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/c50088e4-5c37-47db-97b9-c5217fd1ca52_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b9be10d24fe8c9fb1d04c143206e492d6a728f1f5053c52fb89077c9e3aff472
+size 776733
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/full.md b/learningneuralcontextualbanditsthroughperturbedrewards/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..3f269eafe1514126fcbddb260a4d651069a2473f
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/full.md
@@ -0,0 +1,638 @@
+# LEARNING NEURAL CONTEXTUAL BANDITS THROUGH PERTURBED REWARDS
+
+Yiling Jia $^{1}$ , Weitong Zhang $^{2}$ , Dongruo Zhou $^{2}$ , Quanquan Gu $^{2}$ , Hongning Wang $^{1}$
+
+1Department of Computer Science, University of Virginia
+$^{2}$ Department of Computer Science, University of California, Los Angeles.
+
+yj9xs@virginia.edu, wt.zhang@ucla.edu, drzhou@cs.ucla.edu, qgu@cs.ucla.edu, hw5x@virginia.edu
+
+# ABSTRACT
+
+Thanks to the power of representation learning, neural contextual bandit algorithms demonstrate remarkable performance improvement against their classical counterparts. But because their exploration has to be performed in the entire neural network parameter space to obtain nearly optimal regret, the resulting computational cost is prohibitively high. We perturb the rewards when updating the neural network to eliminate the need of explicit exploration and the corresponding computational overhead. We prove that a $\widetilde{O}(\widetilde{d}\sqrt{T})$ regret upper bound is still achievable under standard regularity conditions, where $T$ is the number of rounds of interactions and $\widetilde{d}$ is the effective dimension of a neural tangent kernel matrix. Extensive comparisons with several benchmark contextual bandit algorithms, including two recent neural contextual bandit models, demonstrate the effectiveness and computational efficiency of our proposed neural bandit algorithm.
+
+# 1 INTRODUCTION
+
+Contextual bandit is a well-formulated abstraction of many important real-world problems, including content recommendation (Li et al., 2010; Wu et al., 2016), online advertising (Schwartz et al., 2017; Nuara et al., 2018), and mobile health (Lei et al., 2017; Tewari & Murphy, 2017). In such problems, an agent iteratively interacts with an environment to maximize its accumulated rewards over time. Its essence is sequential decision-making under uncertainty. Because the reward from the environment for a chosen action (also referred to as an arm in literature) under each context is stochastic, a no-regret learning algorithm needs to explore the problem space for improved reward estimation, i.e., learning the mapping from an arm and its context1 to the expected reward.
+
+Linear contextual bandit algorithms (Abbasi-Yadkori et al., 2011; Li et al., 2010), which assume the reward mapping is a linear function of the context vector, dominate the community's attention in the study of contextual bandits. Though theoretically sound and practically effective, their linear reward mapping assumption is incompetent to capture possible complex non-linear relations between the context vector and reward. This motivated the extended studies in parametric bandits, such as generalized linear bandits (Filippi et al., 2010; Faury et al., 2020) and kernelized bandits (Chowdhury & Gopalan, 2017; Krause & Ong, 2011). Recently, to unleash the power of representation learning, deep neural networks (DNN) have also been introduced to learn the underlying reward mapping directly. In (Zahavy & Mannor, 2019; Riquelme et al., 2018; Xu et al., 2020), a deep neural network is applied to provide a feature mapping, and exploration is performed at the last layer. NeuralUCB (Zhou et al., 2020) and NeuralTS (ZHANG et al., 2020) explore the entire neural network parameter space to obtain nearly optimal regret using the neural tangent kernel technique (Jacot et al., 2018). These neural contextual bandit algorithms significantly boosted empirical performance compared to their classical counterparts.
+
+Nevertheless, a major practical concern of existing neural contextual bandit algorithms is their added computational cost when performing exploration. Take the recently developed NeuralUCB and NeuralTS for example. Their construction of the high-probability confidence set for model exploration
+
+depends on the dimensionality of the network parameters and the learned context vectors' representations, which is often very large for DNNs. For instance, a performing neural bandit solution often has the number of parameters in the order of 100 thousands (if not less). It is prohibitively expensive to compute inverse of the induced covariance matrix on such a huge number of parameters, as required by their construction of confidence set. As a result, approximations, e.g., only using the diagonal of the covariance matrix (Zhou et al., 2020; ZHANG et al., 2020), are employed to make such algorithms operational in practice. But there is no theoretical guarantee for such diagonal approximations, which directly leads to the gap between the theoretical and empirical performance of the neural bandit algorithms.
+
+In this work, to alleviate the computational overhead caused by the expensive exploration, we propose to eliminate explicit model exploration by learning a neural bandit model with perturbed rewards. At each round of model update, we inject pseudo noise generated from a zero-mean Gaussian distribution to the observed reward history. With the induced randomization, sufficient exploration is achieved when simply pulling the arm with the highest estimated reward. This brings in considerable advantage over existing neural bandit algorithms: no additional computational cost is needed to obtain no regret. We rigorously prove that with a high probability the algorithm obtains a $\widetilde{O}(\widetilde{d}\sqrt{T})$ regret, where $\widetilde{d}$ is the effective dimension of a neural tangent kernel matrix and $T$ is the number of rounds of interactions. This result recovers existing regret bounds for the linear setting where the effective dimension equals to the input feature dimension. Besides, our extensive empirical evaluations demonstrate the strong advantage in efficiency and effectiveness of our solution against a rich set of state-of-the-art contextual bandit solutions over both synthetic and real-world datasets.
+
+# 2 RELATED WORK
+
+Most recently, attempts have been made to incorporate DNNs with contextual bandit algorithms. Several existing work study neural-linear bandits (Riquelme et al., 2018; Zahavy & Mannor, 2019), where exploration is performed on the last layer of the DNN. Under the neural tangent kernel (NTK) framework (Jacot et al., 2018), NeuralUCB (Zhou et al., 2020) constructs confidence sets with DNN-based random feature mappings to perform upper confidence bound based exploration. NeuralTS (ZHANG et al., 2020) samples from the posterior distribution constructed with a similar technique. However, as the exploration is performed in the induced random feature space, the added computational overhead is prohibitively high, which makes such solutions impractical. The authors suggested diagonal approximations of the resulting covariance matrix, which however leave the promised theoretical guarantees of those algorithms up in the air.
+
+Reward perturbation based exploration has been studied in a number of classical bandit models (Kveton et al., 2019a; 2020; 2019b). In a context-free $k$ -armed bandit setting, Kveton et al. (2019b) proposed to estimate each arm's reward over a perturbed history and select the arm with the highest estimated reward at each round. Such an arm selection strategy is proved to be optimistic with a sufficiently high probability. Later this strategy has been extended to linear and generalized linear bandits (Kveton et al., 2019a; 2020). In (Kveton et al., 2020), the authors suggested its application to neural network models; but only some simple empirical evaluations were provided, without any theoretical justifications. Our work for the first time provides a rigorous regret analysis of neural contextual bandits with the perturbation-based exploration: a sublinear regret bound is still achievable in terms of the number of interactions between the agent and environment.
+
+# 3 NEURAL BANDIT LEARNING WITH PERTURBED REWARDS
+
+We study the problem of contextual bandit with finite $K$ arms, where each arm is associated with a $d$ -dimensional context vector: $\mathbf{x}_i \in \mathbb{R}^d$ for $i \in [K]$ . At each round $t \in [T]$ , the agent needs to select one of the arms, denoted as $a_t$ , and receives its reward $r_{a_t,t}$ , which is generated as $r_{a_t,t} = h(\mathbf{x}_{a_t}) + \eta_t$ . In particular, $h(\mathbf{x})$ represents the unknown underlying reward mapping function satisfying $0 \leq h(\mathbf{x}) \leq 1$ for any $\mathbf{x}$ , and $\eta_t$ is an $R$ -sub-Gaussian random variable that satisfies $\mathbb{E}[\exp(\mu \eta_t)] \leq \exp[\mu^2 R^2]$ for all $\mu \geq 0$ . The goal is to minimize pseudo regret over $T$ rounds:
+
+$$
+R _ {T} = \mathbb {E} \left[ \sum_ {t = 1} ^ {T} \left(r _ {a ^ {*}} - r _ {t, a _ {t}}\right) \right], \tag {3.1}
+$$
+
+Algorithm 1 Neural bandit with perturbed reward (NPR)
+1: Input: Number of rounds $T$ , regularization coefficient $\lambda$ , perturbation parameter $\nu$ , network width $m$ , network depth $L$ .
+2: Initialization: $\theta_0 = (\mathrm{vec}(\mathbf{W}_1), \dots, \mathrm{vec}(\mathbf{W}_L)] \in \mathbb{R}^p$ with Gaussian distribution: for $1 \leq l \leq L - 1$ , $\mathbf{W}_l = (\mathbf{W}, 0; 0, \mathbf{W})$ with each entry of $\mathbf{W}$ sampled independently from $\mathcal{N}(0, 4/m)$ ; $\mathbf{W}_L = (\mathbf{w}^\top, -\mathbf{w}^\top)$ with each entry of $\mathbf{w}$ sampled independently from $\mathcal{N}(0, 2/m)$ .
+3: for $t = 1, \dots, T$ do
+4: if $t > K$ then
+5: Pull arm $a_t$ and receive reward $r_{t,a_t}$ , where $a_t = \operatorname{argmax}_{i \in [K]} f(\mathbf{x}_i, \boldsymbol{\theta}_{t-1})$ .
+6: Generate $\{\gamma_s^t\}_{s \in [t]} \sim \mathcal{N}(0, \nu^2)$ .
+7: Set $\boldsymbol{\theta}_t$ by the output of gradient descent for solving Eq (3.2).
+8: else
+9: Pull arm $a_k$ .
+10: end if
+11: end for
+
+where $a^*$ is the optimal arm with the maximum expected reward.
+
+To deal with the potential non-linearity of $h(\mathbf{x})$ and unleash the representation learning power of DNNs, we adopt a fully connected neural network $f(\mathbf{x};\pmb{\theta})$ to approximate $h(\mathbf{x})$ : $f(\mathbf{x};\pmb{\theta}) = \sqrt{m}\mathbf{W}_L\phi \Big(\mathbf{W}_{L - 1}\phi \big(\dots \phi (\mathbf{W}_1\mathbf{x})\big)\Big)$ , where $\phi (x) = \mathrm{ReLU}(x)$ , $\pmb{\theta} = [\mathrm{vec}(\mathbf{W}_1),\ldots ,\mathrm{vec}(\mathbf{W}_L)]\in \mathbb{R}^p$ with $p = m + md + m^2 (L - 1)$ , and depth $L\geq 2$ . Each hidden layer is assumed to have the same width (i.e., $m$ ) for convenience in later analysis; but this does not affect the conclusion of our theoretical analysis.
+
+Existing neural bandit solutions perform explicit exploration in the entire model space (Zhou et al., 2020; ZHANG et al., 2020; Zahavy & Mannor, 2019; Riquelme et al., 2018; Xu et al., 2020), which introduces prohibitive computational cost. And oftentimes the overhead is so high that approximation has to be employed (Zhou et al., 2020; ZHANG et al., 2020), which unfortunately breaks the theoretical promise of these algorithms. In our proposed model, to eliminate such explicit model exploration in neural bandit, a randomization strategy is introduced in the neural network update. We name the resulting solution as Neural bandit with Perturbed Rewards, or NPR in short. In NPR, at round $t$ , the neural model is learned with the $t$ rewards perturbed with designed perturbations:
+
+$$
+\min _ {\boldsymbol {\theta}} \mathcal {L} (\boldsymbol {\theta}) = \sum_ {s = 1} ^ {t} \left(f \left(\mathbf {x} _ {a _ {s}}; \boldsymbol {\theta}\right) - \left(r _ {s, a _ {s}} + \gamma_ {s} ^ {t}\right)\right) ^ {2} / 2 + m \lambda \| \boldsymbol {\theta} - \boldsymbol {\theta} _ {0} \| _ {2} ^ {2} / 2 \tag {3.2}
+$$
+
+where $\{\gamma_s^t\}_{s = 1}^t\sim \mathcal{N}(0,\sigma^2)$ are Gaussian random variables that are independently sampled in each round $t$ , and $\sigma$ is a hyper-parameter that controls the strength of perturbation (and thus the exploration) in NPR. We use an $l_{2}$ -regularized square loss for model estimation, where the regularization centers at the randomly initialization $\theta_0$ with the trade-off parameter $\lambda$ .
+
+The detailed procedure of NPR is given in Algorithm 1. The algorithm starts by pulling all candidate arms once. This guarantees that for any arm, NPR is sufficiently optimistic compared to the true reward with respect to its approximation error (Lemma 4.4). When all the $K$ arms have been pulled once, the algorithm pulls the arm with the highest estimated reward, $a_{t} = \operatorname{argmax}_{i} f(\mathbf{x}_{i};\boldsymbol{\theta}_{t - 1})$ . Once received the feedback $r_{a_t,t}$ , the model perturbs the entire reward history so far via a freshly sampled noise sequence $\{\gamma_s^t\}_{s = 1}^t$ , and updates the neural network by $\{(\mathbf{x}_{a_s},r_{a_s,s} + \gamma_s^t)\}_{s = 1}^t$ using gradient descent. In the regret analysis in Section 4, we prove that the variance from the added $\{\gamma_s^t\}_{s\in [t]}$ will lead to the necessary optimism for exploration (Abbasi-Yadkori et al., 2011). We adopt gradient descent for analysis convenience, while stochastic gradient descent can also be used to solve the optimization problem with a similar theoretical guarantee based on recent works (Allen-Zhu et al., 2019; Zou et al., 2019).
+
+Compared with existing neural contextual bandit algorithms (Zhou et al., 2020; ZHANG et al., 2020; Zahavy & Mannor, 2019; Riquelme et al., 2018; Xu et al., 2020), NPR does not need any added computation for model exploration, besides the regular neural network update. This greatly alleviates the overhead for the computation resources (both space and time) and makes NPR sufficiently general to be applied for practical problems. More importantly, our theoretical analysis directly corresponds to its actual behavior when applied, as no approximation is needed.
+
+# 4 REGRET ANALYSIS
+
+In this section, we provide finite time regret analysis of NPR, where the time horizon $T$ is set beforehand. The theoretical analysis is built on the recent studies about the generalization of DNN models (Cao & Gu, 2020; 2019; Chen et al., 2020; Daniely, 2017; Arora et al., 2019), which illustrate that with (stochastic) gradient descent, the learned parameters of a DNN locate in a particular regime with the generalization error being characterized by the best function in the corresponding neural tangent kernel (NTK) space (Jacot et al., 2018). We leave the background of NTK in the appendix and focus on the key steps of our proof in this section.
+
+The analysis starts with the following lemma for the set of context vectors $\{\mathbf{x}_i\}_{i=1}^K$ .
+
+Lemma 4.1. There exists a positive constant $\bar{C}$ such that for any $\delta \in (0,1)$ , with probability at least $1 - \delta$ , when $m \geq \bar{C} K^4 L^6 \log (K^2 L / \delta) / \lambda_0^4$ , there exists a $\pmb{\theta}^{*} \in \mathbb{R}^{p}$ , for all $i \in [K]$ ,
+
+$$
+h \left(\mathbf {x} _ {i}\right) = \left\langle \mathbf {g} \left(\mathbf {x} _ {i}; \boldsymbol {\theta} _ {0}\right), \boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0} \right\rangle , \quad \sqrt {m} \| \boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0} \| _ {2} \leq \sqrt {2 \mathbf {h} ^ {\top} \mathbf {H} ^ {- 1} \mathbf {h}}, \tag {4.1}
+$$
+
+where $\mathbf{H}$ is the NTK matrix defined on the context set and $\mathbf{h} = (h(\mathbf{x}_1),\dots ,h(\mathbf{x}_K))$ . Details of $\mathbf{H}$ can be found in the appendix.
+
+This lemma suggests that with a satisfied neural network width $m$ , with high probability, the underlying reward mapping function can be approximated by a linear function over $\mathbf{g}(\mathbf{x}^i;\pmb{\theta}_0)$ , parameterized by $\pmb{\theta}^{*} - \pmb{\theta}_{0}$ , where $\mathbf{g}(\mathbf{x}^i;\pmb{\theta}_0) = \nabla_{\pmb{\theta}}f(\mathbf{x};\pmb{\theta}_0) \in \mathbb{R}^d$ is the gradient of the initial neural network. We also define the covariance matrix $\mathbf{A}_t$ at round $t$ as,
+
+$$
+\mathbf {A} _ {t} = \sum_ {s = 1} ^ {t - 1} \mathbf {g} \left(\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}\right) \mathbf {g} \left(\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}\right) ^ {\top} / m + \lambda \mathbf {I} \tag {4.2}
+$$
+
+where $\lambda > 0$ is the $l_{2}$ regularization parameter in Eq (3.2). Discussed before, there exist two kinds of noises in the training samples: the observation noise and the perturbation noise. To analyze the effect of each noise in model estimation, two auxiliary least square solutions are introduced, $\mathbf{A}_t^{-1}\bar{\mathbf{b}}_t$ and $\mathbf{A}_t^{-1}\mathbf{b}_t$ with
+
+$$
+\bar {\mathbf {b}} _ {t} = \sum_ {s = 1} ^ {t - 1} (r _ {s, a _ {s}} + \mathbb {E} [ \gamma_ {s} ^ {t - 1} ]) \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \pmb {\theta} _ {0}) / \sqrt {m}, \quad \mathbf {b} _ {t} = \sum_ {s = 1} ^ {t - 1} (r _ {s, a _ {s}} + \gamma_ {s} ^ {t - 1}) \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \pmb {\theta} _ {0}) / \sqrt {m}.
+$$
+
+These two auxiliary solutions isolate the induced deviations: the first least square solution only contains the deviation caused by observation noise $\{\eta_s\}_{s=1}^{t-1}$ ; and the second least square solution has an extra deviation caused by $\{\gamma_s^{t-1}\}_{s=1}^{t-1}$ .
+
+To analysis the estimation error of the neural network, we first define the following events. At round $t$ , we have event $E_{t,1}$ defined as:
+
+$$
+E _ {t, 1} = \left\{\forall i \in [ K ], | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle - h (\mathbf {x} _ {t, i}) | \leq \alpha_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) \| _ {\mathbf {A} _ {t} ^ {- 1}} \right\}.
+$$
+
+According to Lemma 4.1 and the definition of $\bar{\mathbf{b}}_t$ , under event $E_{t,1}$ , the deviation caused by the observation noise $\{\eta_s\}_{s = 1}^{t - 1}$ can be controlled by $\alpha_{t}$ . We also need event $E_{t,2}$ at round $t$ defined as
+
+$$
+E _ {t, 2} = \{\forall i \in [ K ]: | f (\mathbf {x} _ {t, i}; \pmb {\theta} _ {t - 1}) - \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \leq \epsilon (m) + \beta_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) \| _ {\mathbf {A} _ {t} ^ {- 1}} \},
+$$
+
+where $\epsilon (m)$ is defined as
+
+$$
+\begin{array}{l} \epsilon (m) = C _ {\epsilon , 1} m ^ {- 1 / 6} T ^ {2 / 3} \lambda^ {- 2 / 3} L ^ {3} \sqrt {\log m} + C _ {\epsilon , 2} (1 - \eta m \lambda) ^ {J} \sqrt {T L / \lambda} \\ + C _ {\epsilon , 3} m ^ {- 1 / 6} T ^ {5 / 3} \lambda^ {- 5 / 3} L ^ {4} \sqrt {\log m} (1 + \sqrt {T / \lambda}), \\ \end{array}
+$$
+
+with constants $\{C_{\epsilon ,i}\}_{i = 1}^{3}$ . Event $E_{t,2}$ considers the situation that the deviation caused by the added noise $\{\gamma_s^{t - 1}\}_{s = 1}^{t - 1}$ is under control with parameter $\beta_{t}$ at round $t$ , and the approximation error $\epsilon (m)$ is carefully tracked by properly setting the neural network width $m$ .
+
+The following lemmas show that given the history $\mathcal{F}_{t-1} = \sigma\{\mathbf{x}_1, r_1, \mathbf{x}_2, r_2, \ldots, \mathbf{x}_{t-1}, r_{t-1}, \mathbf{x}_t\}$ , which is $\sigma$ -algebra generated by the previously pulled arms and the observed rewards, with proper setting, events $E_{t,1}$ and $E_{t,2}$ happen with a high probability.
+
+Lemma 4.2. For any $t \in [T]$ , $\lambda > 0$ and $\delta > 0$ , with $\alpha_{t} = \sqrt{R^{2} \log \left( \det(\mathbf{A}_{t}) / (\delta^{2} \det(\lambda \mathbf{I})) \right)} + \sqrt{\lambda} S$ , we have $\mathbb{P}(E_{t,1} | \mathcal{F}_{t-1}) \geq 1 - \delta$ .
+
+In particular, $S$ denotes the upper bound of $\sqrt{2\mathbf{h}^\top\mathbf{H}^{-1}\mathbf{h}}$ , which is a constant if the reward function $h(\cdot)$ belongs to the RKHS space induced by the neural tangent kernel.
+
+Lemma 4.3. There exist positive constants $\{C_i\}_{i=1}^3$ , such that with step size and the neural network satisfy that $\eta = C_1(m\lambda + mLT)^{-1}$ , $m \geq C_2\sqrt{\lambda}L^{-3/2}[\log(TKL^2/\delta)]^{3/2}$ , and $m[\log m]^{-3} \geq C_3\max\{TL^{12}\lambda^{-1}, T^7\lambda^{-8}L^{18}(\lambda + LT)^6, L^{21}T^7\lambda^{-7}(1 + \sqrt{T/\lambda})^6\}$ , given history $\mathcal{F}_{t-1}$ , by choosing $\beta_t = \sigma \sqrt{4\log t + 2\log K}$ , we have $\mathbb{P}(E_{t,2}|\mathcal{F}_{t-1}) \geq 1 - t^{-2}$ .
+
+We leave the detailed proof in the appendix. According to Lemma 4.2 and Lemma 4.3, with more observations become available, the neural network based reward estimator $f(\mathbf{x};\boldsymbol{\theta}_t)$ will gradually converge to the true expected reward $h(\mathbf{x})$ . In the meantime, the variance of the added perturbation leads to reward overestimation, which will compensate the potential underestimation caused by the observation noise and the approximation error. The following lemma describes this anticoncentration behavior of the added noise $\{\gamma_s^{t - 1}\}_{s = 1}^{t - 1}$ .
+
+Lemma 4.4. For any $t \in [T]$ , with $\sigma = \alpha_t (1 - \lambda \lambda_K^{-1} (\mathbf{A}_K))^{-1/2}$ , $\alpha_t$ defined in Lemma 4.2, $\epsilon(m)$ defined in Lemma 4.3, given history $\mathcal{F}_{t-1}$ , we have $\mathbb{P}(E_{t,3}) = \mathbb{P}(f(\mathbf{x}_{t,i}; \boldsymbol{\theta}_{t-1}) \geq h(\mathbf{x}_{t,i}) - \epsilon(m) | \mathcal{F}_{t-1}, E_{t,1}) \geq (4e\sqrt{\pi})^{-1}$ , where $\mathbf{A}_K$ is the covariance matrix constructed after the initial $K$ -round arm pulling (line 8 to 10 in Algorithm 1) by Eq (4.2), and $\lambda_K(\mathbf{A}_K)$ represents the $K$ -th largest eigenvalue of matrix $\mathbf{A}_K$ .
+
+With $\alpha_{t}$ defined in Lemma 4.2, and $\epsilon(m)$ and $\beta_{t}$ defined in Lemma 4.3, we divide the arms into two groups. More specifically, we define the set of sufficiently sampled arms in round $t$ as:
+
+$$
+\Omega_ {t} = \{\forall i \in [ K ]: 2 \epsilon (m) + (\alpha_ {t} + \beta_ {t}) \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) \| _ {\mathbf {A} _ {t} ^ {- 1}} \leq h (\mathbf {x} _ {t, a ^ {*}}) - h (\mathbf {x} _ {t, i}) \}.
+$$
+
+Accordingly, the set of undersampled arms is defined as $\bar{\Omega}_t = [K] \setminus \Omega_t$ . Note that by this definition, the best arm $a^*$ belongs to $\bar{\Omega}_t$ . In the following lemma, we show that at any time step $t > K$ , the expected one-step regret is upper bounded in terms of the regret due to playing an undersampled arm $a_t \in \bar{\Omega}_t$ .
+
+Lemma 4.5. With $m$ , $\eta$ , $\sigma$ satisfying the conditions in Lemma 4.2, 4.3, 4.4, and $\epsilon(m)$ defined in Lemma 4.3, with probability at least $1 - \delta$ the one step regret of NPR is upper bounded,
+
+$$
+\mathbb {E} [ h (\mathbf {x} _ {t, a _ {t} ^ {*}}) - h (\mathbf {x} _ {t, a _ {t}}) ] \leq \mathbb {P} (\bar {E} _ {t, 2}) + 4 \epsilon (m) + (\beta_ {t} + \alpha_ {t}) \big (1 + 2 / \mathbb {P} (a _ {t} \in \bar {\Omega} _ {t}) \big) \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}.
+$$
+
+Furthermore, $\mathbb{P}(a_t\in \bar{\Omega}_t)\geq \mathbb{P}_t(E_{t,3}) - \mathbb{P}_t(\bar{E}_{t,2}).$
+
+To bound the cumulative regret of NPR, we also need the following lemma.
+
+Lemma 4.6. With $\widetilde{d}$ as the effective dimension of the NTK matrix $\mathbf{H}$ , we have
+
+$$
+\sum_ {t = 1} ^ {T} \min \left\{\| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t - 1} ^ {- 1}} ^ {2}, 1 \right\} \leq 2 (\widetilde {d} \log (1 + T K / \lambda) + 1)
+$$
+
+The effective dimension is first proposed in (Valko et al., 2013) to analyze the kernelized contextual bandit, which roughly measures the number of directions in the kernel space where the data mostly lies. The detailed definition of $\widetilde{d}$ can be found in Definition B.3 in the appendix. Finally, with proper neural network setup, we provide an $m$ -independent regret upper bound.
+
+Theorem 4.7. Let $\widetilde{d}$ be the effective dimension of the NTK kernel matrix $\mathbf{H}$ . There exist positive constants $C_1$ and $C_r$ , such that for any $\delta \in (0,1)$ , when network structure and the step size for model update satisfy $m \geq \mathrm{poly}(T,L,K,\lambda^{-1},S^{-1},\log(1/\delta))$ , $\eta = C_1(mTL + m\lambda)^{-1}$ and $\lambda \geq \max\{1,S^{-2}\}$ , with probability at least $1 - \delta$ , the cumulative regret of NPR satisfies
+
+$$
+R _ {T} \leq \Gamma \left(R \sqrt {\tilde {d} \log (1 + T K / \lambda) + 2 - 2 \log \delta} + \sqrt {\lambda} S\right) \cdot \sqrt {2 \tilde {d} T \log (1 + T K / \lambda) + 2} + 7 + K \tag {4.3}
+$$
+
+where $\Gamma = 44\mathbf{e}\sqrt{\pi} (1 + \sqrt{(4\log T + 2\log K) / (1 - \lambda\lambda_{K}^{-1}(\mathbf{A}_{K}))})$
+
+Proof. By Lemma 4.2, $E_{t,1}$ holds for all $t \in [T]$ with probability at least $1 - \delta$ . Therefore, with probability at least $1 - \delta$ , we have
+
+$$
+\begin{array}{l} R _ {T} = \sum_ {t = 1} ^ {T} \mathbb {E} \left[ \left(h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - h \left(\mathbf {x} _ {t, a _ {t}}\right)\right) \mathbb {1} \left\{E _ {t, 1} \right\} \right] \leq \sum_ {t = K + 1} ^ {T} \mathbb {E} \left[ \left(h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - h \left(\mathbf {x} _ {t, a _ {t}}\right)\right) \mathbb {1} \left\{E _ {t, 1} \right\} \right] + K \\ \leq 4 T \epsilon (m) + \sum_ {t = 1} ^ {T} \mathbb {P} _ {t} (\bar {E} _ {t, 2}) + (\beta_ {t} + \alpha_ {t}) (1 + \frac {2}{\mathbb {P} _ {t} (E _ {t , 3}) - \mathbb {P} _ {t} (\bar {E} _ {t , 2})}) \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} + K. \\ \end{array}
+$$
+
+The second inequality is due to the analysis of one-step regret in Lemma 4.5. According to Lemma 4.3, by choosing $\delta = \sigma c_{t}$ , with $c_{t} = \sqrt{4\log t + 2\log K}$ , $\mathbb{P}_t(\bar{E}_{t,2})\leq t^{-2}$ . Hence, $\sum_{t = 1}^{T}\mathbb{P}_{t}(\bar{E}_{t,2})\leq \pi^2 /6$ . Based on Lemma 4.4, with $\sigma = \alpha_t(1 - \lambda \lambda_K^{-1}(\mathbf{A}_K))^{-1 / 2}$ , $\mathbb{P}_t(E_{t,3})\geq \frac{1}{4\mathrm{e}\sqrt{\pi}}$ . Therefore, $1 + 2 / (\mathbb{P}_t(E_{t,3}) - \mathbb{P}_t(\bar{E}_{t,2}))\leq 44\mathrm{e}\sqrt{\pi}$ . By chaining all the inequalities, we have the cumulative regret of NPR upper bounded as,
+
+$$
+\begin{array}{l} R _ {T} \leq \frac {\pi^ {2}}{3} + 4 T \epsilon (m) + \sum_ {t = 1} ^ {T} (\beta_ {t} + \alpha_ {t}) (1 + \frac {2}{\mathbb {P} _ {t} (E _ {t , 3}) - \mathbb {P} _ {t} (\bar {E} _ {t , 2})}) \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} + K \\ \leq \Gamma \left(R \sqrt {\tilde {d} \log (1 + T K / \lambda) + 2 - 2 \log \delta} + \sqrt {\lambda} S\right) \cdot \sqrt {2 \tilde {d} T \log (1 + T K / \lambda) + 2} + \frac {\pi^ {2}}{3} + K \\ + C _ {\epsilon , 1} m ^ {- 1 / 6} T ^ {5 / 3} \lambda^ {- 2 / 3} L ^ {3} \sqrt {\log m} + C _ {\epsilon , 2} (1 - \eta m \lambda) ^ {J} T \sqrt {T L / \lambda} \\ + C _ {\epsilon , 3} m ^ {- 1 / 6} T ^ {8 / 3} \lambda^ {- 5 / 3} L ^ {4} \sqrt {\log m} (1 + \sqrt {T / \lambda}) \\ \end{array}
+$$
+
+where $\Gamma = 44\mathrm{e}\sqrt{\pi} (1 + \sqrt{(4\log T + 2\log K) / (1 - \lambda\lambda_K^{-1}(\mathbf{A}_K)))}$ . The second inequality is due to Lemma 4.6, and the bounds of events $\bar{E}_{t,2}$ and $E_{t,3}$ . By setting $\eta = c(m\lambda +mLT)^{-1}$ , and $J = (1 + LT / \lambda)(\log (C_{\epsilon ,2}) + \log T\sqrt{TL / \lambda}) / c$ , $C_{\epsilon ,2}(1 - \eta m\lambda)^{J}T\sqrt{TL / \lambda}\leq 1$ . Then by choosing the satisfied $m,C_{\epsilon ,1}m^{-1 / 6}T^{5 / 3}\lambda^{-2 / 3}L^3\sqrt{\log m} +C_{\epsilon ,3}m^{-1 / 6}T^{8 / 3}\lambda^{-5 / 3}L^4\sqrt{\log m}(1 + \sqrt{T / \lambda})\leq$ $2 / 3$ . $R_{T}$ can be further bounded by $R_{T}\leq \Gamma \Big(R\sqrt{\tilde{d}\log(1 + TK / \lambda) + 2 - 2\log\delta} +\sqrt{\lambda} S\Big)$ $\sqrt{2\tilde{d}T\log(1 + TK / \lambda) + 2} +7 + K$
+
+This completes the proof.
+
+
+
+# 5 EXPERIMENTS
+
+In this section, we empirically evaluate the proposed neural bandit algorithm NPR against several state-of-the-art baselines, including: linear and neural UCB (LinUCB (Abbasi-Yadkori et al., 2011) and NeuralUCB (Zhou et al., 2020)), linear and neural Thompson Sampling (LinTS (Agrawal & Goyal, 2013) and NeuralTS (ZHANG et al., 2020)), perturbed reward for linear bandits (LinFPL) (Kveton et al., 2019a). To demonstrate the real impact of using diagonal approximation in confidence set construction, we also include NeuralUCB and NeuralTS with diagonal approximation as suggested in their original papers for comparisons.
+
+We evaluated all the algorithms on 1) synthetic dataset via simulation, 2) six $K$ -class classification datasets from UCI machine learning repository (Beygelzimer et al., 2011), and 3) two real-world datasets extracted from the social bookmarking web service Delicious and music streaming service LastFM (Wu et al., 2016). We implemented all the algorithms in PyTorch and performed all the experiments on a server equipped with Intel Xeon Gold 6230 2.10GHz CPU, 128G RAM, four NVIDIA GeForce RTX 2080Ti graphical cards.
+
+# 5.1 EXPERIMENT ON SYNTHETIC DATASET
+
+In our simulation, we first generate a size- $K$ arm pool, in which each arm $i$ is associated with a $d$ -dimensional feature vector $\mathbf{x}_i$ . The contextual vectors are sampled uniformly at random from a unit ball. We generate the rewards via the following two nonlinear functions:
+
+$$
+h _ {1} (\mathbf {x}) = 1 0 ^ {- 2} \left(\mathbf {x} ^ {\top} \Sigma \Sigma^ {\top} \mathbf {x}\right), \quad h _ {2} (\mathbf {x}) = \exp (- 1 0 \left(\mathbf {x} ^ {\top} \boldsymbol {\theta}\right) ^ {2}),
+$$
+
+
+(a) $h_1(\mathbf{x}) = 10^{-2}(\mathbf{x}^\top \Sigma \Sigma^\top \mathbf{x})$
+
+
+(b) $h_2(\mathbf{x}) = \exp (-10(\mathbf{x}^\top \pmb {\theta})^2)$
+
+
+(c) Elapsed time
+
+
+(d) Effect of pool size
+
+
+(e) Effect of network complexity
+Figure 1: Empirical results of regret and time consumption on synthetic dataset.
+
+where each element of $\Sigma \in \mathbb{R}^{d\times d}$ is randomly sampled from $\mathcal{N}(0,1)$ , and $\theta$ is randomly sampled from a unit ball. At each round $t$ , only a subset of $k$ arms out of the total $K$ arms are sampled without replacement and disclosed to all algorithms for selection. The ground-truth reward $r_a$ is corrupted by Gaussian noise $\eta = \mathcal{N}(0,\xi^2)$ before feeding back to the bandit algorithms. We fixed the feature dimension $d = 50$ and the pool size $K = 100$ with $k = 20$ . $\xi$ was set to 0.1 for both $h_1$ and $h_2$ .
+
+Cumulative regret is used to compare the performance of different algorithms. Here the best arm is defined as the one with the highest expected reward in the presented $k$ candidate arms. All the algorithms were executed up to 10000 rounds in simulation, and the averaged results over 10 runs are reported in Figure 1(a) to 1(e). For the neural bandit algorithms, we adopted a 3-layer neural network with $m = 64$ units in each hidden layer. We did a grid search on the first 1000 rounds for regularization parameter $\lambda$ over $\{10^{-i}\}_{i=0}^{4}$ , and step size $\eta$ over $\{10^{-i}\}_{i=0}^{3}$ . We also searched for the concentration parameter $\delta$ so that the exploration parameter $\nu$ is equivalently searched over $\{10^{-i}\}_{i=0}^{4}$ . The best set of hyper-parameters for each algorithm are applied for the full simulation over 10000 rounds, i.e., only that trial will be continued for the rest of 9000 rounds.
+
+In Figure 1(a) and 1(b), we can observe that linear bandit algorithms clearly failed to learn nonlinear mapping and suffered much higher regret compared to the neural algorithms. NPR achieved similar performance as NeuralUCB and NeuralTS, which shows the effectiveness of our randomized exploration strategy in neural bandit learning.
+
+Figure 1(c) shows the average running time for all the neural bandit models in this experiment. With the same network structure, the time spent for model update was similar across different neural bandit models. But we can clearly observe that NeuralUCB and NeuralTS took much more time in arm selection. When choosing an arm, NeuralUCB and NeuralTS, and their corresponding versions with diagonal approximation, need to repeatedly compute: 1) the inverse of the covariance matrix based on the pulled arms in history; and 2) the confidence set of their reward estimation on each candidate arm. The size of the covariance matrix depends on the number of parameters in the neural network (e.g., 7460-by-7460 in this experiment). With diagonal approximation, the computational cost is significantly reduced. But, as mentioned before, there is no theoretical guarantee about the approximation's impact on the model's performance. Intuitively, the impact depends on how the full covariance matrix concentrates on its diagonal, e.g., whether the random feature mappings of the network on the pulled arms are correlated among their dimensions. Unfortunately, this cannot be determined in advance. Figure 1(a) and 1(b) show that the diagonal approximation leads to a significant performance drop. This confirms our concern of such an approximation. In contrast, as shown in Figure 1(c), there is no extra computation overhead in NPR; in the meantime, it provides comparable performance to NeuralUCB and NeuralTS with a full covariance matrix.
+
+
+(a) Adult
+
+
+(b) Mushroom
+
+
+(c) Shuttle
+Figure 2: Comparison of NPR and the baselines on the UCI datasets.
+
+To further investigate the efficiency advantage of NPR, we reported the total running time for the neural bandit algorithms under different sizes of the arm pool and different structures of the neural network under the same simulation setting. With the same neural network structure, models with different sizes of candidate arms should share the same running time for model update. Hence, Figure 1(d) reports how the size of arm pool affects the time spent on arm selection. As we can find, with more candidate arms, NeuralUCB, NeuralTS, and their corresponding diagonal approximations spent more time on arm selection, or more specifically on constructing the confidence set of the reward estimation for each arm. With a fixed size arm pool, the complexity of the neural network will strongly affect the time for computing the inverse of the covariance matrix. In Figure 1(e), the x-axis shows the structure for the hidden layers. The running time for NeuralUCB and NeuralTS significantly increased with enlarged neural networks. The running time of NPR stayed stable, across varying sizes of arm pools and the network complexity. This shows the strong advantage of NPR in efficiency and effectiveness, especially for large-scale problems.
+
+# 5.2 EXPERIMENT ON CLASSIFICATION DATASETS
+
+Following the setting in (Zhou et al., 2020), we evaluated the bandit algorithms on $K$ -class classification problem with six public benchmark datasets, including adult, mushroom, and shuttle from UCI Machine Learning Repository (Dua & Graff, 2017). Due to space limit, we report the results on these three datasets in this section, and leave the other three, letter, covertype, and MagicTelescope in the appendix. We adopted the disjoint model (Li et al., 2010) to build the context vectors for candidate arms: given an input instance with feature $\mathbf{x} \in \mathbb{R}^d$ of a $k$ -class classification problem, we constructed the context features for $k$ candidate arms as: $\mathbf{x}_1 = (\mathbf{x}, \mathbf{0}, \dots, \mathbf{0}), \dots, \mathbf{x}_k = (\mathbf{0}, \dots, \mathbf{0}, \mathbf{x}) \in \mathbb{R}^{d \times k}$ . The model receives reward 1 if it selects the correct class by pulling the corresponding arm, otherwise 0. The cumulative regret measures the total mistakes made by the model over $T$ rounds. Similar to the experiment in synthetic datasets, we adopted a 3-layer neural network with $m = 64$ units in each hidden layer. We used the same grid search setting as in our experiments on synthetic datasets. Figure 2 shows the averaged results across 10 runs for 10000 rounds, except for mushroom which only contains 8124 data instances.
+
+There are several key observations in Figure 2. First, the improvement of applying a neural bandit model depends on the nonlinearity of the dataset. For example, the performance on mushroom and shuttle was highly boosted by the neural models, while the improvement on adult was limited. Second, the impact of the diagonal approximation for NeuralUCB and NeuralTS also depends on the dataset. It did not hurt their performance too much on shuttle, while using the full covariance matrix led to much better performance on Mushroom. Overall, NPR showed consistently better or at least comparable performance to the best neural bandit baselines in all six datasets. Such robust performance and high efficiency make it more advantageous in practice.
+
+# 5.3 EXPERIMENT ON LASTFM & DELICIOUS
+
+The LastFM dataset was extracted from the music streaming service website Last.fm, and the Delicious data set was extracted from the social bookmark sharing service website Delicious (Wu et al., 2016). In particular, the LastFM dataset contains 1,892 users and 17,632 items (artists). We treat the "listened artists" in each user as positive feedback. The Delicious dataset contains 1,861 users and 69,226 items (URLs). We treat the bookmarked URLs for each user as positive feedback. Following the standard setting (Cesa-Bianchi et al., 2013), we pre-processed these two datasets. For the item
+
+
+(a) LastFM dataset
+
+
+(b) Delicious dataset
+Figure 3: Comparisons of normalized rewards on LastFM & Delicious datasets.
+
+features, we used all the tags associated with each item to create its TF-IDF feature vector. Then PCA was applied to reduce the dimensionality of the features. In both datasets, we used the first 25 principle components to construct the item feature vectors. On the user side, we created user features by running node2vec (Grover & Leskovec, 2016) on the user relation graph extracted from the social network provided by the datasets. Each of the users was represented with a 50-dimensional feature vector. We generated the candidate pool as follows: we fixed the size of candidate arm pool to $k = 25$ for each round; for each user, we picked one item from those non-zero payoff items according to the complete observations in the dataset, and randomly picked the other 24 from those zero-payoff items. We constructed the context vectors by concatenating the user and item feature vectors. In our experiment, a 3-layer neural network with $m = 128$ units in each hidden layer was applied to learn the bandit model. And the same gird search was performed to find the best set of hyper-parameters. We performed the experiment with 10000 rounds. Because of the high demand of GPU memory for the matrix inverse computation, we only compared NPR to NeuralUCB and NeuralTS with the diagonal approximation.
+
+We compared the cumulative reward from each algorithm in Figure 3. Besides the neural contextual bandit algorithms, we also include the best reported model on these two datasets, hLinUCB (Wang et al., 2016) for comparison. To improve visibility, we normalized the cumulative reward by a random strategy's cumulative reward (Wu et al., 2016), where the arm was randomly sampled from the candidate pool. All the neural models showed the power to learn the potential non-linear reward mapping on these two real-world datasets. NPR showed its advantage over the baselines (especially on LastFM). As NPR has no additional requirement on the computation resource (e.g., no need for the expensive matrix operation as in the baselines), we also experienced much shorter running in NPR than the other two neural bandit models.
+
+# 6 CONCLUSION
+
+Existing neural contextual bandit algorithms sacrifice computation efficiency for effective exploration in the entire neural network parameter space. To eliminate the computational overhead caused by such an expensive operation, we appealed to randomization-based exploration and obtained the same level of learning outcome. No extra computational cost or resources are needed besides the regular neural network update. We proved that the proposed solution obtains $\widetilde{\mathbf{O}} (\widetilde{d}\sqrt{T})$ regret for $T$ rounds of interactions between the system and user. Extensive empirical results on both synthetic and real-world datasets support our theoretical analysis, and demonstrate the strong advantage of our model in efficiency and effectiveness, which suggest the potential of deploying powerful neural bandit model online in practice.
+
+Our empirical efficiency analysis shows that the key bottleneck of learning a neural model online is at the model update step. Our current regret analysis depends on (stochastic) gradient descent over the entire training set for model update in each round, which is prohibitively expensive. We would like to investigate the possibility of more efficient model update, e.g., online stochastic gradient descent or continual learning, and the corresponding effect on model convergence and regret analysis. Currently, our analysis focuses on the $K$ -armed setting, and it is important to extend our solution and analysis to infinitely many arms in our future work.
+
+# ACKNOWLEDGEMENTS
+
+We thank the anonymous reviewers for their helpful comments. YJ and HW are partially supported by the National Science Foundation under grant IIS-2128019 and IIS-1553568. WZ, DZ and QG are partially supported by the National Science Foundation CAREER Award 1906169 and IIS-1904183. The views and conclusions contained in this paper are those of the authors and should not be interpreted as representing any funding agencies.
+
+# REFERENCES
+
+Yasin Abbasi-Yadkori, David Pál, and Csaba Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pp. 2312-2320, 2011.
+Shipra Agrawal and Navin Goyal. Thompson sampling for contextual bandits with linear payoffs. In International Conference on Machine Learning, pp. 127-135, 2013.
+Zeyuan Allen-Zhu, Yuzhhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pp. 242-252, 2019.
+Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, 2019.
+Alina Beygelzimer, John Langford, Lihong Li, Lev Reyzin, and Robert E. Schapire. Contextual bandit algorithms with supervised learning guarantees. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 19-26, 2011.
+Yuan Cao and Quanquan Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. In Advances in Neural Information Processing Systems, 2019.
+Yuan Cao and Quanquan Gu. Generalization error bounds of gradient descent for learning overparameterized deep relu networks. In the Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020.
+Nicolo Cesa-Bianchi, Claudio Gentile, and Giovanni Zappella. A gang of bandits. arXiv preprint arXiv:1306.0811, 2013.
+Zixiang Chen, Yuan Cao, Difan Zou, and Quanquan Gu. How much over-parameterization is sufficient to learn deep relu networks? In International Conference on Learning Representations, 2020.
+Sayak Ray Chowdhury and Aditya Gopalan. On kernelized multi-armed bandits. In International Conference on Machine Learning, pp. 844-853. PMLR, 2017.
+Amit Daniely. SGD learns the conjugate kernel class of the network. In Advances in Neural Information Processing Systems, pp. 2422-2430, 2017.
+Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675-1685, 2019.
+Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml.
+Louis Faury, Marc Abeille, Clément Calauzènes, and Olivier Fercoq. Improved optimistic algorithms for logistic bandits. In International Conference on Machine Learning, pp. 3052-3060. PMLR, 2020.
+Sarah Filippi, Olivier Cappe, Aurélien Garivier, and Csaba Szepesvári. Parametric bandits: The generalized linear case. In Advances in Neural Information Processing Systems, pp. 586-594, 2010.
+
+Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855-864, 2016.
+Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pp. 8571-8580, 2018.
+Andreas Krause and Cheng S Ong. Contextual Gaussian process bandit optimization. In Advances in neural information processing systems, pp. 2447-2455, 2011.
+Branislav Kveton, Csaba Szepesvári, Mohammad Ghavamzadeh, and Craig Boutilier. Perturbed-history exploration in stochastic linear bandits. In Proceedings of the 35th Conference on Uncertainty in Artificial Intelligence (UAI), pp. 176, 2019a.
+Branislav Kveton, Csaba Szepesvari, Sharan Vaswani, Zheng Wen, Tor Lattimore, and Mohammad Ghavamzadeh. Garbage in, reward out: Bootstrapping exploration in multi-armed bandits. In International Conference on Machine Learning, pp. 3601-3610. PMLR, 2019b.
+Branislav Kveton, Manzil Zaheer, Csaba Szepesvári, Lihong Li, Mohammad Ghavamzadeh, and Craig Boutilier. Randomized exploration in generalized linear bandits. In Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics, 2020.
+Huitian Lei, Ambuj Tewari, and Susan A Murphy. An actor-critic contextual bandit algorithm for personalized mobile health interventions. arXiv preprint arXiv:1706.09090, 2017.
+Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pp. 661-670. ACM, 2010.
+Alessandro Nuara, Francesco Trovo, Nicola Gatti, and Marcello Restelli. A combinatorial-bandit algorithm for the online joint bid/budget optimization of pay-per-click advertising campaigns. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
+Carlos Riquelme, George Tucker, and Jasper Snoek. Deep Bayesian bandits showdown. In International Conference on Learning Representations, 2018.
+Eric M Schwartz, Eric T Bradlow, and Peter S Fader. Customer acquisition via display advertising using multi-armed bandit experiments. Marketing Science, 36(4):500-522, 2017.
+Ambuj Tewari and Susan A Murphy. From ads to interventions: Contextual bandits in mobile health. In Mobile Health, pp. 495-517. Springer, 2017.
+Michal Valko, Nathaniel Korda, Rémi Munos, Ilias Flaounas, and Nelo Cristianini. Finite-time analysis of kernelised contextual bandits. arXiv preprint arXiv:1309.6869, 2013.
+Huazheng Wang, Qingyun Wu, and Hongning Wang. Learning hidden features for contextual bandits. In Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, pp. 1633-1642, 2016.
+Qingyun Wu, Huazheng Wang, Quanquan Gu, and Hongning Wang. Contextual bandits in a collaborative environment. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, pp. 529-538, 2016.
+Pan Xu, Zheng Wen, Handong Zhao, and Quanquan Gu. Neural contextual bandits with deep representation and shallow exploration. arXiv preprint arXiv:2012.01780, 2020.
+Tom Zahavy and Shie Mannor. Deep neural linear bandits: Overcoming catastrophic forgetting through likelihood matching. arXiv preprint arXiv:1901.08612, 2019.
+Weitong ZHANG, Dongruo Zhou, Lihong Li, and Quanquan Gu. Neural thompson sampling. In International Conference on Learning Representations, 2020.
+Dongruo Zhou, Lihong Li, and Quanquan Gu. Neural contextual bandits with ucb-based exploration. In International Conference on Machine Learning, pp. 11492-11502. PMLR, 2020.
+
+Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Stochastic gradient descent optimizes over-parameterized deep ReLU networks. Machine Learning, 2019.
+
+# A ADDITIONAL EXPERIMENTS
+
+# A.1 EXPERIMENTS ON SYNTHETIC DATASETS
+
+# A.1.1 REWARD PREDICTION WITH MORE COMPLICATED NEURAL NETWORKS
+
+In the main paper, to compare NPR with the existing neural bandit baselines, we chose a relatively small neural network, e.g., $m = 64$ , so that NeuralUCB/NeuralTS can be executed with a full covariance matrix. To better capture the non-linearity in reward generation, we increased the width of the neural network to $m = 128$ , and report the results in Figure 4. All other experiment settings (e.g., underlying reward generation function) are the same as reported in the main paper. And to provide a more comprehensive picture, we also reported the variance of each algorithm's performance in this figure.
+
+With the increased network width and limited by the GPU memory, NeuralUCB and NeuralTS can only be executed with the diagonal matrix of the covariance matrix when computing their required "exploration bonus term". In Figure 4, we can observe 1) all neural bandit algorithms obtained the expected sublinear regret; and 2) NPR performed better than NeuralUCB and NeuralTS, because of the diagonal approximation that we have to use on these two baselines. This again strongly suggested the advantage of NPR: the approximation due to the computational complexity in NeuralUCB and NeuralTS limits their practical effectiveness, though they have the same theoretical regret bound as NPR's. 3) FALCON+ shows better performance in the initial rounds, while with more iterations, its regret is higher than the neural bandit baselines' and our NPR model'. Compared to the neural bandit models, FALCON+ has much slower convergence, e.g., the slope of its regret curve did not decrease as fast as other models' over the course of interactions. After a careful investigation, we found this is caused by its scheduled update: because less and less updates can be performed in the later rounds, FALCON+ still selected the suboptimal arms quite often. Another important observation is that FALCON+ has a very high variance in its performance: in some epochs, it could keep sampling the suboptimal arms. This is again caused by its lazy update: in some epochs of some trials, its estimation could be biased by large reward noise, which will directly cost it miss the right arm in almost the entire next epoch.
+
+
+(a) $h_1(\mathbf{x}) = 10^{-2}(\mathbf{x}^\top \Sigma \Sigma^\top \mathbf{x})$
+
+
+(b) $h_2(\mathbf{x}) = \exp (-10(\mathbf{x}^\top \pmb {\theta})^2)$
+Figure 4: Comparison of NPR and the baselines on the synthetic dataset with $m = 128$
+
+# A.1.2 COMPARISONS UNDER DIFFERENT VALUES OF $k$
+
+For the experiment in the main paper, at each round only $k = 20$ arms are sampled from the $K = 100$ arm pool and disclosed to all the algorithms for selection. It is to test a more general setting in practice, e.g., different recommendation candidates appear across rounds. In the meantime, such setting also introduces more practical difficulties as only a subset of arms are revealed to the agent to learn from each time. In this experiment, we report the results of the neural bandit models with
+
+
+(a) $h_1(\mathbf{x}) = 10^{-2}(\mathbf{x}^\top \Sigma \Sigma^\top \mathbf{x})$
+
+
+(b) $h_2(\mathbf{x}) = \exp (-10(\mathbf{x}^\top \pmb {\theta})^2)$
+Figure 5: Comparison of NPR and the baselines on the synthetic dataset with different $k$ .
+
+different value $k$ , e.g., the number of arms disclosed each round. We followed the setting in Section A.1.1 to set the network width $m = 128$ .
+
+Figure 5 demonstrates that for both datasets, revealing all the candidate arms, e.g., $k = 100$ , will considerably reduce the regret compared to only revealing a subset of the arms. But in both settings, all bandit algorithms, including NPR, can obtain desired performance (i.e., sublinear regret). And again, NPR still obtained more satisfactory performance as it is not subject to the added computational complexity in NeuralUCB and NeuralTS. The FALCON+ baseline performed much better when $k = 20$ than $k = 100$ , as it has less chance to select the suboptimal arms in each epoch, which is expected based on its polynomial dependence on the number of arms $K$ . On the contrary, NPR only has a logarithmic dependence on $K$ , whose advantage was validated in this experiment.
+
+# A.2 EXPERIMENTS ON CLASSIFICATION DATASETS
+
+
+(a) MagicTelescope
+Figure 6: Comparison of NPR and the baselines on the UCI datasets.
+
+
+(b) Letter
+
+
+(c) Covertype
+
+Table 1: Dataset statistics
+
+| DATASET | ADULT | MUSHROOM | SHUTTLE | MAGIC | LETTER | COVERTYPE |
| INPUT DIMENSION | 2 × 15 | 2 × 23 | 7 × 9 | 2 × 12 | 16 × 26 | 54 × 7 |
+
+We present the experiment results of the classification problem on UCI datasets, MagicTelescope, letter and covertype. The experiment setting and grid search setting for parameter tuning are the same as described in Section 5. For datasets letter and covertype, only the results of NeuralUCB and NeuralTS with diagonal approximation are reported as the required GPU memory for the calculation of matrix inverse, together with the neural model update, exceeds the supported memory of the NVIDIA GEFORCE RTX 2080 graphical card. Similar observations are obtained for these three datasets. Compared to the linear contextual models, the neural contextual bandit algorithms significantly improve the performance with much lower regret (mistakes on classification). NPR showed consistently better performance to the best neural bandit baselines. And due to its perturbation-based exploration strategy, no extra computational resources are needed, which makes it more practical in real-world problems, especially large-scale tasks.
+
+# B BACKGROUND FOR THEORETICAL ANALYSIS
+
+We denote the set of all the possible $K$ arms by their context vectors as $\{\mathbf{x}_i\}_{i=1}^K$ . Our analysis is built upon the existing work in neural tangent kernel techniques.
+
+Definition B.1 (Jacot et al. (2018); Cao & Gu (2019)). Let $\{\mathbf{x}_i\}_{i=1}^K$ be a set of contexts. Define
+
+$$
+\widetilde {\mathbf {H}} _ {i, j} ^ {(1)} = \boldsymbol {\Sigma} _ {i, j} ^ {(1)} = \langle \mathbf {x} _ {i}, \mathbf {x} _ {j} \rangle , \qquad \mathbf {B} _ {i, j} ^ {(l)} = \left( \begin{array}{c c} \boldsymbol {\Sigma} _ {i, i} ^ {(l)} & \boldsymbol {\Sigma} _ {i, j} ^ {(l)} \\ \boldsymbol {\Sigma} _ {i, j} ^ {(l)} & \boldsymbol {\Sigma} _ {j, j} ^ {(l)} \end{array} \right),
+$$
+
+$$
+\boldsymbol {\Sigma} _ {i, j} ^ {(l + 1)} = 2 \mathbb {E} _ {(u, v) \sim N (\mathbf {0}, \mathbf {B} _ {i, j} ^ {(l)})} [ \phi (u) \phi (v) ],
+$$
+
+$$
+\widetilde {\mathbf {H}} _ {i, j} ^ {(l + 1)} = 2 \widetilde {\mathbf {H}} _ {i, j} ^ {(l)} \mathbb {E} _ {(u, v) \sim N (\mathbf {0}, \mathbf {B} _ {i, j} ^ {(l)})} [ \phi^ {\prime} (u) \phi^ {\prime} (v) ] + \boldsymbol {\Sigma} _ {i, j} ^ {(l + 1)}.
+$$
+
+Then, $\mathbf{H} = (\widetilde{\mathbf{H}}^{(L)} + \boldsymbol{\Sigma}^{(L)}) / 2$ is called the neural tangent kernel (NTK) matrix on the context set.
+
+With Definition B.1, we also have the following assumption on the contexts: $\{\mathbf{x}_i\}_{i=1}^K$ .
+
+Assumption B.2. $\mathbf{H} \succeq \lambda_0\mathbf{I}$ ; and moreover, for any $1 \leq i \leq K$ , $\| \mathbf{x}_i \|_2 = 1$ and $[\mathbf{x}_i]_j = [\mathbf{x}_i]_{j+d/2}$ .
+
+By assuming $\mathbf{H} \succeq \lambda_0\mathbf{I}$ , the neural tangent kernel matrix is non-singular (Du et al., 2019; Arora et al., 2019; Cao & Gu, 2019). It can be easily satisfied when no two context vectors in the context set are in parallel. The second assumption is just for convenience in analysis and can be easily satisfied by: for any context vector $\mathbf{x}$ , $\| \mathbf{x}\|_2 = 1$ , we can construct a new context $\mathbf{x}' = [\mathbf{x}^\top, \mathbf{x}^\top]^\top / \sqrt{2}$ . It can be verified that if $\pmb{\theta}_0$ is initialized as in Algorithm 1, then $f(\mathbf{x}_i; \pmb{\theta}_0) = 0$ for any $i \in [K]$ .
+
+The NTK technique builds a connection between the analysis of DNN and kernel methods. With the following definition of effective dimension, we are able to analyze the neural network by some complexity measures previously used for kernel methods.
+
+Definition B.3. The effective dimension $\widetilde{d}$ of the neural tangent kernel matrix on contexts $\{\mathbf{x}_i\}_{i=1}^K$ is defined as
+
+$$
+\widetilde {d} = \frac {\log \det (\mathbf {I} + T \mathbf {H} / \lambda)}{\log (1 + T K / \lambda)}.
+$$
+
+The notion of effective dimension is first introduced in Valko et al. (2013) for analyzing kernel contextual bandits, which describes the actual underlying dimension in the set of observed contexts $\{\mathbf{x}_i\}_{i=1}^K$ .
+
+And we also need the following concentration bound on Gaussian distribution.
+
+Lemma B.4. Consider a normally distributed random variable $X \sim \mathcal{N}(\mu, \sigma^2)$ and $\beta \geq 0$ . The probability that $X$ is within a radius of $\beta \sigma$ from its mean can be written as,
+
+$$
+\mathbb {P} \left(\left| X - \mu \right| \leq \beta \sigma\right) \geq 1 - \exp \left(- \beta^ {2} / 2\right).
+$$
+
+# C PROOF OF THEOREMS AND LEMMAS IN SECTION 4
+
+# C.1 PROOF OF LEMMA 4.2
+
+Proof of Lemma 4.2. By Lemma 4.1, with a satisfied $m$ , with probability at least $1 - \delta$ , we have for any $i \in [K]$
+
+$$
+h \left(\mathbf {x} _ {i}\right) = \left\langle \mathbf {g} \left(\mathbf {x} _ {i}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m}, \sqrt {m} \left(\boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0}\right) \right\rangle , \text {a n d} \sqrt {m} \left\| \boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0} \right\| _ {2} \leq \sqrt {2 \mathbf {h} ^ {\top} \mathbf {H} ^ {- 1} \mathbf {h}} \leq S.
+$$
+
+Hence, based on the definition of $\mathbf{A}_t$ and $\bar{\mathbf{b}}_t$ , we know that $\mathbf{A}_t^{-1}\bar{\mathbf{b}}_t$ is the least square solution on top of the observation noise. Therefore, by Theorem 1 in Abbasi-Yadkori et al. (2011), with probability at least $1 - \delta$ , for any $1 \leq t \leq T$ , $\pmb{\theta}^*$ satisfies that
+
+$$
+\left\| \sqrt {m} \left(\boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0}\right) - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} \right\| _ {\mathbf {A} _ {t}} \leq \sqrt {R ^ {2} \log \frac {\det (\mathbf {A} _ {t})}{\delta^ {2} \det (\lambda \mathbf {I})}} + \sqrt {\lambda} S, \tag {C.1}
+$$
+
+where $R$ is the sub-Gaussian variable for the observation noise $\eta$ . Then we have,
+
+$$
+\begin{array}{l} | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle - h (\mathbf {x} _ {t, i}) | \\ = \left| \left\langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \right\rangle - \left\langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0} \right\rangle \right| \\ \leq \| \sqrt {m} (\boldsymbol {\theta} ^ {*} - \boldsymbol {\theta} _ {0}) - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} \| _ {\mathbf {A} _ {t}} \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} \leq \alpha_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}. \\ \end{array}
+$$
+
+with $\alpha_{t} = \sqrt{R^{2}\log\frac{\operatorname*{det}(\mathbf{A}_{t})}{\delta^{2}\operatorname*{det}(\lambda\mathbf{I})}} +\sqrt{\lambda} S.$ This completes the proof.
+
+
+
+# C.2 PROOF OF LEMMA 4.3
+
+The proof starts with three lemmas that bound the error terms of the function value and gradient of a neural network.
+
+Lemma C.1 (Lemma B.2, Zhou et al. (2020)). There exist constants $\{\bar{C}_i\}_{i=1}^5 > 0$ such that for any $\delta > 0$ , with $J$ as the number of steps for gradient descent in neural network learning, if for all $t \in [T]$ , $\eta$ and $m$ satisfy
+
+$$
+\begin{array}{l} 2 \sqrt {t / (m \lambda)} \geq \bar {C} _ {1} m ^ {- 3 / 2} L ^ {- 3 / 2} [ \log (K L ^ {2} / \delta) ] ^ {3 / 2}, \\ 2 \sqrt {t / (m \lambda)} \leq \bar {C} _ {2} \min \left\{L ^ {- 6} [ \log m ] ^ {- 3 / 2}, \left(m (\lambda \eta) ^ {2} L ^ {- 6} t ^ {- 1} (\log m) ^ {- 1}\right) ^ {3 / 8} \right\}, \\ \eta \leq \bar {C} _ {3} (m \lambda + t m L) ^ {- 1}, \\ m ^ {1 / 6} \geq \bar {C} _ {4} \sqrt {\log m} L ^ {7 / 2} t ^ {7 / 6} \lambda^ {- 7 / 6} (1 + \sqrt {t / \lambda}), \\ \end{array}
+$$
+
+then with probability at least $1 - \delta$ , we have that $\| \pmb{\theta}_{t-1} - \pmb{\theta}_0 \|_2 \leq 2 \sqrt{t / (m\lambda)}$ and
+
+$$
+\| \pmb {\theta} _ {t - 1} - \pmb {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \| _ {2} \leq (1 - \eta m \lambda) ^ {J / 2} \sqrt {t / (m \lambda)} + \bar {C} _ {5} m ^ {- 2 / 3} \sqrt {\log m} L ^ {7 / 2} t ^ {5 / 3} \lambda^ {- 5 / 3} (1 + \sqrt {t / \lambda}).
+$$
+
+Lemma C.2 (Lemma B.3 Zhou et al. (2020)). There exist constants $\{\bar{C}_i^u\}_{i = 1}^3 >0$ such that for any $\delta >0$ , if $\tau$ satisfies
+
+$$
+\bar {C} _ {1} ^ {u} m ^ {- 3 / 2} L ^ {- 3 / 2} [ \log (K L ^ {2} / \delta) ] ^ {3 / 2} \leq \tau \leq \bar {C} _ {2} ^ {u} L ^ {- 6} [ \log m ] ^ {- 3 / 2},
+$$
+
+then with probability at least $1 - \delta$ , for any $\widetilde{\pmb{\theta}}$ and $\widehat{\pmb{\theta}}$ satisfying $\| \widetilde{\pmb{\theta}} - \pmb{\theta}_0 \|_2 \leq \tau$ , $\| \widehat{\pmb{\theta}} - \pmb{\theta}_0 \|_2 \leq \tau$ and $j \in [K]$ we have
+
+$$
+\left| f (\mathbf {x} _ {j}; \widetilde {\boldsymbol {\theta}}) - f (\mathbf {x} _ {j}; \widehat {\boldsymbol {\theta}}) - \langle \mathbf {g} (\mathbf {x} _ {j}; \widehat {\boldsymbol {\theta}}), \widetilde {\boldsymbol {\theta}} - \widehat {\boldsymbol {\theta}} \rangle \right| \leq \bar {C} _ {3} ^ {u} \tau^ {4 / 3} L ^ {3} \sqrt {m \log m}.
+$$
+
+Lemma C.3 (Lemma B.4, Zhou et al. (2020)). There exist constants $\{\bar{C}_i^v\}_{i = 1}^3 >0$ such that for any $\delta >0$ , if $\tau$ satisfies that
+
+$$
+\bar {C} _ {1} ^ {v} m ^ {- 3 / 2} L ^ {- 3 / 2} [ \log (K L ^ {2} / \delta) ] ^ {3 / 2} \leq \tau \leq \bar {C} _ {2} ^ {v} L ^ {- 6} [ \log m ] ^ {- 3 / 2},
+$$
+
+then with probability at least $1 - \delta$ , for any $\| \pmb{\theta} - \pmb{\theta}_0 \|_2 \leq \tau$ and $j \in [K]$ we have $\| \mathbf{g}(\mathbf{x}_j; \pmb{\theta}) \|_F \leq \bar{C}_3^v \sqrt{mL}$ .
+
+With above lemmas, we prove Lemma 4.3 as follows.
+
+Proof of Lemma 4.3. According to Lemma C.1, with satisfied neural network and the learning rate $\eta$ , we have $\| \pmb{\theta}_{t - 1} - \pmb{\theta}_0 \|_2 \leq 2\sqrt{t / m\lambda}$ . Further, by the choice of $m$ , Lemma C.2 and C.3 hold.
+
+Therefore, $|f(\mathbf{x}_{t,i};\pmb{\theta}_{t - 1}) - \langle \mathbf{g}(\mathbf{x}_{t,i};\pmb{\theta}_0),\mathbf{A}_t^{-1}\bar{\mathbf{b}}_t / \sqrt{m}\rangle |$ can be first upper bounded by:
+
+$$
+\begin{array}{l} | f (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {t - 1}) - \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \\ \leq \left| f \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {t - 1}\right) - f \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) - \left\langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} \right\rangle \right| + \left| \left\langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \right\rangle \right| \\ \leq C _ {\epsilon , 1} m ^ {- 1 / 6} T ^ {2 / 3} \lambda^ {- 2 / 3} L ^ {3} \sqrt {\log m} + | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \tag {C.2} \\ \end{array}
+$$
+
+where the first inequality holds due to triangle inequality, $f(\mathbf{x}_{t,i};\pmb{\theta}_0) = 0$ by the random initialization of $\pmb{\theta}_0$ , and the second inequality holds due to Lemma C.2 with the fact $\| \pmb{\theta}_{t - 1} - \pmb{\theta}_0\| _2\leq 2\sqrt{t / m\lambda}$ .
+
+Next, we bound the second term of Eq (C.2),
+
+$$
+\begin{array}{l} | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \\ \leq \left| \langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} \rangle \right| + \left| \langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle \right| \\ \leq \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) \| _ {2} \| \boldsymbol {\theta} _ {t - 1} - \boldsymbol {\theta} _ {0} - \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} \| _ {2} + | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \\ \leq C _ {\epsilon , 2} (1 - \eta m \lambda) ^ {J} \sqrt {T L / \lambda} + C _ {\epsilon , 3} m ^ {- 1 / 6} T ^ {5 / 3} \lambda^ {- 5 / 3} L ^ {4} \sqrt {\log m} (1 + \sqrt {T / \lambda}) \\ + \left| \left\langle \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \right\rangle \right| \tag {C.3} \\ \end{array}
+$$
+
+where the first inequality holds due to the triangle inequality, the second inequality holds according to Cauchy-Schwarz inequality, and the third inequality holds due to Lemma C.1, C.3, with the fact that $\| \pmb{\theta}_{t - 1} - \pmb{\theta}_0\| _2\leq 2\sqrt{t / m\lambda}$ and $t\le T$
+
+Now, we provide the upper bound of the last term in Eq (C.3). Based on the definition of $\mathbf{b}_t$ and $\bar{\mathbf{b}}_t$ , we have
+
+$$
+| \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | = | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) / \sqrt {m}, \mathbf {A} _ {t} ^ {- 1} \sum_ {s = 1} ^ {t - 1} \gamma_ {s} ^ {t - 1} \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \pmb {\theta} _ {0}) \rangle |
+$$
+
+According to the definition of the added random noise $\gamma_s^t\sim \mathcal{N}(0,\sigma^2)$ , and Lemma B.4, with $\beta_{t}\geq 0$ we have the following inequality,
+
+$$
+\begin{array}{l} \mathbb {P} _ {t} \left(\left| \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m}, \mathbf {A} _ {t} ^ {- 1} \sum_ {s = 1} ^ {t - 1} \gamma_ {s} ^ {t - 1} \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \rangle \right| \geq \beta_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \\ \leq 2 \exp \left(- \frac {\beta_ {t} ^ {2} \| \mathbf {g} (\mathbf {x} _ {t , i} ; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ^ {2}}{2 \sigma^ {2} \mathbf {g} (\mathbf {x} _ {t , i} ; \boldsymbol {\theta} _ {0}) ^ {\top} \mathbf {A} _ {t} ^ {- 1} (\sum_ {s = 1} ^ {t - 1} \mathbf {g} (\mathbf {x} _ {s , a _ {s}} ; \boldsymbol {\theta} _ {0}) \mathbf {g} (\mathbf {x} _ {s , a _ {s}} ; \boldsymbol {\theta} _ {0}) ^ {\top} / m) \mathbf {A} _ {t} ^ {- 1} \mathbf {g} (\mathbf {x} _ {t , i} ; \boldsymbol {\theta} _ {0}) / m}\right) \\ \leq 2 \exp \left(- \frac {\beta_ {t} ^ {2}}{2 \sigma^ {2}}\right), \\ \end{array}
+$$
+
+where the last inequality stands as,
+
+$$
+\begin{array}{l} \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) ^ {\top} \mathbf {A} _ {t} ^ {- 1} \left(\sum_ {s = 1} ^ {t - 1} \mathbf {g} \left(\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}\right) \mathbf {g} \left(\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}\right) ^ {\top} / m\right) \mathbf {A} _ {t} ^ {- 1} \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) / m \\ \leq \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) ^ {\top} \mathbf {A} _ {t} ^ {- 1} (\sum_ {s = 1} ^ {t - 1} \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}) \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \boldsymbol {\theta} _ {0}) ^ {\top} / m + \lambda \mathbf {I}) \mathbf {A} _ {t} ^ {- 1} \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / m \\ = \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ^ {2}. \\ \end{array}
+$$
+
+Therefore, in round $t$ , for the given arm $i$
+
+$$
+\mathbb {P} _ {t} \left(| \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \leq \beta_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \geq 1 - \exp (- \beta_ {t} ^ {2} / (2 \sigma^ {2})).
+$$
+
+Taking the union bound over $K$ arms, we have that for any $t$ :
+
+$$
+\mathbb {P} _ {t} \left(\forall i \in [ K ], | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \leq \beta_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \geq 1 - K \exp (- \beta_ {t} ^ {2} / (2 \sigma^ {2})).
+$$
+
+By choosing $\beta_{t} = \sigma \sqrt{4\log t + 2\log K}$ , we have:
+
+$$
+\mathbb {P} _ {t} \left(\forall i \in [ K ], | \langle \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle | \leq \beta_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \geq 1 - \frac {1}{t ^ {2}}.
+$$
+
+This completes the proof.
+
+# C.3 PROOF OF LEMMA 4.4
+
+The proof requires the anti-concentration bound of Gaussian distribution.
+
+Lemma C.4. For a Gaussian random variable $X\sim N(\mu ,\sigma^2)$ , for any $\beta >0$
+
+$$
+\mathbb {P} \left(\frac {X - \mu}{\sigma} > \beta\right) \geq \frac {\exp (- \beta^ {2})}{4 \sqrt {\pi} \beta}.
+$$
+
+Proof of Lemma 4.4. Under event $E_{t,2}$ , according to Lemma 4.2, (C.2) and (C.3), we have, for all $i \in [K]$ ,
+
+$$
+\begin{array}{l} \mathbb {P} _ {t} \left(f \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {t}\right) > h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - \epsilon (m)\right) \\ \geq \mathbb {P} _ {t} (\langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} \rangle > \langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle + \alpha_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}) \\ \end{array}
+$$
+
+According to the definition of $\mathbf{A}_t$ , $\bar{\mathbf{b}}_t$ and $\mathbf{b}_t$ , we have,
+
+$$
+\langle \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}), \mathbf {A} _ {t} ^ {- 1} \mathbf {b} _ {t} / \sqrt {m} - \mathbf {A} _ {t} ^ {- 1} \bar {\mathbf {b}} _ {t} / \sqrt {m} \rangle = \sum_ {s = 1} ^ {t} \gamma_ {s} ^ {t} \cdot \frac {1}{m} \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) ^ {\top} \mathbf {A} _ {t} ^ {- 1} \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \pmb {\theta} _ {0}) = U _ {t}
+$$
+
+which follows a Gaussian distribution with mean $\mathbb{E}[U_t] = 0$ and variance $\mathrm{Var}[U_t]$ as:
+
+$$
+\begin{array}{l} \mathrm {V a r} [ U _ {t} ] = \sigma^ {2} \cdot (\sum_ {s = 1} ^ {t} (\frac {1}{m} \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) ^ {\top} \mathbf {A} _ {t} ^ {- 1} \mathbf {g} (\mathbf {x} _ {s, a _ {s}}; \pmb {\theta} _ {0})) ^ {2}) \\ = \sigma^ {2} \| \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ^ {2} - \lambda \sigma^ {2} \| \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 2}} ^ {2} \\ \geq \sigma^ {2} \left(1 - \lambda \lambda_ {\min } ^ {- 1} \left(\mathbf {A} _ {t}\right)\right) \| \mathbf {g} \left(\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ^ {2} \\ \geq \sigma^ {2} (1 - \lambda \lambda_ {K} ^ {- 1} (\mathbf {A} _ {K})) \| \mathbf {g} (\mathbf {x} _ {t, i}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ^ {2}, \\ \end{array}
+$$
+
+where the second equality holds according to the definition of $\mathbf{A}_t$ , and the first inequality holds as for any positive semi-definite matrix $\mathbf{M} \in \mathbb{R}^{d \times d}$ ,
+
+$$
+\mathbf {x} ^ {\top} \mathbf {M} ^ {2} \mathbf {x} = \lambda_ {\max} ^ {2} (\mathbf {M}) \mathbf {x} ^ {\top} (\lambda_ {\max} ^ {- 2} (\mathbf {M}) \mathbf {M} ^ {2}) \mathbf {x} \leq \lambda_ {\max} (\mathbf {M}) \| \mathbf {x} \| _ {\mathbf {M}} ^ {2},
+$$
+
+and $\lambda_{\min}(\mathbf{A}_t) \geq \lambda_K(\mathbf{A}_K)$ . Therefore, based on Lemma C.4, by choosing $\sigma = \alpha_t / \sqrt{1 - \lambda\lambda_K^{-1}(\mathbf{A}_K)}$ , the target probability could be lower bounded by,
+
+$$
+\begin{array}{l} \mathbb {P} _ {t} (f (\mathbf {x} _ {t, j}; \pmb {\theta} _ {t}) > h (\mathbf {x} _ {t, a _ {t} ^ {*}}) - \epsilon (m)) \geq \mathbb {P} _ {t} (U _ {t} > \alpha_ {t} \| \mathbf {g} (\mathbf {x} _ {t, i}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}) \\ = \mathbb {P} _ {t} (\frac {U _ {t}}{\operatorname {V a r} [ U _ {t} ]} > \frac {\alpha_ {t} \| \mathbf {g} (\mathbf {x} _ {t , i} ; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}}{\operatorname {V a r} [ U _ {t} ]}) \geq \mathbb {P} _ {t} (\frac {U _ {t}}{\operatorname {V a r} [ U _ {t} ]} > 1) \geq \frac {1}{4 e \sqrt {\pi}} \\ \end{array}
+$$
+
+This completes the proof.
+
+
+
+# C.4 PROOF OF LEMMA 4.5
+
+Proof of Lemma 4.5. With the defined sufficiently sampled arms in round $t$ , $\Omega_t$ , we have the set of undersampled arms $\bar{\Omega}_t = [K] \setminus \Omega_t$ . We also have the least uncertain and undersampled arm $e_t$ in round $t$ defined as,
+
+$$
+e_{t} = \operatorname *{argmin}_{j\in \bar{\Omega}_{t}}\| \mathbf{g}(\mathbf{x}_{j,t};\boldsymbol {\theta}_{0}) / \sqrt{m}\|_{\mathbf{A}_{t}^{-1}}
+$$
+
+In round $t$ , it is easy to verify that $\mathbb{E}[h(\mathbf{x}_{t,a_t^*}) - h(\mathbf{x}_{t,a_t})] \leq \mathbb{E}[(h(\mathbf{x}_{t,a_t^*}) - h(\mathbf{x}_{t,a_t}))\mathbb{1}\{E_{t,2}\}] + \mathbb{P}_t(\bar{E}_{t,2})$ .
+
+Under event $E_{t,1}$ and $E_{t,2}$ , we have,
+
+$$
+\begin{array}{l} h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - h \left(\mathbf {x} _ {t, a _ {t}}\right) \\ = h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - h \left(\mathbf {x} _ {t, e _ {t}}\right) + h \left(\mathbf {x} _ {t, e _ {t}}\right) - h \left(\mathbf {x} _ {t, a _ {t}}\right) \\ \leq \Delta_ {e _ {t}} + f (\mathbf {x} _ {t, e _ {t}}, \boldsymbol {\theta} _ {t}) - f (\mathbf {x} _ {t, a _ {t}}, \boldsymbol {\theta} _ {t}) + 2 \epsilon (m) + (\beta_ {t} + \alpha_ {t}) \left(\| \mathbf {g} (\mathbf {x} _ {t, e _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} + \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \\ \leq 4 \epsilon (m) + \left(\beta_ {t} + \alpha_ {t}\right) \left(2 \| \mathbf {g} \left(\mathbf {x} _ {t, e _ {t}}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} + \| \mathbf {g} \left(\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}\right) \\ \end{array}
+$$
+
+Next, we will bound $\mathbb{E}[\| \mathbf{g}(\mathbf{x}_{t,e_t};\pmb {\theta}_0) / \sqrt{m}\|_{\mathbf{A}_{\bar{t}}^{-1}}]$ . It is easy to see that,
+
+$$
+\begin{array}{l} \mathbb {E} [ \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \pmb {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} ] \\ = \mathbb {E} [ \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} \mathbb {1} \{a _ {t} \in \bar {\Omega} _ {t} \} ] + \mathbb {E} [ \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} \mathbb {1} \{a _ {t} \in \Omega_ {t} \} ] \\ \geq \| \mathbf {g} (\mathbf {x} _ {t, e _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} \mathbb {P} _ {t} (a _ {t} \in \bar {\Omega} _ {t}). \\ \end{array}
+$$
+
+It can be arranged as $\| \mathbf{g}(\mathbf{x}_{t,e_t};\pmb {\theta}_0) / \sqrt{m}\|_{\mathbf{A}_t^{-1}}\leq \mathbb{E}[\| \mathbf{g}(\mathbf{x}_{t,a_t};\pmb {\theta}_0) / \sqrt{m}\|_{\mathbf{A}_t^{-1}}] / \mathbb{P}_t(a_t\in \bar{\Omega}_t)$ . Hence, the one step regret can be bounded by the following inequality with probability at least $1 - \delta$
+
+$$
+\begin{array}{l} \mathbb {E} \left[ h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - h \left(\mathbf {x} _ {t, a _ {t}}\right) \right] \\ \leq \mathbb {P} (\bar {E} _ {t, 2}) + 4 \epsilon (m) + (\beta_ {t} + \alpha_ {t}) \big (1 + 2 / \mathbb {P} (a _ {t} \in \bar {\Omega} _ {t}) \big) \| \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}}. \\ \end{array}
+$$
+
+For the probability $\mathbb{P}_t(a_t\in \bar{\Omega}_t)$ , we have:
+
+$$
+\begin{array}{l} \mathbb {P} _ {t} (a _ {t} \in \bar {\Omega} _ {t}) \geq \mathbb {P} _ {t} (\exists a _ {i} \in \bar {\Omega} _ {t}: f (\mathbf {x} _ {t, a _ {i}}; \boldsymbol {\theta} _ {t}) > \max _ {a _ {j} \in \Omega_ {t}} f (\mathbf {x} _ {t, a _ {j}}; \boldsymbol {\theta} _ {t})) \\ \geq \mathbb {P} _ {t} \left(f \left(\mathbf {x} _ {t, a _ {t} ^ {*}}; \boldsymbol {\theta} _ {t}\right) > \max _ {a _ {j} \in \Omega_ {t}} f \left(\mathbf {x} _ {t, a _ {j}}; \boldsymbol {\theta} _ {t}\right)\right) \\ \geq \mathbb {P} _ {t} \left(f \left(\mathbf {x} _ {t, a _ {t} ^ {*}}; \boldsymbol {\theta} _ {t}\right) > \max _ {a _ {j} \in \Omega_ {t}} f \left(\mathbf {x} _ {t, a _ {j}}; \boldsymbol {\theta} _ {t}\right), E _ {t, 2} \text {o c c u r s}\right) \\ \geq \mathbb {P} _ {t} \left(f \left(\mathbf {x} _ {t, a _ {t} ^ {*}}; \boldsymbol {\theta} _ {t}\right) > h \left(\mathbf {x} _ {t, a _ {t} ^ {*}}\right) - \epsilon (m)\right) - \mathbb {P} _ {t} \left(\bar {E} _ {t, 2}\right) \\ \geq \mathbb {P} _ {t} (E _ {t, 3}) - \mathbb {P} _ {t} (\bar {E} _ {t, 2}) \\ \end{array}
+$$
+
+where the fourth inequality holds as for arm $a_{j}\in \Omega_{t}$ , under event $E_{t,1}$ and $E_{t,2}$ ..
+
+$$
+f (\mathbf {x} _ {t, j}; \boldsymbol {\theta} _ {t}) \leq h (\mathbf {x} _ {t, j}) + \epsilon (m) + (\beta_ {t} + \alpha_ {t}) \| \mathbf {g} (\mathbf {x} _ {t, j}; \boldsymbol {\theta} _ {0}) / \sqrt {m} \| _ {\mathbf {A} _ {t} ^ {- 1}} \leq h (\mathbf {x} _ {t, a _ {t} ^ {*}}) - \epsilon (m).
+$$
+
+This completes the proof.
+
+
+
+# C.5 PROOF OF LEMMA 4.6
+
+We first need the following lemma from Abbasi-Yadkori et al. (2011).
+
+Lemma C.5 (Lemma 11, Abbasi-Yadkori et al. (2011)). We have the following inequality:
+
+$$
+\sum_ {t = 1} ^ {T} \min \left\{\| \mathbf {g} \left(\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}\right) / \sqrt {m} \| _ {\mathbf {A} _ {t - 1} ^ {- 1}} ^ {2}, 1 \right\} \leq 2 \log \frac {\det \mathbf {A} _ {T}}{\det \lambda \mathbf {I}}.
+$$
+
+Lemma C.6 (Lemma B.1, Zhou et al. (2020)). Let $\mathbf{G} = [\mathbf{g}(\mathbf{x}^1;\pmb {\theta}_0),\dots ,\mathbf{g}(\mathbf{x}^K;\pmb {\theta}_0)] / \sqrt{m}\in \mathbb{R}^{p\times K}$ . Let $\mathbf{H}$ be the NTK matrix as defined in Definition B.1. For any $\delta \in (0,1)$ , if
+
+$$
+m = \Omega \bigg (\frac {L ^ {6} \log (K ^ {2} L / \delta)}{\epsilon^ {4}} \bigg),
+$$
+
+then with probability at least $1 - \delta$ , we have
+
+$$
+\| \mathbf {G} ^ {\top} \mathbf {G} - \mathbf {H} \| _ {F} \leq K \epsilon .
+$$
+
+Proof of Lemma 4.6. Denote $\mathbf{G} = [\mathbf{g}(\mathbf{x}^1;\pmb {\theta}_0) / \sqrt{m},\dots ,\mathbf{g}(\mathbf{x}^K;\pmb {\theta}_0) / \sqrt{m} ]\in \mathbb{R}^{p\times K}$ , then we have
+
+$$
+\begin{array}{l} \log \frac {\det \mathbf {A} _ {T}}{\det \lambda \mathbf {I}} = \log \det \left(\mathbf {I} + \sum_ {t = 1} ^ {T} \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) \mathbf {g} (\mathbf {x} _ {t, a _ {t}}; \boldsymbol {\theta} _ {0}) ^ {\top} / (m \lambda)\right) \\ \leq \log \det \left(\mathbf {I} + \sum_ {t = 1} ^ {T} \sum_ {i = 1} ^ {K} \mathbf {g} \left(\mathbf {x} ^ {i}; \boldsymbol {\theta} _ {0}\right) \mathbf {g} \left(\mathbf {x} ^ {i}; \boldsymbol {\theta} _ {0}\right) ^ {\top} / (m \lambda)\right) \\ = \log \det \left(\mathbf {I} + T \mathbf {G} \mathbf {G} ^ {\top} / \lambda\right) = \log \det \left(\mathbf {I} + T \mathbf {G} ^ {\top} \mathbf {G} / \lambda\right), \tag {C.4} \\ \end{array}
+$$
+
+where the inequality holds naively, the third equality holds since for any matrix $\mathbf{A} \in \mathbb{R}^{p \times K}$ , we have $\operatorname*{det}(\mathbf{I} + \bar{\mathbf{A}}\mathbf{A}^{\top}) = \operatorname*{det}(\mathbf{I} + \bar{\mathbf{A}}^{\top}\mathbf{A})$ . We can further bound Eq (C.4) as follows:
+
+$$
+\begin{array}{l} \log \det \left(\mathbf {I} + T \mathbf {G} ^ {\top} \mathbf {G} / \lambda\right) = \log \det \left(\mathbf {I} + T \mathbf {H} / \lambda + T (\mathbf {G} ^ {\top} \mathbf {G} - \mathbf {H}) / \lambda\right) \\ \leq \log \det \left(\mathbf {I} + T \mathbf {H} / \lambda\right) + \langle (\mathbf {I} + T \mathbf {H} / \lambda) ^ {- 1}, T (\mathbf {G} ^ {\top} \mathbf {G} - \mathbf {H}) / \lambda \rangle \\ \leq \log \det \left(\mathbf {I} + T \mathbf {H} / \lambda\right) + \| (\mathbf {I} + T \mathbf {H} / \lambda) ^ {- 1} \| _ {F} \| \mathbf {G} ^ {\top} \mathbf {G} - \mathbf {H} \| _ {F} \cdot T / \lambda \\ \leq \log \det \left(\mathbf {I} + T \mathbf {H} / \lambda\right) + T \sqrt {K} \| \mathbf {G} ^ {\top} \mathbf {G} - \mathbf {H} \| _ {F} \\ \leq \log \det \left(\mathbf {I} + T \mathbf {H} / \lambda\right) + 1 = \widetilde {d} \log (1 + T K / \lambda) + 1, \\ \end{array}
+$$
+
+where the first inequality holds due to the concavity of $\log \det(\cdot)$ , the second inequality holds due to the fact that $\langle \mathbf{A}, \mathbf{B} \rangle \leq \| \mathbf{A} \|_F \| \mathbf{B} \|_F$ , the third inequality holds due to the facts that $\mathbf{I} + \mathbf{H} / \lambda \succeq \mathbf{I}$ , $\lambda \geq 1$ and $\| \mathbf{A} \|_F \leq \sqrt{K} \| \mathbf{A} \|_2$ for any $\mathbf{A} \in \mathbb{R}^{K \times K}$ , the fourth inequality holds by Lemma C.6 with the required choice of $m$ , the fifth inequality holds by the definition of effective dimension in Definition B.3. This completes the proof.
\ No newline at end of file
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/images.zip b/learningneuralcontextualbanditsthroughperturbedrewards/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4dc186da977ae52d72ba8c08951ea6662553d8ef
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f555df36da805bf6dae951aaeaf54e51bf0092f7eee1bcc75243c4e88ceab59
+size 1029719
diff --git a/learningneuralcontextualbanditsthroughperturbedrewards/layout.json b/learningneuralcontextualbanditsthroughperturbedrewards/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ff3c1085fc6e5a89d45ca920c96aa83ff0c93d37
--- /dev/null
+++ b/learningneuralcontextualbanditsthroughperturbedrewards/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f3dc872e96c62f6e03864dfd15aeb9f0f8645494d49d828213c041c54b59294
+size 830313
diff --git a/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_content_list.json b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1502eb9fb6e109d7567c3f78ad746c45e4314bd0
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2da6fd47c97c4cd8ef3b4eb57a5e4e64abce195f6df56c262b10d1c4901ff43c
+size 123543
diff --git a/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_model.json b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9aa57f1ac90aea9103c3a8ff627c004b3bc4ec87
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9698d3bb942cb30f0a2b032f6a1b004d1fb71c1fafb43c2e72c7124632a5007e
+size 144064
diff --git a/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_origin.pdf b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..29f350583f4a8247d1a1e655e7de2bd74ff387e2
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/5ac9de2c-7425-4adb-a49c-14c0046df07b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e91fde9251d0ce3fdd7a64315547ebe91f9e1d9b5c76f9100556205773c521c1
+size 1546872
diff --git a/learningobjectorienteddynamicsforplanningfromtext/full.md b/learningobjectorienteddynamicsforplanningfromtext/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..35848cd5987eeaafb773cb22a1298dfa73191dcd
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/full.md
@@ -0,0 +1,435 @@
+# LEARNING OBJECT-ORIENTED DYNAMICS FOR PLANNING FROM TEXT
+
+Guiliang Liu $^{1,3}$ , Ashutosh Adhikari $^{1,4}$ , Amir-massoud Farahmand $^{2,3}$ , Pascal Poupart $^{1,3}$
+
+1University of Waterloo, 2University of Toronto, 3Vector Institute, 4Microsoft g233liu@uwaterloo.ca, aadhikari@microsoft.com, farahmand@vectorinstitute.ai, ppoupart@uwaterloo.ca
+
+# ABSTRACT
+
+The advancement of dynamics models enables model-based planning in complex environments. Dynamics models mostly study image-based games with fully observable states. Generalizing these models to Text-Based Games (TBGs), which often include partially observable states with noisy text observations, is challenging. In this work, we propose an Object-Oriented Text Dynamics (OOTD) model that enables planning algorithms to solve decision-making problems in text domains. OOTD predicts a memory graph that dynamically remembers the history of object observations and filters object-irrelevant information. To improve the robustness of dynamics, our OOTD model identifies the objects influenced by input actions and predicts beliefs of object states with independently parameterized transition layers. We develop variational objectives under the object-supervised and self-supervised settings to model the stochasticity of predicted dynamics. Empirical results show that our OOTD-based planner significantly outperforms model-free baselines in terms of sample efficiency and running scores.
+
+# 1 INTRODUCTION
+
+Planning algorithms typically leverage the environment dynamics to solve decision-making problems (Sutton & Barto, 2018). To plan in unknown environments, the agent must learn a dynamics model to predict future (belief) states and rewards by conditioning on an action. This dynamics model enables the implementation of intensive search for optimal actions, which can potentially increase both sample efficiency and cumulative rewards, compared to model-free methods (Hafner et al., 2019; Wang et al., 2019; Kaiser et al., 2020). Despite the promising performance, learning a dynamics model that can accurately generalize at test time is still challenging, especially when handling a high-dimensional state space for low-level features, e.g., pixels and text.
+
+To facilitate dynamics learning in complex environments, Diuk et al. (2008) proposed an Object-Oriented Markov Decision Process (OO-MDP) that factorizes world states into object states. They showed that the agent can find optimal policies with a better sample efficiency by modeling the dynamics at the object level. Some following works (Finn et al., 2016; Goel et al., 2018; Zhu et al., 2018; 2020) extended OO-MDPs to image-based games. These methods typically assume full observability over game states and a fixed input size, which facilitates the use of object masks to decompose an image into different objects. On the other hand, in Text-Based Games (TBGs), the text observation, whose length runs from a few words to an entire paragraph, is a partial description of the current game state, and thus each observation provides information about a limited number of objects (in fact, only an average of $4.51\%$ of the candidate objects are mentioned in an observation from Textworld (Côté et al., 2018)). The dynamics model must remember the history of observed objects to predict accurately their states. Moreover, an observation typically contains lots of noisy patterns that record object-irrelevant information (e.g., the non-bolded text from $o_t$ in Figure 1). While previous works (Ammanabrolu & Riedl, 2019; Ammanabrolu & Hausknecht, 2020) designed rule-based heuristics to extract useful information, we expect that dynamically capturing object information from noisy observations helps to generalize to more environments.
+
+In this work, we design an Object-Oriented Text Dynamics (OOTD) model that integrates:
+
+1) Graph Representation for Objects. OOTD predicts a memory graph from the input states. The memory graph, whose nodes correspond to the objects to be modelled, captures the information about these objects from the beginning of a game. By applying this graph as an information bottleneck for
+
+dynamics prediction, OOTD filters the object-irrelevant information in the text inputs, which forms a tighter information plane and facilitates generalization to unseen games (Tishby & Zaslavsky, 2015).
+
+2) Independent Transition Layers. Intuitively, an input action influences the states of a limited number of objects, for example, when the agent performs "take the carrot from the counter", only the states of "carrot" and "counter" should be updated. To capture which objects are influenced and keep others invariant to this update, OOTD learns an action-aware representation for each object with bi-directional attention and predicts the belief states of objects with independently parameterized transition layers. This independent mechanism enhances the robustness for dynamics prediction (Goyal et al., 2019) (also see the ablation study in Section 4.2).
+
+During planning, we predict belief states without knowing rewards and observations. To learn a stochastic dynamics model, we propose object-supervised and self-supervised Evidence Lower Bound (ELBo) objectives for training our OOTD model. We evaluate how well the OOTD model supports planning by implementing planning algorithms (e.g., Dyna-Q (Kuvayev & Sutton, 1996) and Monte Carlo Tree Search (MCTS) (Kocsis & Szepesvári, 2006)) based on learned dynamics. Empirical results show that these planning algorithms significantly outperform other baselines in terms of game performance and sample efficiency. To support the design of our OOTD model, we include an ablation study that visualizes the object states and quantifies the dynamics prediction performance.
+
+Contributions: 1) We introduce our approach to implementing model-based planning algorithms for solving decision-making problems in the text-domain. 2) We propose the OOTD model that learns to predict beliefs about object dynamics.
+
+
+Figure 1: An example of planning from text. We show three objects (cheese, carrot and banana) in this example. When interacting with the environment $(env)$ , the agent encodes the information of observation $o_t$ into object states $z_t$ with encoders $(q_{\mathcal{E}}^1, q_{\mathcal{E}}^2, q_{\mathcal{E}}^3)$ . Given a goal $g_t$ , the planner determines the action $a_t$ by searching with the reward $(p_r)$ and transition models $(p_T^1, p_T^2, p_T^3)$ .
+
+# 2 OBJECT LEVEL PLANNING IN TEXT DOMAINS
+
+In this work, the object-level dynamics are learned and evaluated in Text-Based Games (TBGs), for which we extend OO-MDPs (Diuk et al., 2008) to capture partial observability. We define a graph representation to remember object information and introduce the corresponding planning algorithms.
+
+# 2.1 TEXT-BASED GAMES
+
+Text-Based Games (TBGs) are complex, interactive simulations where an agent explores and plays a game by processing text observations and responding with text commands. To study the generalization ability of this policy, many recent works (Yin & May, 2019; Hausknecht et al., 2019; Ecoffet et al., 2019; Adolphs & Hofmann, 2020; Adhikari et al., 2020) proposed to learn a policy by training with a set of games and evaluating with games from a hold-out test set. The distributions of rewards over state-action pairs are different in training and testing games because TBGs assign rewards by conditioning on specific goals (that are predefined, but unknown). In this setting, TBGs have different intermediate goals in each game, but they commonly share the same ultimate goals, and the underlying causal dependencies leading to this ultimate goal are consistent. For example, to solve the 'First Text-World Problems' (Côté et al., 2018), an agent should always gather and process cooking ingredients (e.g., "fry the potato") according to a recipe that it discovers in the game, although the names and locations of the ingredients are different across different games. This property enables the generalization of knowledge learned from training games to solve testing games.
+
+# 2.2 OBJECT-ORIENTED PARTIALLY OBSERVABLE MARKOV DECISION PROCESSES
+
+Since an observation reveals only partial information about the game state, we formulate TBGs as partially observable Markov decision processes (POMDPs). In this work, we extend the POMDP framework to represent object-level dynamics (Diuk et al., 2008). The Object-Oriented (OO) POMDP is a tuple $\langle S, \mathcal{O}, \mathcal{Z}, \varPhi, \mathcal{G}, \mathcal{A}, \mathcal{R}, \mathcal{T}, \gamma \rangle$ , where:
+
+- $S$ and $\mathcal{O}$ define the spaces of low-level states and observations from the TGB environments while $\mathcal{Z}$ and $\varPhi$ are the spaces of object-level states and observations. In a TBG, $o\in \mathcal{O}$ is a text message from the game environment (e.g., "Please fry the potato"), whereas $\phi \in \varPhi$ records the specific objects and their relations in this message (e.g., a triplet like "potato-need-fry"). To model the object dynamics, the agent must extract $\phi$ from $o$ by distilling objects' information from text sentences. In this work, we model object states $z\in \mathcal{Z}$ (instead of $s\in S$ ) and learn latent representations for $z$ .
+- $\mathcal{G}$ and $\mathcal{A}$ are the spaces for goals and actions. We study choice-based games (Yin & May, 2019), where candidate actions $A_{t} \in \mathcal{A}$ are available at time step $t$ . We include a goal variable $g$ to mark different tasks in each game. Following the Universal MDP (UMDP) (Schaul et al., 2015), the agent initializes a goal at the beginning of a game and updates it when the task is finished.
+- $\mathcal{R}$ and $\mathcal{T}$ define the spaces of reward and transition models. $\gamma$ is a discount factor. We assume the real dynamics models $(p_{\mathcal{T}}^{*}$ and $p_r^*$ ) are unknown, so we learn the object-oriented transition model and the reward model, i.e., $\forall k\in \{1,\dots ,K\} ,p_{\mathcal{T}}^{k}(z_{k,t}|z_{t - 1},a_{t - 1})\in \mathcal{T}$ and $p_r(r_t|z_{t - 1},g_t)\in \mathcal{R}$ .
+
+In our OO-POMDP, transitions $p_{\mathcal{T}}$ , observations $\phi$ , and states $z$ are modelled for each object, whereas actions $a$ and rewards $r$ are defined for the entire environment. This generalizes to popular RL environments that accept an action and return a reward at every time step. Unlike (Wandzel et al., 2019) that represented object states with symbolic attributes, we develop a latent object representation that can generalize to the complex environment with high-dimensional inputs (e.g., text).
+
+# 2.3 GRAPH REPRESENTATION FOR OBJECTS
+
+We utilize an object-relation-object triplet $\phi$ to represent object information. At time step $t$ , $\phi_t = [\phi_{t,1}, \dots, \phi_{t,M}]$ ( $M$ is the number of observed triplets at $t$ ). Given a total of $K$ candidate objects and $C$ candidate relations, these triplets can be mapped to a knowledge graph $\Omega_t \in \{0,1\}^{C \times K \times K}$ . Each entry $(c,i,j) \in \{0,1\}$ indicates whether there is a relationship $r$ between the $i^{th}$ and $j^{th}$ objects. This knowledge graph forms a natural representation of object relations since object information in most observations $o_t$ corresponds to either entity attributes (e.g., "potato-is-fried") or to relational information about entities (e.g., "potato-on-counter" and "bedroom-north_of-kitchen"), which can be conveniently represented by triplets and the corresponding graph.
+
+Memory Graph. We store the observations up to time step $t$ in a memory graph $h_t = \Omega_0 \oplus \Omega_1 \oplus \dots \oplus \Omega_t$ that captures object information observed by the agent since the beginning of a game. Similar to previous works Adhikari et al. (2020); Ammanabrolu & Riedl (2019); Ammanabrolu & Hausknecht (2020), we summarize the object-level history with a latent memory graph $h_t$ . To update the memory from $t - 1$ to $t$ , we learn a graph updater $\oplus$ , and $h_t = h_{t-1} \oplus \Omega_t$ . During updating, $\oplus$ needs to resolve some semantically contradictory triplets, for example "player-at-kitchen" and "player-at-bedroom" (because the player cannot simultaneously be in two different locations). Our OOTD model is trained to automatically emulate such an operator. Our transition model (Section 3.1) is trained to generate $h_t$ from $z_t$ , allowing the latent object states to capture object relations.
+
+# 2.4 MODEL-BASED PLANNING IN TEXT-BASED GAMES
+
+We introduce model-based planning in TBGs. Based on the OO-POMDP (Section 2.2), at each time step $t$ we define latent states $z_{t} = [z_{1,t},\dots,z_{K,t}]$ for a total of $K$ objects, text observations $o_{t}$ , action commands $a_{t}$ , and scalar rewards $r_{t}$ , that follow the stochastic dynamics in Table 1. The details of these dynamics models are introduced in Section 3.
+
+Table 1: Object dynamics for planning, where the transition models and observation encoders are independently parameterized for a total of $K$ objects.
+
+| Transition models | [ pTk(zk,t+1|at,zt)]K
+k=1 |
| Observation encoders | [ qEk(zk,t+1|ot+1, at,zt)]K
+k=1 |
| Reward model | pr(rt|zt,gt) |
| Graph & Obs. decoder | pΩ(ht|zt), po(at|zt) |
+
+Based on these dynamics, we implement planning algorithms to select an action from candidate commands $A_{t}$ for maximizing the expected sum of rewards $\mathbb{E}_{\pi}(\sum_{t=0}^{T} \gamma^{t} r_{t})$ , as shown in Figure 1. In this work, we study choice-based games (Yin & May, 2019), where the candidate commands (or actions) $A_{t}$ are available and the planner determines the action $a_{t} \in A_{t}$ to be performed. The planning algorithms include Dyna-Q, Monte-Carlo Tree Search (MCTS) and their combinations:
+
+Dyna-Q (Kuvayev & Sutton, 1996) incorporates dynamics models and Q-learning. Dyna-Q interactively 1) updates the dynamics model with observed transitions and 2) trains the Q network to minimize the Temporal Difference (TD) loss (Equation 1) based on both observed transitions from the environment and predicted transitions from the dynamics models. Compared to the model-free Deep Q-Network (DQN), Dyna-Q is more sample efficient: by expanding the replay buffer with dynamics models, Dyna-Q converges faster with the same number of interactions from the environment.
+
+$$
+\mathcal {L} _ {T D} = \mathbb {E} \left[ \left(r _ {t} + \gamma \max _ {a \in A _ {t}} Q \left(\boldsymbol {z} _ {t}, a, g _ {t}\right) - Q \left(\boldsymbol {z} _ {t - 1}, a _ {t - 1}, g _ {t - 1}\right)\right) ^ {2} \right] \tag {1}
+$$
+
+MCTS (Kocsis & Szepesvári, 2006) is a heuristic search algorithm that builds and updates a search tree based on environment dynamics. By performing Monte-Carlo simulations organized in a tree structure, MCTS does an efficient search in environments with large action spaces (Silver et al., 2018). MCTS iteratively runs multiple playouts. At the $i^{th}$ payout, we implement 1) Selection: Traverse the tree from the root node to a leaf node (corresponding to object state $\mathbf{z}_{\tau}$ ) by selecting the action command $a_{i,t}$ to maximize the Upper Confidence Bound (UCB) (Couëtoux et al., 2011):
+
+$$
+a _ {i, t} = \underset {a \in A _ {t}} {\arg \max } \left[ Q _ {i} \left(\boldsymbol {z} _ {t}, a, g\right) + c _ {p u c t} \frac {\sqrt {\log (i - 1)}}{\zeta_ {i - 1} \left(\boldsymbol {z} _ {t} , a , g\right) + 1} \right] \tag {2}
+$$
+
+where $c_{puct}$ controls the scale of exploration, and $\zeta_i$ records the visit count at the $i^{th}$ play. 2) Evaluation: Evaluate the selected leaf $z_{\tau}$ with the reward model $p_r(r_{\tau}|z_{\tau},g_t)$ . 3) Expansion: Expand the leaf node by adding child nodes. 4) Back Up: Update the action-values: $Q_i = (Q_{i - 1}\zeta_{i - 1} + r_{\tau}) / (\zeta_{i - 1} + 1)$ and increment the visit count: $\zeta_i = \zeta_{i - 1} + 1$ on all the traversed edges.
+
+Dyna-Q + MCTS initializes Q values in MCTS by utilizing the Dyna-Q network. This combination enables MCTS to perform the tree search with more efficiency and efficacy (Silver et al., 2016).
+
+# 3 OBJECT-ORIENTED DYNAMICS MODELS
+
+We introduce the Object-Oriented Text Dynamics (OOTD) models, including 1) a transition model that directly predicts the belief states of objects and 2) a reward model that maps sampled object states to rewards. Based on these models, the planner determines an action purely based on predicted beliefs and calibrates its belief with the feedback (observations and rewards) from the environment. We introduce the object-supervised and self-supervised objectives to train these models.
+
+
+Figure 2: Left: The Object-Oriented Transition Model. Right: The Reward Model.
+
+# 3.1 OBJECT ORIENTED TRANSITION MODEL
+
+Figure 2 illustrates our transition model, which has three major components $(a)$ a graph decoder, $(b)$ a graph encoder, and $(c)$ independent transition layers.
+
+(a) Graph Decoder. Given the states of $K$ objects $\mathbf{z}_{t - 1} = [z_{1,t - 1},\dots,z_{K,t - 1}]$ , we implement a graph decoder with the ComplEx scoring function (Trouillon et al., 2016) that maps the object states to a memory graph $h_{t - 1}\in [0,1]^{C\times K\times K}$ . The scoring function for an entry $(c,i,j)$ (in the adjacency matrix of $h_{t - 1}$ ) is implemented by $Re(\langle \omega_c,z_{i,t - 1},z_{j,t - 1}\rangle)$ where $\omega_{c}\in \mathbb{C}^{E}$ is a complex vector for
+
+the relation $c$ and $Re$ denotes the real part of the decomposition in complex space. The function can model a large variety of binary relations, including both symmetric and antisymmetric relations. Based on this scoring function, predicting $h_{t-1}$ is equivalent to estimating the probability of having a relation $c$ between object $i$ and $j$ , which can be efficiently approximated with a low-ranked $(E \ll K)$ matrix decomposition: $h_t = [Re(\mathbf{Z}\mathbf{W}_1\mathbf{Z}^T), \dots, Re(\mathbf{Z}\mathbf{W}_C\mathbf{Z}^T)]$ where $\mathbf{Z} \in \mathbb{R}^{K \times E}$ is the matrix of object states and $W_c \in \mathbb{C}^{E \times E}$ is a complex matrix. In practice, this decomposition enables to map efficiently from $z_{t-1}$ to $h_{t-1}$ , therefore scaling our method to environments with numerous objects.
+
+(b) Graph Encoder. We encode the memory graph $h_{t-1}$ into node representations $e_{t-1} = [e_{1,t-1}, \dots, e_{K,t-1}]$ with a Relational Graph Convolution Network (R-GCN) (Schlichtkrull et al., 2018). Nodes in $h_t$ correspond to candidate objects and RGCN performs message passing between nodes, so $e_{k,t-1}$ captures the semantic information of the $k^{th}$ object and its relations to other nodes (objects). Compared to $z_{t-1}$ , $e_{t-1}$ denotes the object embeddings after taking into account relations to other objects in the graph. The graph can be thought as a succinct latent representation that ignores irrelevant object information in text observations when predicting the next state $z_t$ .
+
+(c) Independent Transition Layers. TBG environments typically contain a large population of objects, and each action can only affect a few underlying objects. In order to improve the robustness of the dynamics, we utilize 1) a Bi-Directional Attention Flow (BIDAF) network (Seo et al., 2017) to identify the affected objects and 2) a group of transition layers to predict the belief state of objects by following the Independent Causal Mechanism (ICM) framework (Pearl, 2009).
+
+Given $e_{t-1}$ and an action $a_{t-1} = [a_{1,t-1}, \dots, a_{J,t-1}]$ (a sentence of $J$ words), the BIDAF network learns an attention matrix $B^{ae} \in [0,1]^{K \times J}$ , where $b_{k,j}$ measures the similarity between the representation of the $k$ -th object and the embedding of the $j$ -th word. To learn an action-aware representation of object, we compute 1) action-to-object attentions $b^e$ that indicate which object representations have the closest similarity to one of the action words and are hence critical for modelling the impact of the action words; 2) object-to-action attentions $b_k^a$ that indicate which action words are most relevant to the $k^{th}$ object representation. The action-aware object representation concatenates the attended action vector $\nu_{k,t-1}^a$ , the attended object representation $\nu_{t-1}^e$ and the initial object representation
+
+$$
+\boldsymbol {e} _ {k, t - 1}: \quad \boldsymbol {\nu} _ {k, t - 1} ^ {a} = \sum_ {j} b _ {k, j} ^ {a} \psi^ {a} (a _ {j, t - 1}) \quad \text {w h e r e} \quad \boldsymbol {b} _ {k} ^ {a} = \operatorname {s o f t m a x} (\boldsymbol {B} _ {k,:} ^ {a e}) \in [ 0, 1 ] ^ {J},
+$$
+
+$$
+\boldsymbol {\nu} _ {t - 1} ^ {e} = \sum_ {k} b _ {k} ^ {e} \boldsymbol {e} _ {k, t - 1} \quad \text {w h e r e} \quad \boldsymbol {b} ^ {e} = \operatorname {s o f t m a x} (\max _ {c o l} (\boldsymbol {B} ^ {a e})) \in [ 0, 1 ] ^ {K},
+$$
+
+$$
+p _ {\mathcal {T}} ^ {k} \left(z _ {k, t} \mid \boldsymbol {a} _ {t - 1}, \boldsymbol {z} _ {t - 1}\right) = \mathcal {N} \left(\boldsymbol {\mu} _ {k, t}, \boldsymbol {\sigma} _ {k, t}\right) \quad \text {w h e r e} \quad \left[ \boldsymbol {\mu} _ {k, t}, \boldsymbol {\sigma} _ {k, t} \right] = \psi_ {k} ^ {p} \left(\left[ \boldsymbol {\nu} _ {k, t - 1} ^ {a}, \boldsymbol {\nu} _ {t - 1} ^ {e}, \boldsymbol {e} _ {k, t - 1} \right]\right) \tag {3}
+$$
+
+Here $\psi^a$ is a transformer-based text embedding function (Vaswani et al., 2017) for the input action, and $\psi_k^p$ is implemented by a MLP. The transition layers $\psi_1^p,\ldots ,\psi_K^p$ are parameterized independently.
+
+# 3.2 OBJECT ORIENTED REWARD MODEL
+
+We learn a reward model $p_r(r_t|z_t, g_t)$ based on the predicted belief states. This reward model is important for learning goal-conditioned policies that can utilize the knowledge learned from a task to solve similar tasks, which accelerates learning and facilitates knowledge generalization.
+
+To implement the reward model, we build a goal extractor (Appendix A.3) that extracts goals $g_{t}$ from object states $z_{t} = [z_{1,t},\dots,z_{K,t}]$ . The goal is described by a sequence of words and symbols that follow the triplet format, e.g., "[potato, -, need, -, fry]" where "-" serves as separator between object and relation mentions. Although $z_{t}$ implicitly embeds $g_{t}$ with latent values, we prefer to represent $g_{t}$ explicitly with a sentence for the ease of model comprehension. Given the goal $g_{t}$ and object states $z_{t}$ , the reward model $p_{r}$ is defined by
+
+$$
+p _ {r} \left(r _ {t} \mid \boldsymbol {z} _ {t}, g _ {t}\right) = \psi^ {r} \left[ \boldsymbol {z} _ {t} ^ {\text {p o o l}}, \psi^ {g} \left(g _ {t}\right) \right] \text {w h e r e} \boldsymbol {z} _ {t} ^ {\text {p o o l}} = \text {m e a n - p o o l i n g} \left[ z _ {1, t}, \dots , z _ {K, t} \right], \tag {4}
+$$
+
+$\psi^g$ is a transformer-based text embedding function for goals, and $\psi^r$ is implemented by a MLP.
+
+# 3.3 TRAINING OBJECTIVE FOR DYNAMICS MODELS
+
+In this section, we introduce the objectives for learning the transition model and the reward model under the object-supervised setting and the self-supervised setting.
+
+Object-Supervised Setting. We learn the dynamics model under the supervision of memory graphs $h_t$ that record rich information about the observed objects and their relations from the beginning of a
+
+game (Section 2.3). The Object-Supervised Evidence Lower Bound (OS-ELBo) objective is:
+
+$$
+\sum_ {t = 1} ^ {T} \left\{\mathbb {E} _ {q _ {\mathcal {E}}} \left[ \log p _ {\Omega} \left(\hat {h} _ {t} \mid \boldsymbol {z} _ {t}\right) \right] - \sum_ {k = 1} ^ {K} D _ {k l} \left[ q _ {\mathcal {E}} ^ {k} \left(z _ {k, t} \mid o _ {t}, a _ {t - 1}, \boldsymbol {z} _ {t - 1}\right) \| p _ {\mathcal {T}} ^ {k} \left(z _ {k, t} \mid a _ {t - 1}, \boldsymbol {z} _ {t - 1}\right) \right] \right\} \tag {5}
+$$
+
+where $p_{\Omega}$ is the graph decoder, $p_{\mathcal{T}}$ is the transition model and $q_{\mathcal{E}}^{k}$ is the observation encoder. We now provide more details about each component and how to obtain $h_t$ . $p_{\Omega}$ is approximated by a re-sampling technique described in Appendix A.2. $p_{\mathcal{T}}$ is a Gaussian distribution as described in Equation 3. $q_{\mathcal{E}}^{k}$ shares a similar structure to $p_{\mathcal{T}}$ (see Appendix A.5 for more details).
+
+The memory graph $h_t$ is not a direct output from the RL environment. To perform object-supervised training, we extract object information from $o_t$ and predict $\hat{h}_t$ with a deterministic object extractor $f_e(o_t, a_{t-1}, h_{t-1})$ . We learn $f_e$ during a pre-training stage by utilizing a FTWP dataset. The dataset records the trajectories $[o_1, a_1, \dots, o_t, a_t]$ and corresponding $[h_1, \dots, h_t]$ by following walkthroughs in FTWP games. In practice, we can build such a dataset by extracting triplets $(\phi)$ from the text observations $(o_1, \dots, o_t)$ with an Open Information Extractor (OIE) (Angeli et al., 2015) and map the captured triplets into a knowledge graph by following (Ammanabrolu & Hausknecht, 2020). After training $f_e$ , we initialize $h_0 = \{0\}^{C \times K \times K}$ and update by $\hat{h}_t = f_e(o_t, a_{t-1}, \hat{h}_{t-1})$ during training. The detailed introduction of $f_e$ and the FTWP dataset can be found in Appendix A.4 and A.6.
+
+To train the reward model, we sample object states $\boldsymbol{z}_t = [z_{1,t},\dots,z_{K,t}]$ from their belief states, extract goal $g_{t}$ , and minimize a smooth L1 loss (Girshick, 2015):
+
+$$
+\left\{ \begin{array}{l l} \frac {1}{2 \beta} \left[ p _ {r} \left(r _ {t} \mid \boldsymbol {z} _ {t}, g _ {t}\right) - r _ {t} \right] ^ {2}, & \text {i f} \left| p _ {r} \left(r _ {t} \mid \boldsymbol {z} _ {t}, g _ {t}\right) - r _ {t} \right| < \beta , \\ \left| p _ {r} \left(r _ {t} \mid \boldsymbol {z} _ {t}, g _ {t}\right) - r _ {t} \right| - \frac {1}{2} \beta , & \text {o t h e r w i s e .} \end{array} \right. \tag {6}
+$$
+
+Self-Supervised Setting. In order to generalize our dynamics model to common RL environments where the predicted or ground truth memory graphs are unavailable, we develop a Self-Supervised Evidence Lower Bound (SS-ELBo) objective that directly learns from rewards and observations:
+
+$$
+\sum_ {t = 1} ^ {T} \left\{\mathbb {E} _ {q _ {\mathcal {E}}} \left[ \log p _ {o} (o _ {t} | \boldsymbol {z} _ {t}) + \log p _ {r} (r _ {t} | \boldsymbol {z} _ {t}, g _ {t}) \right] - \sum_ {k = 1} ^ {K} D _ {k l} \left[ q _ {\mathcal {E}} \left(z _ {k, t} | o _ {t}, a _ {t - 1}, \boldsymbol {z} _ {t - 1}\right) \| p _ {\mathcal {T}} \left(z _ {k, t} | a _ {t - 1}, \boldsymbol {z} _ {t - 1}\right) \right] \right\}
+$$
+
+where $p_{\mathcal{T}}$ , $p_r$ and $q_{\mathcal{E}}$ are the aforementioned transition model, reward model and observation encoder. The observation decoder $p_o$ is implemented by a Sequence-to-Sequence (Seq2Seq) model (Sutskever et al., 2014), which is trained by a teacher-forcing technique with text observations $o_t$ . This SS-EBLo objective enables training the reward and transition model together by maximizing one objective, which improves the training efficiency. Appendix C.1 shows an example of a predicted graph.
+
+# 4 EXPERIMENTS
+
+**Environments.** We divide the games in the Text-World benchmark (Côté et al., 2018) into five subsets according to their difficulty levels. Each subset contains 100 training, 20 validation, and 20 testing games. These subsets are mutually exclusive. For the easier cooking games, the recipe requires a single ingredient and the world is limited to a single location, whereas harder games require an agent to navigate a map of multiple locations to collect and appropriately process up to three ingredients. Table 4 summarizes the game statistics.
+
+Running Settings. To efficiently collect samples from the games in the training dataset, we train our OOTD model by implementing the Dyna-Q algorithm (Algorithm 1 in Appendix) due to the fact that 1) Q-network supports batch input, which enables solving and gathering data from multiple games in parallel, and 2) the Q-based algorithms provide a fair comparison of sample efficiency with other model-free baselines. After training, we fix the parameters in dynamics models and predict belief states and rewards to solve the games in the test dataset. During testing, we study the options of applying different planning algorithms including Dyna-Q, MCTS, and their combination (Dyna-Q+MCTS) that initializes MCTS with values from Q networks (Algorithm 2 in appendix). The model hyper-parameters are tuned with the games in the validation set. (Appendix A.1).
+
+Baselines. we compare the state-of-the-art models for solving TBGs. The baselines include Deep Q-Network (DQN) (Narasimhan et al., 2015) and Deep Recurrent Q-Network (DRQN) (Yuan et al., 2018). DQN selects the action based on the current observation, whereas DRQN models the history of action and observations with an RNN. For fair comparisons, we replace their LSTM-based text
+
+encoders with transformers. We compare an extension of DRQN by using an episodic counting bonus to encourage exploration, which is denoted as $(\mathbf{DRQN}+)$ (Yuan et al., 2018). Our next baseline is KG-A2C (Ammanabrolu & Hausknecht, 2020), which builds a graph-based state space and applies the Actor-Critic algorithm for learning the policy. We replace their action generator with an action selector for comparison. The last baseline is GATA (Adhikari et al., 2020) that learns a graph-structured representation to model the environment dynamics and select actions based on this representation. We experiment with several options of GATA, including: 1) GATA-GTP that pre-trains the discrete graph updater with ground-truth graphs from the FTWP dataset (Appendix A.6). Note that we apply the same pre-training dataset for our OS-ELBo objective. 2) GATA-OG that learns a continuous graph updater by reconstructing the text observation. 3) GATA-COC that trains the graph updater with a contrastive observation classification objective. Both GATA-OG and GATA-COC follow the self-supervised setting, which offers fair comparison to our SS-ELBo objective.
+
+Table 2: Normalized testing scores and averaged improvement $(\uparrow)$ over DQN in six difficulty levels (0 to 5). For each method, we implement three independent runs (check random seeds in Appendix A.1). We select the top-performing agents in validation games and report their testing scores.
+
+| Type | Model | 0 | 1 | 2 | 3 | 4 | 5 | ↑ |
| Model-Free Algorithm | DQN | 90.0 | 62.5 | 32.0 | 38.3 | 17.7 | 34.6 | 0 |
| DRQN | 95.0 | 58.8 | 31.0 | 36.7 | 21.4 | 27.4 | -0.8 |
| DRQN+ | 95.0 | 58.8 | 33.0 | 33.3 | 19.5 | 30.6 | -0.8 |
| KG-A2C | 96.7 | 55.5 | 31.0 | 54.3 | 26.8 | 30.1 | +3.2 |
| GATA-GTP | 95.0 | 62.5 | 32.0 | 51.7 | 21.8 | 23.5 | +1.9 |
| GATA-OG | 100 | 66.2 | 36.0 | 58.3 | 14.1 | 45.0 | +7.4 |
| GATA-COC | 96.7 | 62.5 | 33.0 | 46.7 | 25.9 | 33.4 | +3.9 |
| Model-Based Planning | OOTD learned by the Object-Supervised (OS) ELBo Objective |
| OS-Dyna-Q | 100 | 62.5 | 42.0 | 58.3 | 21.8 | 48.2 | +9.6 |
| OS-MCTS | 95.0 | 77.5 | 56.0 | 63.3 | 24.9 | 42.9 | +14.1 |
| OS-Dyna-Q + MCTS | 95.0 | 78.8 | 57.0 | 71.7 | 27.7 | 38.1 | +15.5 |
| OOTD learned by the Self-Supervised (SS) ELBo Objective |
| SS-Dyna-Q | 100 | 62.5 | 48.0 | 53.3 | 30.5 | 47.0 | +11.0 |
| SS-MCTS | 100 | 70.0 | 51.0 | 70.0 | 27.3 | 54.4 | +16.3 |
| SS-Dyna-Q + MCTS | 100 | 81.3 | 56.9 | 75.0 | 31.4 | 58.4 | +21.3 |
+
+# 4.1 CONTROLLING PERFORMANCE IN TBG ENVIRONMENTS
+
+Table 2 shows the agent's controlling performance at different difficulty levels. Equipped with the OOTD model, our agent implements model-based planning and achieves leading performance over the agents based on model-free algorithms. We find the SS-based OOTD models outperform the OS-based models by scoring more rewards at 4 (out of 6) difficulty levels. Although the object signals facilitate a better prediction of dynamics, this advantage can not be directly transferred to controlling performance. This is commonly known as the objective-mismatch problem in model-based RL (Lambert et al., 2020). On the other hand, SS-based models are directly optimized toward generating a better prediction of rewards, which are important signals for controlling. The reward-irrelevant information is filtered to derive a more compressed representation for better generalization ability. Another important finding is that our OOTD-based agents perform better than other graph-based agents (e.g., GATA-GTP and KG-A2C). This is because OOTD is doing model-based RL by learning the dynamics at the object level while other graph-based techniques are model free since they learn to extract object representations, but not to predict their dynamics.
+
+Sample Efficiency. We empirically demonstrate the sample efficiency of our model-based agents by comparing their training performance with other model-free agents. This experiment studies three variations of proposed methods, including 1) OS-Dyna-Q and 2) SS-Dyna-Q that implement the Q-Dyna algorithm and train the OOTD models with the OS-ELBo objective and the SS-ELBo objective respectively. 3) Object-Oriented (OO)-DQN that trains the OOTD model to predict object states, based on which we compute action values. As a model-free method, OO-DQN does not expand the replay buffer with the samples generated by dynamics models. Figure 3 shows the training curve for 6 difficulty levels. The learning speed of proposed model-based algorithms (OS-Dyna-Q and SS-Dyna-Q) is generally faster than that of MF algorithms, but we observe an exception at the games of difficulty level 5, where GATA-OG converges faster. We find it generally takes more
+
+samples to learn the interactions among $K$ objects and their relations to action values. It explains why (MF)-Dyna-Q converges slower than others. However, the object-based value function performs better than that based on raw observation in terms of normalized scores.
+
+
+
+
+
+
+
+
+Figure 3: Training Curves: Agents' normalized scores for the games at different difficulty levels. The plot shows mean $\pm$ std normalized scores computed with three independent runs.
+
+
+
+
+
+# 4.2 ABLATION STUDIES FOR OBJECT-ORIENTED DYNAMICS
+
+To understand the importance of our OOTD design, we empirically study the options of 1) removing the BIDAF attentions by directly applying the action and node embeddings to predict object states (i.e., No-Attentions Dynamics (NAt-Dyna)) and 2) removing independent transition layers by building a single layer to predict states for all objects (i.e., Single-Layer Dynamics (SLa-Dyna)). We compare these models with our OOTD models trained by the OS-ELBo objective (OS-OOTD) and the SS-ELBo objective (SS-OOTD). To evaluate how well the modified model $p_{T'}^k$ , captures object dynamics, we sample object states $z_{k,t} \sim p_{T'}^k(z_{k,t}|a_{t-1}, z_{t-1})$ for a total of $K$ objects, visualize these states with the t-distributed Stochastic Neighbor Embedding (t-SNE) algorithm (Van der Maaten & Hinton, 2008), and quantify the dynamics prediction performance.
+
+Object States Visualization. In this experiment, we randomly pick 20 games from the testing games of all difficulty levels. Within each game, $p_T^k$ computes the states $z_{k,1},\dots ,z_{k,T}$ with randomly selected actions $a_0,\ldots ,a_{T - 1}$ , and t-SNE embeds $z_{k,t}$ into a vector of 2 dimensions. Figure 4 visualizes the embedded vectors labelled by 10 randomly selected objects. The object states computed by our OOTD model are distinguishable, and thus t-SNE embeds the states for the same object close to each other. This phenomenon is not observable when we apply a single layer for computing object states (i.e., SLa-Dyna). Another important observation is that the OOTD model automatically learns to generate similar states for similar objects. For example, OS-OOTD generates similar states for the object of ingredients (e.g., parsley, apple, carrot, and potato marked by the dark frame). A similar phenomenon, although less obvious, can be observed for SS-OOTD. However, such a shrinkage effect disappears in NAt-Dyna, which explains the importance of bidirectional attentions.
+
+
+Figure 4: Scatter plots for T-SNE-embedded object states. From left to right, the states are sampled from SLa-Dyna, NAt-Dyna, OS-OOTD and SS-OOTD (from left to right).
+
+
+
+
+
+
+
+Probing Experiment. This experiment studies how well our OOTD models can capture useful information from the TBG environments. We map the sampled object states $z_{1,t}, \ldots, z_{K,t}$ to memory
+
+graphs $\hat{h}_t$ and rewards $\hat{r}_t$ with the additional graph decoder $p_{\mathcal{G}}'$ and reward model $p_r'$ . The performance of the dynamics models is quantified by whether $\hat{h}_t$ and $\hat{r}_t$ can match the ground-truth $h_t^*$ and $r_t^*$ in the FTWP dataset (Appendix A.6). During sampling, the input actions $a_1, \ldots, a_T$ follow the recorded trajectories in FTWP. The ground-truth rewards in FTWP games is either one or zero, and we perform an entry-level evaluation (e.g., $h_t[i, j, c]$ ) on the adjacency matrix of a predicted graph. It allows us to evaluate whether the real rewards and triplets are captured with F1 scores. For a fair comparison, the games in the FTWP dataset are divided into training ( $80\%$ ), validation ( $10\%$ ) and testing ( $10\%$ ) sets, based on which we first freeze the parameters in the dynamics models and then update the added $p_{\mathcal{G}}'$ and $p_r'$ with data in training games.
+
+Table 3 shows the testing performance. We study both 1) the graph-Generation performance which measures the accuracy of generating all the candidate triplets in a graph and 2) the graph-Updating performance which evaluates only the triplets that have been updated at the current step $t$ . We add a Real and a Random baseline that feed the ground-truth graph $h_t^*$ and a randomly generated graph $h_t^{RM}$ into the graph encoder of transition models. They study the probing performance when ground-truth graphs are known and when the posterior collapses for the transition model (so $p_{\mathcal{T}'}'^k(\boldsymbol{z}_{k,t}|\boldsymbol{a}_{t-1}, \boldsymbol{z}_{t-1}) = p_{\mathcal{T}'}'^k(\boldsymbol{z}_{k,t})$ ). The results show that OS-OOTD achieves a better graph prediction performance by applying the object-supervised objectives (OS-ELBo), but SS
+
+OOTD has higher reward prediction accuracy, since SS-ELBo includes an end-to-end training to predict future rewards, which filters the reward-irrelevant object information. Another observation is that removing independent layers and directional attentions significantly degrade the graph prediction performance. It demonstrates that they are important components of our OOTD model.
+
+Table 3: Graph-generation $(\mathcal{G}$ -gen), graph updating $(\mathcal{G}$ -upt) and rewards prediction $(r$ -pred) performance.
+
+ | G-gen | G-upt | r-pred |
| Random | 93.5 | 57.4 | 49.5 |
| Real | 99.2 | 95.9 | 94.0 |
| Ablated Dynamics models |
| SLa-Dyna | 84.4 | 75.4 | 85.5 |
| NAt-Dyna | 90.9 | 75.2 | 88.7 |
| OOTD models |
| OS-OOTD | 99.0 | 83.8 | 92.5 |
| SS-OOTD | 77.2 | 65.3 | 94.2 |
+
+# 5 RELATED WORK
+
+DRL Agent for Text-Based Games (TBGs). TBGs (e.g., Textworld (Côté et al., 2018) and interactive fictional games (Hausknecht et al., 2020)) are interactive simulations with text observations and actions. To solve TBGs, previous DRL agents typically applied advanced neural models for representing the state and action sentences, including recurrent models (Narasimhan et al., 2015; Jain et al., 2020; Zelinka, 2018; Madotto et al., 2020; Adolphs & Hofmann, 2020), Transformers (Adhikari et al., 2020; Ammanabrolu et al., 2020; Urbanek et al., 2019), relevance networks (He et al., 2016), and convolutional neural networks (Yin & May, 2019; Zahavy et al., 2018; Yin & May, 2019). Since states in the TBG environments are partially observable, many previous studies have formulated TBGs as POMDPs and modelled the history of observations with a Deep Recurrent Q-Network (DRQN) (Yuan et al., 2018) or a knowledge graph (Hausknecht et al., 2019; Ammanabrolu & Riedl, 2019; Ammanabrolu & Hausknecht, 2020; Adhikari et al., 2020; Ammanabrolu et al., 2020). Previous works are commonly based on model-free Q learning while we explore model-based planning.
+
+Object Oriented Reinforcement Learning. Diuk et al. (2008) proposed modelling the transition and reward models at the object level. Previous work (Mohan & Laird, 2011; Joshi et al., 2012; da Silva & Costa, 2018; Marom & Rosman, 2018; da Silva et al., 2019) explored training DRL agents with the object-level features. However, object features are not commonly available from the RL environments. Recent works have extracted object representations from states with optical flow (Goel et al., 2018), variational models (Burgess et al., 2019) and structured convolutional layers (Kipf et al., 2020; Finn et al., 2016; Zhu et al., 2018; 2020). Previous works commonly studied image-based fully observable environments whereas we explore text-based partially observable environments.
+
+# 6 CONCLUSION
+
+We proposed an OOTD model that enables planning in text-based environments. The OOTD model learned a graph representation for capturing object dynamics and predicted the belief of object states with independent transition layers. Empirical results demonstrated that OOTD-based agents outperformed model-free baselines in terms of controlling performance and sample efficiency. We then provided an ablation study to show the importance of OOTD components. A promising future direction will be expanding our OOTD model to parser-based games where the agent must generate the commands character by character without knowing candidate actions.
+
+# ACKNOWLEDGMENTS
+
+We acknowledge the funding from the Canada CIFAR AI Chairs program, and the support of the Natural Sciences and Engineering Research Council of Canada (NSERC). Resources used in this work were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring the Vector Institute https://vectorinstitute.ai/partners/.
+
+# ETHICS STATEMENT
+
+In this work, we study model-based planning in a simulated (TBG) environment. Although the task itself has limited consequences for society, we take a broader view of our work and discuss its potential influence on future research that might have a considerable impact on our society. We believe developing an autonomous RL agent for TBGs serves as the stepping stone toward real-world applications where the machine cooperates or interacts with humans for some specific tasks. A concrete example of these applications will be the auto-dialogue systems, where the machine must respond to human concerns by conveying accurate information and solving the problem with humans. During this process, failing to communicate clearly, sensibly, or convincingly might also cause harm, for example, without sufficient calibration, the machine could generate improper words or phrases that might potentially cause a bias toward some minorities or underrepresented groups. How to eliminate such bias will be an important direction of future research.
+
+# REPRODUCIIBILITY STATEMENT
+
+This section introduces how we facilitate the reproducibility from the following perspectives:
+
+Model Implementation. Section 4 introduces our approach to dividing the training, validation, and testing datasets as well as the running settings based on the constructed datasets. We report the hyper-parameters for training our OOTD model and the seeds for independent runs in Appendix A.1. The computing resources and running time are discussed in Appendix A.7.
+
+Code and Dataset. Please find our implementation on Github1.
+
+# REFERENCES
+
+Ashutosh Adhikari, Xingdi Yuan, Marc-Alexandre Côté, Mikuláš Zelinka, Marc-Antoine Rondeau, Romain Laroche, Pascal Poupart, Jian Tang, Adam Trischler, and William L. Hamilton. Learning dynamic belief graphs to generalize on text-based games. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
+Leonard Adolphs and Thomas Hofmann. Ledepchef deep reinforcement learning agent for families of text-based games. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 7342-7349. AAAI Press, 2020.
+Prithviraj Ammanabrolu and Matthew J. Hausknecht. Graph constrained reinforcement learning for natural language action spaces. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
+Prithviraj Ammanabrolu and Mark Riedl. Playing text-adventure games with graph-based deep reinforcement learning. In Jill Burstein, Christy Doran, and Thamar Solorio (eds.), Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pp. 3557-3565. Association for Computational Linguistics, 2019.
+Prithviraj Ammanabrolu, Ethan Tien, Matthew J. Hausknecht, and Mark O. Riedl. How to avoid being eaten by a grue: Structured exploration strategies for textual worlds. CoRR, abs/2006.07409, 2020.
+
+Gabor Angeli, Melvin Jose Johnson Premkumar, and Christopher D. Manning. Leveraging linguistic structure for open domain information extraction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL 2015, July 26-31, 2015, Beijing, China, Volume 1: Long Papers, pp. 344-354. The Association for Computer Linguistics, 2015.
+Christopher P. Burgess, Loic Matthews, Nicholas Watters, Rishabh Kabra, Irina Higgins, Matthew Botvinick, and Alexander Lerchner. Monet: Unsupervised scene decomposition and representation. CoRR, abs/1901.11390, 2019.
+Marc-Alexandre Côté, Akos Kádár, Xingdi Yuan, Ben Kybartas, Tavian Barnes, Emery Fine, James Moore, Matthew Hausknecht, Layla El Asri, Mahmoud Adada, et al. Textworld: A learning environment for text-based games. In Workshop on Computer Games, pp. 41-75. Springer, 2018.
+Adrien Couëtoux, Jean-Baptiste Hoock, Nataliya Sokolovska, Olivier Teytaud, and Nicolas Bonnard. Continuous upper confidence trees. In Carlos A. Coello Coello (ed.), Learning and Intelligent Optimization - 5th International Conference, LION 5, Rome, Italy, January 17-21, 2011. Selected Papers, volume 6683 of Lecture Notes in Computer Science, pp. 433-445. Springer, 2011.
+Felipe Leno da Silva and Anna Helena Reali Costa. Object-oriented curriculum generation for reinforcement learning. In Elisabeth Andre, Sven Koenig, Mehdi Dastani, and Gita Sukthankar (eds.), Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS 2018, Stockholm, Sweden, July 10-15, 2018, pp. 1026-1034. International Foundation for Autonomous Agents and Multiagent Systems Richland, SC, USA / ACM, 2018.
+Felipe Leno da Silva, Ruben Glatt, and Anna Helena Reali Costa. MOO-MDP: an object-oriented representation for cooperative multiagent reinforcement learning. IEEE Trans. Cybern., 49(2): 567-579, 2019.
+Carlos Diuk, Andre Cohen, and Michael L. Littman. An object-oriented representation for efficient reinforcement learning. In William W. Cohen, Andrew McCallum, and Sam T. Roweis (eds.), Machine Learning, Proceedings of the Twenty-Fifth International Conference (ICML 2008), Helsinki, Finland, June 5-9, 2008, volume 307 of ACM International Conference Proceeding Series, pp. 240-247. ACM, 2008.
+Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O. Stanley, and Jeff Clune. Go-explore: a new approach for hard-exploration problems. CoRR, abs/1901.10995, 2019.
+Chelsea Finn, Ian J. Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 64-72, 2016.
+Ross B. Girshick. Fast R-CNN. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pp. 1440-1448. IEEE Computer Society, 2015.
+Vikash Goel, Jameson Weng, and Pascal Poupart. Unsupervised video object segmentation for deep reinforcement learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 5688-5699, 2018.
+Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. CoRR, abs/1909.10893, 2019.
+Danijar Hafner, Timothy P. Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 2555-2565. PMLR, 2019.
+
+Matthew J. Hausknecht, Ricky Loynd, Greg Yang, Adith Swaminathan, and Jason D. Williams. NAIL: A general interactive fiction agent. CoRR, abs/1902.04259, 2019.
+Matthew J. Hausknecht, Prithviraj Ammanabrolu, Marc-Alexandre Côté, and Xingdi Yuan. Interactive fiction games: A colossal adventure. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 7903-7910. AAAI Press, 2020.
+Ji He, Jianshu Chen, Xiaodong He, Jianfeng Gao, Lihong Li, Li Deng, and Mari Ostendorf. Deep reinforcement learning with a natural language action space. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. The Association for Computer Linguistics, 2016.
+Vishal Jain, William Fedus, Hugo Larochelle, Doina Precup, and Marc G. Bellemare. Algorithmic improvements for deep reinforcement learning applied to interactive fiction. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 4328-4336. AAAI Press, 2020.
+Mandar Joshi, Rakesh Khobragade, Saurabh Sarda, Umesh Deshpande, and Shiwali Mohan. Object-oriented representation and hierarchical reinforcement learning in infinite mario. In IEEE 24th International Conference on Tools with Artificial Intelligence, ICTAI 2012, Athens, Greece, November 7-9, 2012, pp. 1076-1081. IEEE Computer Society, 2012.
+Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H. Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, Afroz Mohiuddin, Ryan Sepassi, George Tucker, and Henryk Michalewski. Model based reinforcement learning for atari. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
+Thomas N. Kipf, Elise van der Pol, and Max Welling. Contrastive learning of structured world models. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
+Levente Kocsis and Csaba Szepesvári. Bandit based monte-carlo planning. In Johannes Furnkranz, Tobias Scheffer, and Myra Spiliopoulou (eds.), Machine Learning: ECML 2006, 17th European Conference on Machine Learning, Berlin, Germany, September 18-22, 2006, Proceedings, volume 4212 of Lecture Notes in Computer Science, pp. 282-293. Springer, 2006.
+Leonid Kuvayev and Richard S Sutton. Model-based reinforcement learning with an approximate, learned model. In Proceedings of the ninth Yale workshop on adaptive and learning systems, pp. 101-105, 1996.
+Nathan O. Lambert, Brandon Amos, Omry Yadan, and Roberto Calandra. Objective mismatch in model-based reinforcement learning. In Alexandre M. Bayen, Ali Jabbabaie, George J. Pappas, Pablo A. Parrilo, Benjamin Recht, Claire J. Tomlin, and Melanie N. Zeilinger (eds.), Proceedings of the 2nd Annual Conference on Learning for Dynamics and Control, L4DC 2020, Online Event, Berkeley, CA, USA, 11-12 June 2020, volume 120 of Proceedings of Machine Learning Research, pp. 761-770. PMLR, 2020.
+Andrea Madotto, Mahdi Namazifar, Joost Huizinga, Piero Molino, Adrien Ecoffet, Huaixiu Zheng, Alexandros Papangelis, Dian Yu, Chandra Khatri, and Gökhan Tür. Exploration based language learning for text-based games. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pp. 1488-1494. ijcai.org, 2020.
+Ofir Marom and Benjamin Rosman. Zero-shot transfer with deictic object-oriented representation in reinforcement learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 2297-2305, 2018.
+Shiwali Mohan and John E. Laird. An object-oriented approach to reinforcement learning in an action game. In Vadim Bulitko and Mark O. Riedl (eds.), Proceedings of the Seventh AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, AIIDE 2011, October 10-14, 2011, Stanford, California, USA. The AAAI Press, 2011.
+
+Karthik Narasimhan, Tejas D. Kulkarni, and Regina Barzilay. Language understanding for text-based games using deep reinforcement learning. In Lluis Marquez, Chris Callison-Burch, Jian Su, Daniele Pighin, and Yuval Marton (eds.), Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, pp. 1-11. The Association for Computational Linguistics, 2015.
+Judea Pearl. Causality. Cambridge university press, 2009.
+Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In Francis R. Bach and David M. Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, 2015.
+Michael Sejr Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In Aldo Gangemi, Roberto Navigli, Maria-Esther Vidal, Pascal Hitzler, Raphael Troncy, Laura Hollink, Anna Tordai, and Mehwish Alam (eds.), The Semantic Web - 15th International Conference, ESWC 2018, Heraklion, Crete, Greece, June 3-7, 2018, Proceedings, volume 10843 of Lecture Notes in Computer Science, pp. 593-607. Springer, 2018.
+Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
+David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Vedavyas Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy P. Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nat., 529(7587):484-489, 2016.
+David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140-1144, 2018.
+Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 3104-3112, 2014.
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop, ITW 2015, Jerusalem, Israel, April 26 - May 1, 2015, pp. 1-5. IEEE, 2015.
+Adam Trischler, Marc-Alexandre Côté, and Pedro Lima. First TextWorld Problems, the competition: Using text-based games to advance capabilities of AI agents. 2019.
+Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In Maria-Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 2071-2080. JMLR.org, 2016.
+Jack Urbanek, Angela Fan, Siddharth Karamcheti, Saachi Jain, Samuel Humeau, Emily Dinan, Tim Rocktäschel, Douwe Kiela, Arthur Szlam, and Jason Weston. Learning to speak and act in a fantasy text adventure game. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pp. 673-683. Association for Computational Linguistics, 2019.
+
+Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of machine learning research, 9(11), 2008.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998-6008, 2017.
+Arthur Wandzel, Yoonseon Oh, Michael Fishman, Nishanth Kumar, Lawson L. S. Wong, and Stefanie TELEX. Multi-object search using object-oriented pomdpds. In International Conference on Robotics and Automation, ICRA 2019, Montreal, QC, Canada, May 20-24, 2019, pp. 7194-7200. IEEE, 2019.
+Tingwu Wang, Xuchan Bao, Ignasi Clavera, Jerrick Hoang, Yeming Wen, Eric Langlois, Shunshi Zhang, Guodong Zhang, Pieter Abbeel, and Jimmy Ba. Benchmarking model-based reinforcement learning. CoRR, abs/1907.02057, 2019.
+Xusen Yin and Jonathan May. Comprehensible context-driven text game playing. In IEEE Conference on Games, CoG 2019, London, United Kingdom, August 20-23, 2019, pp. 1-8. IEEE, 2019.
+Xingdi Yuan, Marc-Alexandre Côté, Alessandro Sordoni, Romain Laroche, Remi Tachet des Combes, Matthew J. Hausknecht, and Adam Trischler. Counting to explore and generalize in text-based games. CoRR, abs/1806.11525, 2018.
+Tom Zahavy, Matan Haroush, Nadav Merlis, Daniel J. Mankowitz, and Shie Mannor. Learn what not to learn: Action elimination with deep reinforcement learning. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 3566-3577, 2018.
+Mikuláš Zelinka. Baselines for reinforcement learning in text games. In Lefteri H. Tsoukalas, Éric Grégoire, and Miltiadis Alamaniotis (eds.), IEEE 30th International Conference on Tools with Artificial Intelligence, ICTAI 2018, 5-7 November 2018, Volos, Greece, pp. 320-327. IEEE, 2018.
+Guangxiang Zhu, Zhiao Huang, and Chongjie Zhang. Object-oriented dynamics predictor. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 9826-9837, 2018.
+Guangxiang Zhu, Jianhao Wang, Zhizhou Ren, Zichuan Lin, and Chongjie Zhang. Object-oriented dynamics learning through multi-level abstraction. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 6989-6998. AAAI Press, 2020.
+
+# A MODEL IMPLEMENTATION DETAILS AND DATASETS
+
+# A.1 HYPER-PARAMETERS
+
+We report the key hyper-parameters that have been applied for model implementation. We set the number of candidate objects $K$ to 99 and the number of candidate relations to 10 by following the settings in (Adhikari et al., 2020), which show that the agent can properly solve a game by modelling these objects and relations. The learning rate of policy training and dynamics model training is set to 0.0001. The discount factor $\gamma$ is set to 0.9. The size of the hidden layers and the size of $z$ in our OOTD model are set to 32. The transition layers of different objects are parameterized independently, so the neural network predicts $32 \times 99 = 3$ , 168 values at each step during dynamics modelling. The sizes of word embedding and node embedding are set to 300 and 100 respectively. These numbers are determined experimentally, which could provide promising performance with a reasonable computational resource. The full list of hyper-parameters is recorded in the .yaml file in our submitted code. In our experiment, the random seeds we select are 123, 321, and 666.
+
+# A.2 RESAMPLING FOR COMPUTING THE GRAPH LIKELIHOOD
+
+The graph likelihood $p_{\Omega}(h_t | \mathbf{z}_t)$ computes the probability of generating $h_t$ with a graph decoder. As it is discussed in Section 3.1, our graph decoder is implemented as a scoring function for entry-level prediction. However, $h_t$ is a graph with significant sparsity, for example, the corresponding adjacency matrix assigns positive labels (i.e., 1) for an average of 97.6 out of all 98,010 entries. As a result, directly optimizing toward $h_t^*$ creates a large negative bias. In other words, the decoder can achieve a satisfying accuracy by labelling all the entries with 0s, which does not capture any object information. To solve this problem, we implement a re-sampling technique that extracts all the positive samples (the entries labelled with one) from $h_t^*$ and sample an equivalent number of negative samples from the rest of the entries. These positive and negative samples are used to estimate the graph likelihood.
+
+# A.3 GOAL EXTRACTOR
+
+At a time step $t$ , the goal extractor generates the goal $g_{t}$ from the object states $\mathbf{z}_{t}$ by optionally conditioning on the previous goal $g_{t-1}$ and observed text $o_{t}$ . The goal can be represented by a sequence of words and symbols that follows the triplet format. To generate this goal, we introduce two kinds of extractors that are built for the OOTD learned by the OS-ELBo and the SS-ELBo objectives.
+
+Goal Extractor with the OS-ELBo objective. Under this setting, the predicted memory graph $\hat{h}_t^{OS}$ captures the sparsity of object observations and forms a direct prediction of the ground truth graph $\hat{h}_t^*$ (check Figure 7). We can build a rule-based goal extractor that maps $z_t$ to $\hat{h}_t^{OS}$ and checks whether $h_t^{OS}$ captures certain relations (e.g., 'need') between two objects. If there is such a relation, we directly output the sentence of corresponding triplets by following a format "[object 1 $ relation $ object 2)". Such a simple extractor can generalize well to training and testing games if $\hat{h}_t^{OS}$ manages to capture correct relations.
+
+Goal Extractor with the SS-ELBo objective. The memory graph $\hat{h}_t^{OS}$ learned by the SS-ELBo objective captures a latent representation of $\hat{h}_t^*$ . This latent representation is not directly interpretable, and thus we build a word-by-word sequence generator whose output is the goal to be predicted $(g_t)$ and inputs are $z_{t}, g_{t - 1}$ and $o_t$ . To train this model, we manually build a goal learning dataset that collects pairs of model input/output from the training games. During testing, we predict the goal after interacting with the environment and update the current goal if a valid goal sentence is generated.
+
+# A.4 OBJECT EXTRACTOR
+
+The object extractor $f_{e}(o_{t},a_{t - 1},h_{t - 1})$ predicts the memory graph $h_t$ by conditioning on current observations $o_{t}$ and action $a_{t}$ . Figure 5 shows the architecture of $f_{e}$ . It shares a similar structure to our OOTD model, but the key differences are 1) $f_{e}$ is a deterministic model which only maximizes the likelihood of predicting $h_t^*$ during training. 2) $f_{e}$ captures object information from $o_{t}$ , whereas
+
+$o_{t}$ is not available for our OOTD model, and it is the motivation why OOTD predicts the belief (distribution) of states while $f_{e}$ directly generates the deterministic states.
+
+
+Figure 5: The object extractor.
+
+# A.5 OBSERVATION ENCODER.
+
+The observation encoder $q_{\mathcal{E}}$ is defined by:
+
+$$
+\begin{array}{l} \boldsymbol {\nu} _ {k, t - 1} ^ {a} = \sum_ {j} b _ {k, j} ^ {a} \psi^ {a} (a _ {j, t - 1}) \quad \text {w h e r e} \quad \boldsymbol {b} _ {k} ^ {a} = \operatorname {s o f t m a x} (\boldsymbol {B} _ {k,:} ^ {a e}) \in [ 0, 1 ] ^ {J}, \\ \boldsymbol {\nu} _ {t - 1} ^ {e} = \sum_ {k} b _ {k} ^ {e} \boldsymbol {e} _ {k, t - 1} \quad \mathrm {w h e r e} \quad \boldsymbol {b} ^ {e} = s o f t m a x (\max _ {c o l} (\boldsymbol {B} ^ {a e})) \in [ 0, 1 ] ^ {K}, \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \boldsymbol {\nu} _ {k, t - 1} ^ {o} = \sum_ {j} b _ {k, j} ^ {o} \psi^ {o} \left(a _ {j, t - 1}\right) \quad \text {w h e r e} \quad \boldsymbol {b} _ {k} ^ {o} = \operatorname {s o f t m a x} \left(\boldsymbol {B} _ {k,:} ^ {o e}\right) \in [ 0, 1 ] ^ {J} \\ \boldsymbol {\nu} _ {t - 1} ^ {\prime , e} = \sum_ {k} b _ {k} ^ {o e, e} \boldsymbol {e} _ {k, t - 1} \quad \text {w h e r e} \quad \boldsymbol {b} ^ {o e, e} = \operatorname {s o f t m a x} \left(\max _ {\operatorname {c o l}} (\boldsymbol {B} ^ {o e})\right) \in [ 0, 1 ] ^ {K} \tag {8} \\ \end{array}
+$$
+
+$$
+q _ {\mathcal {E}} ^ {k} \left(z _ {k, t} \mid \boldsymbol {o} _ {t}, \boldsymbol {a} _ {t - 1}, z _ {k, t - 1}\right) = \mathcal {N} \left(\boldsymbol {\mu} _ {k, t} ^ {q}, \boldsymbol {\sigma} _ {k, t} ^ {q}\right) \text {w h e r e} \left[ \boldsymbol {\mu} _ {k, t} ^ {q}, \boldsymbol {\sigma} _ {k, t} ^ {q} \right] = \psi_ {k} ^ {q} \left(\left[ \boldsymbol {\nu} _ {k, t - 1} ^ {o}, \boldsymbol {\nu} _ {t - 1} ^ {\prime , e}, \boldsymbol {\nu} _ {k, t - 1} ^ {a}, \boldsymbol {\nu} _ {t - 1} ^ {e}, \boldsymbol {e} _ {k, t - 1} \right]\right)
+$$
+
+$\psi^o$ is a transformer-based text embedding function (Vaswani et al., 2017) for observations, and $\psi_k^q$ is implemented by a MLP. The transition layers $\psi_1^q,\ldots ,\psi_K^q$ are parameterized independently.
+
+Figure 6 shows the structure of an observation encoder $q_{\varepsilon}^{k}$ , which shares a similar structure to the transition (OOTD) model (Figure 3), but it includes an additional BIDAF network to learn an attention matrix $B^{oe}$ , where $b_{k,i}^{oe}$ measures the similarity between the representation of the $k^{th}$ object and the $i^{th}$ word in the current observation $o_t$ . It predicts the memory graph $h_t$ from $z_t^q$ with a ComplEx graph decoder (Section 3.1). It predicts the current observation $\hat{o}_t$ and reward $r_t$ with a sequence decoder and the reward function (Section 3.2).
+
+
+Figure 6: The observation encoder.
+
+# A.6 FTWP DATASET
+
+The FTWP dataset is a public dataset that supports pre-training the dynamics model ${}^{2}$ . Trischler et al. (2019) provided the First TextWorld Problems (FTWP) dataset. The dataset consists of TextWorld
+
+games in a cooking theme across a wide range of difficulty levels. For each game, the expert trajectory and the memory graph $h_t$ at each time step are recorded. The original dataset has only 10 games for each difficulty level. This is insufficient for dynamics model pre-training, so Adhikari et al. (2020) further expanded this dataset by adding more games into this dataset by utilizing the logic in the Textworld game engine. The specific generation rules are described in (Adhikari et al., 2020). After expansion, the dataset contains 4440 games for training, 222 games for validation, 514 games for testing. To ensure fairness when using this dataset, we confirm that there is no overlap between the FTWP and the games we used to train and evaluate our planning algorithms.
+
+# A.7 COMPUTATIONAL RESOURCE AND RUNNING TIME
+
+We run the experiment on a cluster operated by the Slurm workload manager. The cluster has multiple kinds of GPUs, including Tesla T4 with 16 GB memory, Tesla P100 with 12 GB memory, and RTX 6000 with 24 GB memory. We used machines with 24 GB of memory for pre-training the object extractor and 64 GB for training the OOTD model. The number of running nodes is 1, and the number of CPUs requested per task is 32. Given the aforementioned resources, pre-training can be completed within 4 days (96 hours), and training the dynamics model takes 6 days (144 hours).
+
+Table 4: Game statistics at different difficulty levels.
+
+| Level | Recipe Size | #Locations | Max Scores | Need Cut | Need Cook | #Action Candidates | #Objects |
| 0 | 1 | 1 | 3 | ✘ | ✘ | 10.5 | 15.4 |
| 1 | 1 | 1 | 4 | ✓ | ✘ | 11.5 | 17.1 |
| 2 | 1 | 1 | 5 | ✓ | ✓ | 11.8 | 17.5 |
| 3 | 1 | 9 | 3 | ✘ | ✘ | 7.2 | 34.1 |
| 4 | 3 | 6 | 11 | ✓ | ✓ | 28.4 | 33.4 |
| 5 | Mixture of Levels[1,2,3,4} |
+
+# B ALGORITHMS
+
+Algorithm 1: Dyna-Q Training
+Input: Transition Model: \(p_{\mathcal{T}}(\boldsymbol{z}_{t+1}|\boldsymbol{a}_t,\boldsymbol{z}_t)\), Object Encoder: \(q_{\mathcal{E}}(\boldsymbol{z}_{t+1}|o_{t+1},a_t,\boldsymbol{z}_t)\), Reward Model: \(p_r(r_{t+1}|z_{t+1},a_t,g_t)\), Object Extraction function: \(f_e(h_t,a_t,o_{t+1})\), Graph Decoder: \(p_{\Omega}(h_t|z_t)\), Training game ids \(\mathcal{I}\). Initialize Replay Buffers \(\mathcal{D}\); while not converged do Initialize belief state \(z_0 =\) random numbers, action \(a_0 =\) "restart", goal \(g_0 =\) "" and memory graph \(h_0 = 0^{C\times K\times K}\); Randomly pick a game \(id\in \mathcal{I}\), set \(t = 0\); while not end do /* Q learning with environment */
+[ o_{t+1},r_{t+1}\leftarrow env(at,id); Extract object information \(h_{t+1} = f(a_t,z_t,o_{t+1});]
+Update object belief \(z_{t+1}\sim q_{\mathcal{E}}(z_{t+1}|o_{t+1},a_t,z_t);\) Extract goal: \(g_{t+1} =\) ExtractGoal \((z_{t+1},o_{t+1},g_t);\) Action selection: \(\hat{a}_{t+1} =\) EpsilonGreedy \((Q(z_{t+1},a_{t+1},g_{t+1}))\); Expand the replay buffer: \(\mathcal{D}\cup \{z_t,h_t,a_t,g_t,r_{t+1},z_{t+1},h_{t+1},g_{t+1}\};\) \(t = t + 1\) and end = CheckEnd(env) end for update step \(c = 1,\dots,C\) do /* Model fitting */
+Sample a transition: \(\mathcal{T} = \{z_t,h_t,a_t,g_t,r_{t+1},z_{t+1},h_{t+1},g_{t+1}\}\) from the dataset \(\mathcal{D}\); Update the reward model to minimize the L1Smooth loss (Equation 6) with \(\mathcal{T}\); Update the transition model to minimize the OS-ELBO (Equation 5) objective or the SS-ELBO objective (Equation 7) with \(\mathcal{T}\); Update the Q function to minimize the TD Loss (Equation 1) with \(\mathcal{T}\); for explore step \(b = 1,\dots,B\) do /* Exploration with the transition and reward models */
+Randomly select \(a_{\tau}'\in \mathcal{A}\); \(z_{\tau +1}'\sim p_{\mathcal{T}}(z_{\tau +1}'|a_{\tau}',z_{\tau}),r_{\tau +1}'\sim pr(r_{t + 1}'|z_{\tau +1}',a_{\tau}',g_{\tau})\); Update the transition \(\mathcal{T}' = \{z_t,g_t,a_t',r_{t + 1}',z_{t + 1}',g_{t + 1}\}\); Update the Q function to minimize the TD Loss (Equation 1) with \(\mathcal{T}\); end end
+
+Algorithm 2: MCTS Testing
+Input:Transition Model: $p_{\mathcal{T}}(\boldsymbol{z}_{t + 1}|a_t,\boldsymbol {z}_t)$ Object Encoder: $q_{\mathcal{E}}(z_{t + 1}|o_{t + 1},a_t,z_t)$ Reward Model: $p_r(r_{t + 1}|z_{t + 1},a_t,g_t)$ Action Value function: $Q(z_{t},a_{t},g_{t})$ Testing game ids $\mathcal{I}$
+Initialize belief state $\textbf{z}_0 =$ random numbers, action $a_0 = "\mathrm{restart}"$ , and goal $g_0 = " < \mathrm{pad} > "$
+Initialize reward buffer $\mathcal{R}$ .
+for game id id $\in \mathcal{I}$ do Initialize root $N_0 =$ InitTree(Q $\left(\boldsymbol {z}_t,a_t,g_t\right)$ ), set $t = 0$ and $R = 0$ while not end do $o_{t + 1},r_{t + 1}\gets env(a_t,id)$ and $R = R + r_{t + 1}$ Update object belief $z_{t + 1}\sim q_{\mathcal{E}}(z_{t + 1}|o_{t + 1},a_t,z_t)$ Extract goal: $g_{t + 1} =$ ExtractGoal $(z_{t + 1},o_{t + 1},g_{t})$ Select action: $\hat{a}_{t + 1} = MCTS\_ Simulations(N_t,z_{t + 1},g_{t + 1},p_{\mathcal{T}}(\cdot),p_r(\cdot),Q(\cdot))$ Move the search node: $N_{t + 1} = M o v e (N_{t},\hat{a}_{t + 1})$ Expand $t = t + 1$ and end $=$ CheckEnd(env)
+end Buffer total rewards $\mathcal{R} = \mathcal{R}\cup R$
+end output:Reward buffer $\mathcal{R}$
+
+# C COMPLEMENTARY RESULTS
+
+# C.1 GRAPH VISUALIZATION
+
+Graph Visualization. Figure 7 illustrates examples of the ground-truth memory graph $h_t^*$ and the graphs learned by the OS-ELBo ( $h_t^{OS}$ ) and SS-ELBo ( $h_t^{SS}$ ) objectives. Since the space of adjacency matrices is large ( $K \times K \times C$ ) while the observed object information is limited, $h_t^*$ can be represented by a sparse matrix. Supervised by predicted graphs $\hat{h}_t$ , OS-ELBo captures the sparsity, and $h_t^{OS}$ is a direct approximation to $h_t^*$ . However, graph information is unavailable for the SS-ELBo objective, so $h_t^{OS}$ forms a dense latent representation of $h_t^*$ . Similar phenomenon can be observed in GATA (Adhikari et al., 2020). We study how well this latent representation and the corresponding object states can represent the object dynamics in Section 4.2.
+
+
+Figure 7: Adjacency tensors corresponding the "is" relation in memory graphs $h_t$ . From left to right: 1) the ground-truth graph, and the graph learned by 2) the OS-ELBo objective, 3) the SS-ELBo objective (Section 3.3), and 4) GATA (a graph-based dynamics model baseline) (Adhikari et al., 2020).
+
+
+
+
+
+
+
+# C.2 PLANNING EFFICIENCY
+
+We compare the efficiency of OOTD-based planning algorithms (including Dyna-Q, MCTS, and Dyna-Q+MCTS) by studying which method can gather more rewards with a limited number of selected actions. Figure 8 shows results. Among the planning algorithms, Dyna-Q+MCTS significantly outperforms others. It is because the Q network provides prior knowledge over the preference of
+
+actions, based on which MCTS implements Monte-Carlo rollouts to generate and evaluate the belief states of objects. Together, they yield a more accurate look ahead of future rewards.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Planning Curve. The agent are based on the dynamics model with the OS-ELBO objective (Upper) and the SS-ELBo objective (Lower). The plot shows mean $\pm$ std normalized scores computed with three independent runs.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/learningobjectorienteddynamicsforplanningfromtext/images.zip b/learningobjectorienteddynamicsforplanningfromtext/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..238a12adf97973d77e77d63e130b80135eff2e5a
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c6124b32f015d0ef76712fa70f4ea34e4b2209150525dca85dd79a17602bbbd
+size 711572
diff --git a/learningobjectorienteddynamicsforplanningfromtext/layout.json b/learningobjectorienteddynamicsforplanningfromtext/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1bde57219a761a23f83191e9cdf85aa678cf8d99
--- /dev/null
+++ b/learningobjectorienteddynamicsforplanningfromtext/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:29c0997747c84806fdd6c3811453a3876a73461c9fdf5474112cb2a66763d688
+size 705911
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_content_list.json b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..32d99bc5d0e792e75d55345dfe212095360d3bc3
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:56c9f5e6bd60b0dd878f0c87d19be1c0757387e365132092dbe3d5997505756e
+size 125401
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_model.json b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2f924c2a985ffed2f274bd372886ffabb03992ef
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0846cb2703268bbd153f7b0579e4c9e02140badbef095abca6e40e74b64093e1
+size 147065
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_origin.pdf b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..fe84078379e0e1d03cbe5e97d64f3b5bf638bf8b
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/cd6f9d0b-fac0-4adf-bb96-ec7ddf00621f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:74ec09cf74d2d56e1fcfd64bd83f43d0f28c5c2c9702e9865586961759c1d50c
+size 1599233
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/full.md b/learningprototypeorientedsetrepresentationsformetalearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..40c33927d0b8dd661023044871c0d02a921bbad5
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/full.md
@@ -0,0 +1,429 @@
+# LEARNING PROTOTYPE-ORIENTED SET REPRESENTATIONS FOR META-LEARNING
+
+Dandan Guo $^{1}$ , Long Tian $^{2}$ , Minghe Zhang $^{3}$ , Mingyuan Zhou $^{4}$ , Hongyuan Zha
+
+1The Chinese University of Hong Kong, Shenzhen 2Xidian University
+
+3Georgia Institute of Technology 4The University of Texas at Austin
+
+guodandan@cuhk.edu.cn tianlong@xidian.edu.cn mzhang388@gatech.edu
+migyuan.zhou@mccombs.utexas.edu zhahy@cuhk.edu.cn
+
+# ABSTRACT
+
+Learning from set-structured data is a fundamental problem that has recently attracted increasing attention, where a series of summary networks are introduced to deal with the set input. In fact, many meta-learning problems can be treated as set-input tasks. Most existing summary networks aim to design different architectures for the input set in order to enforce permutation invariance. However, scant attention has been paid to the common cases where different sets in a metadata distribution are closely related and share certain statistical properties. Viewing each set as a distribution over a set of global prototypes, this paper provides a novel prototype-oriented optimal transport (POT) framework to improve existing summary networks. To learn the distribution over the global prototypes, we minimize its regularized optimal transport distance to the set empirical distribution over data points, providing a natural unsupervised way to improve the summary network. Since our plug-and-play framework can be applied to many meta-learning problems, we further instantiate it to the cases of few-shot classification and implicit meta generative modeling. Extensive experiments demonstrate that our framework significantly improves the existing summary networks on learning more powerful summary statistics from sets and can be successfully integrated into metric-based few-shot classification and generative modeling applications, providing a promising tool for addressing set-input and meta-learning problems.
+
+# 1 INTRODUCTION
+
+Machine learning models, such as convolutional neural networks for images (He et al. 2016) and recurrent neural networks for sequential data (Sutskever et al. 2014), have achieved great success in taking advantage of the structure in the input space (Maron et al. 2020). However, extending them to handle unstructured input in the form of sets, where a set can be defined as an unordered collections of elements, is not trivial and has recently attracted increasing attention (Jurewicz & Strømberg-Derczynski, 2021). Set-input is relevant to a range of problems, such as understanding a scene formed of a set of objects (Eslami et al. 2016), classifying an object composed of a set of 3D points (Qi et al. 2017), summarizing a document consisting of a set of words (Blei et al., 2003; Zhou et al., 2016), and estimating summary statistics from a set of data points for implicit generative models (Chen et al. 2021). Moreover, many meta-learning problems, which process different but related tasks, may also be viewed as set-input tasks (Lee et al., 2019), where an input set corresponds to the training dataset of a single task. Therefore, we broaden the scope of set-related applications by including traditional set-structured input problems and most meta-learning problems. Both of them aim to improve the quick adaptation ability for unseen sets, even though the latter is more difficult because of limited samples or the occurrence of new categories for classification problems.
+
+For a set-input, the output of the model must not change if the elements of the input set are reordered, which entails permutation invariance of the model. To enforce this property, multiple researchers have recently focused on designing different network architectures, which can be referred to as a summary network for compressing the set-structured data into a fixed-size output. For example, the prominent works of Zaheer et al. (2017) and Edwards & Storkey (2017) combined the standard
+
+feed-forward neural networks with a set-pooling layer, which have been proven to be universal approximators of continuous permutation invariant functions. Lee et al. (2019) further introduced Set Transformer to encode and aggregate the features within the set using multi-head attention. Maron et al. (2020) designed deep models and presented a principled approach to learn sets of symmetric elements. Despite the effectiveness and recent popularity of these works in set-input problems, there are several shortcomings for existing summary networks, which could hinder their applicability and further extensions: 1) The parameters of the summary network are typically optimized by a task-specific loss function, which could limit the models' flexibility. 2) A desideratum of a summary network is to extract set features, which have enough ability to represent the summary statistics of the input set and thus benefit the corresponding set-specific task; but for many existing summary networks, there is no clear evidence or constraint that the outputs of the summary network could describe the set's summary statistics well. These limits still remain even with the recent more carefully designed summary networks, while sets with limited samples further exacerbate the problem.
+
+To address the above shortcomings, we present a novel and generic approach to improve the summary networks for set-structured data and adapt them to meta-learning problems. Motivated by meta-learning that aims to extract transferable patterns useful for all related tasks, we assume that there are $K$ global prototypes (i.e., centers) among the collection of related sets, and each prototype or center is encouraged to capture the statistical information shared by those sets, similar to the "topic" in topic modeling (Blei et al., 2003; Zhou et al., 2016) or "dictionary atom" in dictionary learning (Aharon et al., 2006; Zhou et al., 2009). Specifically, for the $j$ th set, we consider it as a discrete distribution $P_{j}$ over all the samples within the set (in data or feature space). At the same time, we also represent this set with another distribution $Q_{j}$ (in the same space with $P_{j}$ ), supported on $K$ global prototypes with a $K$ -dimensional set representation $h_{j}$ . Since $h_{j}$ measures the importance of global prototypes for set $j$ , it can be treated as the prototype proportion for summarizing the salient characteristics of set $j$ . Moreover, the existing summary networks can be adopted to encode set $j$ as $h_{j}$ for their desired property of permutation invariance. In this way, we can formulate the learning of summary networks as the process of learning a $P_{j}$ to be as close to $Q_{j}$ as possible, a process facilitated by leveraging the optimal transport (OT) distance (Peyre & Cuturi 2019). Therefore, the global prototypes and summary network can be learned by jointly optimizing the task-specific loss and OT distance between $P_{j}$ and $Q_{j}$ in an end-to-end manner. We can refer to this method as prototype-oriented OT (POT) framework for meta-learning, which is applicable to a range of unsupervised and supervised tasks, such as set-input problems solved by summary networks, meta-generation (Hong et al., 2020c; Antoniou et al., 2017), metric-based few-shot classification (Snell et al., 2017), and learning statistics for approximate Bayesian computation (Chen et al., 2021). We note our construction has drawn inspirations from previous works that utilize a transport based loss between a set of objects and a set of prototypes (Tanwisuth et al., 2021; Wang et al., 2022). These works mainly follow the bidirectional conditional transport framework of Zheng & Zhou (2021), instead of the undirectional OT framework, and focus on different applications.
+
+Since our plug-and-play framework can be applied to many meta-learning problems, this paper further instantiates it to the cases of metric-based few-shot classification and implicit meta generative modeling. We summarize our contributions as follows: (1) We formulate the learning of summary network as the distribution approximation problem by minimizing the distance between the distribution over data points and another one over global prototypes. (2) We leverage the POT to measure the difference between the distributions for use in a joint learning algorithm. (3) We apply our method to metric-based few-shot classification and construct implicit meta generative models, where a summary network is used to extract the summary statistics from set and optimized by the POT loss. Experiments on several meta-learning tasks demonstrate that introducing the POT loss into existing summary networks can extract more effective set representations for the corresponding tasks, which can also be integrated into existing few-shot classification and GAN frameworks, producing a new way to learn the set' summary statistics applicable to many applications.
+
+# 2 BACKGROUND
+
+# 2.1 SUMMARY NETWORKS FOR SET-STRUCTURED INPUT
+
+To deal with the set-structured input $D_{j} = \{x_{j,1:N_{j}}\}$ and satisfy the permutation invariance in set, a remarkably simple but effective summary network is to perform pooling over embedding vectors extracted from the elements of a set. More formally,
+
+$$
+S _ {\phi} \left(D _ {j}\right) = g _ {\phi_ {2}} \left(\operatorname {p o o l} \left(\left\{f _ {\phi_ {1}} \left(\boldsymbol {x} _ {j 1}\right), \dots , f _ {\phi_ {1}} \left(\boldsymbol {x} _ {j N _ {j}}\right) \right\}\right)\right), \tag {1}
+$$
+
+where $f_{\phi_1}(\cdot)$ acts on each element of a set and $g_{\phi_2}(\mathrm{pool}(\cdot))$ aggregates these encoded features and produces desired output, and $\phi = \{\phi_1,\phi_2\}$ denotes the parameters of the summary network. Most network architectures for set-structured data follow this structure; see more details from previous works (Lee et al., 2019; Zaheer et al., 2017; Edwards & Storkey, 2017; Maron et al., 2020).
+
+# 2.2 OPTIMAL TRANSPORT
+
+Although OT has a rich theory, we limit our discussion to OT for discrete distributions and refer the reader to Peyré & Cuturi (2019) for more details. Let us consider $p$ and $q$ as two discrete probability distributions on the arbitrary space $X \subseteq \mathbb{R}^d$ , which can be formulated as $p = \sum_{i=1}^{n} a_i \delta_{x_i}$ and $q = \sum_{j=1}^{m} b_j \delta_{y_j}$ . In this case, $\boldsymbol{a} \in \Sigma^n$ and $\boldsymbol{b} \in \Sigma^m$ , where $\Sigma^n$ denotes the probability simplex of $\mathbb{R}^n$ . The OT distance between $\boldsymbol{a}$ and $\boldsymbol{b}$ is defined as
+
+$$
+\mathrm {O T} (\boldsymbol {a}, \boldsymbol {b}) = \min _ {\mathbf {T} \in U (\boldsymbol {a}, \boldsymbol {b})} \langle \mathbf {T}, \mathbf {C} \rangle , \tag {2}
+$$
+
+where $\langle \cdot, \cdot \rangle$ means the Frobenius dot-product; $\mathbf{C} \in \mathbb{R}_{\geq 0}^{n \times m}$ is the transport cost function with element $C_{ij} = C(x_i, y_j)$ ; $\mathbf{T} \in \mathbb{R}_{>0}^{n \times m}$ denotes the doubly stochastic transport probability matrix such that $U(\mathbf{a}, \mathbf{b}) \coloneqq \{\mathbf{T} | \sum_i^n T_{ij} = b_j, \sum_j^m T_{ij} = a_i\}$ . To relax the time-consuming problem when optimising the OT distance, Cuturi (2013) introduced the entropic regularization, $H = -\sum_{ij} T_{ij} \ln T_{ij}$ , leading to the widely-used Sinkhorn algorithm for discrete OT problems.
+
+# 3 PROPOSED FRAMEWORK
+
+In meta-learning, given a meta-distribution $p_{\mathcal{M}}$ of tasks, the marginal distribution $p_j$ of task $j$ is sampled from $p_{\mathcal{M}}$ for $j \in \mathcal{J}$ , where $\mathcal{J}$ denotes a finite set of indices. E.g., we can sample $p_j$ from $p_{\mathcal{M}}$ with probability $\frac{1}{\mathcal{J}}$ when $p_{\mathcal{M}}$ is uniform over a finite number of marginals. During meta-training, direct access to the distribution of interest $p_j$ is usually not available. Instead, we will observe a set of data points $D_j = \{\pmb{x}_{ji}\}_{i=1}^{N_j}$ , which consists of $N_j$ i.i.d. samples from $p_j$ over $\mathbb{R}^d$ . We can roughly treat the meta-learning problems as the set-input tasks, where dataset $D_j$ from $p_j$ corresponds to an input set. To learn more representative features from related but unseen sets in meta-learning problems, we adopt the summary network as the encoder to extract set representations and improve it by introducing the OT loss and global prototypes, providing many applications. Besides, we also provide the applications to metric-based few-shot classification and implicit generative framework by assimilating the summary statistics. Below we describe our model in detail.
+
+# 3.1 LEARNING GLOBAL PROTOTYPES AND SET REPRESENTATION VIA OT
+
+Given $J$ sets from meta-distribution $p_{\mathcal{M}}$ , we can represent each set $D_{j}$ from meta-distribution $p_{\mathcal{M}}$ as an empirical distribution over $N_{j}$ samples on the original data space, formulated as
+
+$$
+P _ {j} = \sum_ {i = 1} ^ {N _ {j}} \frac {1}{N _ {j}} \delta_ {\boldsymbol {x} _ {j i}}, \boldsymbol {x} _ {j i} \in \mathbb {R} ^ {d}. \tag {3}
+$$
+
+Since all sets (distributions) drawn from meta-distribution $p_{\mathcal{M}}$ are closely related, it is reasonable to assume that these sets share some statistical information. Motivated by dictionary learning, topic modeling, and two recent prototype-oriented algorithms (Tanwisuth et al., 2021; Wang et al., 2022), we define the shared information as the learnable global prototype matrix $\mathbf{B} = \{\beta_k\} \in \mathbb{R}^{d \times K}$ , where $K$ represents the number of global prototypes and $\beta_k$ denotes the distributed representation of the $k$ -th prototype in the same space of the observed data points (e.g., "topic" in topic modeling). Given the prototype matrix $\mathbf{B}$ , each set can be represented with a $K$ -dimensional weight vector $h_j \in \Sigma_k$ (e.g., "topic proportion" in topic modeling), where $h_{jk}$ means the weight of the prototype $\beta_k$ for set $j$ . Hence, we can represent set $D_j$ with another distribution $Q_j$ on prototypes $\beta_{1:K}$ :
+
+$$
+Q _ {j} = \sum_ {k = 1} ^ {K} h _ {j k} \delta_ {\beta_ {k}}, \beta_ {k} \in \mathbb {R} ^ {d}, \tag {4}
+$$
+
+where $h_j$ is a set representation for describing set $j$ . Since set $j$ can be represented as $Q_j$ and $P_j$ , we can learn set-specific representation $h_j$ and prototype matrix $\mathbf{B}$ by pushing $Q_j$ towards $P_j$ :
+
+$$
+\mathrm {O T} \left(P _ {j}, Q _ {j}\right) = \min _ {\mathbf {B}, \mathbf {h} _ {j}} \langle \mathbf {T}, \mathbf {C} \rangle \stackrel {\text {d e f .}} {=} \sum_ {i} ^ {N _ {j}} \sum_ {k} ^ {K} C _ {i k} T _ {i k}, \tag {5}
+$$
+
+
+Figure 1: An overview of our proposed framework, where "pool" operation including mean, sum, max or similar. We compute the representation $\pmb{h}_j$ for set $j$ using the summary network in Equation 1, which is the weight vector of the global prototypes (i.e., centers) $\beta_{1:K}$ in the corresponding set.
+
+where $\mathbf{C} \in \mathbb{R}_{\geq 0}^{N_j \times K}$ is the transport cost matrix. In this paper, to measure the distance between data point $\pmb{x}_{ji}$ in set $j$ and prototype $\beta_k$ , unless specified otherwise, we construct $\mathbf{C}$ as $C_{ik} = 1 - \cos(\pmb{x}_{ji}, \pmb{\beta}_k)$ , which provides an upper-bounded positive similarity metric. Besides, the transport probability matrix $\mathbf{T} \in \mathbb{R}_{>0}^{N_j \times K}$ should satisfy $\Pi(\pmb{a}, \pmb{b}) := \{\mathbf{T} \mid \mathbf{T1}_K = \pmb{a}, \mathbf{T}^\top \mathbf{1}_{N_j} = \pmb{b}\}$ with $T_{ik} = T(\pmb{x}_{ji}, \pmb{\beta}_k)$ , where $\pmb{a} = [\frac{1}{N_j}] \in \Sigma^{N_j}$ and $\pmb{b} = [h_{jk}] \in \Sigma^K$ denote the respective probability vectors for distribution $P_j$ in Equation 3 and $Q_j$ in Equation 4.
+
+Since $h_j$ should be invariant to permutations of the samples in set $j$ , we adopt a summary network to encode the set of $N_j$ points. For unsupervised tasks, taking the summary network in Equation 1 as the example, we can directly add a Softmax activation function into $S_{\phi}$ to enforce the simplex constraint in set representation $h_j$ , denoted as $h_j = \mathrm{Softmax}(S_{\phi}(D_j))$ . As shown in Fig. 1, given $J$ sets, to learn the global prototype matrix $\mathbf{B}$ and summary network parameterized by $\phi$ , we adopt the entropic constraint (Cuturei, 2013) and define the average OT loss for all training sets as
+
+$$
+L _ {\mathrm {P O T}} = \min _ {\mathbf {B}, \phi} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {J}} \left(\sum_ {i} ^ {N _ {j}} \sum_ {k} ^ {K} C _ {i k} T _ {i k} - \epsilon \sum_ {i} ^ {N _ {j}} \sum_ {k} ^ {K} - T _ {i k} \ln T _ {i k}\right) = \min _ {\mathbf {B}, \phi} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {J}} \left(\mathrm {O T} _ {\epsilon} \left(P _ {j}, Q _ {j}\right)\right), \tag {6}
+$$
+
+where $\epsilon$ is a hyper-parameter for entropic constraint. Algorithm 1 describes the workflow of the POT loss for improving summary network under unsupervised tasks. For supervised tasks, set $j$ is denoted as $D_{j} = \{\pmb{x}_{j,1:N_{j}},\pmb{y}_{j}\}$ , where $\pmb{y}_j$ is the ground-truth output determined by specific tasks. As $\pmb{h}_j$ is a normalized weight vector, directly using it to realize the corresponding task may be undesired. Denoting $\pmb{z}_j = \mathrm{pool}\left(\left\{f_{\phi_1}(\pmb{x}_{j1}),\dots,f_{\phi_1}(\pmb{x}_{jN_j})\right\}\right)$ , we project it to the following vectors:
+
+$$
+\boldsymbol {h} _ {j} = f _ {e} \left(\boldsymbol {z} _ {j}\right), \hat {\boldsymbol {y}} _ {j} = f _ {\lambda} \left(\boldsymbol {z} _ {j}\right), \tag {7}
+$$
+
+where $h_j$ and $\hat{y}_j$ are responsible for the POT and task-specific losses, respectively. Now the summary network parameters $\tilde{\phi} = \{e, \lambda, \phi_1\}$ and global prototypes $\mathbf{B}$ are learned by jointly optimizing the task-specific loss (computed by $\hat{y}_j$ and $y_j$ ) and OT loss in Equation 6. In summary, minimizing the POT loss defined by the prototype distribution $Q_j$ and empirical distribution $P_j$ provides a principled and unsupervised way to encourage the summary network to capture the set's summary statistics. Therefore, our plug-and-play framework can integrate a suite of summary networks and realize efficient learning from new sets for both unsupervised and supervised tasks.
+
+# 3.2 APPLICATION TO METRIC-BASED FEW-SHOT CLASSIFICATION
+
+As a challenging meta-learning problem, few-shot classification has recently attracted increasing attention, where one representative method is metric-based few-shot classification algorithms. Taking the ProtoNet (Snell et al., 2017) as an example, we provide a simple but effective method to improve its classification performance with the help of POT and summary network, where we refer the reader to ProtoNet for more details. ProtoNet represents each class by computing an $M$ -dimensional representation $\mathbf{z}_j \in \mathbb{R}^M$ , with an embedding function $f_{\phi_1}: \mathbb{R}^d \to \mathbb{R}^M$ , where we adopt the same $\phi_1$ as the learnable parameters, following the feature extractor in summary network in Equation 1 for simplicity. Formally, ProtoNet adopts the average pooling to aggregate the embedded features of the support points belonging to its class into vector $\mathbf{z}_j = \frac{1}{|S_j|} \sum_{(\mathbf{x}_{ji}, y_{ji}) \in S_j} f_{\phi_1}(\mathbf{x}_{ji})$ . ProtoNet
+
+Algorithm 1 The workflow of POT on minimizing the OT distance between $P_{j}$ and $Q_{j}$ .
+Require: Datasets $\mathcal{D}_{1:\mathcal{J}}$ , batch size $m$ , learning rate $\alpha$ , initial summary network parameters $\phi$ , initial global prototype matrix B, cost function $C$ and hyper-parameter $\epsilon$
+while $\mathbf{B},\phi$ has not converged do Randomly choose $j$ from 1,2,..,J Sample the real data $\{\pmb {x}_{ji}\}_{i = 1}^{m}$ from set $j$ , which is denoted as empirical distribution $P_{j}$ in Equation 3; Compute the set representation $h_j = \mathrm{Softmax}(S_\phi (\{x_{ji}\}_{i = 1}^m))$ with summary network in Equation 1; Represent the $Q_{j}$ with global prototype matrix B and statistics $\pmb{h_j}$ in Equation 4; Compute the loss $\mathrm{OT}_{\epsilon}(P_j,Q_j)$ between $P_{j}$ and $Q_{j}$ with Sinkhorn algorithm in Equation 6; $\mathbf{B}\gets \mathbf{B} + \alpha g_{\mathbf{B}}$ , where $g_{\mathbf{B}}\gets \nabla_{\mathbf{B}}[\mathrm{OT}_{\epsilon}(P_j,Q_j)];\phi \gets \phi +\alpha g_{\phi}$ , where $g_{\phi}\gets \nabla_{\phi}[\mathrm{OT}_{\epsilon}(P_j,Q_j)]$ end while
+
+then compares the distance between a query point $f_{\phi_1}(\pmb{x})$ to the $\mathbf{z}_j$ in the same embedding space. Motivated by the summary network, we further introduce a feed-forward network $g_{\phi_2}$ to map the $\mathbf{z}_j$ into the $h_j$ used to define $Q_j$ distribution over $\mathbf{B}$ . Therefore, the functions $g_{\phi_2}$ and $f_{\phi_1}$ can be jointly optimized by minimizing the POT loss and the original classification loss in ProtoNet,
+
+$$
+\min _ {\phi_ {1}, \phi_ {2}, \mathbf {B}} V \left(\phi_ {1}, \phi_ {2}, \mathbf {B}\right) = L _ {\mathrm {P O T}} + \sum_ {j = 1} ^ {\mathcal {I}} \sum_ {i = 1} ^ {N _ {j}} \operatorname {C L S} \left(y _ {j i}, \hat {y} _ {j i}\right) \tag {8}
+$$
+
+where $\mathbf{h}_j$ is used for computing the POT loss, $N_{j}$ the number of samples in class $j$ , $\hat{y}_{ji}$ the predicted label for sample $\pmb{x}_{ji}$ , conditioned on $\mathbf{z}_{1:J}$ and $f_{\phi_1}(\pmb{x}_{ji})$ , and CLS the classification loss. Only introducing matrix $\mathbf{B}$ and $g_{\phi_2}$ , whose parameters are usually negligible compared to $f_{\phi_1}$ , our proposed method can benefit the metric-based few-shot classification by enforcing the $f_{\phi_1}$ to learn more powerful representation $\mathbf{z}_j$ of each class and feature $f_{\phi_1}(\pmb{x})$ of the query sample.
+
+# 3.3 APPLICATION TO IMPLICIT META GENERATIVE MODELS
+
+Considering implicit meta generative modeling is still a challenging but important task in meta-learning, we further present how to construct the model by introducing set representation $\pmb{h}_j$ as summary statistics, where we consider GAN-based implicit models. Specifically, given $p_j \sim p_{\mathcal{M}}$ , we aim to construct a parametrized pushforward (i.e., generator) of reference Gaussian distribution $\rho$ , denoted as $T_{\theta}(\cdot, p_j) \sharp \rho$ , to approximate the marginal distribution $p_j$ , where $\theta$ summarizes the parameters of pushforward. Since it is unaccessible to the distribution of interest $p_j$ , we replace $p_j$ with $P_j$ and use the summary network to encode set $D_j$ into $\pmb{h}_j$ as discussed above, which is further fed into the generator serving as the conditional information, denoted as $T_{\theta}(z; h_j), z \sim \rho$ . To enforce the pushforward $T_{\theta}(z; h_j)$ to fit the real distribution $P_j$ as well as possible, we introduce a discriminator $f_w$ following the standard GAN (Goodfellow et al., 2014). Generally, our GAN-based model consists of three components. Summary network $S_{\phi}(\cdot)$ focuses on learning the summary statistics $\pmb{h}_j$ by minimizing $\mathrm{OT}_{\epsilon}(P_j, Q_j)$ . The pushforward aims to push the combination of a random noise vector $z$ and statistics $\pmb{h}_j$ to generate samples that resemble the ones from $P_j$ , where we simply adopt a concatenation for $\pmb{h}_j$ and $z$ although other choices are also available. Besides, $f_w$ tries to distinguish the "fake" samples from the "real" samples in set $D_j$ . Therefore, we optimize the implicit meta generative model by defining the objective function as:
+
+$$
+\min _ {\mathbf {B}, \phi , \theta} \max _ {w} V (\mathbf {B}, \phi , \theta , w) = L _ {\mathrm {P O T}} + \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {I}} \mathbb {E} _ {\boldsymbol {x} \sim P _ {j}} [ \log f _ {w} (\boldsymbol {x}) ] + \mathbb {E} _ {\boldsymbol {z} \sim \rho} [ \log (1 - f _ {w} (T _ {\theta} (\boldsymbol {z}; \boldsymbol {h} _ {j})) ] \tag {9}
+$$
+
+In addition to the standard GAN loss, we can also adopt the Wasserstein GAN (WGAN) of Arjovsky et al. (2017) to approximate $P_{j}$ . It is also flexibly to decide the input fed into $f_{w}$ . For example, following the conditional GAN (CGAN) of Mirza & Osindero (2014), we can combine $h_{j}$ and data points (generated or real), where the critic can be denoted as $f_{w}(\boldsymbol{x},\boldsymbol{h}_{j})$ and $f_{w}(T_{\theta}(\boldsymbol{z};\boldsymbol{h}_{j}),\boldsymbol{h}_{j})$ , respectively. Since we focus on fitting the meta-distribution with the help of the summary network and POT loss, we leave the problem-specific design of the generator, critic, and summary network as future work for considerable flexibility in architectures. In Appendix A, we provide the illustration of our proposed model in Fig. 3 and detailed algorithm in Algorithm 2.
+
+# 4 RELATED WORK
+
+Learning Summary Representation of Set-input. There are two lines for learning the set representation. The first line aims to design more powerful summary networks, which are reviewed in
+
+Introduction and Section 2.1 and omitted here due to the limited space. The another line assumes a/some to-be-learned reference set(s), and optimizes the distance between the original sets (or features of the observed data points) and the reference set(s) with OT or other distance measures, to learn set representation. For example, RepSet (Skianis et al., 2020) computes some comparison costs between the input sets and some to-be-learned reference sets with a network flow algorithm, such as bipartite matching. These costs are then used as set representation in a subsequent neural network. However, unlike our framework, RepSet does not allow unsupervised learning and mainly focuses on classification tasks. The Optimal Transport Kernel Embedding (OTKE) (Mialon et al., 2021) marries ideas from OT and kernel methods (Schölkopf et al., 2002), and aligns features of a given set to a trainable reference distribution. Wasserstein Embedding for Graph Learning (WEGL) (Kolouri et al., 2021) also uses a similar idea to the linear Wasserstein embedding as a pooling operator for learning from sets of features. To the best of our knowledge, both of them view the reference distribution as the barycenter and compute the set-specific representation by aggregating the features (embedded with kernel methods) in a given set with adaptive weight, defined by the transport plan between the given set and the reference. Different from them, we assume $J$ probability distributions (rather than one reference distribution with an uniform measure) over these shared prototypes by taking set representations $h_{1:J}$ as the measures, to approximate the corresponding $J$ empirical distributions, respectively. Then we naturally use the summary network as the encoder to compute $h_{1:J}$ , which can be jointly optimized with the shared prototypes by minimizing the POT loss in an unsupervised way. For a given set, we can directly compute its representation with summary network, avoiding iteratively optimizing the transport plan between the given set and learned reference like OTKE and WEGL. These differences between the barycenter problem and ours, which are further described in Appendix B, lead to different views of set representation learning and different frameworks as well. To learn compact representations for sequential data, Cherian & Aeron (2020) blend contrastive learning, adversarial learning, OT, and Riemannian geometry into one framework. However, our work directly minimises the POT cost between empirical distribution and the to-be-learned distribution, providing a laconic but effective way to learn set representation.
+
+Metric-based few-shot classification methods. Our method has a close connection with metric-based few-shot classification algorithms. For example, MatchingNet (Vinyals et al., 2016) and ProtoNet (Snell et al., 2017) learned to classify samples by computing distances to representatives of each class. Using an attention mechanism over a learned embedding of the support set to predict classes for the query set, MatchingNet (Vinyals et al., 2016) can be viewed as a weighted nearest-neighbor classifier applied within an embedding space. ProtoNet (Snell et al., 2017) takes a class's prototype to be the mean of its support set in the learned embedding space, which further performs classification for an embedded query point by finding the nearest class prototype. Importantly, the global prototypes in our paper are shared among all sets, which is different from the specific prototype for each class in ProtoNet but suitable for our case. Due to the flexibility of our method, we can project the average aggregated feature vector derived from the encoder in ProtoNet or MatchingNet, into $h_j$ by introducing a simple neural network, which can be jointly optimized with the encoder by minimizing the classification loss and POT loss. Our novelty is that the POT loss can be naturally used to improve the learning of encoder while largely maintaining existing model architectures or algorithms. Another recent work for learning multiple centers is infinite mixture prototypes (IMP) (Allen et al., 2019), which represents each class by a set of clusters and infers the number of clusters with Bayesian nonparametrics. However, in our work, the centers are shared for all classes and set-specific feature extracted from the summary network serves as the proportion of centers, where the centers and summary network can be jointly learned with the POT loss.
+
+Meta GAN-based Models. As discussed by Hong et al. (2020a), meta GAN-based models can be roughly divided into optimization-based, fusion-based, and transformation-based methods. Clouâtre & Demers (2019) and Liang et al. (2020) integrated GANs with meta-learning algorithms to realize the optimization-based methods, including model-agnostic meta-learning (MAML) (Finn et al., 2017) and Reptile (Nichol et al., 2018). Hong et al. (2020b;c) fused multiple conditional images by combining matching procedure with GANs, providing fusion-based methods. For transformation based methods, Antoniou et al. (2017) and Hong et al. (2020a) combine only one image and the random noise into the generator to produce a slightly different image from the same category, without using the multiple images from same category. Besides, a recent work that connects existing summary network with GAN is MetaGAN (Zhang et al. 2018), which feeds the output of the summary network into the generator and focuses on few-shot classification using MAML. The key differences
+
+of these models from ours is that we develop POT to capture each sets' summary statistics, where we can flexibly choose the summary network, generator, and discriminator for specific tasks.
+
+# 5 EXPERIMENTS
+
+We conduct extensive experiments to evaluate the performance of our proposed POT in improving summary networks, few-shot generation, and few-shot classification. Unless specified otherwise, we set the weight of entropic constraint as $\epsilon = 0.1$ , the maximum iteration number in Sinkhorn algorithm as 200, and adopt the Adam optimizer (Kingma & Ba, 2015) with learning rate 0.001. We repeat all experiments 5 times and report the mean and standard deviation on corresponding test datasets.
+
+# 5.1 EXPERIMENTS ABOUT POT LOSS IN SUMMARY NETWORK
+
+To evaluate the effectiveness of POT in improving the summary network, we conduct three tasks on two classical architectures: DeepSets (Zaheer et al. 2017) and Set Transformer (Lee et al. 2019), where the former uses standard feed-forward neural networks and the latter adopts the attention-based network architecture. For Set Transformer and DeepSets, the summary network is defined in Equation 1 and optimized by the task-specific loss; for Set Transformer(+POT) and DeepSets(+POT), the summary network, defined as in Equations 1 and 7, is optimized by both the POT loss and task-specific loss. More experimental details are provided in Appendix C.
+
+Amortized Clustering with Mixture of Gaussians (MoGs): We consider the task of maximum likelihood of MoGs with $C$ components, denoted as $P(x; \boldsymbol{\theta}) = \sum_{c=1}^{C} \pi_c N\left(x \mid \mu_c, \operatorname{diag}\left(\sigma_c^2\right)\right)$ . Given the dataset $X = \{x_{1:n}\}$ generated from the MoG, the goal is to train a neural network, which takes $X$ as input set and outputs parameters $\boldsymbol{\theta} = \{\pi_c, \mu_c, \sigma_c\}_{1,C}$ . Each dataset contains $n \in [100, 500]$ points on a 2D plane, each of which is sampled from one of $C$ Gaussians. Table 1 reports the test average likelihood of different models with varying $C \in \{4,8\}$ , where we set $K = 50$ prototypes for all $C$ . We observe that Set Transformer outperforms DeepSets largely, validating the effectiveness of attention mechanisms in this task. We note both Set Transformer(+POT) and DeepSets(+POT) improve their baselines, showing that the POT loss can encourage the summary networks to learn more efficient summary statistics.
+
+Point Cloud Classification: Here, we evaluate our method on the task of point cloud classification using the ModelNet40 (Chang et al., 2015) dataset $^{1}$ , which consists of 3D objects from 40 different categories. By treating each object as a point cloud, we represent it as a set of $N$ vectors in $\mathbb{R}^3$ (x; y; z-coordinates). Table 1 reports the classification accuracy, where we perform the experiments with varying $N \in \{64, 1024\}$ , set $K = 40$ prototypes. Clearly, both DeepSets and Set Transformer can be improved by adding the POT loss. Notably, fewer points would lead to lower performance, where the POT loss plays a more important role. Taking this task as the example, we further study our model's sensitivity to hyper-parameter $\epsilon$ in Fig. 4 of Appendix C.5.
+
+Sum of Digits: Following Zaheer et al. (2017), we aim to compute the sum of a given set of digits, where we consider MNIST8m (Loosli et al., 2007), consisting of 8 million instances of $28 \times 28$ grey-scale stamps of digits in $\{0, \dots, 9\}$ . By randomly sampling a subset of maximum $M = 10$ images from MNIST8m, we build $N = 100k$ "sets" of training, where we denote the sum of digits in that set as the set-label. We construct $100k$ sets of test MNIST digits, where we vary the $M$ starting from 10 all the way up to 100. The output of the summary network is a scalar, predicting the sum of $M$ digits. In this case, we adopt L1 as the task-specific loss and set $K = 10$ prototypes. We show the accuracy of digit summation for different algorithms in Fig. 2 and find that the POT loss can enhance the summary networks to achieve better generalization. In this task, we also explore the convergence rate and the learned transport plan matrix of Sinkhorn algorithm in Fig. 5 of the Appendix C.6.
+
+
+Figure 2: Accuracy of digit summation with image inputs, where all models are trained on tasks of length 10 at most and tested on examples of length up to 100.
+
+# 5.2 EXPERIMENTS ON FEW-SHOT CLASSIFICATION
+
+To explore whether our proposed method can improve the metric-based few-shot classification, we consider two commonly-used algorithms as the baselines, including ProtoNet (Snell et al., 2017)
+
+Table 1: Test performance of different methods, where left table denotes the likelihood for MoG with varying $C$ (number of components),oracle is the likelihood of true parameters for the test data,and right denotes the test accuracy for point cloud classification task with varying $N$ (number of points).
+
+| Task | Test likelihood for MoG | Test accuracy for the point cloud classification |
| Algorithm | C=4 | C=5 | C=6 | C=7 | C=8 | N=64 | N=128 | N=256 | N=512 | N=1024 |
| Oracle | -1.473 | -1.660 | -1.820 | -1.946 | -2.058 | - | - | - | - | - |
| DeepSets | -1.809 ±0.015 | -1.812 ±0.016 | -1.897 ±0.017 | -2.115 ±0.016 | -2.261 ±0.014 | 79.14 ±0.035 | 82.51 ±0.028 | 84.62 ±0.037 | 85.74 ±0.045 | 86.83 ±0.042 |
| DeepSets(+POT) | -1.723 ±0.015 | -1.743 ±0.017 | -1.861 ±0.012 | -2.078 ±0.018 | -2.214 ±0.015 | 79.91 ±0.050 | 83.65 ±0.060 | 85.22 ±0.055 | 86.25 ±0.067 | 86.93 ±0.075 |
| Set Transformer | -1.501 ±0.006 | -1.721 ±0.006 | -1.859 ±0.007 | -2.003 ±0.007 | -2.106 ±0.007 | 79.01 ±0.103 | 82.31 ±0.117 | 84.46 ±0.125 | 85.82 ±0.114 | 86.34 ±0.122 |
| Set Transformer(+POT) | -1.486 ±0.007 | -1.676 ±0.007 | -1.828 ±0.006 | -1.967 ±0.007 | -2.084 ±0.007 | 80.00 ±0.111 | 83.32 ±0.130 | 85.64 ±0.121 | 86.51 ±0.124 | 86.84 ±0.115 |
+
+and MatchNet (Vinyals et al., 2016). Denoting the feature extractor in each algorithm as $f_{\phi_1}$ , we consider several popular backbones, including ResNet10 and ResNet34 (He et al., 2016). Recalling the discussions in Section 3.2, to enforce $f_{\phi_1}$ to learn more powerful image features, we additionally introduce matrix B and net $g_{\phi_2}$ and learn the model by minimizing the POT loss and classification errors. We perform the experiments on the CUB (Welinder et al., 2010) and miniImageNet (Ravi & Larochelle, 2016). As a fine-grained few-shot classification benchmark, CUB contains 200 different classes of birds with a total of 11, 788 images of size $84 \times 84 \times 3$ , where we split the dataset into 100 base classes, 50 validation classes, and 50 novel classes following Chen et al. (2019). miniImageNet is derived from ILSVRC-12 dataset (Russakovsky et al., 2015), consisting of $84 \times 84 \times 3$ images from 100 classes with 600 random samples in each class. We follow the splits used in previous work (Ravi & Larochelle, 2016), which splits the dataset into 64 base classes, 16 validation classes, and 20 novel classes. Table 2 reports the 5way5shot and 5way10shot classification results of different methods on miniImageNet and CUB. We see that introducing the POT loss and summary network can consistently improve over baseline classifiers, and the performance gain gradually increases with the development of number of network layers. This suggests that our proposed plug-and-play framework can be flexibly used to enhance the metric-based few-shot classification, without the requirement of designing complicated models on purpose.
+
+Table 2: 5way5shot and 5way10shot classification accuracy (%) on CUB and miniImageNet, respectively, based on 1000 random trials. Here, $(\cdot)$ is the $p$ -value computed with two-sample $t$ -test, and $p$ -value with blue (red) color means the increase (reduce) of performance when introducing POT loss.
+
+| Datasets | CUB | miniImageNet |
| ProtoNet(resnet10) | 84.32 ± 0.51 | 87.41 ± 0.49 | 72.74±0.63 | 78.14 ± 0.56 |
| ProtoNet(+OT) (resnet10) | 84.44 ±0.51 (1e-7) | 87.69 ±0.53 (1e-33) | 72.94 ±0.66 (1e-12) | 78.76 ± 0.49 (1e-146) |
| ProtoNet(resnet34) | 87.33 ± 0.48 | 91.75 ± 0.47 | 73.99 ± 0.64 | 78.64 ± 0.56 |
| ProtoNet(+OT) (resnet34) | 88.34 ± 0.46 (0.0) | 92.17 ± 0.48 (1e-79) | 75.15± 0.63(1e-265) | 79.05 ± 0.52 (1e-60) |
| MatchNet (resnet10) | 82.98± 0.56 | 85.97± 0.53 | 68.82 ± 0.65 | 72.06 ± 0.54 |
| MatchNet(+OT) (resnet10) | 83.64 ± 0.58 (1e-127) | 86.02± 0.56 (0.04) | 68.95 ± 0.62(1e-6) | 71.94 ± 0.56 (1e-6) |
| MatchNet (resnet34) | 84.66± 0.55 | 86.32 ± 0.56 | 68.32 ± 0.66 | 72.41 ± 0.63 |
| MatchNet(+OT) (resnet34) | 85.50 ± 0.66 (1e-172) | 86.75 ± 0.61 (1e-57) | 68.51 ± 0.64 (1e-11) | 71.98 ± 0.59 (1e-53) |
+
+# 5.3 EXPERIMENTS ON FEW-SHOT GENERATION
+
+Here, we consider few-shot generation task to investigate the effectiveness of our proposed implicit meta generative framework, where we consider CGAN (Mirza & Osindero, 2014) and DAGAN (Antoniou et al., 2017) as baselines for their ability to generate conditional samples. For CGAN-based models, we adopt summary network as the encoder to extract the feature vector $h_j$ from a given set $D_j$ , which is further fed into the generator and discriminator as the conditional information. Since the original DAGAN only assimilates one image into the generator, in our framework, we replace the encoder in DAGAN with summary network to learn the set representation. For DAGAN-based models, we adopt the same way with the original DAGAN to construct the real/samples for the critic and explain here for clarity: we sample two sets $(D_{1j}, D_{2j})$ from the same distribution or category; then we represent the real samples as the combination of $D_{1j}$ and $D_{2j}$ and the fake ones as the combination of $D_{1j}$ and $\hat{D}_{1j}$ from the generator (conditioned on $D_{1j}$ ). Different from our framework that separately optimizes the summary network using the OT loss, all other models for comparison in this paper jointly optimize the encoder (e.g., summary network) with the generator by the generator loss. Besides, for a fair comparison, we also consider introducing the additional reconstruction loss (mean square error, MSE) to optimize the generator and encoder in baselines. We
+
+consider the DeepSets as the summary network for its simple architecture. For 3D natural images, we adopt the pretrained densenet (Iandola et al., 2014) to extract features from each data pints, and take the features as the input to summary network. To evaluate the quality of generated samples, we adopt commonly used metric Fréchet Inception Distance (FID) (Heusel et al., 2017), where we only report the FID score (Heusel et al., 2017) considering the notable performance gap between our model and the compared ones. We provide several examples on toy datasets to show the efficiency of our proposed model in Appendix E.
+
+Table 3: FID $\downarrow$ of images generated by different methods with varying unseen angles $A$ on MNIST.
+
+| Algorithms | A=-160 | A=-120 | A=-80 | A=-40 | A=0 | A=40 | A=80 | A=120 | A=160 |
| CGAN | 227.94 ± 2.56 | 203.59 ±2.21 | 211.74 ±1.88 | 231.63 ±2.11 | 228.35 ±1.94 | 222.87 ±2.02 | 195.30 ±1.58 | 202.69 ±1.75 | 202.35 ±1.16 |
| CGAN+MSE | 225.56 ± 2.05 | 201.09 ±1.62 | 209.11 ±0.91 | 222.54 ±2.13 | 223.61 ±1.55 | 220.18 ±1.47 | 193.75 ±1.39 | 200.12 ±1.08 | 201.13 ±2.33 |
| CGAN+POT | 213.30 ± 1.35 | 193.42 ±1.25 | 196.56 ±1.61 | 217.28 ±1.58 | 210.27 ±2.04 | 206.44 ±1.78 | 181.05 ±0.99 | 190.19 ±1.22 | 191.22 ±1.37 |
| DAGAN | 169.85 ± 1.56 | 201.58 ±1.98 | 157.95 ±1.45 | 204.23 ±2.31 | 218.42 ±1.96 | 196.70 ±1.75 | 160.35 ±1.57 | 198.24 ±2.14 | 164.64 ±1.85 |
| DAGAN+MSE | 169.77 ±1.51 | 200.12 ±2.10 | 155.87 ±1.41 | 202.16 ±1.89 | 215.12 ±1.97 | 194.61 ±2.10 | 159.08 ±1.74 | 197.48 ±2.05 | 163.23 ±1.84 |
| DAGAN+ POT | 159.51 ± 1.57 | 174.07 ±1.63 | 135.89 ±1.17 | 177.64 ±1.88 | 197.09 ±1.46 | 186.17 ±1.90 | 142.40 ±1.33 | 174.75 ±1.59 | 146.69 ±1.47 |
+
+Rotated MNIST: Following Wu et al. (2020), we artificially transform each image in MNIST dataset (LeCun, 1998) with 18 rotations $(-180$ to 180 by 20 degrees), leading to 18 distributions characterized by angle $A$ . We choose 9 interleaved distributions for training and the rest as unseen distributions for testing. We consider the CGAN-based and DAGAN-based models, respectively. During the test stage, for each unseen distribution, we randomly sample 1000 real images and generate 20 fake images based on every 20 real images and repeat this process 50 times (i.e., $1000 / 20$ ), resulting in 1000 generated samples for each method. We summarize the test performance in Table 3 with varying $A$ . We can find that our proposed framework allows for better generalization to related but unseen distributions at test time, indicating the POT loss can enforce the summary network to capture more salient characteristics.
+
+Natural Images: We further consider few-shot image generation on Flowers (Nilsback & Zisserman, 2008) and Animal Faces (Deng et al., 2009), where we follow seen/unseen split provided in Liu et al. (2019). Flowers dataset contains 8189 images of 102 categories, which are divided into 85 training seen and 17 testing unseen categories; Animal Faces dataset contains 117, 574 animal faces collected from 149 carnivorous animal categories, which are split into 119 training seen and 30 testing unseen categories. We present the example images generated by DAGAN and DAGAN(+POT) and network architectures in Appendix F for the limited space, where we also compute the FID scores with the similar way in Rotated MNIST experiment. We find that our method achieves the lowest FID and has the ability to generate more realistic natural images compared with baselines. This indicates the summary network in our proposed framework can successfully capture the important summary statistics within the set, beneficial for the few-shot image generation.
+
+# 6 CONCLUSION
+
+In this paper, we present a novel method to improve existing summary networks designed for set-structured input based on optimal transport, where a set is endowed with two distributions: one is the empirical distribution over the data points, and another is the distribution over the learnable global prototypes. Moreover, we use the summary network to encode input set as the prototype proportion (i.e., set representation) for global centers in corresponding set. To learn the distribution over global prototypes and summary network, we minimize the prototype-oriented OT loss between two distributions in terms of the defined cost function. Only additionally introducing the acceptable parameters, our proposed model provides a natural and unsupervised way to improve the summary network. In addition to the set-input problems, our plug-and-play framework has shown appealing properties that can be applied to many meta-learning tasks, where we consider the cases of metric-based few-shot classification and implicit meta generative modeling. Extensive experiments have been conducted, showing that our proposed framework achieves state-of-the-art performance on both improving existing summary networks and meta-learning models for set-input problems. Due to the flexibility and simplicity of our proposed framework, there are still some exciting extensions. For example, an interesting future work would be to apply our method into approximate Bayesian computation for posterior inference.
+
+# REFERENCES
+
+Michal Aharon, Michael Elad, and Alfred Bruckstein. K-SVD: An algorithm for designing overcomplete dictionaries for sparse representation. IEEE Transactions on signal processing, 54(11): 4311-4322, 2006.
+Kelsey Allen, Evan Shelhamer, Hanul Shin, and Joshua Tenenbaum. Infinite mixture prototypes for few-shot learning. In International Conference on Machine Learning, pp. 232-241. PMLR, 2019.
+Jason M. Altschuler and Enric Boix-Adserà. Wasserstein barycenters can be computed in polynomial time in fixed dimension. J. Mach. Learn. Res., 22:44:1-44:19, 2021.
+Antreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. arXiv preprint arXiv:1711.04340, 2017.
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International conference on machine learning, pp. 214-223. PMLR, 2017.
+David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet allocation. Journal of machine learning research, 3(Jan):993-1022, 2003.
+Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
+Yanzhi Chen, Dinghuai Zhang, Michael U. Gutmann, Aaron C. Courville, and Zhanxing Zhu. Neural approximate sufficient statistics for implicit models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
+Anoop Cherian and Shuchin Aeron. Representation learning via adversarially-contrastive optimal transport. In International Conference on Machine Learning, volume 119, pp. 1820–1830, 2020.
+Louis Clouatre and Marc Demers. Figr: Few-shot image generation with reptile. arXiv preprint arXiv:1901.02199, 2019.
+Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26:2292-2300, 2013.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2009), 20-25 June 2009, Miami, Florida, USA, pp. 248-255. IEEE Computer Society, 2009.
+Harrison Edwards and Amos J. Storkey. Towards a neural statistician. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings, 2017.
+SM Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, Geoffrey E Hinton, et al. Attend, infer, repeat: Fast scene understanding with generative models. Advances in Neural Information Processing Systems, 29:3225-3233, 2016.
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126–1135. PMLR, 2017.
+Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. volume 27, 2014.
+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.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
+
+Yan Hong, Li Niu, Jianfu Zhang, Jing Liang, and Liqing Zhang. Deltagan: Towards diverse few-shot image generation with sample-specific delta. arXiv preprint arXiv:2009.08753, 2020a.
+Yan Hong, Li Niu, Jianfu Zhang, and Liqing Zhang. Matchinggan: Matching-based few-shot image generation. In 2020 IEEE International Conference on Multimedia and Expo (ICME), pp. 1-6. IEEE, 2020b.
+Yan Hong, Li Niu, Jianfu Zhang, Weijie Zhao, Chen Fu, and Liqing Zhang. F2gan: Fusing-andfilling gan for few-shot image generation. In Proceedings of the 28th ACM International Conference on Multimedia, pp. 2535-2543, 2020c.
+Gao Huang, Shichen Liu, Laurens Van der Maaten, and Kilian Q Weinberger. Condensenet: An efficient densenet using learned group convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2752-2761, 2018.
+Forrest Iandola, Matt Moskewicz, Sergey Karayev, Ross Girshick, Trevor Darrell, and Kurt Keutzer. Densenet: Implementing efficient convnet descriptor pyramids. arXiv preprint arXiv:1404.1869, 2014.
+Mateusz Jurewicz and Leon Strömberg-Derczynski. Set-to-sequence methods in machine learning: a review. arXiv preprint arXiv:2103.09656, 2021.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, 2015.
+Soheil Kolouri, Navig Naderializadeh, Gustavo K. Rohde, and Heiko Hoffmann. Wasserstein embedding for graph learning. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021.
+Yann LeCun. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998.
+Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning, pp. 3744-3753. PMLR, 2019.
+Weixin Liang, Zixuan Liu, and Can Liu. Dawson: A domain adaptive few shot generation framework. arXiv preprint arXiv:2001.00576, 2020.
+Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. Few-shot unsupervised image-to-image translation. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 10550-10559. IEEE, 2019.
+Gäelle Loosli, Stéphane Canu, and Léon Bottou. Training invariant support vector machines using selective sampling. Large scale kernel machines, 2, 2007.
+Haggai Maron, Or Litany, Gal Chechik, and Ethan Fetaya. On learning sets of symmetric elements. In International Conference on Machine Learning, pp. 6734-6744. PMLR, 2020.
+Grégoire Mialon, Dexiong Chen, Alexandre d'Aspremont, and Julien Mairal. A trainable optimal transport embedding for feature aggregation and its relationship to attention. In *ICLR 2021-The Ninth International Conference on Learning Representations*, 2021.
+Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014.
+Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
+Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Sixth Indian Conference on Computer Vision, Graphics & Image Processing, ICVGIP 2008, Bhubaneswar, India, 16-19 December 2008, pp. 722-729. IEEE Computer Society, 2008.
+
+Gabriel Peyre and Marco Cuturi. Computational optimal transport. Found. Trends Mach. Learn., 11 (5-6):355-607, 2019.
+Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652-660, 2017.
+Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. 2016.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. Int. J. Comput. Vis., 115(3):211-252, 2015.
+Bernhard Schölkopf, Alexander J Smola, Francis Bach, et al. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2002.
+Konstantinos Skianis, Giannis Nikolentzos, Stratis Limnios, and Michalis Vazirgiannis. Rep the set: Neural networks for learning set representations. In International conference on artificial intelligence and statistics, pp. 1410-1420. PMLR, 2020.
+Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, pp. 4077-4087, 2017.
+Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104-3112, 2014.
+Korawat Tanwisuth, Xinjie Fan, Huangjie Zheng, Shujian Zhang, Hao Zhang, Bo Chen, and Mingyuan Zhou. A prototype-oriented framework for unsupervised domain adaptation. Advances in Neural Information Processing Systems, 34, 2021.
+Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3630-3638, 2016.
+Dongsheng Wang, Dandan Guo, He Zhao, Huangjie Zheng, Korawat Tanwisuth, Bo Chen, and Mingyuan Zhou. Representing mixtures of word embeddings with mixtures of topic embeddings. arXiv preprint arXiv:2203.01570, 2022.
+Peter Welinder, Steve Branson, Takeshi Mita, Catherine Wah, Florian Schroff, Serge Belongie, and Pietro Perona. Caltech-ucsd birds 200. 2010.
+Mike Wu, Kristy Choi, Noah Goodman, and Stefano Ermon. Meta-amortized variational inference and learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 6404-6412, 2020.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabás Póczos, Ruslan Salakhutdinov, and Alexander J. Smola. Deep sets. In NeurIPS, pp. 3391-3401, 2017.
+Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. NeurIPS, 2:8, 2018.
+Huangjie Zheng and Mingyuan Zhou. Exploiting chain rule and Bayes' theorem to compare probability distributions. Advances in Neural Information Processing Systems, 34, 2021.
+Mingyuan Zhou, Haojun Chen, Lu Ren, Guillermo Sapiro, Lawrence Carin, and John Paisley. Nonparametric Bayesian dictionary learning for sparse image representations. Advances in neural information processing systems, 22, 2009.
+Mingyuan Zhou, Yulai Cong, and Bo Chen. Augmentable gamma belief networks. The Journal of Machine Learning Research, 17(1):5656-5699, 2016.
+
+
+Figure 3: The overview of our proposed implicit meta generative framework, where we sample the $j$ -th distribution from training sets, feed the data points into the summary network, generate the fake samples with the random noise and summary output as the input, discriminate the real/fake samples.
+
+Algorithm 2 The workflow of our proposed implicit meta generative framework.
+Require: Datasets $\mathcal{D}_{1:J}$ , initial discriminator parameters $w$ , initial generator parameters $\theta$ , initial summary network parameters $\phi$ , initial matrix $\mathbf{B}$ , the cost function $C$ , the number of critic iterations per generator iteration $\eta_{\text{critic}}$ , the batch size $m$ , learning rate $\alpha$ and the hyper-parameter $\epsilon$ .
+```latex
+while $w,\theta ,\mathbf{B},\phi$ has not converged do
+Randomly choose $j$ from 1,2,..,J
+for $t = 1,\dots ,\eta_{\text{critic}}$ do Sample the real data set $D_{j} = \{\pmb{x}_{ji}\}_{i = 1}^{m}$ from $j$ -th empirical distribution $P_{j}$ Embed the observed batch data into the statistics $\pmb {h}_j = \mathrm{Softmax}(S_\phi (D_j))$ Sample a batch of prior samples $\{z_i\}_{i = 1}^m$ from $p(z)$ $g_{w}\gets -\nabla_{w}\frac{1}{m}\sum_{i = 1}^{m}[\log f_{w}(x_{j}^{i}) + \log (1 - f_{w}(T_{\theta}(z_{i},\pmb{h}_{j})))];$ $w\gets w + \alpha g_w$
+end for;
+Represent the $Q_{j}$ with global prototype matrix $\mathbf{B}$ and set representation/statistics $\pmb{h_j}$
+Compute the loss $\mathrm{OT}_{\epsilon}(P_j,Q_j)$ between $P_{j}$ and $Q_{j}$ with Sinkhorn algorithm in Equation 6
+ $g_{\mathbf{B}}\leftarrow \nabla_{\mathbf{B}}\left[\mathrm{OT}_{\epsilon}(P_j,Q_j)\right]$ .
+ $\mathbf{B}\gets \mathbf{B} + \alpha g_{\mathbf{B}}$ ..
+ $g_{\phi}\gets \nabla_{\phi}[\mathrm{OT}_{\epsilon}(P_j,Q_j)]$ ..
+ $\phi \gets \phi +\alpha g_{\phi}$ see Algorithm 1 for more details;
+Sample a batch of latent variables $\left\{z^{(i)}\right\}_{i = 1}^{m}\sim p(z)$ $g_{\theta}\gets \nabla_{\theta}\left[\frac{1}{m}\sum_{i = 1}^{m}\log \left(1 - f_w(T_\theta (z_i,h_j))\right)\right];$ $\theta \gets \theta +\alpha g_{\theta}$
+```
+
+# A ALGORITHMS AND ILLUSTRATION OF OUR PROPOSED MODEL
+
+The pseudo code for the implicit meta generative modeling is provided in Algorithm 2.
+
+# B THE DIFFERENCE BETWEEN OUR MODEL AND BARYCENTER PROBLEM
+
+In this section, we clarify the difference between Wasserstein barycenter and our method. Specifically, for $j$ -th distribution, we denoted $P_{j}$ as its empirical distribution consisting of $N_{j}$ samples, expressed as $P_{j} = \sum_{i=1}^{N_{j}} \frac{1}{N_{j}} \delta_{x_{ji}}$ , $x_{ji} \in \mathbb{R}^{d}$ . Notably, $\pmb{a}_{j} = \left[\frac{1}{N_{j}}\right] \in \Sigma^{N_{j}}$ represents the probability measure for distribution $P_{j}$ .
+
+For another thing, we can represent $P_{j}$ with another to-be-learned distribution $Q_{j}$ , defined as $Q_{j} = \sum_{k=1}^{K} h_{jk} \delta_{\beta_{k}}, \beta_{k} \in \mathbb{R}^{d}$ . Here $\boldsymbol{b}_{j} = [h_{jk}] \in \Sigma^{K}$ is the probability measure for distribution $Q_{j}$ , which can be computed using summary network $S_{\phi}(\boldsymbol{x}_{i,1:N_{j}})$ and serves as the representation for set $j$ . And $\beta_{k}$ is the $k$ -th prototype in the same space of the observed data points, which is the $k$ -th column of $\mathbf{B} \in \mathbb{R}^{K \times d}$ , a learnable global prototype matrix. To optimize the $\beta_{1:K}$ and the summary network $S_{\phi}$ for computing $h_{j}$ , we minimize the average OT loss (between $Q_{j}$ and $P_{j}$ ) for all training sets. We rewrite the Equation (6) here for convenience:
+
+$$
+L _ {\mathrm {O T}} = \min _ {\mathbf {B}, \phi} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {J}} \left(\sum_ {i} ^ {N _ {j}} \sum_ {k} ^ {K} C _ {i k} T _ {i k} - \epsilon \sum_ {i} ^ {N _ {j}} \sum_ {k} ^ {K} - T _ {i k} \ln T _ {i k}\right) = \min _ {\mathbf {B}, \phi} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {J}} \left(\mathrm {O T} _ {\epsilon} \left(P _ {j}, Q _ {j}\right)\right).
+$$
+
+Usually, this equation can also be represented:
+
+$$
+\min _ {\mathbf {B}, \phi} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {I}} \left(\mathrm {O T} _ {\epsilon} \left(\boldsymbol {a} _ {j}, \boldsymbol {b} _ {j}\right)\right). \tag {10}
+$$
+
+In terms of Wasserstein barycenter, we adopt the same notations for consistency. Following (Altschuler & Boix-Adserà, 2021), given $J$ empirical distributions $P_{1:j}$ and their respective probability measures $[a_1,\dots ,a_J]$ supported on $\mathbb{R}^d$ and a vector $\lambda \in \Sigma^{J}$ , their corresponding Wasserstein barycenter can be viewed as another distribution $Q$ , i.e., $Q = \sum_{k=1}^{K} m_k \delta_{\beta_k}, \beta_k \in \mathbb{R}^d$ , where $\beta_k$ is the $k$ -th column of $\mathbf{B}$ , $m = [m_k] \in \Sigma^K$ is the probability measure for distribution $Q$ . Then we can learn the barycenter (i.e., $\mathbf{B}$ and $m$ ) by minimizing
+
+$$
+\min _ {\mathbf {B}, \boldsymbol {m}} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {I}} \lambda_ {j} \mathcal {W} (P _ {j}, Q) = \min _ {\mathbf {B}, \boldsymbol {m}} \frac {1}{\mathcal {J}} \sum_ {j = 1} ^ {\mathcal {I}} \lambda_ {j} \mathcal {W} (\boldsymbol {a} _ {j}, \boldsymbol {m}) \tag {11}
+$$
+
+where above $\mathcal{W}(\cdot, \cdot)$ denotes the squared 2-Wasserstein distance. By comparing the equation 11 and equation 10, we can find that our model learns a $Q_{j}$ to approximate $P_{j}$ for each distribution $j$ but "barycenter" problem learns a shared $Q$ as the barycenter for all $P_{1:j}$ . Therefore, after minimizing the average loss for all training sets with Equation (6), we can use the probability measure $\pmb{b}_{j} = [h_{jk}]$ (i.e., $\pmb{h}_{j}$ ) to represent the empirical distribution $P_{j}$ . Especially, we can directly map the test set to its representation by using the summary network. However, since the probability measure $\pmb{m}$ in "barycenter" is shared by all distributions, it can not represent a specific set. Therefore, to achieve the set representation, it might need to first compute the transport plan between test set and the barycenter $Q$ and then aggregate the data points (or features) within the test set by taking the transport plan as the weight. Therefore, our model produces a more intuitive solution to learn the set representation, which can take full advantage of the existing summary networks and provides a promising tool for addressing set-input and meta-learning problems.
+
+# C EXPERIMENTAL SETTINGS ABOUT INTRODUCING POT LOSS INTO THE SUMMARY NETWORKS
+
+# C.1 DETAILS FOR AMORTIZED CLUSTERING WITH MIXTURES OF GAUSSIANS
+
+We generate the 2D toy datasets following the Lee et al. (2019), where we additionally vary the $C$ (the number of components) from 4 to 8. Below, we present the detailed generation process about the toy datasets:
+
+1. Specify the number of components $C$ for 2D toy dataset.
+2. Generate the number of data points, $n \sim \mathrm{Uniform}(100, 500)$ .
+3. Sample the mean vector for $C$ components.
+
+$$
+\mu_ {c, d} \sim \mathrm {U n i f o r m} (- 4, 4), \quad c = 1, \ldots , C, \quad d = 1, 2
+$$
+
+4. Sample the cluster labels.
+
+$$
+\pi \sim \operatorname {D i r} \left(\mathbf {1} ^ {\top}\right), \quad z _ {i} \sim \operatorname {C a t e g o r i c a l} (\pi), i = 1, \dots , n, z _ {i} = 1, \dots , C
+$$
+
+5. Generate data from spherical Gaussian.
+
+$$
+x _ {i} \sim \mathcal {N} \left(\mu_ {z _ {i}}, (0. 3) ^ {2} I\right), i = 1, \dots , n
+$$
+
+# C.2 DETAILS ABOUT SET-TRANSFORMER-BASED AND DEEPSETS-BASED ARCHITECTURES USED IN MOGS EXPERIMENTS
+
+DeepSets In terms of the DeepSets, the $f_{\phi_1}$ in summary network contains 3 permutation-equivariant layers with 256 channels followed by mean-pooling over the set structure. Then the resulting vector representation $z_j$ of the set is then fed to a fully connected layer with 512 units followed by a linear layer $512 \times C(1 + 2 * 2)$ , where $C$ denotes the number of components. We use ELU activation at all layers. To introduce the POT loss into the DeepSets, we further feed the $z_j$ into a fully connected layer with 512 units followed by a 50-way softmax unit and also introduce the global matrix $\mathbf{B} \in \mathbb{R}^{2 \times 50}$ .
+
+Set Transformer To perform the MoGs experiments, we adopt the same architecture for Set Transformer following Lee et al. (2019), whose parameters are reported in Table 4. To introduce the POT loss, we also add the two fully connected layers with 256 units on the resulting vector $\mathbf{z}_j$ followed by a 50-way softmax unit, and a global prototype matrix $\mathbf{B} \in \mathbb{R}^{2 \times 50}$ .
+
+# C.3 DETAILS ABOUT SET-TRANSFORMER-BASED AND DEEPSETS-BASED ARCHITECTURES USED IN SUM OF DIGITS
+
+DeepSets Following the official code in Zaheer et al. (2017), we adopt the default architecture to implement the DeepSets, where we first project the image into a 128-dimensional vector with three convolutional layers and apply summary network on the 128-dimensional vectors. To build DeepSets(+POT), we take the set representation $\mathbf{z}_j$ after sum-pooling in summary network as the input and introduce fully connected layer with 128 units followed by a 10-way softmax unit, and a global prototype matrix $\mathbf{B} \in \mathbb{R}^{128 \times 10}$ .
+
+Set Transformer For Set Transformer, we follow the similar structure used in MoGs experiments, where we also project the image with three convolutional layers and output a scalar. To build Set Transformer(+POT), we take the representation $\mathbf{z}_j$ after sum-pooling in summary network as the input and introduce fully connected layer with 128 units followed by a 10-way softmax unit, and a center matrix $\mathbf{B} \in \mathbb{R}^{128 \times 10}$ .
+
+# C.4 DETAILS ABOUT SET-TRANSFORMER-BASED AND DEEPSETS-BASED ARCHITECTURES USED IN POINT CLOUD CLASSIFICATION
+
+DeepSets For original DeepSets, we adopt the same architecture with Zaheer et al. (2017). In a specific, the $f_{\phi_1}$ in summary network contains 3 permutation-equivariant layers with 256 channels followed by max-pooling over the set structure. Then the resulting vector representation $z_j$ of the set is then fed to a fully connected layer with 256 units followed by a 40-way softmax unit. We use Tanh activation at all layers and dropout on the layers after set-max-pooling (i.e., two dropout operations) with $50\%$ dropout rate. To introduce the POT loss into the DeepSets, we further feed the $z_j$ into a fully connected layer with 256 units followed by a 40-way softmax unit, with $70\%$ dropout rate. Besides, we additionally introduce the center matrix $\mathbf{B} \in \mathbb{R}^{3 \times 40}$ .
+
+Set Transformer We also adopt the same architecture to implement the Set Transformer, where we summarize the parameters in Table 5, following Lee et al. (2019). To improve the Set Transformer with POT loss, we also introduce a fully connected layer with 256 units followed by a 40-way softmax unit, with $90\%$ dropout rate, and a center matrix $\mathbf{B} \in \mathbb{R}^{3 \times 40}$ .
+
+# C.5 PARAMETER SENSITIVITY
+
+In the previous experiments, we fix the value of $\epsilon$ as 0.1, controlling the weight of the entropic regularisation in the Sinkhorn algorithm. Notably, unless specified otherwise, we specify the construction of $\mathbf{C}$ as $C_{ik} = 1 - \cos (\pmb{x}_{ji},\pmb{\beta}_k)$ . Therefore, the cost function provides an upper-bounded
+
+Table 4: Detailed architectures of Set Transformer used in the MoGs experiments, cited from Lee et al. (2019), where $C$ denotes the number of components.
+
+| Encoder | Decoder |
| rFF | SAB | ISAB | Pooling | PMA |
| FC(128,ReLU) | SAB(128,4) | ISABm(128,4) | mean | PMA4(128,4) |
| FC(128,ReLU) | SAB(128,4) | ISABm(128,4) | FC(128,ReLU) | SAB(128,4) |
| FC(128,ReLU) | - | - | FC(128,ReLU) | FC(C·(1+2·2),) |
| FC(128,ReLU) | - | - | FC(128,ReLU) | FC(C·(1+2·2),) |
| - | - | - | FC(C·(1+2·2),) | - |
+
+Table 5: Detailed architectures of Set Transformer used in the point cloud classification experiments, cited from Lee et al. (2019).
+
+| Encoder | Decoder |
| rFF | ISAB | Pooling | PMA |
| FC(256,ReLU) | ISAB(256,4) | max | Dropout(0.5) |
| FC(256,ReLU) | ISAB(256,4) | Dropout(0.5) | PMA1(256,4) |
| FC(256,ReLU) | - | FC(256,ReLU) | Dropout(0.5) |
| FC(256,) | - | Dropout(0.5) | FC(40,) |
| - | - | FC(40,) | - |
+
+
+Figure 4: Parameter sensitivity of DeepSets(+POT) on point cloud classification task, with varying $\epsilon$ , where each object is represented as a set of $N = 20$ vectors.
+
+positive similarity metric, making the $\epsilon$ has the corresponding reasonable range as a prior knowledge. Here, we study our DeepSets(+POT)'s sensitivity to $\epsilon$ . We consider the point cloud classification task and each object is represented as a set of $N = 20$ vectors. As shown in Fig. 4, we report the performance of DeepSets(+POT) on point cloud classification task with varying $\epsilon$ , where DeepSets serves as the baseline. It can be seen that our model is robust to the $\epsilon$ . Besides, all the results of DeepSets(+POT) with different $\epsilon$ are superior than that of DeepSets, indicating the effectiveness of our method. By fine-tuning $\epsilon$ for each dataset in each task, we might obtain better results than those reported in our experiments. However, we aim to validate our method instead of exhaustively tuning this hyper-parameter and thus we set $\epsilon = 0.1$ , which can achieve the acceptable result.
+
+# C.6 CONVERGENCE RATE OF SINKHORN ALGORITHM
+
+In this paper, we set the maximum iteration number as $\text{Itermax} = 200$ in Sinkhorn algorithm for all experiments. As shown in Fig. 5, we visualize the convergence rate of Sinkhorn algorithm, where we consider the task about "sum of digits" (DeepSets+POT). The upper figure shows the convergence rate of Sinkhorn algorithm. The bottom figure visualizes the transport plan matrix with varying iterations. We find that the 200 iterations are typically enough for Sinkhorn algorithm and we can learn a sparse transport plan matrix $\mathbf{T}$ when the algorithm converge. Notably, the transport plan matrix needs to satisfy two marginal constraints, defined by the probability measures of two distributions, respectively. Recall that the empirical distribution has an unchanged uniform probability measure, so the learned transport plan matrix is dense for the $N_{j}$ observed samples. In terms of another distribution, its probability measure is the set-specific representation, weighting the
+
+
+Figure 5: Top: the convergence rate of Sinkhorn for $c(x,y) = 1 - \cosine(x,y)$ , and $\epsilon = 0.1$ , as measured in term of marginal constraint violation $\frac{1}{J}\sum_{j}^{J}\sum_{i}^{N_{j}}|u_{ij}^{l + 1} - u_{ij}^{l}|$ , where $l$ is the iteration index and $\mathbf{u}$ is the scaling variable; please see page 67 in Peyre & Cuturi (2019) for more details. Bottom: evolution of the transport plan matrix $\mathbf{T} = \mathrm{diag}\left(\boldsymbol{u}^{(\ell)}\right)\mathbf{K}$ diagonal $\left(\boldsymbol{v}^{(\ell)}\right)$ computed at iteration of Sinkhorn's iterations.
+
+importance of K shared centers for corresponding set. Therefore, it is reasonable that transport plan matrix is sparse for K centers.
+
+# D EXPERIMENTAL SETTINGS ABOUT FEW-SHOT CLASSIFICATION
+
+Denote the prototype for set $j$ (computed by $f_{\phi_1}$ ) in few-shot classification as $c_j$ . We consider two backbones for $f_{\phi_1}$ , including ResNet10 and ResNet34, which produce the 512-dimensional $c_j$ . To improve the metric-based few-shot classification with our framework, taking the $c_j$ as input, we further construct the $g_{\phi_2}$ . Specifically, we introduce a fully connected network with architecture as $512 \rightarrow 256$ units with ReLU function followed by a $\mathbf{X}$ -way ( $\mathbf{X} = 64$ for CUB, and $\mathbf{X} = 128$ for miniImageNet) Softmax function and a center matrix $\mathbf{B} \in \mathbb{R}^{512 \times \mathbf{X}}$ . We conduct 10000 tasks of the training set $\mathcal{D}_{tr}$ to train the model while 1000 tasks of the test set $\mathcal{D}_{te}$ to evaluate the learned model. And $\mathcal{D}_{tr} \cap \mathcal{D}_{te} = \emptyset$ . We run 60 epochs to train the model on CUB and miniImageNet. The model is trained using Adam optimizer with default settings (learning rate $1e - 3$ , $\beta = (0.9, 0.999)$ , and $\epsilon = 1e - 8$ ) on one Nvidia Geforce RTX3090 GPU.
+
+# E ADDITIONAL EXPERIMENTAL RESULTS ON FEW-SHOT GENERATION ABOUT TOY DATASETS
+
+We test our algorithm through a series of synthetic data sets and realistic data sets. For synthetic datasets, we set $T_{\theta}$ , $f_{w}$ and $S_{\phi}$ as fully connected neural networks, where $T_{\theta}$ , $f_{w}$ have 4 hidden layers and $f_{\phi_1}$ and $g_{\phi_2}$ (we adopt DeepSets) have 3 hidden layers. Each layer has 200 nodes, and the activation function is chosen as RELU, where we adopt the softmax in the final layer.
+
+Normal distribution on 2D toy data: We first consider the 2D normal case, where the training data contains $10K$ sets and each set contains 100 data points from $N(\pmb{\mu}, \pmb{\Sigma})$ . We sample the mean, variance, and covariance from $U[-5,5]$ , $U[1,2]$ , and $U[-0.5,0.5]$ , respectively. Fig. 6 shows the real (gray points) and generated samples (red points) by different models given unseen test sets, where we only consider CGAN-based methods for the simple toy data. We find that our model (third column) can improve the resistance to mode collapse compared with CGAN+MSE (second column) and better fit the unseen test distributions than CGAN (first column). This result indicates the POT loss can spur the summary network to capture more desired statistics for unseen distributions.
+
+
+
+
+
+
+
+
+Figure 6: Examples of few-shot generation for two dimensional Gaussian distributions, where we visualize the real samples from the true distributions (gray points) and generated samples (red points) by different models (from first to third column: CGAN, CGAN+MSE and our proposed CGAN+POT), where we also plot the contour of each Gaussian distribution.
+
+
+
+
+
+One-dimensional Gaussian distributions: In this case, we generate another collection of synthetic $1 - D$ datasets based on Gaussian parametric family, where the means and variances are sampled from $\mathrm{U}[-1,1]$ and $\mathrm{U}[0.5,2]$ respectively. The training data contains $10K$ sets each containing 50 samples. We also visualize the pdfs of gaussian distributions with randomly means and variance in Fig 7, which are used to sample test data, and show the 500 data points generated by the pushforward. For this experiment, we set the dimension of $z$ and summary vector $s$ as 2.
+
+Multi-family distribution on 1D toy data: To validate if our proposed model can capture many types of distributional families simultaneously, we construct a collection of synthetic 1-D datasets each containing 100 samples from either an Exponential, Gaussian or Laplacian distribution with equal probability. For Gaussian and Laplacian distributions, means and variances are sampled from $U[-1,1]$ and $U[0.5,2]$ respectively; for Exponential distributions, rates are sampled from $U[0.5,2]$ . Fig. 8 visualizes the pdfs of six one-dimensional test distributions with different means and variances and the generated data points. It is interesting to observe that the generated data points can fit the corresponding pdf well, indicating our model can generalize to different distributions with varying parameters. Besides, our model performs slightly worse on the Exponential distributions, perhaps attributing to the fact that it is the only non-symmetric distribution.
+
+# F DETAILS ABOUT NATURAL IMAGE GENERATIONS AND THE RESULTS
+
+We use denseNet proposed by Huang et al. (2018) as the backbone of summary network, then a pooling operation is conducted as Zaheer et al. (2017) does. And a 2-layer fully connected network with ReLU activation function is finally employed to embed the 4096-D visual features into the corresponding 512-D set representations $h_j$ . As for conditional generator (conditioned on set representations as well as Gaussian noise), we introduce a 2-layer embedding network [100→600→100] with LeakyReLU activation function to embed the input noise $\mathbf{n}$ . Besides, we use a 5-layer deconvolution network [ConvTranspose2d(X + 100, 512, 4, 1, 0)→ConvTranspose2d(512, 256, 4, 2, 1)→ConvTranspose2d(512, 128, 4, 2, 1)→ConvTranspose2d(128, 64, 4, 2, 1)→ConvTranspose2d(64, 3, 4, 2, 1)], where $\mathbf{X} = 64$ , 128 for oxford and animal face datasets respectively with BatchNorm along channels and ReLU activation function to deconvolute the concatenated noise embeddings and set representations $cat([\mathbf{n}, h_j])$ as fake output images $x_{\text{fake}}: \mathbb{R}^{N \times 3 \times 64 \times 64}$ . Finally, a 5-layer discriminator network [Conv2d(2*3, 64, 4, 2, 1)→Conv2d(64, 128, 4, 2, 1))→Conv2d(128, 256, 4, 2, 1)→Conv2d(256, 512, 4, 2, 1)→Conv2d(512, 1, 4, 1, 0)] with BatchNorm as well as LeakyReLU activation function at the first fourth deconvolutional layers and the last layer without BatchNorm while with sigmoid activation funtion to distinguish the true or fake generated images. We present the generated results in Figure 9.
+
+
+
+
+
+
+
+
+Figure 7: Examples of few-shot generation for one dimensional Gaussian distributions, where we visualize the generated samples by our GAN+POT (conditioned on the test samples from the unseen distribution) and the PDF of the unseen true distribution.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Examples of few-shot generation for multi-distributions, where we visualize the generated samples (green) by our GAN+POT (conditioned on the test samples from the unseen distribution) and the PDF (red) of the unseen true distribution.
+
+
+
+
+
+
+
+
+(a) Real images Above: Animal Face Below: Oxford flower
+
+
+
+
+(b) Fake images generated by DAGAN
+Above: Animal Face
+Below: Oxford flower
+
+
+
+
+(c) Fake images generated by DAGAN+OT Above: Animal Face Below: Oxford flower
+Figure 9: Examples of few-shot generation for natural images, where the images are generated by DAGAN (second column) and DAGAN+POT (third column) conditioned on 3 different categories on Oxford(flower) and animal face datasets. The FID $\downarrow$ scores of DAGAN and DAGAN+POT on Oxford are 97.25 and 91.78, respectively. The FIDs of DAGAN and DAGAN+POT on animal face are 139.14 and 131.51.
\ No newline at end of file
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/images.zip b/learningprototypeorientedsetrepresentationsformetalearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d33d0db9cddd6b4cbfb778c578d331dfd7c21aa4
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:11c63a19962e1a03a6258c66c7470c30056a11755bd2660036717f2d59bf2721
+size 789514
diff --git a/learningprototypeorientedsetrepresentationsformetalearning/layout.json b/learningprototypeorientedsetrepresentationsformetalearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9677b98fe5b2a2581fb4c4f0039ceff26f5fb4e6
--- /dev/null
+++ b/learningprototypeorientedsetrepresentationsformetalearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2cf6eccf1cca858ef07db1c51a3526a7e366bb347c1843ca622c17c32348e094
+size 831001
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_content_list.json b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e04da8ce8f9e1886c307fd74d7b1d3311433bf40
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:73bcb4a19a41cc8358f3a053fa92e9f6c1731b1eb9a7d5020440e66bf1324ac1
+size 149999
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_model.json b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a4aecb87f67829cb6e7b140089fe5dfbb8e96d4e
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b7be85acf73e9d34e5eadb3e6e64fdba33760477457b7346b0475dda582c2197
+size 181116
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_origin.pdf b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7a6596a4142835a6716a2655a7386ff8f2cc01ca
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/e785366c-6412-4be0-91f2-f9bbf567ff53_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7dfd91046cd5afccee0e0417ac1086884af85f6947c01b71bda394254b4feb23
+size 1016852
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/full.md b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..615e17ce62ef48cf4512fe34ce6fe7506f321531
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/full.md
@@ -0,0 +1,536 @@
+# LEARNING REPRESENTATION FROM NEURAL FISHER KERNEL WITH LOW-RANK APPROXIMATION
+
+Ruixiang Zhang
+
+Mila, Université de Montréal
+
+ruixiang.zhang@umontreal.ca
+
+Shuangfei Zhai, Etai Littwin, Josh Susskind
+
+Apple Inc.
+
+{szhai, elittwin, jsusskind}@apple.com
+
+# ABSTRACT
+
+In this paper, we study the representation of neural networks from the view of kernels. We first define the Neural Fisher Kernel (NFK), which is the Fisher Kernel (Jaakkola and Haussler, 1998) applied to neural networks. We show that NFK can be computed for both supervised and unsupervised learning models, which can serve as a unified tool for representation extraction. Furthermore, we show that practical NFKs exhibit low-rank structures. We then propose an efficient algorithm that computes a low rank approximation of NFK, which scales to large datasets and networks. We show that the low-rank approximation of NFKs derived from unsupervised generative models and supervised learning models gives rise to high-quality compact representations of data, achieving competitive results on a variety of machine learning tasks.
+
+# 1 INTRODUCTION
+
+Modern deep learning systems rely on finding good representations of data. For supervised learning models with feed forward neural networks, representations can naturally be equated with the activations of each layer. Empirically, the community has developed a set of effective heuristics for representation extraction given a trained network. For example, ResNets (He et al., 2016) trained on Imagenet classification yield intermediate layer representations that can benefit downstream tasks such as object detection and semantic segmentation. The logits layer of a trained neural network also captures rich correlations across classes which can be distilled to a weaker model (Knowledge Distillation) (Hinton et al., 2015).
+
+Despite empirical prevalence of using intermediate layer activations as data representation, it is far from being the optimal approach to representation extraction. For supervised learning models, it remains a manual procedure that relies on trial and error to select the optimal layer from a pre-trained model to facilitate transfer learning. Similar observations also apply to unsupervised learning models including GANs (Goodfellow et al., 2014), VAEs (Kingma and Welling, 2014), as evident from recent studies (Chen et al., 2020a) that the quality of representation in generative models heavily depends on the choice of layer from which we extract activations as features. Furthermore, although that GANs and VAEs are known to be able to generate high-quality samples from the data distribution, there is no strong evidence that they encode explicit layerwise representations to similar quality as in supervised learning models, which implies that there does not exist a natural way to explicitly extract a representation from intermediate layer activations in unsupervisedly pre-trained generative models. Additionally, layer activations alone do not suffice to reach the full power of learned representations hidden in neural network models, as shown in recent works (Mu et al., 2020) that incorporating additional gradients-based features into representation leads to substantial improvement over solely using activations-based features.
+
+In light of these constraints, we are interested in the question: is there a principled method for representation extraction beyond layer activations? In this work, we turn to the kernel view of neural networks. Recently, initiated by the Neural Tangent Kernel (NTK) (Jacot et al., 2018) work, there have been growing interests in the kernel interpretation of neural networks. It was shown that neural networks in the infinite width regime are reduced to kernel regression with the induced NTK. Our key intuition is that, the kernel machine induced by the neural network provides a powerful and principled way of investigating the non-linear feature transformation in neural networks using the
+
+linear feature space of the kernel. Kernel machines provide drastically different representations than layer activations, where the knowledge of a neural network is instantiated by the induced kernel function over data points.
+
+In this work, we propose to make use of the linear feature space of the kernel, associated with the pre-trained neural network model, as the data representation of interest. To this end, we made novel contributions on both theoretical and empirical side, as summarized below.
+
+- We propose Neural Fisher Kernel (NFK) as a unified and principled kernel formulation for neural networks models in both supervised learning and unsupervised learning settings.
+- We introduce a highly efficient and scalable algorithm for low-rank kernel approximation of NFK, which allows us to obtain a compact yet informative feature embedding as the data representation.
+- We validate the effectiveness of proposed approach from NFK in unsupervised learning, semi-supervised learning and supervised learning settings, showing that our method enjoys superior sample efficiency and representation quality.
+
+# 2 PRELIMINARY AND RELATED WORKS
+
+In this section, we present technical background and formalize the motivation. We start by introducing the notion of data representation from the perspective of kernel methods, then introduce the connections between neural network models and kernel methods.
+
+Notations. Throughout this paper, we consider dataset with $N$ data examples $\mathcal{D} \equiv \{(\mathbf{x}_i, y_i)\}$ , we use $p(\mathbf{x})$ to denote the probability density function for the data distribution and use $p_{\mathrm{data}}(\mathbf{x})$ to denote the empirical data distribution from $\mathcal{D}$ .
+
+Kernel Methods. Kernel methods (Hofmann et al., 2008) have long been a staple of practical machine learning. At their core, a kernel method relies on a kernel function which acts as a similarity function between different data examples in some feature space. Here we consider positive definite kernels $\mathcal{K}:\mathcal{X}\times \mathcal{X}\to \mathbb{R}$ over a metric space $\mathcal{X}$ which defines a reproducing kernel Hilbert space $\mathcal{H}$ of function from $\mathcal{X}$ to $\mathbb{R}$ , along with a mapping function $\varphi :\mathcal{X}\rightarrow \mathcal{H}$ , such that the kernel function can be decomposed into the inner product $\mathcal{K}(\mathbf{x},\mathbf{z}) = \langle \varphi (\mathbf{x}),\varphi (\mathbf{z})\rangle$ . Kernel methods aim to find a predictive linear function $f(\mathbf{x}) = \langle f,\varphi (\mathbf{x})\rangle_{\mathcal{H}}$ in $\mathcal{H}$ , which gives label output prediction for each data point $\mathbf{x}\in \mathcal{X}$ . The kernel maps each data example $\mathbf{x}\in \mathcal{X}$ to a linear feature space $\varphi (\mathbf{x})$ , which is the data representation of interest. Given dataset $\mathcal{D}$ , the predictive model function $f$ is typically estimated via Kernel Ridge Regression (KRR), $\widehat{f} = \operatorname*{argmin}_{f\in \mathcal{H}}\frac{1}{N}\sum_{i = 1}^{N}(f(\mathbf{x}_i) - y_i)^2 +\lambda \| f\|_{\mathcal{H}}^2$ .
+
+Neural Networks and Kernel Methods. A long line of works (Neal, 1996; Williams, 1996; Roux and Bengio, 2007; Hazan and Jaakkola, 2015; Lee et al., 2018; de G. Matthews et al., 2018; Jacot et al., 2018; Chen and Xu, 2021; Geifman et al., 2020; Belkin et al., 2018; Ghorbani et al., 2020), have studied that many kernel formulations can be associated to neural networks, while most of them correspond to neural network where being fixed kernels (e.g. Laplace kernel, Gaussian kernel) or only the last layer is trained, e.g., Conjugate Kernel (CK) (Daniely et al., 2016), also called as NNGP kernel (Lee et al., 2018). On the other hand, Neural Tangent Kernel (NTK) (Jacot et al., 2018) is a fundamentally different formulation corresponding to training the entire infinitely wide neural network models. Let $f(\theta ;\mathbf{x})$ denote a neural network function with parameters $\theta$ , then the empirical NTK is defined as $\kappa_{\mathrm{ntk}}(\mathbf{x},\mathbf{z}) = \langle \nabla_{\theta}f(\theta ;\mathbf{x}),\nabla_{\theta}f(\theta ;\mathbf{z})\rangle$ . (Jacot et al., 2018; Lee et al., 2018) showed that under the so-called NTK parametrization and other proper assumptions, the function $f(\mathbf{x};\pmb {\theta})$ learned by training the neural network model with gradient descent is equivalent to the function estimated via ridgeless KRR using $\kappa_{\mathrm{ntk}}$ as the kernel. For finite-width neural networks, by taking first-order Taylor expansion of funnction $f$ around the $\pmb{\theta}$ , kernel regression under $\kappa_{\mathrm{ntk}}$ can be seen as linearized neural network model at parameter $\pmb{\theta}$ , suggesting that pre-trained neural network models can also be studied and approximated from the perspective of kernel methods.
+
+Fisher Kernel. The Fisher Kernel (FK) is first introduced in the seminal work (Jaakkola and Haussler, 1998). Given a probabilistic generative model $p_{\theta}(x)$ , the Fisher kernel is defined as: $\mathcal{K}_{\mathrm{fisher}}(\mathbf{x},\mathbf{z}) = \nabla_{\theta}\log p_{\theta}(\mathbf{x})^{\top}\mathcal{I}^{-1}\nabla_{\theta}\log p_{\theta}(\mathbf{z}) = U_{\mathbf{x}}^{\top}\mathcal{I}^{-1}U_{\mathbf{z}}$ where $U_{\mathbf{x}} = \nabla_{\theta}\log p_{\theta}(\mathbf{x})$ is the so-called Fisher score and $\mathcal{I}$ is the Fisher Information Matrix (FIM) defined as the covariance of the Fisher score: $\mathcal{I} = \mathbb{E}_{\mathbf{x}\sim p_{\theta}(\mathbf{x})}\nabla_{\theta}\log p_{\theta}(\mathbf{x})\nabla_{\theta}\log p_{\theta}(\mathbf{x})^{\top}$ . Then the Fisher vector is defined as $V_{\mathbf{x}} = \mathcal{I}^{-\frac{1}{2}}\nabla_{\theta}\log p_{\theta}(\mathbf{x}) = \mathcal{I}^{-\frac{1}{2}}U_{\mathbf{x}}$ . One can utilize the Fisher Score as a mapping from the
+
+
+Figure 1: Overview of our proposed approach. Given a pre-trained neural network model, which can be either an unsupervised generative model $p_{\theta}(\mathbf{x})$ (e.g. GANs, VAEs), or a supervised learning model $p_{\theta}(\mathbf{y}|\mathbf{x})$ , we aim to extract a compact yet informative representation from it. By reinterpreting various families of models as energy-based models (EBM), we introduce Neural Fisher Kernel (NFK) $\kappa_{\mathrm{nfk}}$ as a principled and unified kernel formulation for neural network models (Section. 3.1). We introduce a highly efficient and scalable kernel approximation algorithm (Section. 3.2) to obtain the low-dimensional feature embedding $\mathbf{e}_{\mathbf{x}}$ , which serves as the extracted data representation from NFK.
+
+data space $\mathcal{X}$ to parameter space $\Theta$ , and obtain representations that are linearized. As proposed in (Jaakkola and Haussler, 1998; Perronnin and Dance, 2007), the Fisher vector $V_{\mathbf{x}}$ can be used as the feature representation derived from probabilistic generative models, which was shown to be superior to hand-crafted visual descriptors in a variety of computer vision tasks.
+
+Generative Models In this work, we consider a variety of representative deep generative models, including generative adversarial networks (GANs) (Goodfellow et al., 2014), variational auto-encoders (VAEs) (Kingma and Welling, 2014), as well as normalizing flow models (Dinh et al., 2015) and auto-regressive models (van den Oord et al., 2016). Please refer to (Salakhutdinov, 2014) for more technical details on generative models.
+
+# 3 LEARNING REPRESENTATION FROM NEURAL FISHER KERNEL
+
+We aim to propose a general and efficient method for extracting high-quality representation from pre-trained neural network models. As formalized in previous section, we can describe the outline of our proposed approach as: given a pre-trained neural network model $f(\mathbf{x};\pmb {\theta})$ (either unsupervised generative model $p(\mathbf{x};\pmb {\theta})$ or supervised learning model $p(\mathbf{y}\mid \mathbf{x};\pmb {\theta})$ ), with pre-trained weights $\pmb{\theta}$ , we adopt the kernel formulation $\kappa_{f}$ induced by model $f(\mathbf{x};\pmb {\theta})$ and make use of the associated linear feature embedding $\varphi (\mathbf{x})$ of the kernel $\kappa_{f}$ as the feature representation of data $\mathbf{x}$ . We present an overview introduction to illustrate our approach in Figure. 1.
+
+At this point, however, there exist both theoretical difficulties and practical challenges which impede a straightforward application of our proposed approach. On the theoretical side, the NTK theory is only developed in supervised learning setting, and its extension to unsupervised learning is not established yet. Though Fisher kernel is immediately applicable in unsupervised learning setting, deriving Fisher vector from supervised learning model $p(\mathbf{y} \mid \mathbf{x}; \boldsymbol{\theta})$ can be tricky, which needs the log-density estimation of marginal distribution $p_{\boldsymbol{\theta}}(\mathbf{x})$ from $p(\mathbf{y} \mid \mathbf{x}; \boldsymbol{\theta})$ . Note that it is a drastically different problem from previous works (Achille et al., 2019) where Fisher kernel is applied to the joint distribution over $p(\mathbf{x}, \mathbf{y})$ . On the practical efficiency side, the dimensionality of the feature space associated with NTK or FK is same as the number of model parameters $|\boldsymbol{\theta}|$ , which poses unmanageably high time and space complexity when it comes to modern large-scale neural network models. Additionally, the size of the NTK scales quadratically with the number of classes in multi-class supervised learning setting, which gives rise to more efficiency concerns.
+
+To address the kernel formulation issue, we propose Neural Fisher Kernel (NFK) in Sec. 3.1 as a unified kernel for both supervised and unsupervised learning models. To tackle the efficiency challenge, we investigate the structural properties of the proposed NFK and propose a highly scalable low-rank kernel approximation algorithm in Sec. 3.2 to extract compact low-dimensional feature representation from NFK.
+
+# 3.1 NEURAL FISHER KERNEL
+
+In this section, we propose Neural Fisher Kernel (NFK) as a principled and general kernel formulation for neural network models. The key intuition is that we can extend classical Fisher kernel theory to unify the procedure of deriving Fisher vector from supervised learning models and unsupervised learning models by using Energy-based Model (EBM) formulation.
+
+
+Figure 2: Left: The spectrum structure of NFKs from a CNN (green) and a MLP (red), trained on MNIST binary classification task. The NFK of CNN concentrates on fewer eigen-modes compared to the MLP. Right: The low-rankness of the NFK on a DCGAN trained on MNIST. For a trained model, the first 100 principle components of the Fisher Vector matrix explain $99.5\%$ of all variances. An untrained model with the same architecture on the other hand, demonstrates a much lower degree of low-rankness.
+
+
+
+# 3.1.1 UNSUPERVISED NFK
+
+We consider unsupervised probabilistic generative models $p_{\theta}(\mathbf{x}) = p(\mathbf{x};\boldsymbol {\theta})$ here. Our proposed NFK formulation can be applied to all generative models with tractable evaluation (or approximation) of $\nabla_{\theta}\log p_{\theta}(\mathbf{x})$
+
+GANs. We consider the EBM formulation of GANs (Dai et al., 2017; Zhai et al., 2019; Che et al., 2020). Given pre-trained GAN model, we use $D(\mathbf{x};\pmb{\theta})$ to denote the output of the discriminator $D$ , and use $G(\mathbf{h})$ to denote the output of generator $G$ given latent code $\mathbf{h} \sim p(\mathbf{h})$ . As a brief recap, GANs can be interpreted as an implementation of EBM training with a variational distribution, where we have the energy-function $E(\mathbf{x};\pmb{\theta}) = -D(\mathbf{x};\pmb{\theta})$ . Please refer to (Zhai et al., 2019; Che et al., 2020) for more details. Thus we have the unnormalized density function $p_{\pmb{\theta}}(\mathbf{x}) \propto e^{-E(\mathbf{x};\pmb{\theta})}$ given by the GAN model. Following (Zhai et al., 2019), we can then derive the Fisher kernel $\mathcal{K}_{\mathrm{nfk}}$ and Fisher vector from standard GANs as shown below:
+
+$$
+\mathcal {K} _ {\mathrm {n f k}} (\mathbf {x}, \mathbf {z}) = \langle V _ {\mathbf {x}}, V _ {\mathbf {z}} \rangle \qquad V _ {\mathbf {x}} = (\operatorname {d i a g} (\mathcal {I}) ^ {- \frac {1}{2}}) U _ {\mathbf {x}}
+$$
+
+$$
+U _ {\mathbf {x}} = \nabla_ {\boldsymbol {\theta}} D (\mathbf {x}; \boldsymbol {\theta}) - \mathbb {E} _ {\mathbf {h} \sim p (\mathbf {h})} \nabla_ {\boldsymbol {\theta}} D (G (\mathbf {h}); \boldsymbol {\theta}) \tag {1}
+$$
+
+where $\mathbf{x},\mathbf{z}\in \mathcal{X},\mathcal{I} = \mathbb{E}_{\mathbf{h}\sim p(\mathbf{h})}\left[U_{G(\mathbf{h})}U_{G(\mathbf{h})}^{\top}\right]$ . Note that we use diagonal approximation of FIM throughout this work for the consideration of scalability.
+
+VAEs. Given a VAE model pre-trained via maximizing the variational lower-bound ELBO $\mathcal{L}_{\mathrm{ELBO}}(\mathbf{x})\equiv \mathbb{E}_{q(\mathbf{h}|\mathbf{x})}\left[\log \frac{p(\mathbf{x},\mathbf{h})}{q(\mathbf{h}|\mathbf{x})}\right]$ , we can approximate the marginal log-likelihood $\log p_{\theta}(\boldsymbol {\theta})$ by evaluating $\mathcal{L}_{\mathrm{ELBO}}(\mathbf{x})$ via Monte-Carlo estimations or importance sampling techniques (Burda et al., 2016). Thus we have our NFK formulation as
+
+$$
+\mathcal {K} _ {\mathrm {n f k}} (\mathbf {x}, \mathbf {z}) = \left\langle V _ {\mathbf {x}}, V _ {\mathbf {z}} \right\rangle \quad V _ {\mathbf {x}} = \left(\operatorname {d i a g} (\mathcal {I}) ^ {- \frac {1}{2}}\right) U _ {\mathbf {x}} \tag {2}
+$$
+
+$$
+U _ {\mathbf {x}} \approx \nabla_ {\pmb {\theta}} \mathcal {L} _ {\mathrm {E L B O}} (\mathbf {x})
+$$
+
+where $\mathbf{x},\mathbf{z}\in \mathcal{X},\mathcal{I} = \mathbb{E}_{\mathbf{x}\sim p_{\boldsymbol{\theta}}(\mathbf{x})}\left[U_{\mathbf{x}}U_{\mathbf{x}}^{\top}\right]$
+
+Flow-based Models, Auto-Regressive Models. For generative models with explicit exact data density modeling $p_{\theta}(\mathbf{x})$ , we can simply apply the classical Fisher kernel formulation in Sec. 2.
+
+# 3.1.2 SUPERVISED NFK
+
+In the supervised learning setting, we consider conditional probabilistic models $p_{\theta}(\mathbf{y} \mid \mathbf{x}) = p(\mathbf{y} \mid \mathbf{x}; \boldsymbol{\theta})$ . In particular, we focus on classification problems where the conditional probability is parameterized by a softmax function over the logits output $f(\mathbf{x}; \boldsymbol{\theta})$ : $p_{\theta}(\mathbf{y} \mid \mathbf{x}) = \exp(f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})) / \sum_{\mathbf{y}} \exp(f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta}))$ , where $\mathbf{y}$ is a discrete label and $f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})$ denotes $\mathbf{y}$ -th logit output. We then borrow the idea from JEM (Grathwohl et al., 2020) and write out a joint energy function term over $(\mathbf{x}, \mathbf{y})$ as $E(\mathbf{x}, \mathbf{y}; \boldsymbol{\theta}) = -f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})$ . It is easy to see that joint energy yields exactly the same conditional probability, at the same time leading to a free energy function:
+
+# Algorithm 1 Baseline method: compute low-rank NFK feature embedding
+
+Input dataset $\mathcal{D}$ ; pre-train NN model $f(\mathbf{x};\pmb {\theta})$ ; NFK feature dimensionality $k$ ; test data input $\mathbf{x}^{\star}$
+Output low-rank NFK feature embedding $\mathbf{e}_{\mathrm{nfk}}(\mathbf{x}^{*})$
+
+1: compute Fisher vector for all data examples $\mathbf{V} = [V_{\mathbf{x}_i}] \in \mathbb{R}^{N \times |\boldsymbol{\theta}|}$
+2: compute kernel Gram matrix $\mathbf{K} = \mathbf{V}\mathbf{V}^{\top} \in \mathbb{R}^{N \times N}$
+3: compute truncated eigen-decomposition $\mathbf{K} = \Phi \mathrm{diag}(\Lambda)\Phi^{\top}$ , $\Phi \in \mathbb{R}^{N\times k}$
+4: kernel function evaluations between $\mathbf{x}^*$ and all data examples $\mathcal{K}(\mathbf{x}^\star, \mathbf{X}) \equiv [\mathcal{K}(\mathbf{x}^\star, \mathbf{x}_j)]_{j=1}^N$
+5: obtain $\mathbf{e}_{\mathrm{nfk}}(\mathbf{x}^*) \in \mathbb{R}^k$ via Eq. 5 and Eq. 4
+
+$E(\mathbf{x};\pmb {\theta}) = -\log \sum_{\mathbf{y}}\exp (f^{\mathbf{y}}(\mathbf{x};\pmb {\theta}))$ . It essentially reframes a conditional distribution over $\mathbf{y}$ given $\mathbf{x}$ to an induced unconditional distribution over $\mathbf{x}$ , while maintaining the same conditional probability $p_{\theta}(\mathbf{y}\mid \mathbf{x})$ . This allows us to write out the NFK formulation as:
+
+$$
+\mathcal {K} _ {\mathrm {n f k}} (\mathbf {x}, \mathbf {z}) = \langle V _ {\mathbf {x}}, V _ {\mathbf {z}} \rangle \quad V _ {\mathbf {x}} = (\operatorname {d i a g} (\mathcal {I}) ^ {- \frac {1}{2}}) U _ {\mathbf {x}}
+$$
+
+$$
+U _ {\mathbf {x}} = \sum_ {\mathbf {y}} p _ {\boldsymbol {\theta}} (\mathbf {y} \mid \mathbf {x}) \nabla_ {\boldsymbol {\theta}} f ^ {\mathbf {y}} (\mathbf {x}; \boldsymbol {\theta}) - \mathbb {E} _ {\mathbf {x} ^ {\prime} \sim p _ {\boldsymbol {\theta}} (\mathbf {x} ^ {\prime})} \sum_ {\mathbf {y}} p _ {\boldsymbol {\theta}} (\mathbf {y} \mid \mathbf {x}) \nabla_ {\boldsymbol {\theta}} f ^ {\mathbf {y}} \left(\mathbf {x} ^ {\prime}; \boldsymbol {\theta}\right) \tag {3}
+$$
+
+where $\mathcal{I} = \mathbb{E}_{\mathbf{x}\sim p_{\theta}(\mathbf{x})}\left[U_{\mathbf{x}}U_{\mathbf{x}}^{\top}\right]$ , and $p_{\theta}(\mathbf{x})$ is the normalized density corresponding to the free energy $E_{\theta}$ , which could be sampled from via Markov chain Monte Carlo (MCMC) algorithm. In this work, we use empirical data distribution as practical approximation.
+
+# 3.2 NFK WITH LOW-RANK APPROXIMATION
+
+Fisher vector $V_{\mathbf{x}}$ is the linear feature embedding $\varphi(\mathbf{x})$ given by NFK $\mathcal{K}_{\mathrm{nfk}}(\mathbf{x}, \mathbf{z}) = \langle V_{\mathbf{x}}, V_{\mathbf{z}} \rangle$ for neural network model $f(\mathbf{x}; \boldsymbol{\theta})$ . However, straightforward application of NFK by using $V_{x}$ as feature representation suffers from scalability issue, since $V_{\mathbf{x}} \in \mathbb{R}^{|\boldsymbol{\theta}|}$ shares same dimensionality as the number of parameters $|\boldsymbol{\theta}|$ . It is with that in mind that $|\boldsymbol{\theta}|$ can be tremendously large considering the scale of modern neural networks, it is unfortunately infeasible to directly leverage $V_{\mathbf{x}}$ as feature representation.
+
+Low-Rank Structure of NFK. Motivated by the *Manifold Hypothesis of Data* that it is widely believed that real world high dimensional data lives in a low-dimensional manifold (Roweis and Saul, 2000; Rifai et al., 2011a,b), we investigate the structure of NFKs and present empirical evidence that NFKs of good models have low-rank spectral structure. Firstly, we start by examining supervised learning models. We study the spectrum structure of the empirical NFK of trained neural networks with different architectures. We trained a LeNet-5 (LeCun et al., 1998) CNN and a 3-layer MLP network by minimizing binary cross entropy loss, and then compute the eigen-decomposition of the NFK Gram matrix. We show the explained ratio plot in Figure 2. We see that the spectrum of CNN NTK concentrates on fewer large eigenvalues, thus exhibiting a lower effective-rank structure compared to the MLP, which can be explained by the fact that CNN has better model inductive bias for image data domain. For unsupervised learning models, we trained a small unconditional DCGAN (Radford et al., 2016) model on MNIST dataset. We compare the results of a fully trained model against a randomly initialized model in Fig. 2 (note the logarithm scale of the $x$ -axis). Remarkably, the trained model demonstrates an extreme degree of low-rankness that top 100 principle components explain over $99.5\%$ of the overall variance, where 100 is two orders of magnitude smaller than both number of examples and number of parameters in the discriminator. We include more experimental results and discussions in appendix due to the space constraints.
+
+Efficient Low-Rank Approximation of NFK. The theoretical insights and empirical evidence presented above hint at a natural solution to address the challenge of high-dimensionality of $V_{\mathbf{x}} \in \mathbb{R}^{|\boldsymbol{\theta}|}$ : we can turn to seek a low-rank approximation to the NFK. According to the Mercer's theorem (Mercer, 1909), for positive definite kernel $\mathcal{K}(\mathbf{x},\mathbf{z}) = \langle \varphi (\mathbf{x}),\varphi (\mathbf{z})\rangle$ we have $\mathcal{K}(\mathbf{x},\mathbf{z}) = \sum_{i = 1}^{\infty}\lambda_i\phi_i(\mathbf{x})\phi_i(\mathbf{z})$ , $\mathbf{x},\mathbf{z} \in \mathcal{X}$ , where $\{(\lambda_i,\phi_i)\}$ are the eigenvalues and eigenfunctions of the kernel $\mathcal{K}$ , with respect to the integral operator $\int p(\mathbf{z})\mathcal{K}(\mathbf{x},\mathbf{z})\phi_i(\mathbf{z})\mathrm{d}\mathbf{z} = \lambda_i\phi_i(\mathbf{x})$ . The linear feature embedding representation $\varphi (\mathbf{x})$ can thus be constructed from the orthonormal eigenbasis $\{(\lambda_i,\phi_i)\}$ as $\varphi (\mathbf{x}) \equiv [\sqrt{\lambda_1}\phi_1(\mathbf{x}),\sqrt{\lambda_2}\phi_2(\mathbf{x}),\dots ] \equiv [\sqrt{\lambda_i}\phi_i(\mathbf{x})]$ , $i = 1,\ldots ,\infty$ . To obtain a low-rank approximation, we only keep top- $k$ largest eigen-basis $\{(\lambda_i,\phi_i)\}$ ordered by corresponding eigenvalues $\lambda_{i}$ to form the low-rank $k$ -dimensional feature embedding $\mathbf{e}(\mathbf{x}) \in \mathbb{R}^k$ , $k \ll N, k \ll |\pmb {\theta}|$
+
+$$
+\mathbf {e} (\mathbf {x}) \equiv \left[ \sqrt {\lambda_ {1}} \phi_ {1} (\mathbf {x}), \sqrt {\lambda_ {2}} \phi_ {2} (\mathbf {x}), \dots \sqrt {\lambda_ {k}} \phi_ {k} (\mathbf {x}) \right] \equiv \left[ \sqrt {\lambda_ {i}} \phi_ {i} (\mathbf {x}) \right], i = 1, \dots , k \tag {4}
+$$
+
+Algorithm 2 Our proposed method: compute low-rank NFK feature embedding
+
+1: $\mathbf{V} = \Phi \mathrm{diag}(\Sigma)\mathbf{P}^{\top},\mathbf{P}\in \mathbb{R}^{|\boldsymbol {\theta}|\times k}$ using power iteration methods via JVP/VJP evaluations
+2: compute $\mathcal{K}(\mathbf{x},\mathbf{X})^\top \Phi_i\approx V_{\mathbf{x}}\mathrm{diag}(\Sigma_i)\mathbf{P}_i$ via JVP evaluation
+3: obtain $\mathbf{e}_{\mathrm{nfk}}(\mathbf{x}^*) \in \mathbb{R}^k$ via Eq. 5 and Eq. 4
+
+By applying our proposed NFK formulation $\mathcal{K}_{\mathrm{nfk}}$ to pre-trained neural network model $f(\mathbf{x};\boldsymbol {\theta})$ , we can obtain a compact low-dimensional feature representation $\mathbf{e}_{\mathrm{nfk}}(\mathbf{x})\in \mathbb{R}^k$ in this way. We call it the low-rank NFK feature embedding.
+
+We then illustrate how to estimate the eigenvalues and eigenfunctions of NFK $\mathcal{K}_{\mathrm{nfk}}$ from data. Given dataset $\mathcal{D}$ , the Gram matrix $\mathbf{K} \in \mathbb{R}^{N \times N}$ of kernel $\mathcal{K}$ is defined as $\mathbf{K}(\mathbf{x}_i, \mathbf{x}_j) = \mathcal{K}(\mathbf{x}_i, \mathbf{x}_j)$ . We use $\mathbf{X} \equiv [\mathbf{x}_i]_{i=1}^N$ to denote the matrix of all data examples, and use $\phi_i(\mathbf{X}) \in \mathbb{R}^N$ to denote the concatenated vector of evaluating $i$ -th eigenfunction $\phi_i$ at all data examples. Then by performing eigen-decomposition of the Gram matrix $\mathbf{K} = \Phi \operatorname{diag}(\Lambda) \mathbf{\Phi}^\top$ , the $i$ -th eigenvector $\Phi_i \in \mathbb{R}^N$ and eigenvalue $\Lambda_i$ can be seen as unbiased estimation of the $i$ -th eigenfunction $\phi_i$ and eigenvalue $\lambda_i$ of the kernel $\mathcal{K}$ , evaluated at training data examples $\mathbf{X}$ , $\phi_i(\mathbf{X}) \approx \sqrt{N} \Phi_i$ , $\lambda_i \approx \frac{1}{N} \Lambda_i$ . Based on these estimations, we can thus approximate the eigenfunction $\phi_i$ via the integral operator by Monte-Carlo estimation with empirical data distribution,
+
+$$
+\lambda_ {i} \phi_ {i} (\mathbf {x}) = \int p (\mathbf {z}) \mathcal {K} (\mathbf {x}, \mathbf {z}) \phi_ {i} (\mathbf {z}) \mathrm {d} \mathbf {z} \approx \mathbb {E} _ {\mathbf {x} _ {j} \in p _ {\mathrm {d a t a}}} \mathcal {K} (\mathbf {x}, \mathbf {x} _ {j}) \phi_ {j} (\mathbf {x} _ {j}) \approx \frac {1}{N} \sum_ {j = 1} ^ {N} \mathcal {K} (\mathbf {x}, \mathbf {x} _ {j}) \boldsymbol {\Phi} _ {j i} \tag {5}
+$$
+
+Given new test data example $\mathbf{x}^{\star}$ , we can now approximate the eigenfunction evaluation $\phi_{i}(\mathbf{x}^{\star})$ by the projection of kernel function evaluation results centered on training data examples $\mathcal{K}(\mathbf{x}^{\star},\mathbf{X})\equiv [\mathcal{K}(\mathbf{x}^{\star},\mathbf{x}_{j})]_{j = 1}^{N}$ onto the $i$ -th eigenvector $\Phi_{i}$ of kernel Gram matrix $\mathbf{K}$ . We adopt this method as the baseline approach for low-rank approximation, and present the baseline algorithm description in Alg. 1.
+
+However, due to the fact that it demands explicit computation and manipulation of the Fisher vector matrix $\mathbf{V} \in \mathbb{R}^{N \times |\theta|}$ and the Gram matrix $\mathbf{K} \in \mathbb{R}^{N \times N}$ in Alg. 1, straightforward application of the baseline approach, as well as other off-the-shelf classical kernel approximation (Williams and Seeger, 2000; Rahimi and Recht, 2007) and SVD methods (Halko et al., 2011), are practically infeasible to scale to larger-scale machine learning settings, where both the number of data examples $N$ and the number of model parameters $|\theta|$ can be extremely large.
+
+To tackle the posed scalability issue, we propose a novel highly efficient and scalable algorithm for computing low-rank approximation of NFK. Given dataset $\mathcal{D}$ and model $f(\mathbf{x};\boldsymbol{\theta})$ , We aim to compute the truncated SVD of the Fisher vector matrix $\mathbf{V} = \Phi \mathrm{diag}(\Sigma)\mathbf{P}^{\top}, \mathbf{P} \in \mathbb{R}^{|\boldsymbol{\theta}| \times k}$ . Based on the idea of power methods (Golub and Van der Vorst, 2000; Bathe, 1971) for finding leading top eigenvectors, we start from a random vector $\mathbf{v}_0$ and iteratively construct the sequence $\mathbf{v}_{t+1} = \frac{\mathbf{V}\mathbf{V}^\top\mathbf{v}_t}{\|\mathbf{V}\mathbf{V}^\top\mathbf{v}_t\|}$ . By leveraging the special structure of $\mathbf{V}$ that it can be obtained from the Jacobian matrix $J_{\boldsymbol{\theta}}(\mathbf{X}) \in \mathbb{R}^{N \times |\boldsymbol{\theta}|}$ up to element-wise linear transformation under the NFK formulation in Sec. 3, we can decompose each iterative step into a Jacobian Vector Product (JVP) and a Vector Jacobian Product (VJP). With modern automatic-differentiation techniques, we can evaluate both JVP and VJP efficiently, which only requires the same order of computational costs of one vanilla backward-pass and forward-pass of neural networks respectively. With computed truncated SVD results, we can approximate the projection term in Eq. 5 by $\mathcal{K}(\mathbf{x},\mathbf{X})^\top \boldsymbol{\Phi}_i = V_{\mathbf{x}}\mathbf{V}^\top \boldsymbol{\Phi}_i \approx V_{\mathbf{x}}\mathrm{diag}(\Sigma_i)\mathbf{P}_i$ , which is again in the JVP form so that we can pre-compute and store the truncated SVD results and evaluate the eigenfunction of any test data example via one efficient JVP forward-pass. We describe our proposed algorithm briefly in Alg. 2.
+
+# 4 EXPERIMENTS
+
+In this section, we evaluate NFK in the following settings. We first evaluate the proposed low-rank kernel approximation algorithm (Sec. 3.2), in terms of both approximation accuracy and running time efficiency. Next, we evaluate NFK on various representation learning tasks in both supervised, semi-supervised and unsupervised learning settings.
+
+
+
+
+
+
+Figure 3: Top row: Running time efficiency evaluation for truncated SVD algorithm on single GPU. We vary the number of data examples used, shown in $x$ -axis. $y$ -axis denotes the wall-clock running time (in seconds). Red crosses mark the cases when it is no longer possible for the baseline method to obtain the results in an affordable waiting time and memory consumption. Bottom left: Running time costs with different number of GPUs used in our distributed SVD implementation. Bottom right: Approximation errors (in blue) of our proposed implementation for each eigenmode (in descending order of eigenvalues), v.s. the explained variance (in red). Best viewed in color.
+
+
+
+# 4.1 QUALITY AND EFFICIENCY OF LOW-RANK NFK APPROXIMATIONS
+
+We implement our proposed low-rank kernel approximation algorithm in Jax (Bradbury et al., 2018) with distributed multi-GPU parallel computation support. For the baseline methods for comparison, we first compute the full kernel Gram matrix using the neural-tangets (Novak et al., 2020) library, and then use sklearn.decomposition.TruncatedSVD to obtain the truncated SVD results. All model and algorithm hyper-parameters are included in the Appendix.
+
+Computational Costs. We start by comparing running time costs of computing top NFK eigenvectors via truncated SVD. We use two models for the comparison, a DCGAN-like GAN model in (Zhai et al., 2019) and a Wide ResNet (WRN) with 40 layers and 2 times wider than original network (denoted as WRN-40-2). Please see appendix for the detailed description of hyper-parameters. We observed that our proposed algorithm could achieve nearly linear time scaling, while the baseline method would not be able to handle more than $2^{14}$ data examples as the memory usage and time complexity are too high to afford. We also see in Fig. 3 that by utilizing multi-GPU parallelism, we achieved further speed-up which scales almost linearly with the number of GPUs. We emphasize that given the number of desired eigenvectors, the time complexity of our method scales linearly with the number of data examples and the demanded memory usage remains constant with adequate data batch size, since explicit computation and storage of the full kernel matrix is never needed.
+
+Approximation accuracy. We investigate the approximation error of our proposed low-rank approximation method. Since we did not introduce any additional approximations, our method shares the same approximation error bound with the existing randomized SVD algorithm (Martinsson and Tropp, 2020; Halko et al., 2011) and would only expect differences compared to the baseline randomized SVD algorithm up to numerical errors. To evaluate the quality of the low-rank kernel approximation, we use LeNet-5 and compute its full NFK Gram matrix on MNIST dataset. Please see appendix for detailed hyper-parameter setups. We show in Fig. 3 the approximation errors of top-128 eigenvalues along with corresponding explained variances. We obtain less than $1e - 8$ absolute error and less than $1e - 7$ relative error in top eigen-modes which explains most of the data.
+
+Table 1: CIFAR-10 accuracies of linear evaluation on top of representations learned with unsupervised and self-supervised methods. NFK-128d denotes the 128 dimensional embeddings from the low-rank approximation of the NFK (ie AFV). Remarkably, we can use 128 dimensions to exactly recover the performance of the 5.9M dimensional Fisher Vectors.
+
+| Model | Acc | Category | #Features |
| Exemplar CNN (Dosovitskiy et al., 2015) | 84.3 | Unsupervised | - |
| BiGAN (Mu et al., 2020) | 70.5 | Unsupervised | - |
| RotNet Linear (Gidaris et al., 2018) | 81.8 | Self-Supervised | ~ 25K |
| AET Linear (Zhang et al., 2019) | 83.3 | Self-Supervised | ~ 25K |
| VAE(Mu et al., 2020) | 61.5 | Unsupervised | - |
| VAE-NFK-128d (ours) | 63.2 | Unsupervised | 128 |
| VAE-NFK-256d (ours) | 68.7 | Unsupervised | 256 |
| GAN-Supervised | 92.7 | Supervised | - |
| GAN-Activations | 65.3 | Unsupervised | - |
| GAN-AFV (Zhai et al., 2019) | 89.1 | Unsupervised | 5.9M |
| GAN-AFV (re-implementation) (Zhai et al., 2019) | 89.8 | Unsupervised | 5.9M |
| GAN-NFK-128d (ours) | 89.8 | Unsupervised | 128 |
| GAN-NFK-256d (ours) | 89.8 | Unsupervised | 256 |
+
+# 4.2 LOW-RANK NFK EMBEDDING AS DATA REPRESENTATIONS
+
+In this section we evaluate NFK to answer the following: Q1. In line with the question raised in Sec. 1, how does our proposed low-rank NFK embedding differ from the intermediate layer activations for data representation? Q2. How does the low-rank NFK embedding compare to simply using gradients (Jacobian) as data representation? Q3. To what extent can the low-rank NFK embedding preserve the information in full Fisher vector? Q4. Does the NFK embedding representation lead to better generalization performance in terms of better sample efficiency and faster adaptation? We conduct comparative studies on different tasks to understand the NFK embedding and present empirical observations to answer these questions in following sections.
+
+NFK Representations from Unsupervised Generative Models. In order to examine the effectiveness of the low-rank NFK embeddings as data representations in unsupervised learning setting, we consider GANs and VAEs as representative generative models and compute the low-rank NFK embeddings. Then we adopt the linear probing protocol by training a linear classifier on top of the obtained embeddings and report the classification performance to quantify the quality of NFK data representation. For GANs, we use the same pretrained GAN model from (Zhai et al., 2019) and reimplemented the AFV baseline. For VAEs, we follow the same model architecture proposed in (Child, 2020). We then apply the proposed truncated SVD algorithm with 10 power iterations to obtain the 256 dimensional embedding via projection. We present our results on CIFAR-10 (Krizhevsky et al., 2009a) in Table. 1. We use GAN-NFK-128d (GAN-NFK-256d) to denote the NFK embedding obtained from using top-128 (top-256) eigenvectors in our GAN model. Our VAE models (VAE-NFK-128d and VAE-NFK-256d) follow the same notations. For VAE baselines, the method proposed in (Mu et al., 2020) combines both gradients features and activations-based features into one linear model, denoted as VAE in the table. For GAN baselines, we first consider using intermediate layer activations only as data representation, referred to as the GAN-Activations model. We then consider using full Fisher vector as representation, namely using the normalized gradients w.r.t all model parameters as features, denoted as the GAN-AFV model as proposed in (Zhai et al., 2019). Moreover, we also compare our results against training whole neural network using data labels in a supervised learning way, denoted as GAN-Supervised model.
+
+As shown in Table. 1, by contrasting against the baseline GAN-AFV from GAN-Activations, as well as validation in recent works (Zhai et al., 2019; Mu et al., 2020), gradients provide additional useful information beyond layer activations based features. However, it would be impractical to use all gradients or full Fisher vector as representation when scaling up to large-scale neural network models. For example, VAE (Child, 2020) has $\sim 40M$ parameters, it would not be possible to apply the baseline methods directly. Our proposed low-rank NFK embedding approach addressed this challenge by building low-dim vector representation from efficient kernel approximation algorithm, making it possible to utilize all model parameters' gradients information by embedding it into a low-dim vector, e.g. 256-dimensional embedding in VAE-NFK-256d from $\sim 40M$ parameters. As our low-rank NFK embedding is obtained by linear projections of full Fisher vectors, it naturally provides answers for Q2 that the NFK embedding can be viewed as a compact yet informative representation containing information from all gradients. We see from Table. 1 that by using top-128 eigenvectors,
+
+Table 2: Error rates of semi-supervised classification on CIFAR10 and SVHN, varying labels from 500 to 4000. NFK-128d yields extremely competitive performance, compared to other more sophisticated baselines, Mixup (Zhang et al., 2018), VAT (Miyato et al., 2019), MeanTeacher(Tarvainen and Valpola, 2017), MixMatch (Berthelot et al., 2019), Improved GAN(Salimans et al., 2016), all are jointly learns with labels, . Also note that the architecture used by MixMatch yields a $4.13\%$ supervised learning error rate, which is a much stronger than our supervised baseline $(7.3\%)$ .
+
+| Model | Category | CIFAR-10 | SVHN |
| 500 | 1000 | 2000 | 4000 | 500 | 1000 | 2000 | 4000 |
| Mixup | Joint | 36.17 | 25.72 | 18.14 | 13.15 | 29.62 | 16.79 | 10.47 | 7.96 |
| VAT | Joint | 26.11 | 18.68 | 14.40 | 11.05 | 7.44 | 5.98 | 4.85 | 4.20 |
| MeanTeacher | Joint | 47.32 | 42.01 | 17.32 | 12.17 | 6.45 | 3.82 | 3.75 | 3.51 |
| MixMatch | Joint | 9.65 | 7.75 | 7.03 | 6.24 | 3.64 | 3.27 | 3.04 | 2.89 |
| Improved GAN | Joint | - | 19.22 | 17.25 | 15.59 | 18.44 | 8.11 | 6.16 | - |
| NFK-128d (ours) | Pretrained | 20.68 | 14.77 | 13.82 | 12.95 | 8.74 | 4.47 | 3.82 | 3.19 |
+
+Table 3: Supervised knowledge distillation results (classification accuracy on test dataset) on CIFAR10 against baseline methods KD (Hinton et al., 2015), FitNet (Romero et al., 2015), AT (Zagoruyko and Komodakis, 2017), NST (Huang and Wang, 2017), VID-I (Ahn et al., 2019), numbers are from (Ahn et al., 2019).
+
+ | Teacher | Student | KD | FitNet | AT | NST | VID-I | NFKD (ours) |
| ACC | 94.26 | 90.72 | 91.27 | 90.64 | 91.60 | 91.16 | 91.85 | 92.42 |
+
+the low-rank NFK embedding is able to recover the performance of full $\sim 5.9M$ -dimension Fisher vector, which provides positive evidence for Q3 that we can preserve most of the useful information in Fisher vector by taking advantage of the low-rank structure of NFK spectrum.
+
+NFK Representations for Semi-Supervised Learning. We then test the low-rank NFK embeddings in the semi-supervised learning setting. Following the standard semi-supervised learning benchmark settings (Berthelot et al., 2019; Miyato et al., 2019; Laine and Aila, 2017; Sajjadi et al., 2016; Tarvainen and Valpola, 2017), we evaluate our method on CIFAR-10 (Krizhevsky et al., 2009a) and SVHN datasets (Krizhevsky et al., 2009b). We treat most of the dataset as unlabeled data and use few examples as labeled data. We use the same GAN model as the unsupervised learning setting above, and compute top-128 eigenvectors using training dataset (labeled and unlabeled) to derive the 128-dimensional NFK embedding. Then we only use the labeled data to train a linear classifier on top of the NFK embedding features, denoted as the NFK-128d model. We vary the number of labeled training examples and report the results in Table. 2, in comparison with other baseline methods. We see that NFK-128d achieves very competitive performance. On CIFAR-10, NFK-128d is only outperformed by the state-of-the-art semi-supervised learning algorithm MixMatch (Berthelot et al., 2019), which also uses a stronger architecture than ours. The results on SVHN are mixed though NFK-128d is competitive with the top performing approaches. The results demonstrated the effectiveness of NFK embeddings from unsupervised generative models in semi-supervised learning, showing promising sample efficiency for Q4.
+
+NFK Representations for Knowledge Distillation. We next test the effectiveness of using low-rank NFK embedding for knowledge distillation in the supervised learning setting. We include more details of the distillation method in the Appendix. Our experiments are conducted on CIFAR10, with a teacher set as the WRN-40-2 model and student being WRN-16-1. After training the teacher, we compute the low-rank approximation of NFK of the teacher model, using top-20 eigenvectors. We include more details about the distillation method setup in the Appendix. Our results are reported in Table. 3. We see that our method achieves superior results compared to other competitive baseline knowledge distillation methods, which mainly use the logits and activations from teacher network as distillation target.
+
+# 5 CONCLUSIONS
+
+In this work, we propose a novel principled approach to representation extraction from pre-trained neural network models. We introduce NFK by extending the Fisher kernel to neural networks in both unsupervised learning and supervised learning settings, and propose a novel low-rank kernel approximation algorithm, which allows us to obtain a compact feature representation in a highly efficient and scalable way.
+
+# REFERENCES
+
+Tommi S. Jaakkola and David Haussler. Exploiting generative models in discriminative classifiers. In Michael J. Kearns, Sara A. Solla, and David A. Cohn, editors, Advances in Neural Information Processing Systems 11, [NIPS Conference, Denver, Colorado, USA, November 30 - December 5, 1998], pages 487-493. The MIT Press, 1998. URL http://papers.nips.cc/paper/1520-exploiting-generative-models-in-discriminative-classifiers.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770-778. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90.
+Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. CoRR, abs/1503.02531, 2015. URL http://arxiv.org/abs/1503.02531.
+Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. URL https://arxiv.org/abs/1406.2661.
+Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun, editors, 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. URL http://arxiv.org/abs/1312.6114.
+Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 1691-1703. PMLR, 2020a. URL http://proceedings.mlr.press/v119/chen20s.html.
+Fangzhou Mu, Yingyu Liang, and Yin Li. Gradients as features for deep representation learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=BkeoaehKDS.
+Arthur Jacot, Clément Hongler, and Franck Gabriel. Neural tangent kernel: Convergence and generalization in neural networks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 8580-8589, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/5a4be1fa34e62bb8a6ec6b91d2462f5a-AAbstract.html.
+Thomas Hofmann, Bernhard Scholkopf, and Alexander J Smola. Kernel methods in machine learning. The annals of statistics, pages 1171-1220, 2008.
+Radford M Neal. Priors for infinite networks. In *Bayesian Learning for Neural Networks*, pages 29-53. Springer, 1996.
+Christopher K. I. Williams. Computing with infinite networks. In Michael Mozer, Michael I. Jordan, and Thomas Petsche, editors, Advances in Neural Information Processing Systems 9, NIPS, Denver, CO, USA, December 2-5, 1996, pages 295-301. MIT Press, 1996. URL http://papers.nips.cc/paper/1197-computing-with-infinite-networks.
+Nicolas Le Roux and Yoshua Bengio. Continuous neural networks. In Marina Meila and Xiaotong Shen, editors, Proceedings of the Eleventh International Conference on Artificial Intelligence and Statistics, AISTATS 2007, San Juan, Puerto Rico, March 21-24, 2007, volume 2 of JMLR Proceedings, pages 404-411. JMLR.org, 2007. URL http://proceedings.mlr.press/v2/leroux07a.html.
+Tamir Hazan and Tommi S. Jaakkola. Steps toward deep kernel methods from infinite neural networks. CoRR, abs/1508.05133, 2015. URL http://arxiv.org/abs/1508.05133.
+
+Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S. Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep neural networks as gaussian processes. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=B1EA-M-0Z.
+Alexander G. de G. Matthews, Jiri Hron, Mark Rowland, Richard E. Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=H1-nGgWC-.
+Lin Chen and Sheng Xu. Deep neural tangent kernel and laplace kernel have the same RKHS. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=vK9WrZ0QYQ.
+Amnon Geifman, Abhay Kumar Yadav, Yoni Kasten, Meirav Galun, David W. Jacobs, and Ronen Basri. On the similarity between the laplace and neural tangent kernels. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and HsuanTien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/bit/1006ff12c465532f8c574aea4461b16-Abstract.html.
+Mikhail Belkin, Siyuan Ma, and Soumik Mandal. To understand deep learning we need to understand kernel learning. In Jennifer G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 540-548. PMLR, 2018. URL http://proceedings.mlr.press/v80/belkin18a.html.
+Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. When do neural networks outperform kernel methods? In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/black/9d25ad642b923d95503b9a7958d8-AAbstract.html.
+Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett, editors, Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 2253-2261, 2016. URL https://proceedings.neurips.cc/paper/2016/bitstream/abea47ba24142ed16b7d8fbf2c740e0d-Abstract.html.
+Florent Perronnin and Christopher R. Dance. Fisher kernels on visual vocabularies for image categorization. In 2007 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2007), 18-23 June 2007, Minneapolis, Minnesota, USA. IEEE Computer Society, 2007. doi: 10.1109/CVPR.2007.383266. URL https://doi.org/10.1109/CVPR.2007.383266.
+Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: non-linear independent components estimation. In *Yoshua Bengio and Yann LeCun*, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Workshop Track Proceedings, 2015. URL http://arxiv.org/abs/1410.8516.
+Aäron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In Maria-Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pages 1747-1756. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/oord16.html.
+
+Ruslan Salakhutdinov. Deep learning. In Sofus A. Macskassy, Claudia Perlich, Jure Leskovec, Wei Wang, and Rayid Ghani, editors, The 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '14, New York, NY, USA - August 24 - 27, 2014, page 1973. ACM, 2014. doi: 10.1145/2623330.2630809. URL https://doi.org/10.1145/2623330.2630809.
+Alessandro Achille, Michael Lam, Rahul Tewari, Avinash Ravichandran, Subhransu Maji, Charless C. Fowlkes, Stefano Soatto, and Pietro Perona. Task2vec: Task embedding for meta-learning. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 6429-6438. IEEE, 2019. doi: 10.1109/ICCV.2019.00653. URL https://doi.org/10.1109/ICCV.2019.00653.
+Zihang Dai, Amjad Almahairi, Philip Bachman, Eduard H. Hovy, and Aaron C. Courville. Calibrating energy-based generative adversarial networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=SyxeqhP911.
+Shuangfei Zhai, Walter Talbott, Carlos Guestrin, and Joshua M. Susskind. Adversarial fisher vectors for unsupervised representation learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 11156-11166, 2019. URL https://proceedings.neurips.cc/paper/2019/bit/7e1cacfb27da22fb243ff2debf4443a0-Abstract.html.
+Tong Che, Ruixiang Zhang, Jascha Sohl-Dickstein, Hugo Larochelle, Liam Paull, Yuan Cao, and Yoshua Bengio. Your GAN is secretly an energy-based model and you should use discriminator driven latent sampling. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/ hash/90525e70b7842930586545c6f1c9310c-AAbstract.html.
+Yuri Burda, Roger B. Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In Yoshua Bengio and Yann LeCun, editors, 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1509.00519.
+Will Grathwohl, Kuan-Chieh Wang, Jorn-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. Your classifier is secretly an energy based model and you should treat it like one. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=HkxzxONtDB.
+Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. science, 290(5500):2323-2326, 2000.
+Salah Rifai, Pascal Vincent, Xavier Muller, Xavier Glorot, and Yoshua Bengio. Contractive auto-encoders: Explicit invariance during feature extraction. In Lise Getoor and Tobias Scheffer, editors, Proceedings of the 28th International Conference on Machine Learning, ICML 2011, Bellevue, Washington, USA, June 28 - July 2, 2011, pages 833-840. Omnipress, 2011a. URL https://icml.cc/2011/papers/455_icmlpaper.pdf.
+Salah Rifai, Yann N. Dauphin, Pascal Vincent, Yoshua Bengio, and Xavier Muller. The manifold tangent classifier. In John Shawe-Taylor, Richard S. Zemel, Peter L. Bartlett, Fernando C. N. Pereira, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 24: 25th Annual Conference on Neural Information Processing Systems 2011. Proceedings of a meeting held 12-14 December 2011, Granada, Spain, pages 2294-2302, 2011b. URL https://proceedings.neurips.cc/paper/2011/bit/df44e2f09dc172978a4d3151d11d63e-Abstract.html.
+
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In Yoshua Bengio and Yann LeCun, editors, 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.06434.
+J Mercer. Functions of positive and negative type and their connection with the theory of integral equations. Philos. Trinsdictions Rogyal Soc, 209:4-415, 1909.
+Christopher K. I. Williams and Matthias W. Seeger. Using the nystrom method to speed up kernel machines. In Todd K. Leen, Thomas G. Dietterich, and Volker Tresp, editors, Advances in Neural Information Processing Systems 13, Papers from Neural Information Processing Systems (NIPS) 2000, Denver; CO, USA, pages 682-688. MIT Press, 2000. URL https://proceedings.neurips.cc/paper/2000/bit/19de10adbaa1b2ee13f77f679fa1483a-Abstract.html.
+Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In John C. Platt, Daphne Koller, Yoram Singer, and Sam T. Roweis, editors, Advances in Neural Information Processing Systems 20, Proceedings of the Twenty-First Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada, December 3-6, 2007, pages 1177-1184. Curran Associates, Inc., 2007. URL https://proceedings.neurips.cc/paper/2007/bit/013a006f03dbc5392effeb8f18fda755-Abstract.html.
+Nathan Halko, Per-Gunnar Martinsson, and Joel A. Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Rev., 53(2): 217-288, 2011. doi: 10.1137/090771806. URL https://doi.org/10.1137/090771806.
+Gene H Golub and Henk A Van der Vorst. Eigenvalue computation in the 20th century. Journal of Computational and Applied Mathematics, 123(1-2):35-65, 2000.
+Klaus-Jürgen Bathe. Solution methods for large generalized eigenvalue problems in structural engineering. National Technical Information Service, US Department of Commerce, 1971.
+James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
+Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=Sk1D9yrFPS.
+Per-Gunnar Martinsson and Joel A. Tropp. Randomized numerical linear algebra: Foundations and algorithms. Acta Numer., 29:403-572, 2020. doi: 10.1017/S0962492920000021. URL https://doi.org/10.1017/S0962492920000021.
+Alexey Dosovitskiy, Philipp Fischer, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. IEEE transactions on pattern analysis and machine intelligence, 38(9):1734-1747, 2015.
+Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=S1v4N210-.
+Liheng Zhang, Guo-Jun Qi, Liqiang Wang, and Jiebo Luo. AET vs. AED: unsupervised representation learning by auto-encoding transformations rather than data. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20,
+
+2019. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00265. URL http://openaccess.thecvf.com/content_CVPR_2019/html/Zhang_AET_vs_.AED_Unsupervised_Representation_Learning_by_Auto-Encoding_Transformations_Rather_CVPR_2019_paper.html.
+Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. CoRR, abs/2011.10650, 2020. URL https://arxiv.org/abs/2011.10650.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009a.
+Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=r1Ddp1-Rb.
+Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: A regularization method for supervised and semi-supervised learning. IEEE Trans. Pattern Anal. Mach. Intell., 41(8):1979-1993, 2019. doi: 10.1109/TPAMI.2018.2858821. URL https://doi.org/10.1109/TPAMI.2018.2858821.
+Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 1195-1204, 2017. URL https://proceedings.neurips.cc/paper/2017/bit/68053af2923e00204c3ca7c6a3150cf7-Abstract.html.
+David Berthelot, Nicholas Carlini, Ian J. Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 5050-5060, 2019. URL https://proceedings.neurips.cc/paper/2019/hash/1cd138d0499a68f4bb72bee04bbec2d7-Abstract.html.
+Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett, editors, Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 2226-2234, 2016. URL https://proceedings.neurips.cc/paper/2016/black/8a3363abe792db2d8761d6403605aab7-Abstract.html.
+Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=BJ6oOfqge.
+Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Daniel D. Lee, Masashi Sugiyama, Ulrike von Luxburg, Isabelle Guyon, and Roman Garnett, editors, Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 1163-1171, 2016. URL https://proceedings.neurips.cc/paper/2016/bitstream/30ef30b64204a3088a26bc2e6ecf7602-Abstract.html.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009b.
+Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In Yoshua Bengio and Yann LeCun, editors, 3rd
+
+International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6550.
+Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=Sks9 ajex.
+Zehao Huang and Naiyan Wang. Like what you like: Knowledge distill via neuron selectivity transfer. CoRR, abs/1707.01219, 2017. URL http://arxiv.org/abs/1707.01219.
+Sungsoo Ahn, Shell Xu Hu, Andreas C. Damianou, Neil D. Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 9163-9171. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00938. URL http://openaccess.thecvf.com/content_CVPR_2019/html/Ahn_Variational_Intermation_Distillation_for_Knowledge_Transfer_CVPR_2019_paper.html.
+Aristide Baratin, Thomas George, César Laurent, R. Devon Hjelm, Guillaume Lajoie, Pascal Vincent, and Simon Lacoste-Julien. Implicit regularization via neural feature alignment. In Arindam Banerjee and Kenji Fukumizu, editors, The 24th International Conference on Artificial Intelligence and Statistics, AISTATS 2021, April 13-15, 2021, Virtual Event, volume 130 of Proceedings of Machine Learning Research, pages 2269-2277. PMLR, 2021. URL http://proceedings.mlr.press/v130/baratin21a.html.
+Vardan Papyan. Traces of class/cross-class structure pervade deep learning spectra. Journal of Machine Learning Research, 21(252):1-64, 2020.
+Abdulkadir Canatar, Blake Bordelon, and Cengiz Pehlevan. Spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks, 2020.
+Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, Pierre-Antoine Manzagol, and León Bottou. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of machine learning research, 11(12), 2010.
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. URL https://arxiv.org/abs/1807.03748.
+Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 1597-1607. PMLR, 2020b. URL http://proceedings.mlr.press/v119/chen20j.html.
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 9726-9735. IEEE, 2020. doi: 10.1109/CVPR42600.2020.00975. URL https://doi.org/10.1109/CVPR42600.2020.00975.
+R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=Bklr3j0cKX.
+Ben Poole, Sherjil Ozair, Aaron van den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 5171-5180. PMLR, 2019. URL http://proceedings.mlr.press/v97/poole19a.html.
+
+Ruixiang Zhang, Masanori Koyama, and Katsuhiko Ishiguro. Learning structured latent factors from dependent data: a generative model framework from information-theoretic perspective. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 11141-11152. PMLR, 2020. URL http://proceedings.mlr.press/v119/zhang20m.html.
+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.
+Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2654-2662, 2014. URL https://proceedings.neurips.cc/paper/2014/bitstream/ea8fcd92d59581717e06eb187f10666d-Abstract.html.
+Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 1365-1374. IEEE, 2019. doi: 10.1109/ICCV.2019.00145. URL https://doi.org/10.1109/ICCV.2019.00145.
+Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=SkgpBJrtvS.
+Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251-276, 1998.
+Ryo Karakida and Kazuki Osawa. Understanding approximate fisher information for fast convergence of natural gradient descent in wide neural networks. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/bitnet/7b41bfa5085806dfa24b8c9de0ce567f-Abstract.html.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Richard C. Wilson, Edwin R. Hancock, and William A. P. Smith, editors, Proceedings of the British Machine Vision Conference 2016, BMVC 2016, York, UK, September 19-22, 2016. BMVA Press, 2016. URL http://www.bmva.org/bmvc/2016/papers/paper087/index.html.
+
+# A EXTENDED PRELIMINARIES
+
+We extend Sec. 2 to introduce additional technical background and related work.
+
+Kernel methods in Deep Learning. Popularized by the NTK work Jacot et al. (2018), there has been great interests in the deep learning community around the kernel view of neural networks. In particular, several works have studied the low-rank structure of the NTK, including (Baratin et al., 2021; Papyan, 2020; Canatar et al., 2020), which demonstrate that empirical NTK demonstrates low-rankness and that encourages better generalization theoretically. Our low-rank analysis of NFK shares a similar flavor, but generalizes across supervised and unsupervised learning settings. Besides, we make an explicit effort in proposing an efficient implementation of the low-rank approximation, and demonstrate strong empirical performances.
+
+Unsupervised/self supervised representation learning. Unsupervised representation learning is an old idea in deep learning. A large body of work is dedicated to designing better learning objectives (self supervised learning), including denoising (Vincent et al., 2010), contrastive learning (Oord et al., 2018; Chen et al., 2020b; He et al., 2020), mutual information based methods (Hjelm et al., 2019; Poole et al., 2019; Zhang et al., 2020) and other "pretext tasks" Jing and Tian (2020). Our attempt falls into the same category of unsupervised representation learning, but differs in that we instead focus on effectively extracting information from a standard probabilistic model. This makes our effort orthogonal to many of the related works, and can be easily plugged into different family of models.
+
+Knowledge Distillation. Knowledge distillation (KD) is generally concerned about the problem of supervising a student model with a teacher model (Hinton et al., 2015; Ba and Caruana, 2014). The general form of KD is to directly match the statistics of one or a few layers (default is the logits). Various works have studied the layer selection (Romero et al., 2015) or loss function design aspects (Ahn et al., 2019). More closely related to our work is efforts that consider the second order statistics between examples, including (Tung and Mori, 2019; Tian et al., 2020). NFKD differs in that we represent the teacher's knowledge in the kernel space, which is directly tied to the kernel interpretation of neural networks which introduces different inductive biases than layerwise representations.
+
+Neural Tangent Kernel. Recent advancements in the understanding of neural networks have shed light on the connection between neural network training and kernel methods. In (Jacot et al., 2018), it is shown that one can use the Neural Tangent Kernel (NTK) to characterize the full training of a neural network using a kernel. Let $f(\theta; \mathbf{x})$ denote a neural network function with parameters $\theta$ . The NTK is defined as follows:
+
+$$
+\mathcal {K} _ {\mathrm {n t k}} (\mathbf {x}, \mathbf {z}) = \mathbb {E} _ {\theta \sim \mathcal {P} _ {\theta}} \left\langle \nabla_ {\theta} f (\boldsymbol {\theta}; \mathbf {x}), \nabla_ {\boldsymbol {\theta}} f (\boldsymbol {\theta}; \mathbf {z}) \right\rangle . \tag {6}
+$$
+
+where $\mathcal{P}_{\theta}$ is the probability distribution of the initialization of $\pmb{\theta}$ . (Jacot et al., 2018) further demonstrates that in the large width regime, a neural network undergoing training under gradient descent essentially evolves as a linear model. Let $\pmb{\theta}_0$ denote the parameter values at initialization. To determine how the function $f_{t}(\pmb{\theta}_{t};\mathbf{x})$ evolves, we may naively Taylor expand the output around $\pmb{\theta}_0$ : $f_{t + 1}(\pmb{\theta}_{t + 1};\mathbf{x})\approx f_t(\pmb {\theta}_t;\mathbf{x}) - \eta \nabla_{\pmb{\theta}_t}f_t(\pmb {\theta}_t;\mathbf{x})^\top (\pmb{\theta}_{t + 1} - \pmb {\theta}_t)$ . As the weight updates are given by $\pmb{\theta}_{t - 1} - \pmb{\theta}_t = -\frac{1}{N}\eta \sum_{i = 1}^{m}\nabla_{\pmb{\theta}_t}\mathcal{L}_t(x_i)$ , hence we have $f_{t + 1}(\pmb{\theta}_{t + 1};\mathbf{x})\approx f_t(\pmb {\theta}_t;\mathbf{x}) - \eta \frac{1}{N}\sum_{i = 1}^N\mathcal{K}_{\mathrm{ntk}}(\mathbf{x},\mathbf{x}_i)\nabla_f\mathcal{L}_t(\mathbf{x}_i)$ .
+
+The significance of the NTK stems from two observations. 1) When suitably initialized, the NTK converges to a limit kernel when the width tends to infinity $\lim_{\mathrm{width}\to \infty}\mathcal{K}_{\mathrm{ntk}}(\mathbf{x},\mathbf{z};\pmb {\theta}_0) = \mathring{\mathcal{K}}_{\mathrm{ntk}}(\mathbf{x},\mathbf{z})$ 2) In that limit, the NTK remains frozen in its limit state throughout training.
+
+# B ON THE CONNECTIONS BETWEEN NFK AND NTK
+
+In Sec 3.1, we showed that our definition of NFK in the supervised learning setting bares great similarity to the NTK. We provide more discussion here on the connections between NFK and NTK.
+
+For the L2 regression loss function, the empirical fisher information reduces to $\mathcal{I} = \frac{1}{N}\sum_{i=1}^{N}\nabla_{\theta}f_{\theta}(\mathbf{x})\nabla_{\theta}f_{\theta}(\mathbf{x})^{\top}$ . Note that the fisher information matrix $\mathcal{I}$ is given by a covariance matrix of $J$ , while the NTK matrix is defined as the Gram matrix of $J$ , where $J$ is the Jacobian matrix, implying they share the same spectrum, and that the NTK and the NFK share the same eigenvectors. The addition of $\mathcal{I}^{-1}$ in the definition of $\kappa_{nk}$ can be seen as a form of conditioning, facilitating fast convergence in all directions spanned by $J$ .
+
+Algorithm 3 Our proposed method: compute low-rank NFK feature embedding
+1: $\mathbf{V} = \Phi \mathrm{diag}(\Sigma)\mathbf{P}^{\top},\mathbf{P}\in \mathbb{R}^{|\boldsymbol {\theta}|\times k}$ via truncated_svd(X, $f_{\theta}$ ,topk=K, kernel_type="NFK")
+2:
+3: compute $\kappa (\mathbf{x},\mathbf{X})^\top \Phi_i\approx V_{\mathbf{x}}\mathrm{diag}(\Sigma_i)\mathbf{P}_i$ via JVP evaluation
+4: obtain $\mathbf{e}_{\mathrm{nfk}}(\mathbf{x}^{*})\in \mathbb{R}^{k}$ via Eq. 5 and Eq. 4
+
+Equation 3 also has immediate connections to NTK. In NTK, the kernel $\mathbf{K}_{\mathrm{ntk}}(\mathbf{x},\bar{\mathbf{x}})\in \mathbb{R}^{N\times N}$ is a matrix which measures the dot product of Jacobian for every pair of logits. The NFK, on the other hand, reduces the Jacobian $\nabla_{\theta}f_{\theta}(\mathbf{x})$ for each example $\mathbf{x}$ to a single vector of dimension $n$ (i.e., size of $\pmb{\theta}$ ), weighted by the predicted probability of each class $p_{\theta}(\mathbf{y}|\mathbf{x})$ . The other notable difference between NFK and NTK is the subtractive and normalize factors, represented by $\mathbb{E}_{\mathbf{x}'\sim p_{\theta}(\mathbf{x}')}\sum_{\mathbf{y}}p_{\theta}(\mathbf{y}|\mathbf{x})\nabla_{\theta}f_{\theta}^{\mathbf{Y}}(\mathbf{x}')$ and $\mathcal{I}$ , respectively. This distinction is related to the difference between Natural Gradient Descent (Amari, 1998; Karakida and Osawa, 2020) and gradient descent. In a nutshell, our definition of NFK in the supervised learning setting can be considered as a reduced version of NTK, with proper normalization. These properties make NFK much more scalable w.r.t. the number of classes, and also less sensitive to the scale of model's parameters.
+
+To better see this, we can define an "unnormized" version of NFK as $\mathcal{K}_u(\mathbf{x},\bar{\mathbf{x}}) = [\sum_{\mathbf{y}}p_\theta (\mathbf{y}\mid$ $\mathbf{x})\nabla_{\boldsymbol{\theta}}f_{\boldsymbol{\theta}}^{\mathbf{y}}(\mathbf{x})]^\top \sum_{\mathbf{y}}p_{\boldsymbol{\theta}}(\mathbf{y}\mid \bar{\mathbf{x}})\nabla_{\boldsymbol{\theta}}f_{\boldsymbol{\theta}}^{\mathbf{y}}(\bar{\mathbf{x}})$ . It is easy to see that $\kappa_{u}$ has the same rank as the original NFK $\kappa$ , as $\mathcal{I}^{-1}$ is full rank by definition. We can then further rewrite it as
+
+$$
+\mathcal {K} _ {u} (\mathbf {x}, \bar {\mathbf {x}}) = \sum_ {\mathbf {y}} \sum_ {\bar {\mathbf {y}}} p _ {\theta} (\mathbf {y} \mid \mathbf {x}) p _ {\theta} (\bar {\mathbf {y}} | \bar {\mathbf {x}}) \nabla_ {\theta} f _ {\theta} ^ {\mathbf {y}} (\mathbf {x}) ^ {\top} \nabla_ {\theta} f _ {\theta} ^ {\bar {\mathbf {y}}} (\bar {\mathbf {x}}) = \sum_ {\mathbf {y}} \sum_ {\bar {\mathbf {y}}} p _ {\theta} (\mathbf {y} \mid \mathbf {x}) p _ {\theta} (\bar {\mathbf {y}} \mid \bar {\mathbf {x}}) \mathcal {K} _ {\mathrm {n t k}} ^ {\mathbf {y}, \bar {\mathbf {y}}} (\mathbf {x}, \bar {\mathbf {x}}) \tag {7}
+$$
+
+In words, the unnormalized version of NFK can be considered as a reduction of NTK, where the weights of each element is weight by the predicted probability for the respective class. If we further assume that the model of interest is well trained, as is often the case in knowledge distillation, we can approximate the $\mathcal{K}_u$ as $\mathcal{K}_{\mathrm{ntk}}^{\mathbf{y}^*,\bar{\mathbf{y}}^*}(\mathbf{x},\bar{\mathbf{x}})$ , where $\mathbf{y}^{*} = \arg \max_{\mathbf{y}}p_{\theta}(\mathbf{y}\mid \mathbf{x})$ and likewise for $\bar{\mathbf{y}}^{*}$ . This suggests that the unnormalized NFK can roughly viewd as a downsampled version of NTK. As a result, we expect the unnormalized NFK (and hence the NFK) to exhibit similar low rank properties as demonstrated in the NTK literature.
+
+On the low-rank structure of NTK. Consider the NTK Gram matrix $\mathbf{K}_{\mathrm{ntk}} \in \mathbb{R}^{N \times N}$ of some network. Given the dataset $\{\mathbf{x}_i\}_{i=1}^N$ (for simplicity we assume a scalar output) and its eigen decomposition $\mathbf{K}_{\mathrm{ntk}} = \sum_{j=1}^{m} \lambda_j \mathbf{u}_j \mathbf{u}_j^\top$ . Let $f \in \mathbb{R}^N$ denote the concatenated outputs. Under GD in the linear regime, the outputs $f_t$ evolves according to:
+
+$$
+\forall_ {j}, \mathbf {u} _ {j} ^ {\top} \left(f _ {t + 1} - f _ {t}\right) \approx - \eta \lambda_ {j} \mathbf {u} _ {j} ^ {\top} \nabla_ {f} \mathcal {L}. \tag {8}
+$$
+
+The updates $f_{t + 1} - f_t$ projected onto the bases of the kernel therefore converge at different speeds, determined by the eigenvalues $\{\lambda_j\}$ . Intuitively, a good kernel-data alignment means that the $\nabla_f\mathcal{L}$ is spanned by a few eigenvectors with large corresponding eigenvalues, speeding up convergence and promoting generalization.
+
+# C NEURAL FISHER KERNEL WITH LOW-RANK APPROXIMATION
+
+# C.1 NEURAL FISHER KERNEL FORMULATION
+
+We provide detailed derivations of the various NFK formulations presented in Section 3.
+
+NFK for Energy-based Models. Consider an Energy-based Model (EBM) $p_{\theta}(\mathbf{x}) = \frac{\exp(-E(\mathbf{x};\boldsymbol{\theta}))}{Z(\boldsymbol{\theta})}$ , where $E(\mathbf{x})$ is the energy function parametrized by $\boldsymbol{\theta}$ and $Z(\boldsymbol{\theta}) = \int \exp(-E(\mathbf{x};\boldsymbol{\theta})) \, \mathrm{d}\mathbf{x}$ is the
+
+Algorithm 4 truncated_svd, Truncated SVD Algorithm for Low-rank Kernel Approximation. Comments are based on NTK for simplicity.
+Input Dataset $\mathbf{X}\equiv \{\mathbf{x}_i\}_{i = 1}^N$
+Input Neural network model $f_{\theta}$
+Input Kernel type kernel, NFK or NTK
+Input Low-rank embedding size $K$
+Input Number of power iterations $L = 10$
+Input Number of over samples $U = 10$
+Output Truncated SVD of Jacobian $J_{\theta}(\mathbf{X})\approx \mathbf{P}_{k}\Sigma_{k}\mathbf{Q}_{k}^{\top}$
+1: $U = K + U$ ▷ Size of augmented set of vectors in power iterations
+2: Draw random matrix $\Omega \in \mathbb{R}^{N\times U}$
+3: $\Omega =$ matrix_jacobian_product $(f_{\theta},\mathbf{X},\Omega ,\mathrm{kernel})$ ▷ $\Omega = J_{\theta}(\mathbf{X})\Omega \in \mathbb{R}^{M\times U}$
+4: for step $= 1$ to $L$ do
+5: $\Omega =$ jacobian_matrix_product $(f_{\theta},\mathbf{X},\Omega ,\mathrm{kernel})$ ▷ $\Omega = J_{\theta}^{\top}(\mathbf{X})\Omega \in \mathbb{R}^{N\times U}$
+6: $\Omega =$ matrix_jacobian_product $(f_{\theta},\mathbf{X},\Omega ,\mathrm{kernel})$ ▷ $\Omega = J_{\theta}(\mathbf{X})\Omega \in \mathbb{R}^{M\times U}$
+7: $\Omega = qr\_ decomposition(\Omega)$
+8: end for
+9: $\mathbf{B} =$ jacobian_matrix_product $(f_{\theta},\mathbf{X},\Omega ,\mathrm{kernel})$ ▷ $\mathbf{B} = J_{\theta}^{\top}(\mathbf{X})\Omega \in \mathbb{R}^{N\times U}$
+10: $\mathbf{P},\boldsymbol {\Sigma},\mathbf{Q}^{\top} = \operatorname {svd}(\mathbf{B}^{\top})$
+11: $\mathbf{P} = \boldsymbol {\Omega}\mathbf{P}$
+12: Keep top rank- $K$ vectors to obtain the truncated results $\mathbf{P}_k,\Sigma_k,\mathbf{Q}_k^\top$
+13: Return $\mathbf{P}_k,\Sigma_k,\mathbf{Q}_k^\top$
+
+Algorithm 5 jacobian_matrix_product
+Input Neural network model $f_{\theta}$
+Input Input data $\mathbf{X} \in \mathbb{R}^{B \times D}$ , where $B$ is batch size
+Input Input matrix M
+Input Kernel type kernel, NFK or NTK
+Output $J_{\theta}^{\top}(\mathbf{X})\mathbf{M}$ for NTK, Fisher-vector-matrix-product $V_{\theta}^{\top}(\mathbf{X})\mathbf{M}$ for NFK
+1: jmp_fn = jax.vmap(jax.jvp)
+2: $\mathbf{P} = \mathrm{jmp\_fn}(f_{\theta}, \mathbf{X}, \mathbf{M})$
+3: if kernel = "NFK" then
+4: $\mathbf{P} = \mathrm{diag}(\mathcal{I})^{-\frac{1}{2}}(\mathbf{P} - \mathbf{Z}_{\theta}^{\top}\mathbf{M})$
+5: end if
+6: Return P
+
+partition function, we could apply the Fisher kernel formulation to derive the Fisher score $U_{\mathbf{x}}$ as
+
+$$
+\begin{array}{l} U _ {\mathbf {x}} = \nabla_ {\boldsymbol {\theta}} \log p _ {\boldsymbol {\theta}} (\mathbf {x}) = \nabla_ {\boldsymbol {\theta}} \log [ \exp (- E (\mathbf {x}; \boldsymbol {\theta})) ] - \nabla_ {\boldsymbol {\theta}} \log Z (\boldsymbol {\theta}) \\ = - \nabla_ {\boldsymbol {\theta}} E (\mathbf {x}; \boldsymbol {\theta}) - \nabla_ {\boldsymbol {\theta}} \log Z (\boldsymbol {\theta}) \\ = - \nabla_ {\boldsymbol {\theta}} E (\mathbf {x}; \boldsymbol {\theta}) - \mathbb {E} _ {\mathbf {x} \sim p _ {\boldsymbol {\theta}} (\mathbf {x})} \nabla_ {\boldsymbol {\theta}} \log [ \exp (- E (\mathbf {x}; \boldsymbol {\theta})) ] \tag {9} \\ = \mathbb {E} _ {\mathbf {x} \sim p _ {\theta} (\mathbf {x})} \nabla_ {\boldsymbol {\theta}} E (\mathbf {x}; \boldsymbol {\theta}) - \nabla_ {\boldsymbol {\theta}} E (\mathbf {x}; \boldsymbol {\theta}) \\ \end{array}
+$$
+
+Then we can obtain the FIM $\mathcal{I}$ and the Fisher vector $V_{\mathbf{x}}$ from above results, shown as below
+
+$$
+\mathcal {I} = \underset {1} {\mathbb {E}} _ {\mathbf {x} \sim p _ {\theta} (\mathbf {x})} \left[ U _ {\mathbf {x}} U _ {\mathbf {x}} ^ {\top} \right] \tag {10}
+$$
+
+$$
+V _ {\mathbf {x}} = \mathcal {I} ^ {- \frac {1}{2}} U _ {\mathbf {x}}
+$$
+
+NFK for GANs. As introduced in Section 3, we consider the EBM formulation of GANs. Given pre-trained GAN model, we use $D(\mathbf{x};\pmb{\theta})$ to denote the output of the discriminator $D$ , and use $G(\mathbf{h})$ to denote the output of generator $G$ given latent code $\mathbf{h} \sim p(\mathbf{h})$ . Then we have the energy-function defined as $E(\mathbf{x};\pmb{\theta}) = -D(\mathbf{x};\pmb{\theta})$ . Based on the NFK formulation for EBMs, we can simply substitute
+
+Algorithm 6 matrix_jacobian_product
+Input Neural network model $f_{\theta}$
+Input Input data $\mathbf{X}\in \mathbb{R}^{B\times D}$ , where $B$ is batch size
+Input Input matrix M
+Input Kernel type kernel, NFK or NTK
+Output $J_{\theta}(\mathbf{X})\mathbf{M}$ for NTK, Fisher-vector-matrix-product $V_{\theta}(\mathbf{X})\mathbf{M}$ for NFK
+1: mjp_fn = jax.vmap(jax.vjp)
+2: $\mathbf{P} = \mathrm{mjp\_fn}(f_{\theta},\mathbf{X},\mathbf{M})$
+3: if kernel $=$ "NFK" then
+4: $\mathbf{P} = \mathrm{diag}(\mathcal{I})^{-\frac{1}{2}}(\mathbf{P} - \mathbf{Z}_{\theta}\mathbf{M})$
+5: end if
+6: Return P
+
+$E(\mathbf{x};\pmb {\theta}) = -D(\mathbf{x};\pmb {\theta})$ into Eq. 9 and Eq. 10 and derive the NFK formulation for GANs as below
+
+$$
+U _ {\mathbf {x}} = \nabla_ {\boldsymbol {\theta}} D (\mathbf {x}; \boldsymbol {\theta}) - \mathbb {E} _ {\mathbf {h} \sim p (\mathbf {h})} \nabla_ {\boldsymbol {\theta}} D (G (\mathbf {h}); \boldsymbol {\theta})
+$$
+
+$$
+\mathcal {I} = \mathbb {E} _ {\mathbf {h} \sim p (\mathbf {h})} \left[ U _ {G (\mathbf {h})} U _ {G (\mathbf {h})} ^ {\top} \right] \tag {11}
+$$
+
+$$
+V _ {\mathbf {x}} = \left(\operatorname {d i a g} (\mathcal {I}) ^ {- \frac {1}{2}}\right) U _ {\mathbf {x}}
+$$
+
+$$
+\mathcal {K} _ {\mathrm {n f k}} (\mathbf {x}, \mathbf {z}) = \left\langle V _ {\mathbf {x}}, V _ {\mathbf {z}} \right\rangle
+$$
+
+Note that we use diagonal approximation of FIM throughout this work for the consideration of scalability. Also, since the generator of GANs is trained to match the distribution induced by the discriminator's EBM from the perspective of variational training for GANs, we could use the samples generated by the generator to approximate $\mathbf{x} \in p_{\theta}(\mathbf{x})$ , which is reflected in above formulation.
+
+NFK for VAEs, Flow-based Models, Auto-Regressive Models. For models including VAEs, Flow-based Models, Auto-Regressive Models, where explicit or approximate density estimation is available, we can simply apply the classical Fisher kernel formulation as introduced in the main text.
+
+NFK for Supervised Learning Models. In the supervised learning setting, we consider conditional probabilistic models $p_{\theta}(\mathbf{y} \mid \mathbf{x}) = p(\mathbf{y} \mid \mathbf{x}; \boldsymbol{\theta})$ . In particular, we focus on classification problems where the conditional probability is parameterized by a softmax function over the logits output $f(\mathbf{x}; \boldsymbol{\theta})$ : $p_{\theta}(\mathbf{y} \mid \mathbf{x}) = \exp(f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})) / \sum_{\mathbf{y}} \exp(f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta}))$ , where $\mathbf{y}$ is a discrete label and $f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})$ denotes $\mathbf{y}$ -th logit output. We then borrow the idea from JEM (Grathwohl et al., 2020) and write out a joint energy function term over $(\mathbf{x}, \mathbf{y})$ as $E(\mathbf{x}, \mathbf{y}; \boldsymbol{\theta}) = -f^{\mathbf{y}}(\mathbf{x}; \boldsymbol{\theta})$ . It is easy to see that joint energy yields exactly the same conditional probability, at the same time leading to a free energy function:
+
+$$
+E (\mathbf {x}; \boldsymbol {\theta}) = - \log \sum \exp (f ^ {\mathbf {y}} (\mathbf {x}; \boldsymbol {\theta}))
+$$
+
+$$
+\nabla_ {\theta} E (\mathbf {x}; \theta) = - \sum_ {\mathbf {y}} ^ {\mathbf {y}} p _ {\theta} (\mathbf {y} \mid \mathbf {x}) \nabla_ {\theta} f ^ {\mathbf {y}} (\mathbf {x}; \theta) \tag {12}
+$$
+
+Based on the NFK formulation for EBMs, we can simply substitute above results into Eq. 9 and Eq. 10 and derive the NFK formulation for GANs as below
+
+$$
+U _ {\mathbf {x}} = \sum_ {\mathbf {y}} p _ {\boldsymbol {\theta}} (\mathbf {y} \mid \mathbf {x}) \nabla_ {\boldsymbol {\theta}} f ^ {\mathbf {y}} (\mathbf {x}; \boldsymbol {\theta}) - \mathbb {E} _ {\mathbf {x} ^ {\prime} \sim p _ {\boldsymbol {\theta}} (\mathbf {x} ^ {\prime})} \sum_ {\mathbf {y}} p _ {\boldsymbol {\theta}} (\mathbf {y} \mid \mathbf {x}) \nabla_ {\boldsymbol {\theta}} f ^ {\mathbf {y}} \left(\mathbf {x} ^ {\prime}; \boldsymbol {\theta}\right) \tag {13}
+$$
+
+$$
+\mathcal {I} = \mathbb {E} _ {\mathbf {x} \sim p _ {\boldsymbol {\theta}} (\mathbf {x})} \left[ U _ {\mathbf {x}} U _ {\mathbf {x}} ^ {\top} \right]
+$$
+
+$$
+V _ {\mathbf {x}} = \left(\operatorname {d i a g} (\mathcal {I}) ^ {- \frac {1}{2}}\right) U _ {\mathbf {x}} \tag {14}
+$$
+
+$$
+\mathcal {K} _ {\mathrm {n f k}} (\mathbf {x}, \mathbf {z}) = \langle V _ {\mathbf {x}}, V _ {\mathbf {z}} \rangle
+$$
+
+# C.2 EFFICIENT LOW-RANK NFK/NTK APPROXIMATION VIA TRUNCATED SVD
+
+We provide mode details on experimental observations on the low-rank structure of NFK and the low-rank kernel approximation algorithm here.
+
+
+(a) NFK
+
+
+(b) PCA
+Figure 4: Inverting a DCGAN with 100d NFK embeddings (a), compared with image reconstruction with 100d PCA embeddings (b). In either case, the left plot corresponds to real test images and the right corresponds to the reconstructions. Note that NFK embeddings care capable of inverting a GAN by producing high quality semantic reconstructions. With PCA, embeddings with the same dimensionality produces more blurry reconstructions (thus less semantic).
+
+# Low-Rank Structure of NFK.
+
+For supervised learning models, we trained a LeNet-5 (LeCun et al., 1998) CNN and a 3-layer MLP network by minimizing binary cross entropy loss, and then compute the eigen-decomposition of the NFK Gram matrix. For unsupervised learning models, we trained a small unconditional DCGAN (Radford et al., 2016) model on MNIST dataset. We deliberately selected a small discriminator, which consists of $17\mathrm{K}$ parameters. Because of the relatively low-dimensionality of $\theta$ in the discriminator, we were able to directly compute the Fisher Vectors for a random subset of the training dataset. We then performed standard SVD on the gathered Fisher Vector matrix, and examined the spectrum statistics. In particular, we plot the explained variance ration quantity, defined as $r_k = \frac{\sum_{i=1}^k \lambda_i^2}{\sum_{i=1}^k \lambda_i^2}$ where $\lambda_i$ is the $i$ -th singular value. In addition, we have also visualized the top 5 principle components, by showing example images which have the largest projections on each component in Fig. 6.
+
+Furthermore, we conducted a GAN inversion experiment. We start by sampling a set of latent variables from the generator's prior $\mathbf{h} \in p(\mathbf{h})$ , and get a set of generated example $\{\mathbf{x}_i\}, \mathbf{x}_i = G(\mathbf{h}_i), i = 1, \dots, n$ . We then apply Algorithm 2 on the generated example $\{\mathbf{x}_i\}$ to obtain their NFK embeddings $\{\mathbf{e}(\mathbf{x}_i)\}$ , and we set the dimension of both $h$ and $e$ to 100. We now have a compositional mapping that reads as $\mathbf{h} \to \mathbf{x} \to \mathbf{e}$ . We then learn a linear mapping $\mathbf{W} \in R^{100 \times 100}$ from $\{\mathbf{e}(\mathbf{G}(\mathbf{h}_i))\}$ to $\{\mathbf{h}_i\}$ by minimizing $\sum_{i=1}^{n} \| \mathbf{h}_i - \mathbf{We}(\mathbf{G}(\mathbf{h}_i)) \|^2$ . In doing so, we have constructed an auto encoder from a regular GAN, with the compositional mapping of $\mathbf{x} \to \mathbf{e} \to \mathbf{h} \to \tilde{\mathbf{x}}$ , where $\tilde{\mathbf{x}}$ is the reconstruction of an input $\mathbf{x}$ . The reconstructions are shown in Figure 4 (a). Interestingly, the 100d SVD embedding gives rise to a qualitatively faithful reconstruction on real images. n contrast, a PCA embedding with the same dimension gives much more blurry reconstructions (eg., noise in the background), as shown in Figure 4 (b). This is a good indication that the 100d embedding captures most of the information about an input example.
+
+Power iteration of NFK as JVP/VJP evaluations. Our proposed algorithm is based on the Power method Golub and Van der Vorst (2000); Bathe (1971) for finding the leading top eigenvectors of
+
+
+Figure 5: The low-rankness of the NFK on a DCGAN trained on MNIST. For a trained model, the first 100 principle components of the Fisher Vector matrix explains $99.5\%$ of all variances. An untrained model with the same architecture on the other hand, demonstrates a much lower degree of low-rankness.
+
+
+Figure 6: Images with the largest projections on the first five principle components. Each row corresponds to a principle component.
+
+the real symmetric matrix. Starting from a random vector $\mathbf{v}_0$ drawn from a rotationally invariant distribution and normalize it to unit norm $\| \mathbf{v}_0\| = 1$ , the power method iteratively constructs the sequence $\mathbf{v}_{t + 1} = \frac{\mathbf{K}\mathbf{v}_t}{\|\mathbf{K}\mathbf{v}_t\|}$ up to $q$ power iterations. Given the special structure of $\mathbf{K}$ that it's a Gram matrix of the Jacobian matrix $J_{\theta}(\mathbf{X})\in \mathbb{R}^{D\times N}$ , to evaluate $\mathbf{K}\mathbf{v}_t$ in each power iteration step we need to evaluate $J_{\theta}(\mathbf{X})^{\top}J_{\theta}(\mathbf{X})\mathbf{v}_t$ , which can be decomposed as: (i) evaluating $\mathbf{z}_t = J_\theta (\mathbf{X})\mathbf{v}_t$ , and then (ii) $\mathbf{K}\mathbf{v}_t = J_\theta (\mathbf{X})^\top \mathbf{z}_t$ . Note that when $\mathbf{K}$ is in the form of NTK of neural networks, step (i) of evaluating $\mathbf{z}_t$ is a Vector-Jacobian-Product (VJP) and step (ii) is a Jacobian-Vector-Product (JVP). With the help of automatic-differentiation techniques, we can evaluate both JVP and VJP efficiently, which only requires the same order of computational costs of one backward-pass and forward-pass of neural networks respectively. In this way, we can reduce the Kernel matrix vector product operation in each power iteration step to one VJP evaluation and one JVP evaluation, without the need to computing and storing the Jacobian matrix and kernel matrix explicitly.
+
+As introduced in Section 3.2, we include detailed algorithm description here, from Algorithm. 3 to Algorithm. 6. In Algorithm. 3, we show the algorithm to compute the low-rank NFK embedding, which can be used as data representations. In Algorithm. 4, we present our proposed automatic-differentiation based truncated SVD algorithm for kernel approximation. Note that in Algorithm. 5 and 6, we only need to follow Equation. 3 to pre-compute the model distribution statistics, $\mathbf{Z}_{\theta} = \mathbb{E}_{\mathbf{x}'\sim p_{\theta}(\mathbf{x}')}\sum_{\mathbf{y}}p_{\theta}(\mathbf{y}|\mathbf{x})\nabla_{\theta}f_{\theta}^{\mathbf{y}}(\mathbf{x}')$ , and FIM $\mathcal{I} = \mathbb{E}_{\mathbf{x}'\sim p_{\theta}(\mathbf{x}')}[U_{\mathbf{x}'}U_{\mathbf{x}'}^\top]$ . We adopt
+
+
+Figure 7: Linear probing accuracy on CIFAR10 with different number of principle components in embedding. We use our proposed low-rank approximation method to compute the embedding from the teacher model on CIFAR10 for knowledge distillation.
+
+the EBM formulation of classifier $f_{\theta}(\mathbf{x})$ then replace the Jacobian matrix $J_{\theta}(\mathbf{X})$ with the Fisher vector matrix $V_{\theta}(\mathbf{X}) = \mathrm{diag}(\mathcal{I})^{-\frac{1}{2}}(J_{\theta}(\mathbf{X}) - \mathbf{Z}_{\theta})$ . Note that our proposed algorithm is also readily applicable to empirical NTK via replacing the FIM by the identity matrix.
+
+# D EXPERIMENTS SETUP
+
+# D.1 QUALITY ANEFFICIENCY OFLOW-RANKNFK APPROXIMATIONS
+
+Experiments on Computational Cost. We randomly sample $N \in \{2^k : 7 \leq k \leq 16\}$ data examples from CIFAR-10 dataset, and compute top-32 eigenvectors of the NFK Gram matrix $(\mathbb{R}^{N \times N})$ by truncated SVD. We use same number of power iterations (10) in baseline method and our algorithm. We show in Fig. 3 the running time of SVD for both methods in terms of number of data examples $N$ .
+
+Experiments on Approximation Accuracy. We randomly sample 10000 examples and compute top-128 eigenvalues using both baseline methods and our proposed algorithm. Specifically, we compute the full Gram matrix and perform eigen-decomposition to obtain baseline results. For our implementation, we run 10 power iterations in randomized SVD.
+
+# D.2 NEURAL FISHER KERNEL DISTILLATION
+
+With the efficient low-rank approximation of NFK, one can immediately obtain a compact representation of the kernel. Namely, each example can be represented as a $k$ dimension vector. Essentially, we have achieved a form of kernel distillation, which is a useful technique on its own.
+
+Furthermore, we can use $Q$ as an generalized form for teacher student styled knowledge distillation (KD), as in (Hinton et al., 2015). In standard KD, one obtains a teacher network (e.g., deep model) and use it to train a student network (e.g., a shallow model) with a distillation loss in the following format:
+
+$$
+\mathcal {L} _ {\mathrm {k d}} (\mathbf {x}, \mathbf {y}) = \alpha * \mathcal {L} _ {\text {c l s}} \left(f _ {s} (\mathbf {x}), \mathbf {y}\right) + (1 - \alpha) * \mathcal {L} _ {t} \left(f _ {s} (\mathbf {x}), f _ {t} (\mathbf {x})\right), \tag {15}
+$$
+
+where $L_{cls}$ is a standard classification loss (e.g., cross entropy) and $L_{t}$ is a teacher loss which forces the student network's output $f_{s}$ to match that of the teacher $f_{t}$ . We propose a straightforward extension of KD with NFK, where we modify the loss function to be:
+
+$$
+\mathcal {L} _ {\mathrm {n f k d}} (\mathbf {x}, \mathbf {y}) = \alpha * \mathcal {L} _ {\text {c l s}} \left(f _ {s} (\mathbf {x}), \mathbf {y}\right) + (1 - \alpha) * \mathcal {L} _ {t} \left(h _ {s} (\mathbf {x}), Q _ {t} (\mathbf {x})\right), \tag {16}
+$$
+
+where $Q_{t}(\mathbf{x})$ denotes the $k$ dimensional embedding from the SVD of teacher NFK, for example $\mathbf{x}$ . $h_s$ is a prediction head from the student, and $L_{t}$ is overloaded to denote a suitable loss (e.g., $\ell 2$ distance or cosine distance). Equation 16 essentially uses the low dimension embedding of the teacher's NFK as supervision, inplace of the teacher's logits. There are arguable benefits of using $L_{nfkd}$ over $L_{kd}$ .
+
+For example, when the number of classes is small, the logit layer contains very little extra information (measured in number of bits) than the label alone, whereas $\dot{Q}_t$ can still provide dense supervision to the student.
+
+For the Neural Fisher Kernel Distillation (NFKD) experiments, we adopt the WideResNet-40x2 (Zagoruyko and Komodakis, 2016) neural network as the teacher model. We train another WideResnet with 16 layers as the student model, and keep the width unchanged. We run 10 power iterations to compute the SVD approximation of the NFK of the teacher model, to obtain the top-20 eigenvectors and eigenvalues. Then we train the student model with the additional NFKD distillation loss using mini-batch stochastic gradient descent, with 0.9 momentum, for 250 epochs. The initial learning rate begins at 0.1 and we decay the learning rate by 0.1 at 150-th epoch and decay again by 0.1 at 200-th epoch. We also show the linear probing accuracies on CIFAR10 by using different number of embedding dimensions in Figure. 7.
\ No newline at end of file
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/images.zip b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..66e4f269a7a3c8e41e476f47b5d280fab44536f4
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:877c6be3cbf69a76c0c2aca39a0400be42215ca60890faf89030c97d183f96ae
+size 542369
diff --git a/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/layout.json b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..764a07341004b53395699bb0f60a009d43ae0893
--- /dev/null
+++ b/learningrepresentationfromneuralfisherkernelwithlowrankapproximation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:efa90f126f454cf80169d1b45c9c9450cddb20c3394dd70ccba1dcc645034056
+size 831060
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_content_list.json b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ba1aabfcaaedf698191b0798b603c55c46d31a7f
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:347acb8b301e2b4f60a7f023eae206f623112b0065108b4901d61ff46f84864f
+size 136877
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_model.json b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..c9129066315226c243a94ca53841d4fce58bf239
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9ff58fd38f83ba5f820dfce4587a51671bcd4f70f9e3462e019eb7ed3614258
+size 157359
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_origin.pdf b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4373969a02a8752568255c5cee1400d16fb44bf4
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/8f1e6b81-497d-483b-bc39-8299bbef4169_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eac2d1ee25a9852fbfa70fff9e5563a56f552ffca63d73f21b534a876dc2908f
+size 1005661
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/full.md b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..195c6988995ce4dab2062cf5978c354495d9b790
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/full.md
@@ -0,0 +1,477 @@
+# LEARNING SCENARIO REPRESENTATION FOR SOLVING TWO-STAGE STOCHASTIC INTEGER PROGRAMS
+
+Yaoxin Wu $^{1*}$ , Wen Song $^{2*}$ , Zhiguang Cao $^{3\dagger}$ , Jie Zhang $^{1}$
+
+$^{1}$ School of Computer Science and Engineering, Nanyang Technological University, Singapore
+
+$^{2}$ Institute of Marine Science and Technology, Shandong University, Qingdao, China
+
+$^{3}$ Singapore Institute of Manufacturing Technology, A*STAR, Singapore
+
+{wuyaoxin,zhangj}@ntu.edu.sg; wensong@email.sdu.edu.cn
+
+# ABSTRACT
+
+Many practical combinatorial optimization problems under uncertainty can be modeled as stochastic integer programs (SIPs), which are extremely challenging to solve due to the high complexity. To solve two-stage SIPs efficiently, we propose a conditional variational autoencoder (CVAE) based method to learn scenario representation for a class of SIP instances. Specifically, we design a graph convolutional network based encoder to embed each scenario with the deterministic part of its instance (i.e. context) into a low-dimensional latent space, from which a decoder reconstructs the scenario from its latent representation conditioned on the context. Such a design effectively captures the dependencies of the scenarios on their corresponding instances. We apply the trained encoder to two tasks in typical SIP solving, i.e. scenario reduction and objective prediction. Experiments on two graph-based SIPs show that the learned representation significantly boosts the solving performance to attain high-quality solutions in short computational time, and generalizes fairly well to problems of larger sizes or with more scenarios.
+
+# 1 INTRODUCTION
+
+Stochastic integer programs (SIPs) are a class of combinatorial optimization problems (COPs) with uncertain parameters. They focus on finding a best decision for a practical task to optimize both the deterministic cost and the expectation of stochastic costs on a set of potential scenarios. Since the uncertain elements commonly exist in reality, SIPs are widely applied and studied in many fields such as transportation, inventory management, energy optimization, and so on (Jammeli et al., 2019; Dillon et al., 2017; Bruno et al., 2016; Wallace & Ziemba, 2005). However, optimally solving SIP is intractable especially when many scenarios are involved, due to the fact that: 1) most integer programs themselves are already NP-hard; 2) considerable (even continuous) scenarios significantly increase the computational complexity (Klein, 2021). In reality, solving moderate-sized problems may require prohibitively long time. Thus efficient and high-quality approximate solutions for SIPs are often practically pursued.
+
+The advances in deep (reinforcement) learning has aroused extensive studies on solving optimization problems with neural networks. The related works have shown promising results in tackling some classic COPs, e.g., vehicle routing, job shop scheduling, combinatorial auction, etc. (Kool et al., 2019; Zhang et al., 2020; Lee et al., 2020; Kwon et al., 2020; Gasse et al., 2019; Chen & Tian, 2019; Ichter et al., 2018; Hottung et al., 2020; Wu et al., 2021). However, most of the existing deep learning based methods only focus on deterministic problems, which could hinder their practical applications in the uncertain situation. On the other hand, a few early attempts introduce deep learning to solve SIPs (Larsen et al., 2018; Abbasi et al., 2020; Joe & Lau, 2020; Bengio et al., 2020; Nair et al., 2018). However, they are generally designed for only specific problems and also lack the ability of generalizing across different problem sizes.
+
+In this paper, we focus on graph-based SIPs, which is a general class of problems with broad applications. We propose to learn the deep latent representation of scenarios in SIPs, which can be
+
+applied to various downstream tasks in solving SIPs, e.g., scenario reduction and objective prediction. Based on the basic two-stage form of SIPs, we leverage conditional variational autoencoder (CVAE) to learn latent and continuous representations of stochastic scenarios while considering the deterministic part of a SIP instance, which we term the context. Specifically, we employ a graph convolutional network (GCN) to learn embeddings of each deterministic integer program, which models the first-stage problem with a single scenario. The learned embeddings are mapped into continuous representations, and then decoded back into corresponding scenarios given the embedding of the context. This design ensures that the learned representations of scenarios are correctly linked to the corresponding instances.
+
+The resulting latent space well represents scenarios in a class of SIP instances, and we demonstrate its power with two tasks commonly used in solving SIPs. First, we leverage it for scenario reduction by finding representative scenarios via an off-the-shelf clustering algorithm, which decreases the problem complexity and meanwhile attains high-quality approximate solutions. Second, we further extend the encoder with an additional sub-network to predict objective values for each scenario. Due to the generalization in the latent continuous space, we readily deploy the prediction task in semi-supervised manner with a small number of target objective values. In doing so, the latent space is augmented with the predicted objective value and hence yields more representative scenarios, which further shrinks the approximation gap to the optimal solutions of the original SIPs.
+
+In summary, this paper aims to learn scenario representation for solving graph-based two-stage SIPs. The main contributions are as follows:
+
+- We firstly present a deep generative framework to learn representations for scenarios in graph-based two-stage SIPs. It considers dependencies of the scenarios on the deterministic context of each instance, and hence well differentiates scenarios in the latent space.
+- We apply the learned representations to scenario reduction and objective prediction for SIPs. The representative scenarios derived from clustering of the representations can be used to efficiently compute high-quality solutions for SIPs. Moreover, we further shrink the approximation error by predicting objective values of scenarios via semi-supervised learning.
+- We evaluate the proposed method on two SIP problems, i.e., the network design problem and facility location problem. Experimental results verify the superiority of the learned scenario representation for solving SIPs. Our method significantly outperforms existing deep learning based baselines. Notably, it also generalizes well to problems with larger sizes or more scenarios.
+
+# 2 RELATED WORK
+
+Learning based methods for SIPs. Recent works of deep learning for COPs mostly address deterministic problems, with scarce attention to uncertainty that commonly exist in practice. Though a few methods apply deep learning to improve approximate solutions for two-stage SIPs, they are mostly designed for some specific problems. Nair et al. (2018) train a bit-flipping policy with reinforcement learning to improve solutions iteratively, but it is limited to binary decision variables and assumes no constraints in the first-stage problem. Larsen et al. (2018) predict properties of optimal solutions to integer programs (i.e. the first-stage problem with respective single scenario) in a supervised manner. This method is only applicable when operational solutions are not needed. In contrast, Abbasi et al. (2020) predict values of decision variables for blood transshipment problem with fixed-sized instances. To reduce the complexity of SIPs, Bengio et al. (2020) aim to yield one scenario for the first-stage problem, so that the derived solution achieves a small objective value when evaluated with the original set of scenarios. This method assumes complete recourse, with any generated scenario being feasible for the second-stage problem. All the above methods attempt to reduce the expected cost of stochastic scenarios but their applications are limited by distinct assumptions or fixed problem sizes. In contrast, our method can be used for more general two-stage SIPs, and generalizes well to varying problem sizes or scenario quantities.
+
+Scenario reduction for SIPs. In the SIP formulation, a set of scenarios is used to model stochastic events on top of the first-stage problem. It introduces extra complexity which may exponentially increase with its cardinality, owing to the combinatorial search space (Dyer & Stougie, 2006). Since the direct optimization with massive scenarios is intractable, the scenario reduction is often conducted to find a subset of scenarios that well replaces the original set with a small approximation
+
+error. Existing reduction methods mainly branches into distribution-oriented and problem-oriented paradigms. The former ones pursue a group of scenarios that closely estimate the probability distribution under the scenario space (Henrion & Römisch, 2017). The distance between the estimated and actual probability are often measured by Wasserstein distance (Rüjeerapaiboon et al., 2018), polyhedral discrepancy (Henrion et al., 2008) or difference of moments (Høyland et al., 2003). These methods neglect the influence of the context on the objective function, e.g., similar scenario distributions may cause different expected costs in disparate SIP instances. Thus, there is a recent trend towards the study of problem-oriented methods (Henrion & Römisch, 2018; Fairbrother et al., 2019; Keutchayan et al., 2020; 2021), which attempts to involve problem-specific properties in scenario reduction. For example, Keutchayan et al. (2021) propose to find $K$ scenarios with their objective values separately approximating the expected objective values in the $K$ scenario subsets. Most the above methods are mainly for theoretical proof on stochastic programs (without the restriction of integers). In contrast, we firstly propose a deep learning method for SIPs to learn scenario representation, which can be used for both scenario reduction and objective prediction.
+
+# 3 PRELIMINARIES
+
+# 3.1 TWO-STAGE STOCHASTIC INTEGER PROGRAMS
+
+As an optimization problem, SIP is usually characterized by both the uncertain parameters that potentially follow certain probability distributions and the discrete solution space due to the integer restrictions. It is commonly described by a two-stage formulation as below:
+
+$$
+\min _ {x} \quad \mu^ {\top} x + \mathbb {E} _ {\omega} [ Q (x, \omega) ] \tag {1}
+$$
+
+$$
+\mathrm {s . t .} \quad A x \leq b, \quad x \in \mathbb {R} ^ {n _ {1} - p _ {1}} \times \mathbb {Z} ^ {p _ {1}}, \tag {2}
+$$
+
+where $Q(x,\omega)\coloneqq \min_y\{q_\omega^\top y|W_\omega y\leq h_\omega -T_\omega x;y\in \mathbb{R}^{n_2 - p_2}\times \mathbb{Z}^{p_2}\}$
+
+In particular, Eq. (1) and (2) prescribe the first-stage problem with $x \in \mathbb{R}^{n_1}$ being the decision variable, where $n_1 \geq p_1$ ; $Q(x,\omega)$ prescribes the second-stage problem, with $y \in \mathbb{R}^{n_2}$ being the decision variable, where $n_2 \geq p_2$ . We refer to the group of static parameters $\mu \in \mathbb{R}^{n_1}$ , $A \in \mathbb{R}^{m_1 \times n_1}$ and $b \in \mathbb{R}^{m_1}$ in the first stage as the context, and assume that the group of uncertain parameters $q_{\omega} \in \mathbb{R}^{n_2}$ , $W_{\omega} \in \mathbb{R}^{m_2 \times n_2}$ , $T_{\omega} \in \mathbb{R}^{m_2 \times n_1}$ and $h_{\omega} \in \mathbb{R}^{m_2}$ follows a distribution $\mathcal{P}$ . Here we focus on SIPs defined on graphs, which are a family of problems with practical applications in many domains such as networks, transportation and scheduling (Rahmaniani et al., 2018; An & Lo, 2016).
+
+The primary method to solve the above SIP is sample average approximation (Kleywegt et al., 2002), which converts it into a mixed integer program (MIP) by Monte Carlo simulation and in turn optimizes the following objective:
+
+$$
+\mathcal {O} (x) := \min _ {x} \quad \mu^ {\top} x + \frac {1}{N} \sum_ {i = 1} ^ {N} Q (x, \omega_ {i}), \tag {3}
+$$
+
+where $\{\omega_i\}_{i=1}^N$ is a set of scenarios from $\mathcal{P}$ , i.e., an independently and identically distributed (i.i.d.) random sample of $N$ realizations of uncertain parameters. Typically, a large scenario set is often required to make the distribution of scenarios $\widehat{\mathcal{P}}$ well fit $\mathcal{P}$ , which may cause intractable MIP for a given solver. In this paper, we aim to find a small number of informative representatives in $\{\omega_i\}_{i=1}^N$ by learning representations of scenarios, which is supposed to considerably boost the computation efficiency with tolerable approximation errors.
+
+# 3.2 CONDITIONAL VARIATIONAL AUTOENCODER
+
+As an unsupervised generative model, CVAE is developed on top of VAE, and it further controls the data generation process conditioned on additional random variables (Sohn et al., 2015). These conditional variables could be either class labels or certain properties of the data with specific distributions, which are engaged in the input to both the encoder and decoder. Optimized with the stochastic gradient variational bayes (SGVB) framework (Kingma & Welling, 2014), the evidence lower bound objective (ELBO) of CVAE on the marginal likelihood for the input data is defined as:
+
+$$
+\log p _ {\theta} (X, c) \geq \operatorname {E L B O} (X, c) = \mathbb {E} _ {q _ {\phi} (z | X, c)} [ \log p _ {\theta} (X | z, c) ] - \operatorname {K L} \left[ q _ {\phi} (z | X, c) \| p (z | c) \right], \tag {4}
+$$
+
+where $X$ , $c$ , $z$ denote input, latent and conditional variables, respectively; both the encoder $q_{\phi}$ and decoder $p_{\theta}$ are typically parameterized by deep neural networks. Rather than simple distributions of conditional variables in most existing works, in this paper we exploit CVAE to learn scenario representation in SIPs, with conditional variables derived from continuous parameters in the context. For more details of CVAE, we refer readers to (Kingma et al., 2014; Feng et al., 2021).
+
+# 4 METHODOLOGY
+
+Given a class of SIP instances $\{X_m\}_{m=1}^M$ with parameters drawn from a distribution $\mathcal{D}$ , we regard each instance as a 2-tuple $X_m = (D_m, \{\omega_m^i\}_{i=1}^N)$ , where $D_m$ denotes the context (i.e. the group of static parameters) in the $m$ -th instance, and $\omega_m^i$ denotes the $i$ -th scenario (i.e. the $i$ -th realization of uncertain parameters) in the $m$ -th instance. We aim to learn latent representations (variables) $\{z_m^i\}_{i=1}^N$ of scenarios $\{\omega_m^i\}_{i=1}^N$ under the context $D_m$ in each instance.
+
+# 4.1 CVAE FOR SCENARIO REPRESENTATION
+
+Our CVAE comprises an encoder for the inference process and a decoder for the generation process, which are parameterized by deep neural networks $q_{\phi}$ and $p_{\theta}$ , respectively. In the generation process, the decoder approximates the posterior distribution of uncertain parameters in scenarios, given the latent and conditional variables, such that:
+
+$$
+p _ {\theta} \left(\omega_ {m} ^ {i} \mid z _ {m} ^ {i}, c _ {m}\right) = f \left(\omega_ {m} ^ {i}; z _ {m} ^ {i}, c _ {m}, \theta\right); q _ {\phi} \left(c _ {m} \mid D _ {m}\right) = h \left(c _ {m}; D _ {m}, \phi\right), \tag {5}
+$$
+
+where $f$ and $h$ denote likelihood functions (e.g. Gaussian or multinomial distributions) that are instantiated by $p_{\theta}$ and $q_{\phi}$ , respectively. Note that we do not take the raw context $D_{m}$ as conditional variables for the decoder since they are continuous and high-dimensional. It may not only intensify the computational complexity but also overwhelm the latent variable which is typically low-dimensional. In contrast, we leverage the graph neural network (GNN) in the encoder to derive a low-dimensional conditional variable $c_{m}$ from $D_{m}$ . Further by preserving the marginal independence between latent and conditional variables, the decoder will more effectively govern the generation of $\omega_{m}^{i}$ according to the context $D_{m}$ (Kingma et al., 2014).
+
+In the inference process, the encoder approximates the posterior distribution of latent representations (variables) of scenarios given $(\omega_{m}^{i},D_{m})$ , which is expressed as:
+
+$$
+q _ {\phi} \left(z _ {m} ^ {i} \mid \omega_ {m} ^ {i}, D _ {m}\right) = \mathcal {N} \left(z _ {m} ^ {i} \mid \mu_ {\phi} \left(\omega_ {m} ^ {i}, D _ {m}\right), \sigma_ {\phi} ^ {2} \left(\omega_ {m} ^ {i}, D _ {m}\right)\right), \tag {6}
+$$
+
+where we assume a Gaussian distribution of scenario representations with $\mu_{\phi}$ and $\sigma_{\phi}$ being parameterized by neural networks, respectively. As aforementioned, we exploit a GNN in the encoder to embed the continuous and high-dimensional $\omega_{m}^{i}$ and $D_{m}$ , which is also used by the decoder to embed the sole $D_{m}$ . This parameter sharing design contributes to a fast learning of embeddings for deriving the latent and conditional variables, i.e., $z_{m}^{i}$ and $c_{m}$ . To learn disentangled representations for these two types of variables, we force the conditional independence as:
+
+$$
+q _ {\phi} \left(z _ {m} ^ {i}, c _ {m} \mid \omega_ {m} ^ {i}, D _ {m}\right) = q _ {\phi} \left(z _ {m} ^ {i} \mid \omega_ {m} ^ {i}, D _ {m}\right) q _ {\phi} \left(c _ {m} \mid D _ {m}\right). \tag {7}
+$$
+
+In summary, our CVAE hinges on two important steps, i.e., 1) we first use the encoder to attain scenario representations with respect to the context in each SIP instance; 2) we then use the decoder to reconstruct the scenarios from the latent space according to the context.
+
+Semi-supervised CVAE. With the inferred scenario representations, we can directly conduct various downstream tasks for solving SIPs, such as scenario reduction using an off-the-shelf clustering algorithm. However, it may ignore the relationship between scenarios and objective values, which is nontrivial since even similar scenarios would deliver different solutions. Therefore, we also extend CVAE to predict the objective function in a semi-supervised manner. Given that the scenarios are embedded into a continuous space by the encoder, the prediction is supposed to be well generalized (Gómez-Bombarelli et al., 2018).
+
+Most CVAE models for semi-supervised learning predict discrete targets and regard the ground truth, e.g., class labels, as conditional variables. In contrast, we predict a continuous property of the data (i.e. the objective value) and directly approximate it through the encoder. To this end, we use
+
+
+Figure 1: CVAE structure for learning scenario representations
+
+CPLEX solver to collect optimal objective values $\{Y_m^i\}_{i=1}^N$ of the resulting MIP problems, which are defined by respective scenarios with the context, for only a small volume $(1\% \cdot M)$ of instances in $\{X_m\}_{m=1}^M$ . We refer to the underlying joint distribution of $(\omega_m^i, Y_m^i, D_m)$ as $\mathcal{D}_Y$ . Then we infer the objective values with a sub-network, which processes the GNN embedding of $(\omega_m^i, D_m)$ in the encoder, such that the objective function $\sigma$ is parameterized as:
+
+$$
+r _ {\psi} \left(Y _ {m} ^ {i} \mid h _ {m} ^ {i}\right) = \sigma \left(Y _ {m} ^ {i}; h _ {m} ^ {i}, \psi\right); q _ {\phi} \left(h _ {m} ^ {i} \mid \omega_ {m} ^ {i}, D _ {m}\right) = g \left(h _ {m} ^ {i}; \omega_ {m} ^ {i}, D _ {m}, \phi\right), \tag {8}
+$$
+
+where $h_m^i$ denotes the GNN embedding that is derived by $q_{\phi}$ .
+
+# 4.2 NEURAL NETWORKS
+
+A major challenge to parameterize CVAE for SIPs is how to derive an effective embedding of the context, since it is high-dimensional and continuous. Moreover, it is also involved in the input to both the encoder and decoder, and significantly influences the eventual scenario representation. A direct use of multi-layer perceptron (MLP) to process static parameters in $D_{m}$ may fail to leverage the problem structure and cannot generalize across instances of different sizes. To overcome these limits, we exploit a GNN (as aforementioned) to embed the context $D_{m}$ for attaining conditional variables in the decoder. Meanwhile, we apply the same GNN to embed each scenario with its context $(\omega_{m}^{i}, D_{m})$ for attaining latent representations in the encoder. To this end, we first describe the context with scenarios on a graph.
+
+SIP graphs. We define a complete graph $\mathcal{G} = (\mathcal{V},\mathcal{E})$ , where $\mathcal{V} = \{v_{1},\dots ,v_{n}\}$ denotes nodes with features $\mathbf{V}\in \mathbb{R}^{n\times d_v}$ ; $\mathcal{E} = \{e_{jk}|v_j,v_k\in \mathcal{V}\}$ denotes edges with features $\mathbf{E}\in \mathbb{R}^{n\times n\times d_e}$ . We formally represent the features on the $j$ -th node as $\mathbf{v}_{\omega_i}^j = [s_{\omega_i}^j;d^j]$ ([;] means concatenation). In specific, $s_{\omega_i}^j\in \omega_m^i$ denotes a realization of uncertain parameters on the $j$ -th node and $d^{j}\in D_{m}$ denotes static parameters on the $j$ -th node. Similarly, the features on edge $e_{jk}$ is represented as $\mathbf{e}_{\omega_i}^{jk} = [s_{\omega_i}^{jk};d^{jk}]$ , where $s_{\omega_i}^{jk}$ and $d^{jk}$ denote the parameters from the $i$ -th scenario and the context, respectively. Different from existing works that only consider varying parameters on nodes, e.g., Nazari et al. (2018), our graph representation is more generic and could be applied to a broader class of SIPs. Particularly, two examples of the graph representation on the network design problem and facility location problem are introduced in Section 4.4.
+
+On top of the SIP graphs, we can exploit GNN to derive embeddings for either the context $D_{m}$ or varying scenarios with the context, i.e., $(\omega_{m}^{i},D_{m})$ , $i = \{1,\dots ,N\}$ . In our method, we adopt the graph convolutional network (GCN), which is a commonly used GNN variant (Kipf & Welling, 2017; Yao et al., 2019). The architecture of our GCN is similar to the one in Joshi et al. (2019), which was leveraged to compute an adjacency matrix for solving the travelling salesman problem. Specifically, we extend it for graph-based SIP problems to attain graph embeddings for $D_{m}$ and $(\omega_{m}^{i},D_{m})$ , denoted as $h_m$ and $h_m^i$ , respectively. Detailed structure of the GCN is described in Appendix A. Next, we will revisit our CVAE given the graph embeddings above.
+
+Encoder. The encoder processes the graph embedding $h_m^i$ with two separate linear projections to compute 2-dimensional vectors of means and standard deviations for latent variables, respectively, i.e., $\mu_{\phi}(\omega_m^i, D_m)$ and $\sigma_{\phi}(\omega_m^i, D_m)$ in Eq. (6). Also, we linearly project the graph embedding $h_m$ into a 2-dimensional vector, i.e., $c_m$ in Eq. (5).
+
+Decoder. We concatenate $c_{m}$ with the latent variables $z_{m}^{i}$ and pass them through an MLP to reconstruct the scenario. The MLP is structured by two hidden layers with ReLU activation functions, which are of 128 and 256 dimensions, respectively.
+
+Semi-supervised learning. To echo the semi-supervised CVAE in Section 4.1, we leverage another MLP as a sub-network to process $h_{m}^{i}$ . It comprises a 512-dimensional hidden layer with a ReLU activation function, and outputs a single value to estimate the objective value $Y_{m}^{i}$ .
+
+The basic structure of neural networks is illustrated in Figure 1, where $\hat{\omega}_m^i$ and $\hat{Y}_m^i$ are the reconstruction and predicted objective value for the $i$ -th scenario, respectively. Note that we pad uncertain parameters $\omega_m^i$ with 0 to embed the sole context (in the lower grey square). In this way, the GCN could be shared to attain both graph embeddings $h_m$ and $h_m^i$ .
+
+# 4.3 TRAINING & INFERENCE
+
+The training objective is to minimize three loss functions. The first one is defined by the mean square error (MSE) between the reconstructed scenarios from decoder and the original ones. It is essentially employed in CVAE to maximize the marginal likelihood of the data. The second loss is defined by Kullback-Leibler divergence from the latent variables to the prior Gaussian distribution $p(z) = \mathcal{N}(z|0,I)$ , which is used for regularization. The third loss is defined by the MSE between the predicted objective values and their ground truth. Formally, the objective for training our CVAE is expressed as:
+
+Algorithm 1 Training procedure
+Input: encoder $p_{\theta}$ , decoder $q_{\phi}$ , num. of epochs $E$ , batch size B.
+1: Initialize parameters $\theta^{(0)}$ and $\phi^{(0)}$
+2: for epoch $= 1,2,\dots ,E$ do
+3: Shuffle the data in $\mathcal{D}$ and $\mathcal{D}_Y$ .
+4: for $t = 1,2,\ldots ,\lfloor \frac{\lfloor\mathcal{D}\rfloor}{B}\rfloor$ do
+5: Retrieve a batch of instances from $\mathcal{D}$
+6: Get a random scenario in each instance;
+7: Compute ELBO in Eq. (9);
+8: $\theta ,\phi \gets \mathrm{Adam}(\theta ,\phi ,\nabla \mathcal{L}(\theta ,\phi));$
+9: if objective prediction is trained then
+10: Retrieve a batch of instances from $\mathcal{D}_Y$
+11: Compute MSE of objectives in Eq. (9);
+12: $\phi ,\psi \gets \mathrm{Adam}(\phi ,\psi ,\nabla \mathcal{L}(\phi ,\psi));$
+13: end if
+14: end for
+15: end for
+
+$$
+\mathcal {L} (\theta , \phi , \psi) = \mathbb {E} _ {\mathcal {D}} [ - \operatorname {E L B O} (X _ {m}) ] - \alpha \cdot \mathbb {E} _ {\mathcal {D} _ {Y}} [ \log r _ {\psi} (Y _ {m} ^ {i} | h _ {m} ^ {i}) ], \tag {9}
+$$
+
+where $\mathrm{ELBO}(X_m) = \mathbb{E}_{q_\phi(z_m^i|\omega_m^i,D_m)}[\log p_\theta(\omega_m^i|z_m^i,c_m)] - \beta\cdot \mathrm{KL}[q_\phi(z_m^i|\omega_m^i,D_m)\|p(z)]$ involves the first MSE and KL divergence; $\alpha$ and $\beta$ are hyperparameters to balance the three losses. Following the typical training paradigm for VAE, we jointly optimize $\theta$ and $\phi$ via reparameterization trick and Monte Carlo approximation (Kingma & Welling, 2014). The training procedure is summarized in Algorithm 1 where we use the Adam optimizer to update the parameters (Kingma & Ba, 2015).
+
+As shown in Algorithm 1, we randomly pick one scenario for each instance so that we can process it with its context in a batch. The resulting generalization across both the contexts and scenarios of different instances will allow for a fast training of neural networks. However, in the inference we employ the trained encoder to attain the latent representations, by processing all scenarios from a set of instances in parallel. It is realized by duplicating the context in each instance for all its scenarios. In doing so, the computational efficiency will be considerably improved for solving the instance with a large cardinality of scenarios, and thus a large amount of instances. For each instance, the derived scenario representations from the encoder are then used for clustering to attain a few centers that correspond to representatives among original scenarios, so we end with reduced scenarios.
+
+# 4.4 APPLICATIONS
+
+We apply our method to learn scenario representation in two typical SIP problems, i.e., the network design problem (NDP) and facility location problem (FLP) (Keutchayan et al., 2021). We represent them as the SIP graphs, whose features on nodes and edges including both static and uncertain parameters are listed in Table 1. For FLP, the parameters tokenized by $F_{\cdot}$ and $C$ mean that they are peculiar to facility and customer nodes, respectively. More details about the two problems and their parameters can be found in Appendix B and C.
+
+Table 1: Features on SIP graphs of NDP and FLP
+
+ | Fees | Types | Parameters | Digits |
| NDP | \( \mathbf{v}_{\omega_i}^j \) | \( d^j \) | None | 0 |
| \( s_{\omega_i}^j \) | demand | 1 |
| \( \mathbf{e}_{\omega_i}^{jk} \) | \( d^{jk} \) | opening cost, transportation cost, capacity | 3 |
| \( s_{\omega_i}^{jk} \) | None | 0 |
| FP | \( \mathbf{v}_{\omega_i}^j \) | \( d^j \) | coordinate, opening cost (F.), capacity (F.) | 2(4) |
| \( s_{\omega_i}^j \) | presence (C.) | 1 |
| \( \mathbf{e}_{\omega_i}^{jk} \) | \( d_{jk} \) | distance between nodes | 1 |
| \( s_{\omega_i}^{jk} \) | None | 0 |
+
+# 5 EXPERIMENTS
+
+We evaluate our method on NDP and FLP to demonstrate its effectiveness. On the one hand, we train the CVAE to only learn representations for scenarios (Line 5~8 in Algorithm 1), and the trained encoder can attain representations in each instance, which are directly used for scenario reduction by finding representatives via an off-the-shelf clustering algorithm. On the other hand, we train the semi-supervised CVAE to simultaneously learn scenario representations and predict objective values (Line 5~13). After the training, the neural network can attain representations and objective values for each scenario and we concatenate them for clustering to find more informative scenarios as representatives. We refer to the above two paradigms as CVAE-SIP and CVAE-SIPA, respectively. In the following experiments, we compare them with other learning based methods, and assess their generalization performance across problems with varying sizes and scenario cardinalities.
+
+# 5.1 SETUP
+
+Instance generation. Our instances are generated following the way in (Keutchayan et al., 2021). Specifically, we generate NDP instances with 14 nodes including 2 source nodes, 2 target nodes and 10 transition nodes. For FLP, we designate 10 facility nodes and 20 customer nodes. We generate 200 scenarios for each instance in both problems. To evaluate the generalization performance, we generate larger instances by doubling and quadrupling the number of transition nodes for NDP, respectively. We do the same to both facility and customer nodes for FLP. Besides, we also double and quadruple the scenario cardinality in both problems. More details are provided in Appendix D.
+
+Training. We collect 12,800 instances (of normal size) for NDP and FLP, respectively, and normalize each type of parameters into [0, 1] across instances. Regarding CVAE-SIP, we train our model without the sub-network (used for the prediction task) by solely optimizing the ELBO loss in Eq. (9). Regarding CVAE-SIP, we train neural networks for learning representation and objective prediction simultaneously, as shown in Algorithm 1. We set hyperparameters $\beta = 0.005$ and $\alpha = 100$ in Eq. (9). For both problems, CVAE-SIP and CVAE-SIPA are trained with 100 and 400 epochs, respectively. The batch size and learning rate are set to 128 and $10^{-4}$ . We run the training on a server using a single GeForce RTX 2080 Ti GPU.
+
+Testing. Pertaining to CVAE-SIP, we employ the $K$ -medoids algorithm (Park & Jun, 2009) to obtain representative scenarios based on the latent representations. We keep its default settings and only change the number of clusters (i.e. $K$ ). Given the attained $K$ representatives, we can derive the approximation solution by reformulating Eq. (3) as:
+
+$$
+\tilde {\mathcal {O}} (x) := \min _ {x} \quad \mu^ {\top} x + \frac {N _ {\mathrm {k}}}{N} \sum_ {\mathrm {k} = 1} ^ {K} Q \left(x, \omega_ {\mathrm {k}}\right), \tag {10}
+$$
+
+where $\omega_{\mathrm{k}}$ means the representative from the k-th cluster and the number of intra-cluster population equals to $N_{\mathrm{k}}$ . Accordingly, the approximation error is defined as the gap1 between objective values of the approximate solution derived from Eq. (10) and the optimal solution from Eq. (3). Pertaining to CVAE-SIPA, we infer both the latent representations and objective values of scenarios, which are concatenated as augmented representations to attain the representatives. To reduce the influence by the potential concurrent processes, we conduct the evaluation on a different desktop computer, which uses a single Nvidia Quadro P4000 GPU with a Xeon W-2133 CPU@3.60 GHz.
+
+# 5.2 COMPARISON ANALYSIS
+
+We compare with four baselines $^2$ , i.e., 1) CPLEX IBM (2017), with default settings to compute optimal solutions. It is also used to solve the approximation problem with representative scenarios. 2) $K$ -medoids, the same clustering algorithm as used in our method. However, we apply it to directly cluster the original scenarios rather than the learned low-dimensional representations. 3) Scenarios, a supervised method with hand-crafted features to predict a scenario for solving a variant of FLP (Bengio et al., 2020). 4) Solution- $\mathbf{M}^3$ , a supervised method with raw features to predict the first-stage decision variables for solving blood transshipment problem (Abbasi et al., 2020).
+
+Table 2: Comparison with baselines
+
+| NDP (14; 200) | FLP (30; 200) | |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 | |
| Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | |
| CPLEX | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 236.71 | 0.00 | 18s | 236.71 | 0.00 | 18s | 236.71 | 0.00 | 18s |
| Scenario-M | 2533.50 | 2.96 | 0.8s | 2533.50 | 2.96 | 0.8s | 2533.50 | 2.96 | 0.8s | 1980.03 | 7.11 | 0.6s | 1980.03 | 7.11 | 0.6s | 1980.03 | 7.11 | 0.6s |
| Solution-M | 798.81 | 0.26 | 0.8s | 798.81 | 0.26 | 0.8s | 798.81 | 0.26 | 0.8s | 736.21 | 1.87 | 0.2s | 736.21 | 1.87 | 0.2s | 736.21 | 1.87 | 0.2s |
| K-medoids | 976.47 | 0.54 | 0.3s | 761.18 | 0.19 | 0.6s | 677.02 | 0.08 | 1s | 2390.06 | 9.06 | 0.2s | 1344.39 | 4.57 | 0.3s | 502.68 | 1.17 | 1s |
| CVAE-SIP | 930.73 | 0.48 | 0.7s | 734.24 | 0.15 | 0.9s | 637.99 | 0.02 | 1s | 929.61 | 2.87 | 0.7s | 482.70 | 0.99 | 0.7s | 282.49 | 0.23 | 1s |
| CVAE-SIPA | 769.70 | 0.24 | 0.6s | 687.68 | 0.08 | 0.8s | 642.12 | 0.03 | 1s | 709.08 | 1.71 | 0.6s | 381.41 | 0.58 | 0.7s | 264.01 | 0.15 | 1s |
+
+$^{1}$ $(n;N)$ means $n$ nodes and $N$ scenarios; Bold means the best result from the learning based methods.
+
+Table 3: Generalization to large-scale problems
+
+| NDP (24; 200) | FLP (60; 200) |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 |
| Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time |
| CPLEX | 602.47 | 0.00 | 2m | 602.47 | 0.00 | 2m | 602.47 | 0.00 | 2m | 335.37 | 0.00 | 11m | 335.37 | 0.00 | 11m | 335.37 | 0.00 | 11m |
| Scenario-M | 2238.63 | 2.68 | 2s | 2238.63 | 2.68 | 2s | 2238.63 | 2.68 | 2s | - | - | - | - | - | - | - | - | - |
| Solution-M | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | |
| K-medoids | 981.94 | 0.63 | 0.8s | 723.62 | 0.20 | 1s | 662.46 | 0.09 | 3s | 3549.25 | 9.72 | 1s | 1549.53 | 3.74 | 4s | 561.97 | 0.73 | 7s |
| CVAE-SIP | 871.73 | 0.45 | 2s | 696.22 | 0.16 | 2s | 659.92 | 0.09 | 4s | 1083.12 | 2.17 | 3s | 748.59 | 1.21 | 5s | 506.75 | 0.57 | 8s |
| CVAE-SIPA | 809.65 | 0.34 | 2s | 637.72 | 0.06 | 2s | 610.58 | 0.01 | 5s | 974.17 | 1.86 | 3s | 746.02 | 1.18 | 5s | 470.39 | 0.44 | 8s |
+
+| NDP (44; 200) | FLP (120; 200) |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 |
| Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time |
| CPLEX | 580.67 | 0.00 | 23m | 580.67 | 0.00 | 23m | 580.67 | 0.00 | 23m | 484.60 | 0.00 | 1h | 484.60 | 0.00 | 1h | 484.60 | 0.00 | 1h |
| Scenario-M | 2163.74 | 2.77 | 3s | 2163.74 | 2.77 | 3s | 2163.74 | 2.77 | 3s | - | - | - | - | - | - | - | - | - |
| Solution-M | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
| K-medoids | 803.99 | 0.38 | 3s | 652.78 | 0.12 | 7s | 595.15 | 0.04 | 14s | 6675.13 | 12.56 | 6s | 2803.77 | 4.86 | 21s | 1183.44 | 1.56 | 61s |
| CVAE-SIP | 1079.80 | 0.84 | 5s | 615.99 | 0.06 | 8s | 588.18 | 0.02 | 16s | 1585.53 | 2.27 | 12s | 985.45 | 0.99 | 35s | 627.30 | 0.28 | 56s |
| CVAE-SIPA | 682.35 | 0.17 | 5s | 627.62 | 0.08 | 8s | 581.07 | 0.00 | 17s | 2051.45 | 3.13 | 16s | 910.50 | 0.84 | 33s | 594.33 | 0.22 | 69s |
+
+We evaluate all methods on 200 instances of normal size for NDP and FLP, respectively. We set $K = 5$ , 10, 20 in $K$ -medoids for both problems so that we could access the performance against the number of representatives. Note that the computation by CPLEX, Scenario-M and Solution-M is independent of $K$ . The results are displayed in Table 2, where we record the average of objective values, approximation errors and computational time over all instances, respectively. As shown, both CVAE-SIP and CVAE-SIPA consistently outperform $K$ -medoids in all cases. Though $K$ -medoids can also improve the solution quality as $K$ grows, our methods efficiently attain solutions with much smaller errors. It implies that we achieve more informative representatives with the learned low-dimensional representations, which help deliver high-quality solutions. On the other hand, our methods significantly outperform Scenario-M and Solution-M for the three respective values of $K$ . This suggests that the representatives found by our methods are able to approximate the original problem more accurately than the approximation with the single scenario or solution. Furthermore, we observe that CVAE-SIPA is generally superior to CVAE-SIP, which indicates that the predicted objective values could effectively enrich the scenario representations for achieving more informative representatives and thus better solutions. Last but not least, all the learning based methods consume fairly short time compared to the sole CPLEX.
+
+# 5.3 GENERALIZATION ACROSS PROBLEM SIZES
+
+A desirable generalization to larger problems is necessary for learning based methods. To verify such ability of our methods, we apply the previously trained networks to directly infer another 50 larger instances (of two levels) for both NDP and FLP, respectively. The instances are generated following the operation of doubling and quadrupling described in Section 5.1. The baselines are also directly applied to these larger instances except Solution-M since its output dimension (i.e. number of decision variables) is fixed only for the problem of normal size. Similarly, Scenario-M is not applicable to FLP where the scenario dimension (i.e. number of customer nodes) changes with problem sizes. For CPLEX, we set a 1h time limit on FLP (120; 200). In Table 3, the upper and lower half contains the results on doubling and quadrupling instances, respectively. As shown, CVAE-SIP is superior to $K$ -medoids and Scenario-M in most cases except NDP (44; 200) with $K = 5$ . On the other hand, CVAE-SIPA generally achieves the smallest errors but performs inferior to CVAE-SIP on NDP (44; 200) with $K = 10$ and FLP (120; 200) with $K = 5$ . This might stem from the degenerated accuracy of objective prediction, which induces solutions with relatively large penalties on some instances.
+
+Table 4: Generalization to large scenario cardinalities
+
+| NDP (14; 400) | FLP (30; 400) | | |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 | |
| Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | |
| CPLEX | 634.50 | 0.00 | 1m | 634.50 | 0.00 | 1m | 634.50 | 0.00 | 1m | 244.63 | 0.00 | 2m | 244.63 | 0.00 | 2m | 244.63 | 0.00 | 2m |
| Scenario-M | 2266.88 | 2.58 | 1s | 2266.88 | 2.58 | 1s | 2266.88 | 2.58 | 1s | 5260.62 | 12.79 | 2s | 5260.62 | 12.79 | 2s | 5260.62 | 12.79 | 2s |
| Solution-M | 791.95 | 0.26 | 0.7s | 791.95 | 0.26 | 0.7s | 791.95 | 0.26 | 0.7s | 1215.86 | 5.37 | 0.5s | 1215.86 | 5.37 | 0.5s | 1215.86 | 5.37 | 0.5s |
| K-medoids | 972.69 | 0.53 | 0.3s | 730.18 | 0.15 | 0.5s | 650.45 | 0.04 | 1s | 1848.21 | 6.12 | 0.2s | 734.44 | 2.00 | 0.4s | 497.64 | 0.92 | 1s |
| CVAE-SIP | 887.76 | 0.41 | 0.8s | 711.63 | 0.12 | 1s | 656.06 | 0.05 | 2s | 701.73 | 1.83 | 1s | 468.47 | 0.86 | 1s | 439.52 | 0.73 | 2s |
| CVAE-SIPA | 881.05 | 0.38 | 0.8s | 676.99 | 0.06 | 1s | 645.75 | 0.03 | 2s | 723.75 | 1.89 | 1s | 439.08 | 0.77 | 1s | 294.02 | 0.15 | 2s |
+
+| NDP (14; 800) | FLP (30; 800) | |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 |
| Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time | Obj. | Error | Time |
| CPLEX | 633.34 | 0.00 | 5m | 633.34 | 0.00 | 5m | 633.34 | 0.00 | 5m | 239.45 | 0.00 | 7m | 239.45 | 0.00 | 7m | 239.45 | 0.00 | 7m |
| Scenario-M | 2137.65 | 2.36 | 0.7s | 2137.65 | 2.36 | 0.7s | 2137.65 | 2.36 | 0.7s | 3807.41 | 9.93 | 2s | 3807.41 | 9.93 | 2s | 3807.41 | 9.93 | 2s |
| Solution-M | 815.13 | 0.28 | 0.8s | 815.13 | 0.28 | 0.8s | 815.13 | 0.28 | 0.8s | 1082.62 | 3.76 | 0.7s | 1082.62 | 3.76 | 0.7s | 1082.62 | 3.76 | 0.7s |
| K-medoids | 896.35 | 0.42 | 0.3s | 770.99 | 0.20 | 0.7s | 678.33 | 0.08 | 1s | 1174.66 | 4.18 | 0.2s | 1091.77 | 3.34 | 0.3s | 732.85 | 1.72 | 1s |
| CVAE-SIP | 900.59 | 0.42 | 1s | 658.40 | 0.03 | 2s | 685.74 | 0.09 | 2s | 600.28 | 1.36 | 2s | 351.18 | 0.49 | 2s | 308.24 | 0.23 | 2s |
| CVAE-SIPA | 761.84 | 0.20 | 1s | 684.33 | 0.07 | 2s | 652.69 | 0.04 | 2s | 990.76 | 2.91 | 2s | 420.95 | 0.77 | 2s | 296.98 | 0.21 | 2s |
+
+Notably, the computational time by CPLEX rises drastically on larger problems, in comparison with those in Table 2. Such low efficiency might not be acceptable in practice, especially where real-time decisions are required for handling a number of problem instances simultaneously. In contrast, our methods deliver solutions with small penalties in short runtime. In Appendix F, we draw curves of the average error against the number of representative scenarios used in FLP problems.
+
+# 5.4 GENERALIZATION ACROSS SCENARIO CARDINALITIES
+
+From a practical view, the cardinality of scenarios in SIP problems might be changed due to certain reasons, e.g., new observations are added or outdated ones are removed (Issac & Campbell, 2017). Therefore, a learning based method for SIPs should be able to handle this varying dimension via generalization. To this end, we evaluate our methods and baselines on 50 instances of NDP and FLP with doubling and quadrupling scenarios, respectively. The results in Table 4 show that our methods can still achieve the smallest errors across most settings, except NDP (14; 400) with $K = 5$ , where Solution-M performs better. It implies that our methods are less sensitive to the scenario cardinality. Since our methods process all scenarios in parallel, they solve instances with scenarios up to 800 in about 2 seconds, which is significantly faster than CPLEX. Additionally, we also test with scenarios generated from varying distributions and different dependencies on the context. The details are provided in Appendix G.
+
+# 5.5 OBJECTIVE PREDICTION
+
+We further demonstrate the efficacy of the semi-supervised learning for objective prediction. The trained model is directly adopted to infer objective values of scenarios in NDP and FLP instances. The results are gathered in Figure 3 and 4, which show our prediction is fairly accurate for both problems even when generalizing to larger problem sizes or scenario cardinalities. It well verifies the effectiveness of our semi-supervised design, which only needs to solve a small volume (1%) of training instances. In addition, the sample efficiency is also enhanced through the generalization over the latent space. More details can be found in Appendix H.
+
+# 6 CONCLUSIONS AND FUTURE WORK
+
+In this paper, we present a deep learning method to solve graph-based two-stage SIPs. We leverage CVAE to learn latent representations of stochastic scenarios conditioned on the context of a SIP instance. With the learned representations, we conduct two downstream tasks for solving SIP, i.e., scenario reduction and objective prediction. The evaluation on two classic SIP problems has shown that our method is able to find less yet informative representatives for improving both solution quality and computation efficiency. Additional studies also verify that our method can be well generalized to larger problem sizes, larger cardinalities of scenarios and different distributions of scenarios. In the future, we will attempt to automate the decision on the optimal number of representatives for scenario reduction, and extend our method towards solving general two-stage SIPs.
+
+# ACKNOWLEDGEMENTS
+
+This research was conducted at Singtel Cognitive and Artificial Intelligence Lab for Enterprises (SCALE@NTU), which is a collaboration between Singapore Telecommunications Limited (Singtel) and Nanyang Technological University (NTU) that is supported by A*STAR under its Industry Alignment Fund (LOA Award number: I1701E0013). Wen Song is supported by the National Natural Science Foundation of China under Grant 62102228, and the Shandong Provincial Natural Science Foundation under Grant ZR2021QF063.
+
+# REFERENCES
+
+Babak Abbasi, Toktam Babaei, Zahra Hosseinifard, Kate Smith-Miles, and Maryam Dehghani. Predicting solutions of large-scale optimization problems via machine learning: A case study in blood supply chain management. Computers & Operations Research, 119:104941, 2020.
+Kun An and Hong K Lo. Two-phase stochastic program for transit network design under demand uncertainty. Transportation Research Part B: Methodological, 84:157-181, 2016.
+Yoshua Bengio, Emma Frejinger, Andrea Lodi, Rahul Patel, and Sriram Sankaranarayanan. A learning-based algorithm to quickly compute good primal solutions for stochastic integer programs. In International Conference on Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pp. 99-111. Springer, 2020.
+Sergio Bruno, Shabbir Ahmed, Alexander Shapiro, and Alexandre Street. Risk neutral and risk averse approaches to multistage renewable investment planning under uncertainty. European Journal of Operational Research, 250(3):979-989, 2016.
+Xinyun Chen and Yuandong Tian. Learning to perform local rewriting for combinatorial optimization. In the 33rd Conference on Advances in Neural Information Processing Systems (NIPS), pp. 6278-6289, 2019.
+Mary Dillon, Fabricio Oliveira, and Babak Abbasi. A two-stage stochastic programming model for inventory management in the blood supply chain. International Journal of Production Economics, 187:27-41, 2017.
+Martin Dyer and Leen Stougie. Computational complexity of stochastic programming problems. mathematical programming, 106(3):423-432, 2006.
+Jamie Fairbrother, Amanda Turner, and Stein W Wallace. Problem-driven scenario generation: an analytical approach for stochastic programs with tail risk measure. *Mathematical Programming*, pp. 1-42, 2019.
+Hao-Zhe Feng, Kezhi Kong, Minghao Chen, Tianye Zhang, Minfeng Zhu, and Wei Chen. Shot-vae: Semi-supervised deep generative models with label-aware elbo approximations. In Proceedings of the 35th Conference on Artificial Intelligence (AAAI), pp. 7413-7421, 2021.
+Maxime Gasse, Didier Chételat, Nicola Ferroni, Laurent Charlin, and Andrea Lodi. Exact combinatorial optimization with graph convolutional neural networks. In Proceedings of the 33rd Conference on Neural Information Processing Systems (NIPS), 2019.
+Rafael Gómez-Bombarelli, Jennifer N Wei, David Duvenaud, José Miguel Hernández-Lobato, Benjamín Sánchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D Hirzel, Ryan P Adams, and Alán Aspiru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. ACS central science, 4(2):268-276, 2018.
+Holger Heitsch and Werner Römisch. Scenario reduction algorithms in stochastic programming. Computational optimization and applications, 24(2):187-206, 2003.
+Réné Henrion and Werner Römisch. Optimal scenario generation and reduction in stochastic programming. Humboldt-Universität zu Berlin, Mathematisch-Naturwissenschaftliche Fakultät ..., 2017.
+
+Réne Henrion and Werner Römisch. Problem-based optimal scenario generation and reduction in stochastic programming. Mathematical Programming, pp. 1-23, 2018.
+René Henrion, Christian Kühler, and Werner Römisch. Discrepancy distances and scenario reduction in two-stage stochastic mixed-integer programming. Journal of Industrial & Management Optimization, 4(2):363, 2008.
+Andre Hottung, Bhanu Bhandari, and Kevin Tierney. Learning a latent search space for routing problems using variational autoencoders. In the 8th International Conference on Learning Representations (ICLR), 2020.
+Kjetil Høyland, Michal Kaut, and Stein W Wallace. A heuristic for moment-matching scenario generation. Computational optimization and applications, 24(2):169-185, 2003.
+IBM(2017). Ibml og cplex 12.10 user manual ibm crop. 2017.
+Brian Ichter, James Harrison, and Marco Pavone. Learning sampling distributions for robot motion planning. In Proceedings of the International Conference on Robotics and Automation (ICRA), pp. 7087-7094, 2018.
+Preethi Issac and Ann Melissa Campbell. Shortest path problem with arc failure scenarios. EURO Journal on Transportation and Logistics, 6(2):139-163, 2017.
+Haifa Jammeli, Majdi Argoubi, and Hatem Masri. A bi-objective stochastic programming model for the household waste collection and transportation problem: case of the city of sousse. Operational Research, pp. 1-27, 2019.
+Waldy Joe and Hoong Chuin Lau. Deep reinforcement learning approach to solve dynamic vehicle routing problem with stochastic customers. In Proceedings of the 30th International Conference on Automated Planning and Scheduling (ICAPS), volume 30, pp. 394-402, 2020.
+Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional network technique for the travelling salesman problem. In INFORMS Annual Meeting, 2019.
+Julien Keutchayan, David Munger, and Michel Gendreau. On the scenario-tree optimal-value error for stochastic programming problems. Mathematics of Operations Research, 45(4):1572-1595, 2020.
+Julien Keutchayan, Janosch Ortmann, and Walter Rei. Problem-driven scenario clustering in stochastic optimization. arXiv preprint arXiv:2106.11717, 2021.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In the 3rd International Conference on Learning Representations (ICLR), 2015.
+Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In the 2nd International Conference on Learning Representations (ICLR), 2014.
+Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In the 28th Conference on Advances in Neural Information Processing Systems (NIPS), pp. 3581-3589, 2014.
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In the 5th International Conference on Learning Representations (ICLR), 2017.
+Kim-Manuel Klein. About the complexity of two-stage stochastic ips. Mathematical Programming, pp. 1-19, 2021.
+Anton J Kleywegt, Alexander Shapiro, and Tito Homem-de Mello. The sample average approximation method for stochastic discrete optimization. SIAM Journal on Optimization, 12(2):479-502, 2002.
+Wouter Kool, Herke van Hoof, and Max Welling. Attention, learn to solve routing problems! In the 7th International Conference on Learning Representations (ICLR), 2019.
+
+Yeong-Dae Kwon, Jinho Choo, Byoungjip Kim, Iljoo Yoon, Youngjune Gwon, and Seungjai Min. Pomo: Policy optimization with multiple optima for reinforcement learning. In the 34th Conference on Advances in Neural Information Processing Systems (NIPS), 2020.
+Eric Larsen, Sébastien Lachapelle, Yoshua Bengio, Emma Frejinger, Simon Lacoste-Julien, and Andrea Lodi. Predicting solution summaries to integer linear programs under imperfect information with machine learning. arXiv preprint arXiv:1807.11876, 2018.
+Mengyuan Lee, Seyyedali Hosseinalipour, Christopher Greg Brinton, Guanding Yu, and Huaiyu Dai. A fast graph neural network-based method for winner determination in multi-unit combinatorial auctions. IEEE Transactions on Cloud Computing, 2020.
+Vinod Nair, Dj Dvijotham, Iain Dunning, and Oriol Vinyals. Learning fast optimizers for contextual stochastic integer programs. In Proceedings of the 34th Conference on Uncertainty in Artificial Intelligence (UAI), pp. 591-600, 2018.
+Mohammadreza Nazari, Afshin Oroojlooy, Lawrence Snyder, and Martin Takác. Reinforcement learning for solving the vehicle routing problem. In the 32nd Conference on Neural Information Processing Systems (NIPS), pp. 9839-9849, 2018.
+Hae-Sang Park and Chi-Hyuck Jun. A simple and fast algorithm for k-medoids clustering. Expert systems with applications, 36(2):3336-3341, 2009.
+Ragheb Rahmaniani, Teodor Gabriel Crainic, Michel Gendreau, and Walter Rei. Accelerating the benders decomposition method: Application to stochastic network design problems. SIAM Journal on Optimization, 28(1):875-903, 2018.
+Napat Rugeerapaiboon, Kilian Schindler, Daniel Kuhn, and Wolfram Wiesemann. Scenario reduction revisited: Fundamental limits and guarantees. Mathematical Programming, pp. 1-36, 2018.
+Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. the 29th Conference on Advances in Neural Information Processing Systems (NIPS), 28:3483-3491, 2015.
+Stein W Wallace and William T Ziemba. Applications of stochastic programming. SIAM, 2005.
+Yaoxin Wu, Wen Song, Zhiguang Cao, and Jie Zhang. Learning large neighborhood search policy for integer programming. Advances in Neural Information Processing Systems, 34, 2021.
+Liang Yao, Chengsheng Mao, and Yuan Luo. Graph convolutional networks for text classification. In Proceedings of the 33rd Conference on Artificial Intelligence (AAAI), pp. 7370-7377, 2019.
+Cong Zhang, Wen Song, Zhiguang Cao, Jie Zhang, Puay Siew Tan, and Xu Chi. Learning to dispatch for job shop scheduling via deep reinforcement learning. In the 34th Conference on Advances in Neural Information Processing Systems (NIPS), volume 33, pp. 1621-1632, 2020.
+
+# A GRAPH CONVOLUTIONAL NETWORK
+
+Given a complete SIP graph as defined in Section 4.2, we first process the features of nodes and edges by separate linear transformations as below:
+
+$$
+\mathbf {V} ^ {0} = \mathbf {V} \mathbf {W} _ {v} ^ {0} + \mathbf {b} _ {v}; \quad \mathbf {E} ^ {0} = \mathbf {E} \mathbf {W} _ {e} ^ {0} + \mathbf {b} _ {e}, \tag {11}
+$$
+
+where $\mathbf{V} \in \mathbb{R}^{n \times d_v}$ and $\mathbf{E} \in \mathbb{R}^{n \times n \times d_e}$ are the raw features (i.e. parameters in Table 1) on nodes and edges, respectively; $\mathbf{W}_v^0 \in \mathbb{R}^{d_v \times 128}$ and $\mathbf{W}_e^0 \in \mathbb{R}^{d_e \times 128}$ are trainable weights with corresponding bias vectors $\mathbf{b}_v \in \mathbb{R}^{1 \times 128}$ and $\mathbf{b}_e \in \mathbb{R}^{1 \times 128}$ . Note that we also use different linear transformations for heterogeneous nodes or edges. For example, the location nodes of facilities and customers are processed separately.
+
+Next, we advance the node and edge embeddings by the graph convolution layer for $L$ iterations, and each iteration has its own parameters, which are expressed as:
+
+$$
+\mathbf {v} _ {j} ^ {l + 1} = \mathbf {v} _ {j} ^ {l} + \operatorname {P R e L U} \left(\mathrm {B N} \left(\mathbf {v} _ {j} ^ {l} \mathbf {W} _ {1} ^ {l} + \sum_ {k} ^ {\mathbf {e} _ {j k} \in \mathcal {V}} \eta_ {j k} ^ {l} \odot \mathbf {v} _ {j} ^ {l} \mathbf {W} _ {2} ^ {l}\right)\right), \eta_ {j k} ^ {l} = \frac {\sigma \left(\mathbf {e} _ {j k} ^ {l}\right)}{\sum_ {k} ^ {\mathbf {e} _ {j k} \in \mathcal {V}} \sigma \left(\mathbf {e} _ {j k} ^ {l}\right) + \epsilon} \tag {12}
+$$
+
+$$
+\mathbf {e} _ {j k} ^ {l + 1} = \mathbf {e} _ {j k} ^ {l} + \operatorname {P R e L U} \left(\mathrm {B N} \left(\mathbf {e} _ {j k} ^ {l} \mathbf {W} _ {3} ^ {l} + \mathbf {v} _ {j} ^ {l} \mathbf {W} _ {4} ^ {l} + \mathbf {v} _ {k} ^ {l} \mathbf {W} _ {5} ^ {l}\right)\right), l = 0, \dots , L - 1
+$$
+
+where $\mathbf{W}_1^l, \ldots, \mathbf{W}_5^l \in \mathbb{R}^{128 \times 128}$ ; $\odot$ means the element-wise product; $\sigma$ is the sigmoid activation function; $\epsilon$ is a small value to avoid numerical error. Initially, the node embedding $\mathbf{v}_j^0$ is the $j$ -th row of matrix $\mathbf{V}^0$ and edge embedding $\mathbf{e}_{jk}^0$ is the element at the $j$ -th row and $k$ -th column of matrix $\mathbf{E}^0$ . The above graph layer is similar to the one in Joshi et al. (2019) except that we use parametric rectified linear unit with its learnable parameter being 0.25.
+
+After $L$ ( $L = 10$ ) iterations of the above convolution, the node and edge embeddings are represented as $\{\mathbf{v}_j^L\}_{j=1}^n$ and $\{\mathbf{e}_{jk}^L\}_{j,k=1}^n$ , respectively. We attain the graph embedding by the mean pooling over all the node embeddings. We neglect edge embeddings considering that their information has already been involved in node embeddings, after multiple convolutions.
+
+Parameter sharing The graph embedding network based on Eq. (11) and (12) is able to process the sole context $D_{m}$ with its static parameters on the graph. Also it can process the context with any scenario in the instance, by favorizing the graph with both static parameters in $D_{m}$ and a scenario $\omega_{m}^{i}$ . To foster the learning efficiency, we use a single network to process these two featurizations. It is achieved by padding the uncertain parameters with zeros when we only process the context. We represent the resulting graph embeddings by $h_{m}$ and $h_{m}^{i}$ , which are further used to produce conditional and latent variables and meanwhile predict objective values, as stated in Section 4.2.
+
+# B NETWORK DESIGN PROBLEM
+
+Given a complete directed graph $\mathcal{G} = (\mathcal{V},\mathcal{E})$ , each edge $e_{jk}\in \mathcal{E}$ points from $v_{j}$ to $v_{k}$ where $v_{j},v_{k}\in \mathcal{V}$ . We denote the set of source and target nodes as $\mathcal{S}$ and $\mathcal{T}$ respectively. The features on an edge include its capacity $q_{jk}$ , opening cost $o_{jk}$ and transportation cost $h_{jkc}$ for one unit of commodity $c\in C$ .
+
+Scenarios The uncertainty exists in the demands on each node. In specific, the parameter $d_{vc}^{i}$ denotes the demand of commodity $c$ on node $v$ , in the $i$ -th scenario. A penalty $f_{s}$ is given to a source node if its commodities are not fully transported in a scenario due to the capacity limit of opened edges.
+
+Decision variables The decision variable in the first stage is denoted by $x_{jk}$ . $x_{jk} = 1$ means that the edge $e_{jk}$ is open to transport commodities, otherwise $x_{jk} = 0$ . The decision variable in the second stage is denoted by $y_{jkc}^i$ , which means the units of commodity $c$ transported along the edge $e_{jk}$ in the $i$ -th scenario.
+
+The objective of NDP is to decide the edges to be opened, which minimizes the total opening cost and expected transportation cost (including the penalty). The SIP formulation is expressed as:
+
+$$
+\min \sum_ {e _ {j k} \in \mathcal {E}} o _ {j k} x _ {j k} + \frac {1}{N} \sum_ {i = 1} ^ {N} \left(\sum_ {c \in C} \sum_ {e _ {j k} \in \mathcal {E}} t _ {j k c} h _ {j k c} ^ {i} + \sum_ {s \in S} f _ {s} z _ {s c}\right) \tag {13}
+$$
+
+$$
+\text {s . t .} \quad \sum_ {v _ {j} = v} ^ {e _ {j k} \in \mathcal {E}} y _ {j k c} ^ {i} - \sum_ {v _ {k} = v} ^ {e _ {j k} \in \mathcal {E}} y _ {j k c} ^ {i} = d _ {v c} ^ {i}, \quad \forall (v, c, i) \in \mathcal {V} \times C \times \{1, \dots , N \} \tag {14}
+$$
+
+$$
+\sum_ {v _ {j} = t} ^ {e _ {j k} \in \mathcal {E}} y _ {j k c} ^ {i} = \sum_ {v _ {k} = s} ^ {e _ {j k} \in \mathcal {E}} y _ {j k c} ^ {i} = 0, \quad \forall (s, t, c, i) \in \mathcal {S} \times \mathcal {T} \times C \times \{1, \dots , N \} \tag {15}
+$$
+
+$$
+d _ {s c} ^ {i} \leq \sum_ {v _ {j} = s} ^ {e _ {j k} \in \mathcal {E}} y _ {j k c} ^ {i} + M z _ {s c}, \quad \forall (s, c, i) \in \mathcal {S} \times C \times \{1, \dots , N \} \tag {16}
+$$
+
+$$
+\sum_ {c \in C} y _ {j k c} ^ {i} \leq q _ {j k} x _ {j k}, \quad \forall (v _ {j}, v _ {k}, i) \in \mathcal {V} \times \mathcal {V} \times \{1, \dots , N \} \tag {17}
+$$
+
+$$
+z _ {s c}, x _ {j k} \in \{0, 1 \}; y _ {j k c} ^ {i} \in [ 0, \infty). \tag {18}
+$$
+
+where $M$ is a large value which ensures that the source node will not be penalized if all its commodities are transported.
+
+# C FACILITY LOCATION PROBLEM
+
+The facility location problem comprises $F$ and $C$ locations for facilities and customers, respectively. Each facility location is featured by an opening cost $o_f$ , $f \in \{1, \dots, F\}$ and a facility has $q$ units of resources that can be provided to customers. We assume that the number of facilities to be opened is not larger than $v$ . For each customer $c \in \{1, \dots, C\}$ , it consumes $q_{cf}$ units of resources if it is served by the facility at the location $f$ , and the induced service cost is denoted by $s_{cf}$ .
+
+Scenarios The uncertainty exists in the presence of customers. In specific, the parameter $h_c^i$ refers to the presence of the customer $c$ in the $i$ -th scenario, i.e., $h_c^i = 1$ means that the customer $c$ is present to be served in scenario $i$ , otherwise $h_c^i = 0$ . A penalty $b_f$ is given to the facility $f$ in a scenario if one additional unit of resource is needed for it to meet the demand.
+
+Decision variables The decision variable in the first stage is denoted by $x_{f}$ . $x_{f} = 1$ means that a facility is open at location $f$ to provide services, otherwise $x_{f} = 0$ . The second-stage decision variables include $y_{cf}^{i}$ and $z_{f}^{i}$ . In specific, $y_{cf}^{i} = 1$ means that the customer $c$ is served by facility at location $f$ in the $i$ -th scenario, otherwise $y_{cf}^{i} = 0$ . $z_{f}^{i}$ means the quantity of additional resources required at facility location $f$ to meet the total demand of its customers, in the $i$ -th scenario.
+
+The objective is to decide the locations to build the facilities, so as to minimize the total opening cost and the expected service cost including the potential penalty. The two-stage SIP formulation of the facility location problem is expressed as:
+
+$$
+\min \sum_ {f \in F} o _ {f} x _ {f} + \frac {1}{N} \sum_ {i = 1} ^ {N} \left(\sum_ {c \in C} \sum_ {f \in F} s _ {c f} y _ {c f} ^ {i} + \sum_ {f \in F} b _ {f} z _ {f} ^ {i}\right) \tag {19}
+$$
+
+$$
+\text {s . t .} \quad \sum_ {f \in F} x _ {f} \leq v, \tag {20}
+$$
+
+$$
+\sum_ {c \in C} q _ {c f} y _ {c f} ^ {i} \leq q x _ {f} + z _ {f} ^ {i}, \quad \forall (f, i) \in F \times \{1, \dots , N \} \tag {21}
+$$
+
+$$
+z _ {f} ^ {i} \leq M x _ {f}, \quad \forall (f, i) \in F \times \{1, \dots , N \} \tag {22}
+$$
+
+$$
+\sum_ {f \in F} y _ {c f} ^ {i} = h _ {c} ^ {i}, \quad \forall (c, i) \in C \times \{1, \dots , N \} \tag {23}
+$$
+
+$$
+x _ {f}, y _ {c f} ^ {i} \in \{0, 1 \}; z _ {f} ^ {i} \in [ 0, \infty), \tag {24}
+$$
+
+where $M$ is a large value that constrains $z_{f}^{i}$ to 0 if $x_{f} = 0$ , so as to ensure that the facility $f$ will not be penalized if it is not open.
+
+# D DETAILS OFINSTANCE GENERATION
+
+We generate NDP instances with 14 nodes, in which the commodities on two source nodes are transported to another two target nodes to meet their demands. The remaining nodes are only for transition without demands. We set two types of commodities and their quantities are uniformly sampled from [5, 15] in each scenario. For each edge, we uniformly sample the opening cost, shipping cost and capacity from [3, 11], [5, 11] and [10, 41], respectively. A penalty 1000 will be triggered for each source node if its commodities cannot be fully transported due to the capacity limit of opened edges. For FLP, we consider 10 facility nodes and 20 customer nodes, with their coordinates uniformly sampled from the unit square $[0, 1] \times [0, 1]$ . The opening cost and capacity for each facility are uniformly sampled from [40, 81] and [30, 60]. We generate binary values through Bernoulli sampling for customer nodes to indicate their presence in a scenario, with probabilities uniformly sampled from [0.4, 0.6] for each node. A penalty 1000 is set for each facility node if it cannot meet one unit of demands. We generate 200 scenarios for each instance of both problems. To test the generalization performance, we generate larger instances by doubling and quadrupling the number of transition nodes for NDP, respectively. We do the same to both facility and customer nodes for FLP. Regarding the scenario, we also double and quadruple its cardinality in both problems.
+
+# E TRAINING DETAILS FOR THE TWO BASELINE
+
+Scenario-M This method aims to generate one scenario, which can result in a good approximate solution. It is not easy since for each instance, sufficient scenarios need to be evaluated to attain the target scenario for supervised learning. To avoid much computational burden, Bengio et al. (2020) compute the average of scenarios as the initial one and then iteratively improve it to derive a similar solution as the optimal one. However, the improvement heuristic used cannot guarantee that the attained one exists in the original set of scenarios. To tackle this issue, we adapt the method to track the improvement along existing scenarios. Specifically, we find the 20 scenarios nearest to the average and compute the MIPs defined by each of them with the context. We determine the target scenario by picking the one with the most similar solution to the optimal one. This method could be used for both NDP and FLP.
+
+We conduct the same featurization as described in Appendix A.4 in (Bengio et al., 2020), and use both linear regression (LR) and artificial neural network (ANN) with MSE loss. In addition, we also use the same GCN in our method to directly process raw parameters in SIP instances. Specifically, we only input the context with the average of scenarios to GCN, and the graph embedding is linearly projected into output to estimate scenarios. The reported results in the main paper are delivered by GCN, which we find outperforms LR and ANN in most cases.
+
+Solution-M Following (Abbasi et al., 2020), we directly predict the first-stage solution in both NDP and FLP. Despite the machine learning algorithms listed in the paper, we use the same GCN in our method for training. It is more powerful to process the raw parameters under the graph representation. In our cases, the raw parameters are the static parameters in the context for both NDP and FLP. We take them as the input into GCN and the output dimension is same as the number of first-stage decision variables. If there is no static parameters on nodes or edges, we use 0 for them to run GCN as usual.
+
+For both supervised methods, we use 12,800 instances (of normal size) in the training with the number of epochs 100, batch size 64 and learning rate 0.001. We test them with diverse instances as described in corresponding experiments in the main paper.
+
+# F ADDITIONAL RESULTS ON LARGE FLP
+
+We evaluate our methods on FLP of large sizes to show the trend of the average error as the number of representative scenarios grows. We follow the experimental setting in Section 5.3 and apply the trained model to solve 50 instances from FLP (60; 200) and FLP (120; 200). We set $K$ from 1 to
+
+
+Figure 2: Errors with different values of $K$
+
+
+
+20 and thus attain solutions with varying numbers of representative scenarios. The curve of average approximation errors is plotted in Figure 2. We observe that both CVAE-SIP and CVAE-SIPA persistently reduce errors towards 0 as $K$ grows. It means that our methods are consistently attaining more effective representatives from scenarios, which help deliver better solutions. Meanwhile, CVAE-SIP and CVAE-SIPA outperform $K$ -medoids with different $K$ on both problems, especially on FLP (120; 200). It again verifies the merit of the learned representations for solving SIP problems. The comparison between CVAE-SIP and CVAE-SIPA implies that though CVAE-SIPA is superior to CVAE-SIP at the early stage of the curve, i.e., $K = 1, \dots, 3$ , they are on par with each other when more representatives are used eventually.
+
+Table 5: Results on distributions and dependencies
+
+| NDP (14; 200); Normal | NDP (14; 200); Binomial | | |
| Method | K=3 | K=5 | K=10 | K=3 | K=5 | K=10 | | |
| Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | | |
| CPLEX | 513.82 | 0.00 | 16s | 513.82 | 0.00 | 16s | 513.82 | 0.00 | 16s | 510.08 | 0.00 | 20s | 510.08 | 0.00 | 20s | 510.08 | 0.00 | 20s |
| Scenario-M | 1039.48 | 0.93 | 0.8s | 1039.48 | 0.93 | 0.8s | 1039.48 | 0.93 | 0.8s | 1271.23 | 1.21 | 0.6s | 1271.23 | 1.21 | 0.6s | 1271.23 | 1.21 | 0.6s |
| Solution-M | 678.74 | 0.34 | 0.8s | 678.74 | 0.34 | 0.8s | 678.74 | 0.34 | 0.8s | 729.81 | 0.51 | 0.2s | 729.81 | 0.51 | 0.2s | 729.81 | 0.51 | 0.2s |
| K-medoids | 662.48 | 0.30 | 0.2s | 585.66 | 0.14 | 0.3s | 546.51 | 0.06 | 0.5s | 684.71 | 0.34 | 0.3s | 623.76 | 0.22 | 0.3s | 583.25 | 0.14 | 0.5s |
| CVAE-SIP | 622.98 | 0.23 | 0.6s | 548.45 | 0.07 | 0.6s | 527.59 | 0.03 | 0.9s | 695.60 | 0.36 | 0.6s | 592.40 | 0.16 | 0.6s | 555.35 | 0.09 | 0.9s |
| CVAE-SIPA | 562.87 | 0.11 | 0.5s | 551.94 | 0.07 | 0.6s | 531.94 | 0.04 | 0.8s | 622.91 | 0.22 | 0.5s | 592.91 | 0.16 | 0.6s | 540.54 | 0.06 | 0.9s |
| NDP (14; 200); D0 | NDP (14; 200); D1 | | |
| Method | K=3 | K=5 | K=10 | K=3 | K=5 | K=10 | | |
| Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | Obj. | Error Time | | |
| CPLEX | 563.16 | 0.00 | 17s | 563.16 | 0.00 | 17s | 563.16 | 0.00 | 17s | 617.21 | 0.00 | 17s | 617.21 | 0.00 | 17s | 617.21 | 0.00 | 17s |
| Scenario-M | 1061.20 | 0.87 | 0.7s | 1061.20 | 0.87 | 0.7s | 1061.20 | 0.87 | 0.7s | 1434.12 | 1.37 | 0.9s | 1434.12 | 1.37 | 0.9s | 1434.12 | 1.37 | 0.9s |
| Solution-M | 754.11 | 0.38 | 0.6s | 754.11 | 0.38 | 0.6s | 754.11 | 0.38 | 0.6s | 1282.59 | 1.12 | 0.6s | 1282.59 | 1.12 | 0.6s | 1282.59 | 1.12 | 0.6s |
| K-medoids | 1086.43 | 0.93 | 0.3s | 744.53 | 0.32 | 0.4s | 635.58 | 0.13 | 0.5s | 1091.11 | 0.79 | 0.3s | 816.62 | 0.33 | 0.3s | 692.81 | 0.12 | 0.6s |
| CVAE-SIP | 1070.44 | 0.89 | 0.6s | 698.18 | 0.24 | 0.6s | 632.03 | 0.12 | 0.9s | 1180.53 | 0.90 | 0.6s | 809.02 | 0.31 | 0.6s | 675.19 | 0.09 | 0.9s |
| CVAE-SIPA | 678.80 | 0.20 | 0.5s | 663.97 | 0.18 | 0.6s | 578.57 | 0.03 | 0.8s | 758.14 | 0.23 | 0.5s | 737.81 | 0.19 | 0.5s | 643.50 | 0.04 | 0.8s |
+
+# G GENERALIZATION ACROSS DISTRIBUTIONS AND DEPENDENCIES
+
+We test the generalization performance of our method on NDP with scenarios sampling from the Normal distribution and Binomial distribution. For the former, we set the expectation and standard deviation to 10 and 2, respectively. For the latter, we set the number of runs and the probability to 20 and 0.5. The results are summarized in the upper half of Table 5. We observe that our methods consistently outperform other learning based approaches with scenarios from both distributions. When $K = 10$ , both CVAE-SIP and CVAE-SIPA achieve near-optimal solutions with slight approximation errors. On the other hand, it can be found that the results delivered by CVAE-SIPA are generally superior or comparable to those by CVAE-SIP, suggesting a better cross-distribution generalization.
+
+In our training, we do not assume explicit dependencies between the context and scenarios, following the settings in (Keutchayan et al., 2020; Nair et al., 2018; Abbasi et al., 2020). However, we would like to show that the trained networks can well generalize to the dependent settings. In specific, we construct in NDP two dependencies between the demand scenarios and costs in contexts as follows:
+
+
+
+
+
+
+
+
+Figure 3: Objective prediction against latent representations (NDP)
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Objective prediction against latent representations (FLP)
+
+
+
+
+
+1) D0: for each instance, the lower bound of Uniform demands is determined by the smaller value of the average opening and shipping cost in the context; 2) D1: the lower and upper bounds of Uniform demands are determined by the smaller and larger value of the average opening and shipping cost, respectively. We generate 50 instances for each dependency. From the lower half of Table 5, we observe that our methods outperform learning based baselines except the cases with $K = 3$ , where CVAE-SIP loses its advantage over a few baselines. Generally, it indicates that our methods possess fairly good generalization abilities to the setting where scenarios depend on the contexts.
+
+# H RESULTS ON OBJECTIVE PREDICTION
+
+We first evaluate our trained model for the prediction task in three FLP instances, which are randomly generated from FLP (30; 200), FLP (120; 200) and FLP (30; 800), respectively. For each instance, we draw a scatter plot of the 2-dimensional latent representations for scenarios and represent the normalized objective values using different colors. The results are shown in the upper half
+
+Table 6: Comparison with OR methods
+
+| NDP (14; 200) | FLP (30; 200) | | | |
| Method | K=5 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | K=5 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | | |
| CPLEX | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 236.71 | 0.00 | 18s | 236.71 | 0.00 | 18s | 236.71 | 0.00 | 18s |
| CSSC | 695.08 | 0.10 | 17s | 689.43 | 0.09 | 17s | 669.59 | 0.05 | 30s | 338.84 | 0.39 | 12s | 299.42 | 0.23 | 12s | 264.98 | 0.16 | 14s |
| Scen-red | 951.54 | 0.50 | 0.3s | 739.41 | 0.18 | 0.5s | 650.80 | 0.03 | 1s | 640.07 | 1.54 | 0.3s | 323.34 | 0.29 | 0.3s | 246.57 | 0.08 | 1s |
| CVAE-SIP | 930.73 | 0.48 | 0.7s | 734.24 | 0.15 | 0.9s | 637.99 | 0.02 | 1s | 929.61 | 2.87 | 0.7s | 482.70 | 0.99 | 0.7s | 282.49 | 0.23 | 1s |
| CVAE-SIPA | 769.70 | 0.24 | 0.6s | 687.68 | 0.08 | 0.8s | 642.12 | 0.03 | 1s | 709.08 | 1.71 | 0.6s | 381.41 | 0.58 | 0.7s | 264.01 | 0.15 | 1s |
| NDP (44; 200) | FLP (120; 200) | | |
| Method | K=5 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | K=5 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | K=10 Obj. | Error Time | K=20 Obj. | Error Time | | |
| CPLEX | 580.67 | 0.00 | 23m | 580.67 | 0.00 | 23m | 580.67 | 0.00 | 23m | 484.60 | 0.00 | 1h | 484.60 | 0.00 | 1h | 484.60 | 0.00 | 1h |
| CSSC | 618.10 | 0.07 | 2m | 617.94 | 0.07 | 2m | 612.77 | 0.06 | 4m | 1101.83 | 1.28 | 34s | 844.24 | 0.76 | 42s | 715.46 | 0.59 | 2m |
| Scen-red | 894.90 | 0.57 | 3s | 667.90 | 0.15 | 6s | 616.23 | 0.07 | 15s | 1056.69 | 1.19 | 6s | 793.45 | 0.68 | 15s | 607.69 | 0.26 | 60s |
| CVAE-SIP | 1079.80 | 0.84 | 5s | 615.99 | 0.06 | 8s | 588.18 | 0.02 | 16s | 1585.53 | 2.27 | 12s | 985.45 | 0.99 | 35s | 627.30 | 0.28 | 56s |
| CVAE-SIPA | 682.35 | 0.17 | 5s | 627.62 | 0.08 | 8s | 581.07 | 0.00 | 17s | 2051.45 | 3.13 | 16s | 910.50 | 0.84 | 33s | 594.33 | 0.22 | 69s |
+
+of Figure 4, and the corresponding ground truth (i.e. optimal solution values attained by CPLEX) are displayed in the lower half. It is clear that the prediction is fairly accurate with almost the same patterns as the target values in the ground truth, even for the larger problem size or scenario cardinality. It indicates that our design for semi-supervised learning is effective and the trained model exhibits a desirable generalization ability.
+
+We further evaluate the objective prediction on NDP. Specifically, the trained model is used to predict objective values for the scenarios from three instances, which are randomly generated from NDP (14; 200), NDP (44; 200) and NDP (14; 800), respectively. From the results in Figure 3, we observe that our method can also predict the objective values accurately for NDP. Especially, the pattern of predicted values for NDP (14; 800) is almost indistinguishable from the one by ground truth. It reveals that our design for the semi-supervised learning is effective across distinct SIPs.
+
+# I COMPARISON WITH OR METHODS
+
+In this section, we compare our methods with two mature methods from operations research (OR), i.e., 1) Scen-red (Heitsch & Römisch, 2003), which seeks a subset of scenarios that is closest to original scenarios in terms of Fortet-Mourier probability metric, and 2) CSSC (Keutchayan et al., 2020), which solves a MILP to derive representative scenarios, each of which estimates the average objective of some other scenarios. They are on behalf of the distribution-oriented and problem-oriented paradigm, respectively. The tested instances are the same as the ones in Section 5.2 and 5.3. From the results in Table 6, we observe that our methods are comparable to or better than the baselines and especially on NDP. While CVAE-SIP and CVAE-SIPA are inferior to CSSC on NDP with $K = 5$ , they attain the best approximate solutions when $K = 10$ and 20. Notably, the errors of our methods are close to 0 on both normal and large instances when $K = 20$ . For FLP, while our methods are inferior to CSSC and Scen-red on FLP when $K = 5$ and 10, CVAE-SIPA surpasses CSSC on FLP (30; 200) and gains the smallest objective value and error on FLP (120; 200), when $K = 20$ . Since our runtime is shorter than CSSC and similar to Scen-red, the results again verify that our methods are effective to reduce scenarios for good approximations.
+
+# J ABLATION STUDY
+
+We further conduct an ablation study on NDP to verify the effectiveness of the learned scenario representations, and meanwhile investigate the mixed use of these representations with the original scenarios. In specific, we enrich the original scenario set for clustering in the following ways: 1) CVAE-SIPA+Ori.: we concatenate the predicted objective values with their original scenarios (rather than the learned representations in CVAE-SIPA); 2) CVAE-SIP+Ori.: we concatenate the learned representations with their original scenarios (rather than merely use the learned representations in CVAE-SIP). These two kinds of mixed representations are used for clustering to find representative scenarios, where we set $K = 5$ , 10, 20. The tested instances are the same as the ones in Section 5.2 and 5.3. As shown in Table 6, both CVAE-SIP and CVAE-SIPA are generally superior to their
+
+Table 7: Ablation study
+
+| NDP (14; 200) | NDP (44; 200) |
| Method | K=5 | K=10 | K=20 | K=5 | K=10 | K=20 | K=10 | K=20 |
| Obj. | Error | Obj. | Error | Obj. | Error | Obj. | Error | Obj. | Error | Obj. | Error | Obj. | Error | Obj. |
| CPLEX | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 635.75 | 0.00 | 18s | 580.67 | 0.00 | 23m | 580.67 | 0.00 | 23m |
| K-medoids | 976.47 | 0.54 | 0.3s | 761.18 | 0.19 | 0.6s | 677.02 | 0.08 | 1s | 803.99 | 0.38 | 3s | 652.78 | 0.12 | 7s |
| CVAE-SIPA+Ori. | 917.51 | 0.45 | 0.6s | 741.81 | 0.17 | 0.9s | 699.89 | 0.09 | 1s | 918.16 | 0.57 | 5s | 700.10 | 0.19 | 8s |
| CVAE-SIPA | 769.70 | 0.24 | 0.6s | 687.68 | 0.08 | 0.8s | 642.12 | 0.03 | 1s | 682.35 | 0.17 | 5s | 627.62 | 0.08 | 8s |
| CVAE-SIP+Ori. | 1208.19 | 0.93 | 0.6s | 850.85 | 0.34 | 0.8 | 679.07 | 0.06 | 1s | 1056.61 | 0.82 | 5s | 785.60 | 0.32 | 9s |
| CVAE-SIP | 930.73 | 0.48 | 0.7s | 734.24 | 0.15 | 0.9s | 637.99 | 0.02 | 1s | 1079.80 | 0.84 | 5s | 615.99 | 0.06 | 8s |
+
+1 Bold means the method outperforms its counterpart.
+
+counterparts. The advantage of CVAE-SIPA over CVAE-SIPA+Ori. indicates that with the same predicted objective values, our learned representations are effective to attain better representatives than the original scenarios. Moreover, CVAE-SIP is superior to CVAE-SIP+Ori. probably because the learned representations are overwhelmed by the original scenarios to some extent. It is also interesting to identify an advantage that CVAE-SIP $>$ K-medoids $>$ CVAE-SIP+Ori, which means the pure use of learned representations or original scenarios is better than the mixed use of both.
\ No newline at end of file
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/images.zip b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..31f6d085d0e84b3af4b25dce77b147df983b57f3
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6c066963f7ca1842e5995fed1727f941f3ee5f6793cfb69822e3cdfc35b12e95
+size 1021469
diff --git a/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/layout.json b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d98dc5c703ce6bd1f45a2e3027efef49f4448f80
--- /dev/null
+++ b/learningscenariorepresentationforsolvingtwostagestochasticintegerprograms/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fcd828f80b103924301b53179f48e4b43a083bd02f2a9a40a2c8ff94594e0ad4
+size 683482
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_content_list.json b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..22fec020cf39d7f6a6531c0f6617e68cd3956a6c
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f4a07a4fe0ecbcade97dbc362e6da3a1424e483667f9dcad81f0062089f30ba
+size 125900
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_model.json b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..76f7de6d822ef88ac4da22a42614592df565b8e3
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f34cdf6cd9f7c2820ac56f2290302fdc953098a1997f49240880fccf79126dc4
+size 146801
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_origin.pdf b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..abccaf027c9d3be2fd4d04bf1bf7ea7bca37de48
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/8fae84c9-3835-4931-a036-6864d79211aa_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a6a69e37a7af60d49eb264b6ab2e7e7d5a448ff53c2a013572b4ceeac9f6f74
+size 1603987
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/full.md b/learningstaterepresentationsviaretracinginreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..06203c813e4c4f75ba4891ee1c4bacd6ca190e7b
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/full.md
@@ -0,0 +1,475 @@
+# LEARNING STATE REPRESENTATIONS VIA RETRACING IN REINFORCEMENT LEARNING
+
+Changmin Yu $^{1*}$ , Dong Li $^{2}$ , Jianye Hao $^{3,2}$ , Jun Wang $^{1,2}$ , Neil Burgess $^{1*}$
+
+$^{1}$ UCL, London, United Kingdom
+$^{2}$ Huawei Noah's Ark Lab
+3College of Intelligence and Computing, Tianjin University
+
+{changmin.yu.19; n.burgess}@ucl.ac.uk;
+
+{lidong106; w.j}@huawei.com; jianye.hao@tju.edu.cn
+
+# ABSTRACT
+
+We propose learning via retracing, a novel self-supervised approach for learning the state representation (and the associated dynamics model) for reinforcement learning tasks. In addition to the predictive (reconstruction) supervision in the forward direction, we propose to include "retraced" transitions for representation/model learning, by enforcing the cycle-consistency constraint between the original and retraced states, hence improve upon the sample efficiency of learning. Moreover, learning via retracing explicitly propagates information about future transitions backward for inferring previous states, thus facilitates stronger representation learning for the downstream reinforcement learning tasks. We introduce Cycle-Consistency World Model (CCWM), a concrete model-based instantiation of learning via retracing. Additionally we propose a novel adaptive "truncation" mechanism for counteracting the negative impacts brought by "irreversible" transitions such that learning via retracing can be maximally effective. Through extensive empirical studies on visual-based continuous control benchmarks, we demonstrate that CCWM achieves state-of-the-art performance in terms of sample efficiency and asymptotic performance, whilst exhibiting behaviours that are indicative of stronger representation learning.
+
+# 1 INTRODUCTION
+
+Recent developments in deep reinforcement learning (RL) have made great progress in solving complex control tasks (Mnih et al., 2013; Levine et al., 2016; Silver et al., 2017; Vinyals et al., 2017; Schrittwieser et al., 2020). With the increasing capacity of deep RL algorithms, the problems of interests become increasingly complex. An immediate challenge is that the observation space becomes unprecedentedly high-dimensional, and often the perceived observations have significant redundancy and might only contain partial information with respect to the associated ground-truth states, hence negatively impacting the policy learning. The field of representation learning offers a wide range of approaches for extracting useful information from high-dimensional data (with potentially sequential dependency structure) (Bengio et al., 2013). Many recent works have explored the application of representation learning in RL (Ha and Schmidhuber, 2018; Hafner et al., 2019; 2020a; Schrittwieser et al., 2020; Schwarzer et al., 2021; Zhang et al., 2020), which lead to superior performance comparing to naive embedding. Many such algorithms rely on predictive (reconstruction) supervision for representation learning, such that the effects of actions in the observable space are maximally preserved in the learned representation space.
+
+Here we argue that existing methods do not fully exploit the supervisory signals inherent in the data. Additional valid supervision can often be obtained for representation learning by including temporally "backward" transitions in situations in which the same set of rules govern both temporally forward and backward transitions. Hence, with "learning via retracing", we obtain more training samples for representation learning without additional interaction with the environment (twice as much as existing approaches in tasks that admit perfect reversibility across all transitions). Therefore, we hypothesise that by augmenting representation learning with "learning via retracing", we can significantly improve
+
+*Please send any enquiry to changmin.yu.19@ucl.ac.uk and n.burgess@ucl.ac.uk
+
+the sample efficiency of representation learning and the overall RL task, which is a long-standing issue that plagues the practical applicability of deep RL algorithms. Beyond improved sample efficiency, joint predictive supervision in temporally forward and backward directions use information from both the future and the past for the inference of states, similar to the smoothing operation for latent state inference in state-space models (Kalman, 1960; Murphy, 2012), leading to more accurate latent state inference, hence achieving stronger representation learning.
+
+
+(a)
+
+
+Figure 1: Motivation of "learning via retracing". (a): Retracing in navigation tasks yields faster representation learning and potentially supports stronger generalisation; (b): "Irreversible" transitions (graphical demonstration from the DeepMind Control Suite Tassa et al. (2018)).
+
+
+(b)
+
+As a motivating example, consider a rat navigating towards a cheese in a cluttered environment (Figure 1a). Upon first visit to the goal state, multiple imaginative retracing trajectories can be randomly simulated. By constraining the temporal cycle-consistency of the retracing transitions, the rat quickly builds a state representation that accurately preserves the transitions in the area around the actual forward trajectory taken by the rat. Moreover, all retracing simulations pass through the two "doors", allowing the rat to quickly identify the key bottleneck states that are essential for successful navigation towards the goal and generalisation to other task topologies (Section 5.3). We conjecture that such imaginative retracing could be neurally implemented by the reversed hippocampal "replay" that has been observed in both rodents and humans (Foster and Wilson, 2006; Penny et al., 2013; Liu et al., 2021) (see Section 6 for further discussion).
+
+One problem that hinders the successful application of "learning via retracing" is that reversibility might not be preserved across all valid transitions, i.e., there exists transitions such that $s \rightarrow s'$ for some action $a$ , but no action $a'$ such that $s' \rightarrow s$ (Figure 1b). Under these situations, naively enforcing the similarity between the representations of $s$ and $\check{s}$ (the retraced state given $s'$ and $a$ , see Section 3) leads to a suboptimal representation space, potentially hindering RL training. Hence in order to maximally preserve the advantages brought by "learning via retracing", it is essential to identify "irreversible" transitions and rule them out from representation learning via retracing. To this end, we propose a novel dynamically regulated approach for identifying such "irreversible" states, which we term adaptive truncation (Section 3.3).
+
+"Learning via retracing" can be integrated into any representation learning method that utilises a transition model, under both the model-free and model-based RL frameworks. Here we propose Cycle-Consistency World Model (CCWM), a self-supervised instantiation of "learning via retracing", for joint representation learning and generative model learning under the model-based RL setting. We empirically evaluate CCWM on challenging visual-based continuous control benchmarks. Experimental results show that CCWM achieves state-of-the-art performance in terms of sample efficiency and asymptotic performance, whilst providing additional benefits such as stronger generalisability and extended planning horizon, indicative of stronger representation learning is achieved.
+
+# 2 PRELIMINARIES
+
+# 2.1 PROBLEM FORMULATION
+
+We consider reinforcement learning problems in Markov Decision Processes (MDPs). An MDP can be characterised by the tuple, $\mathcal{M} = \langle S, \mathcal{A}, \mathcal{R}, \mathcal{P}, \gamma \rangle$ , where $S, \mathcal{A}$ are the state and action spaces, respectively; $\mathcal{R}: S \to \mathbb{R}$ is the reward function (we assume deterministic reward functions unless stated otherwise), $\mathcal{P}: S \times \mathcal{A} \times S \to [0,1]$ is the transition distribution of the task dynamics; $\gamma \in \mathbb{R}$ is the discounting factor. The control policy, $\pi: S \times \mathcal{A} \to [0,1]$ , represents a distribution over actions at each state. The goal is to learn the optimal policy, $\pi^{*}$ , such that the expected future reward is maximised across all states, i.e.,
+
+$$
+\pi^ {*} = \underset {\pi \in \Pi} {\arg \max } \mathbb {E} _ {\pi} \left[ \sum_ {t} \gamma^ {t} \mathcal {R} \left(s _ {t}, a _ {t}\right) | s _ {0} = s \right], \forall s \in \mathcal {S}, \text {w h e r e} s _ {t} \sim \mathcal {P} (\cdot | s _ {t - 1}, a _ {t - 1}) \text {f o r} t = 1, 2, \dots \tag {1}
+$$
+
+Here we consider tasks in which the perceivable observation space, $\mathcal{O}$ , is high-dimensional, due to either redundant information or simply because only visual inputs are available. Hence it is necessary
+
+to learn an embedding function, $\phi : \mathcal{O} \rightarrow \mathcal{Z}$ , such that the embedded observation space, $\phi \mathcal{O}$ , could act as $\mathcal{S}$ in the MDP, to support efficient learning of the optimal policy using existing RL algorithms.
+
+# 2.2 GENERATIVE MODELLING OF DYNAMICS
+
+Modelling the transition dynamics using a sequential VAE-like structure enables joint learning of the latent representation and the associated latent transitions. Specifically, the dynamics model is defined in terms of the following components (see also top part in Figure 2b).
+
+$$
+\text {O b s e r v a t i o n} \quad (c o n t e x t) \text {e m b e d d i n g :} e _ {t} = q _ {\phi} \left(O _ {t}\right),
+$$
+
+$$
+\text {L a t e n t} p \left(z _ {t + 1} \mid z _ {t}, a _ {t}, O _ {t + 1}\right),
+$$
+
+$$
+\text {L a t e n t} q _ {\psi_ {1}} \left(z _ {t + 1} \mid z _ {t}, a _ {t}\right), \tag {2}
+$$
+
+$$
+\text {L a t e n t v a r i a t i o n a l p o s t e r i o r d i s t i b u t i o n :} q _ {\psi_ {2}} \left(z _ {t + 1} \mid z _ {t}, a _ {t}, e _ {t + 1}\right),
+$$
+
+$$
+\text {G e n e r a t i v e} p _ {\theta} \left(O _ {t + 1} \mid z _ {t + 1}\right),
+$$
+
+where $\psi = \{\psi_1,\psi_2,\phi \}$ and $\theta$ represent the parameters associated with the recognition and generative models respectively. Latent variables $z\in \mathcal{Z}$ are introduced for more flexible modelling of the distribution of the observed variables. A variational approximation is employed since the true posterior $p(z_{t + 1}|z_t,a_t,O_{t + 1})$ is usually intractable in practice.
+
+At each time step $t$ , the agent receives an observation $O_{t}$ , which is then embedded into a context vector $e_{t} = q_{\phi}(O_{t})$ . After initialisation, the latent space vector is rolled out in a forward fashion given the action $a_{t}$ , yielding one-step prediction into the future following the variational transition (prior) distribution $q_{\psi_1}(z_{t + 1}|z_t,a_t)$ (we assume standard first-order Markovian structure in the latent space). The dynamics model is trained via maximum likelihood learning, and due to intractability, we adopt standard amortised variational inference, and the parameters of the recognition and generative models in Eq. 2 are learned by maximising the variational free energy (also known as the ELBO; (Wainwright and Jordan, 2008; Higgins et al., 2016)).
+
+$$
+\mathcal {L} _ {\text {f o r w a r d}} \left(O _ {t + 1}\right) = \mathbb {E} _ {z _ {t + 1} \sim q _ {\psi_ {2}}} \left[ \log p _ {\theta} \left(O _ {t + 1} \mid z _ {t + 1}\right) - \beta \mathcal {D} _ {\mathrm {K L}} \left[ q _ {\psi_ {2}} \left(z _ {t + 1} \mid z _ {t}, a _ {t}, e _ {t + 1}\right) \right| \left| q _ {\psi_ {1}} \left(z _ {t + 1} \mid z _ {t}, a _ {t}\right) \right] \right], \tag {3}
+$$
+
+The variational free energy objective consists of the reconstruction error, $p_{\theta}(O_{t + 1}|z_{t + 1})$ , and the KL-divergence between the variational posterior distributions and the predictive prior as regularisation. The intuitive autoencoder-like structure nicely separates the generative process from the inference process, with the variational posterior ( $q_{\psi_2}(z_{t + 1}|z_t,a_t,e_{t + 1})$ ) serving as the main inference engine of the optimal latent representations. Note that the $\beta$ parameter controls the degree of factored structure (disentanglement) of the latent code, which by default is set to 1 (Higgins et al., 2016).
+
+# 3 METHOD
+
+We firstly introduce learning via retracing in its most general format, then provide a concrete model-based instantiation based on generative dynamics modelling. We finally propose a novel adaptive truncation scheme for dealing with the "irreversibility" issue in "learning via retracing".
+
+# 3.1 LEARNING VIA RETRACING
+
+We always assume the usage of an approximate dynamics model, regardless of the overall RL agent being model-free or model-based (the dynamics model would only be used for representation learning under the model-free setting, hence it is possible to have separate dynamics models for forward and "reversed" transitions). Given a set of observations, $\mathbf{O} = \{O_1,\dots ,O_T\}$ , a dynamics model, $\mathcal{M}:S\times \mathcal{A}\times S\to [0,1]$ , most existing methods of self-supervised representation learning involve learning an encoder $(\mathcal{E}_{\phi})$ and a decoder $(\mathcal{D}_{\theta})$ , trained via minimising the predictive reconstruction.
+
+$$
+\mathcal {L} (\phi , \theta) = d \left(O _ {1: T}, \mathcal {D} _ {\theta} \left(f \left(\mathcal {E} _ {\phi} \left(O _ {1: T}\right); A _ {1: T - 1}, \mathcal {M}\right)\right) \right. \tag {4}
+$$
+
+where $d$ is some metric of the observable space (e.g., the $L2$ distance). The function $f(e;\mathcal{M},a)$ is some function specifying the schedule for predictions, e.g., $f(e_t,\mathcal{M},a_t) = \mathcal{M}(e_t,a_t) = \hat{e}_{t + 1}$ corresponds to learning the representations based on one-step predictive reconstruction.
+
+Existing methods explore predictive supervision in a temporally forward direction, however, we argue that the "reversed" transitions can also contain useful signals for learning. Consider a transition tuple, $(s,a,s')$ , we define the "reversed" transitions being the tuple $(s',a',s)$ , where $a'$ is the "reversed" action. In situations where the same set of rules apply to forward and backward transitions, the reversed transition given $a'$ could contribute to representation learning via Eq. 4 as an additional training
+
+sample (utilising a potentially different loss function from the forward supervision, see Figure 2a).
+
+Hence by utilising the additional reversed transition for representation learning, we improve the sample efficiency of learning without additional interaction with the environment. As mentioned previously, in situations where perfect reversibility is not preserved across all transitions, such "irreversible" transitions could negatively impact the overall learning. Correct identification of such states is hence essential for the successful implementation of "learning via retracing". To this end, we propose a novel adaptive truncation scheme in Section 3.3.
+
+Despite the intuitive simplicity of learning via retracing, it offers a number of advantages comparing to existing representation learning methods. In addition to the improved sample efficiency, we can interpret learning with "reversed" transitions as explicit inference of the current latent state given future information. In combination with the forward predictive supervision, the joint learning dynamics is similar to the smoothing operation in dynamical systems, which is often superior than filtering (corresponds to using solely the forward predictive supervision) in terms of inference accuracy (Kalman, 1960; Murphy, 2012). Hence learning via retracing could support stronger representation learning for the downstream RL task. We note that the
+
+overall RL agent could still benefit from the representations obtain from learning via retracing even in tasks without perfect reversibility, such as a moving car where the external state feature, such as the absolute location, and controllable internal state features, such as the velocity and acceleration, are not jointly reversible. In such cases, we expect learning via retracing would dissect out the controllable internal features from the external features and prioritise the training with respect to such features.
+
+We have introduced learning via retracing in its most general form, where a large degree of freedom exists such that the method can be tailored and integrated with many of the existing representation learning approaches. There are many free model choices, such as being model-free or model-based; whether or not to use a separate "reversed" dynamics model; loss function for constraining the "retracted" transitions; deterministic or probabilistic dynamics model, just to name a few. Below we provide one concrete instantiation of learning via retracing, the Cycle-Consistency World Model (CCWM), under the model-based framework based on generative dynamics modelling.
+
+# 3.2 CYCLE-CONSISTENCY WORLD MODEL
+
+CCWM is a model-based RL agent that utilises a generative world-model, trained given both the predictive reconstruction of future states, and constraining the temporal cycle-consistency of the "retraced" states (i.e., constraining the retraced states to match the original states). For notational convenience, we denote all predictive prior estimates, posterior estimates, and the retraced predictive latent estimates as $\hat{z}$ , $\tilde{z}$ and $\tilde{z}$ , respectively.
+
+We use the similar dynamics model described in Section 2.2 (top panel in Figure 2b). We additionally define a reverse action approximator, $\rho_{\zeta}:\mathcal{Z}\times \mathcal{Z}\to \mathcal{A}$ , which takes in a tuple of latent states $(z_{t + 1},z_t)$ and outputs an action $\check{a}_{t + 1}$ that approximates the "reversed" action that leads the transition from $z_{t + 1}$ back to $z_{t}$ . Instead of introducing a separate "reversed" dynamics model, we use the same dynamics model for both the forward and retracing transitions, which lead to improved sample efficiency of model learning in addition to representation learning. The parameters of $\rho ,\zeta$ can be
+
+
+(a)
+
+
+Figure 2: Graphical illustration of "learning via retracing". (a) "learning via retracing" additionally constrains the similarity between the retraced and original states for representation learning; (b) Graphical model of CCWM. The empty circle and filler square nodes represent the stochastic and deterministic variables, respectively.
+
+either learned jointly with the model in an end-to-end fashion, or trained separately (see Appendix D). The graphical model of CCWM is shown in Figure 2b.
+
+During training, given a sample trajectory $\{O_{1:T+1}, a_{1:T}\}$ , we firstly perform a one-step forward sweep through all timesteps to compute the variational prior and posterior estimates of latent states.
+
+$$
+\hat {z} _ {\tau + 1} \sim q _ {\psi_ {1}} (z | \tilde {z} _ {\tau}, a _ {\tau}) \tag {5}
+$$
+
+$$
+\tilde {z} _ {\tau + 1} \sim q _ {\psi_ {2}} (z | \hat {z} _ {\tau}, a _ {\tau}, q _ {\phi} (O _ {\tau}))
+$$
+
+for $\tau = 0,\dots ,T$ , where $\hat{z}_0$ is randomly initialised. Note that we also include reward prediction as part of the dynamics modelling, and we have omitted showing this for simplicity.
+
+Given the predictive estimates in the forward direction, we compute the "retracing" estimates, utilising the same latent transition dynamics (variational predictive prior distribution).
+
+$$
+\tilde {z} _ {\tau} \sim q _ {\psi_ {1}} (z | \tilde {z} _ {\tau + 1}, \check {a} _ {\tau + 1}), \text {w h e r e} \check {a} _ {\tau + 1} = \rho_ {\zeta} (\tilde {z} _ {\tau + 1}, \tilde {z} _ {\tau}), \text {f o r} \tau = 1, \dots , T \tag {6}
+$$
+
+The forward and retracing predictive supervision separately contributes to the model learning of CCWM. For the forward pass, the parameters of the dynamics model are trained to maximise the likelihood of the sampled observations via predictive reconstruction. We follow the variational principle, by maximising the variational free energy (Eq. 3), computed by Monte Carlo estimate given the posterior predictive samples. For the "retracing" operation, model learning is based on constraining the deviation of the retracted states from the original states. Intuitively, this utilises the temporal cycle-consistency of the transition dynamics: assuming that the action-dependent transition mapping is invertible across all timesteps (Dwibedi et al., 2019). The loss function for constraining the cycle-consistency is another degree of freedom of "learning via retracing". For CCWM, we choose bisimulation metric as the loss function for the retracing operations, which has been shown to yield stronger constraints of the latent states on the MDP level, and also leads to more robust and noise-invariant representation without reconstruction (Ferns et al., 2011; Zhang et al., 2020).
+
+$$
+\mathcal {L} _ {\text {r e t r a c e}} \left(\tilde {z} _ {t}, \check {z} _ {t}\right) = \mathbb {E} _ {\tilde {z} _ {t}} \left[ \left(\left| | \tilde {z} _ {t} - \check {z} _ {t} \right| \right| _ {1} - \mathcal {D} _ {\mathrm {K L}} \left[ \hat {R} (\cdot | \tilde {z} _ {t}) \right| \left| \hat {R} (\cdot | \check {z} _ {t}) \right] - \gamma W _ {2} \left(q _ {\psi_ {1}} (\cdot | \tilde {z} _ {t}, \pi (\tilde {z} _ {t})) , q _ {\psi_ {1}} (\cdot | \check {z} _ {t}, \pi (\check {z} _ {t}))\right) ^ {2} \right], \tag {7}
+$$
+
+where $\hat{R}(r|z)$ represents the learned reward distributions (we assume stochastic rewards), and $W_{2}(\cdot, \cdot)$ represents the 2-Wasserstein distance (see Eq. 11 in Appendix D). The advantage of choosing the bisimulation metric as the retrace loss function is further empirically shown in Appendix G through careful ablation studies (Figure 11). Multiple retracing trajectories can be simulated and the retrace loss is again a Monte Carlo estimate based on sampled "retracing" states, but empirically we observe that one "retracing" sample is sufficient as we do not observe noticeable improvements for increasing the number of "retraced" samples. We note that here we utilise the same transition dynamics model for both forward and reversed rollouts, which might cause issues in model learning due to the absence of perfect "reversibility" across all valid transitions. Hence we need a method for dynamically assessing the "reversibility" so as to know when to apply learning via retracing (see Section 3.3).
+
+The overall objective for the CCWM dynamics model training is thus a linear combination of the forward and "retracing" loss functions.
+
+$$
+\mathcal {L} (\theta , \psi , \zeta) = \frac {1}{N T} \sum_ {n = 1} ^ {N} \sum_ {\tau = 1} ^ {T} \left[ \mathcal {L} _ {\text {f o r w a r d}} \left(O _ {\tau} ^ {n}; \theta , \psi\right) + \lambda \mathcal {L} _ {\text {r e t r a c e}} \left(\tilde {z} _ {\tau} ^ {n}, \tilde {z} _ {\tau} ^ {n}; \psi , \zeta\right) \right], \tag {8}
+$$
+
+where $\lambda$ is the scalar multiplier for the retrace loss, and $N$ is the batch size. We implement CCWM using a Recurrent State-Space Model (RSSM; Hafner et al. (2019)). The complete pseudocode for CCWM training is shown in Algorithm 1 in Appendix A. We note that "learning via retracing" is also applicable under the model-free setting, we describe one such instantiation in Appendix B.
+
+# 3.3 REVERSIBILITY AND TRUNCATION
+
+As we noted above, perfect reversibility is not always present across all transitions in many environments. For instance, consider the falling android presented in Figure 1b, it is trivial to observe that no valid action is able to transit a falling android to its previous state. Under such situations, naive application of "learning via retracing", by constraining the temporal cycle-consistency, will corrupt
+
+representation learning (and dynamics model learning in CCWM). Here we propose an approach to deal with such "irreversibility".
+
+Our approach is based on adaptive identification of "irreversible" transitions. We propose that the value function of the controller (e.g., an actor-critic agent) possesses some information about the continuity of the latent states (Gelada et al. (2019); see Appendix C for further discussion). Hence we use the value function as an indicator for sudden change in the agent's state. Specifically, for each sampled trajectory, we firstly compute the values of each state-action pair using the current value function approximator, $[Q(z_{1},a_{1}),\dots,Q(z_{T},a_{T})]$ . We then compute the averages of the values over a sliding window of size $S$ through the value vectors of each sampled trajectory, resulting in a $(T - S)$ -length vector $[\bar{Q}_1,\ldots ,\bar{Q}_{T - S}]$ . Any drop/increase in the sliding averages (above some pre-defined threshold) indicates a sudden change in the value function, hence a sudden change in the latent representation given the continuity conveyed by the value function. Given some timestep, $\tau$ , at which the sudden change occurs, we then remove the transitions $\{z_{\tau -S:\tau},a_{\tau -S:\tau}\}$ from "learning via retracing". Such adaptive scheduling allows us to deal with "irreversibility".
+
+# 4 RELATED WORKS
+
+Representation learning in RL. Finding useful state representations that could aid RL tasks has long been studied. Early works have investigated representations based on a fixed basis such as tile coding and Fourier basis (Mahadevan, 2005; Sutton and Barto, 2018). With the development of deep learning techniques, recent works explored automatic feature discovery based on neural network training, which can be categorised into three large classes. The first class of methods studies the usage of data augmentation for broadening the data distribution for training more robust feature representation (Laskin et al., 2020; Kostrikov et al., 2020; Schwarzer et al., 2021; Yarats et al., 2021). The second class explores the role of auxiliary tasks in learning representations, such as weakly-supervised classification and location recognition, for dealing with sparse and delayed supervision (Lee et al., 2020b; Mirowski et al., 2017; Oord et al., 2018). The third class of methods, specifically tailored to model-based RL models, leverages generative modelling of environment dynamics, enabling joint learning of the representations and the dynamics model (Ha and Schmidhuber, 2018; Buesing et al., 2018; Hafner et al., 2019; 2020a; Lee et al., 2020a; Schrittwieser et al., 2020; Hafner et al., 2020b).
+
+Cycle-Consistency. Cycle-consistency is a commonly adopted approach in computer vision and natural language processing (Zhou et al., 2016; Zhu et al., 2017; Yang et al., 2017; Dwibedi et al., 2019), where the core idea is the validation of matches between cycling through multiple samples. We adopt similar design principles for sequential decision-making tasks: rollouts in a temporally forward direction alone yield under-constrained learning of the world model. By additionally incorporating backwards rollouts into model learning in a self-supervised fashion, we enforce the inductive bias that the same transition rules govern the dynamics of the task.
+
+Concurrent to our work, Yu et al. (2021) proposed PlayVirtual, a model-free RL method that integrates a similar cycle-consistency philosophy into training representations with data augmentations (Schwarzer et al., 2021). We note that PlayVirtual falls under the proposed "learning via retracing" framework, but lying on the opposite spectrum comparing to the CCWM agent, being model-free and utilising a separate reversed dynamics model, with the latter being the main difference between the premises of PlayVirtual and CCWM. By using the same dynamics model for both the forward and reversed transitions, we hope to exploit and embed the context prior of reversible transitions into the learnt representations, hence the induced advantages extend beyond the explicit advantage of improved sample efficiency, but also stronger generalisation, improved predictive rollouts (leads to more accurate policy gradient hence improving policy training).
+
+# 5 EXPERIMENTAL STUDIES
+
+The experimental studies aim at examining if "learning via retracing" truly helps with the overall RL training and planning, improves the generalisability of the learned representation, and whether the truncation schedule proposed in Section 3.3 deals with the irreversibility of some state transitions.
+
+# 5.1 EXPERIMENT SETUP
+
+CCWM can be combined with any value-based or policy-based RL algorithms. We implement CCWM with a simple actor-critic RL agent with generalised advantage estimation based on standard model-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(a)
+
+
+
+
+
+Figure 3: Evaluation of CCWM on DeepMind Control Suite. (a): Graphical demonstration of selected continuous control task environments, from left to right: hopper stand/hop, walker run/walk, finger spin, reacher easy, cheetah run, quadruped run. (b): Average evaluation returns $(\pm 1$ s.d.) during training (5 random seeds). "Learning via retracing" generally improves the performance of learning from pixel inputs in presented tasks comparing to the main baseline Dreamer agent (which could approximately be viewed as CCWM without retracing). CCWM reaches the asymptotic performance of state-of-the-art model-free methods (SAC, D4PG at $10^{8}$ steps) on several tasks.
+
+CCWM-A3C Dreamer A3C(state) D4PG(state) SAC(state)
+
+
+(b)
+
+
+
+
+
+based RL framework using model-based rollouts $^{1}$ (Sutton and Barto, 2018; Konda and Tsitsiklis, 1999; Schulman et al., 2015). We base our experimental studies on the challenging visual-based continuous control benchmarks for which we choose 8 tasks from the DeepMind Control Suite (Tassa et al. (2018); Figure. 3a). The details of training and the architecture can be found in Appendix D.
+
+Baselines: We implement Dreamer as our main model-based baseline (Hafner et al., 2020a), which represents the current state-of-the-art world-model-type model-based RL agent on visual-based continuous control tasks. We also compare with the following model-free baselines: SAC Haarnoja et al. (2018), D4PG Barth-Maron et al. (2018), A3C Mnih et al. (2016). We implement the SAC agent given the state inputs and directly report the asymptotic performance of the D4PG and A3C algorithms from Tassa et al. (2018). We report the asymptotic scores for the model-free algorithms due to the large gap in sample efficiency comparing to the model-based methods.
+
+# 5.2 EVALUATION ON CONTINUOUS CONTROL TASKS
+
+The performance of CCWM and selected baseline algorithms is shown in Figure 3b. The empirical results show that CCWM (without adaptive truncation introduced in Section 3.3) generally achieves faster behaviour learning comparing to the baselines, which conforms with our hypothesis that utilising backward passes in addition to forward passes provides additional supervision, hence improving the sample efficiency of learning (see also Appendix E). CCWM outperforms Dreamer on 5 of the selected tasks, and is comparable to Dreamer on 2 of the remaining 3 tasks, in terms of both the sample efficiency and final convergence performance. We note the relative poor performance of CCWM on the Hopper Stand task, which might be accredited to the inherent large degree of irreversibility of the task, we shall examine how to deal with such irreversible tasks in Section 5.4.
+
+Moreover, in the "Cheetah Run" task, CCWM converges at $\sim 900$ score with $\sim 5 \times 10^{5}$ steps, whereas Dreamer, by the time it has received $1 \times 10^{6}$ training steps, is yet to reach a comparable
+
+
+Figure 4: Qualitative comparison of long-range predictive reconstruction of CCWM and Dreamer. Predictive rollouts over 30 time-steps given the actions are computed using the representation models. CCWM consistently generates more accurate predictive reconstructions further into the future than Dreamer, with CCWM becoming noticeably inaccurate by $25 - 30$ timesteps, and Dreamer by $10 - 15$ timesteps. See implementation details and further discussion in Appendix F.
+
+| CHANGED COMPONENTS | CCWM (MEAN ±1 S.D.) | DREAMER (MEAN ±1 S.D.) | P-VALUE (3 S.F.) | SIGNIFICANT? (α = 0.01) |
| R + M + F | 628.07 ± 36.95 | 468.82 ± 94.73 | 7.27 × 10-6 | YES |
| R +M + S + F | 641.89 ± 28.67 | 562.58 ± 93.91 | 3.97 × 10-3 | YES |
+
+Table 1: Evaluation of trained CCWM and Dreamer on the ability of zero-shot transfer in cheetah run tasks with different configurations. (R: Reward; M: Mass; F: Friction; S: Stiffness.)
+
+score. This demonstrates that "learning via retracing" brings more benefits beyond plain sample efficiency, i.e., doubling the training steps does not eliminate the performance gap. This corresponds to our hypothesis that by explicitly conveying future information back to previous states, "learning via retracing" enables the learning of task-aware representations that support stronger behaviour learning. To test our hypothesis, we empirically evaluate CCWM's ability of long-term predictive reconstructions and compare with Dreamer. To ensure fair comparison, we provide further training for Dreamer whenever necessary, such that the asymptotic performance is comparable with CCWM (see Appendix D for details). Figure 4 shows that CCWM consistently yields more accurate predictive reconstructions over a longer time span, on both the walker walk and cheetah run tasks. The empirical evidence confirms our hypothesis that by incorporating "learning via retracing" into model learning enables the resulting latent space to support more accurate latent predictions, hence leading to stronger behaviour learning. Increased range of accurate latent prediction additionally enables CCWM to perform better planning. We provide further analysis of predictive reconstruction in Appendix F.
+
+# 5.3 ZERO-SHOT TRANSFER
+
+Based on the motivation that "learning via retracing" will improve the generalisability of the agent (Figure 1a), we empirically test the generalisability of CCWM on the basis of zero-shot transfer tasks. Specifically, we modify a number of basic configurations of the cheetah run task, such as the mass of the agent and the friction coefficients between the joints. The details of the changes can be found in Appendix D. Despite the increased sample efficiency of CCWM over Dreamer during training (Figure 3b), both methods converge at similar values at $2 \times 10^{6}$ steps. We directly evaluate the trained agents on the updated cheetah run task without further training to test their abilities on zero-shot transfer. We report the mean evaluation scores ( $\pm$ 1 s.d.) of both agents over 15 random seeds, as well as the one-sided t-test statistics and significance of the difference between the two sets of evaluations in Table 1. The overall performance on zero-shot transfer of our approach is comparable with Dreamer on simpler transfer tasks (full results shown in Appendix 5.3), and significantly outperforms Dreamer on more non-trivial modifications to the original task. The introduction of retracing also improves the stability of zero-shot transfer in general (reduced variance in evaluation). These confirm our previous hypothesis that "learning via retracing" improves the ability of within-domain generalisation.
+
+# 5.4 ADAPTIVE TRUNCATION OF "LEARNING VIA RETRACING"
+
+We wish to examine the effects of the proposed adaptive scheduling of truncation (Section 3.3). From Figure 3b, we observe that the original CCWM is outperformed by Dreamer on the Hopper Stand task, probably due to the large degree of "irreversibility" of the task comparing to the others such that the naive representation learning by enforcing "learning via retracing" leads to suboptimal training.
+
+From Figure 5, we observe that augmenting CCWM with the proposed flexible truncation schedule yields significant performance increase on the Hopper-Stand task, with consistently better sample efficiency than both Dreamer and the standard CCWM. For tasks with less degree of "irreversibility", such as Walker-Walk (Figure 5 right), we do not observe significant improvement by the introduction of adaptive truncation since the amount of negative impacts were already minimal in the original settings. Similar patterns are observed across the other tasks (no noticeable improvement except for the Hopper-Stand/Hop tasks). We extend our discussion on adaptive truncation in Appendix C.
+
+
+Figure 5: Evaluation of Adaptive Truncation on tasks with varying degrees of "irreversibility". Minimal improvement is observed on tasks with low degree of "irreversibility" (walker walk in the left panel); whereas significant improvements are observed on tasks with high degree of "irreversibility" (hopper stand in the right panel).
+
+
+
+# 6 DISCUSSION
+
+We proposed "learning via retracing", a novel representation learning method for RL problems that utilises the temporal cycle-consistency of the transition dynamics in addition to the predictive reconstruction in the temporally forward direction. We introduce CCWM, a concrete model-based instantiation of "learning via retracing" based on generative dynamics modelling. We empirically show that CCWM yields improved performance over state-of-the-art model-based and model-free methods on a number of challenging continuous control benchmarks, in terms of both the sample-efficiency and the asymptotic performance. We also show that "learning via retracing" supports stronger generalisability and more accurate long-range predictions, hence stronger planning, both adhere nicely to our intuition and predictions. We note that "learning via retracing" is strongly affected by the degree of "irreversibility" of the task. We propose an adaptive truncation scheme for alleviating the negative impacts caused by the "irreversible" transitions, and empirically show the utility of the proposed truncation mechanism in tasks with a large degree of "irreversibility".
+
+Hippocampal replay has long been thought to play a critical role in model-based decision-making in humans and rodents (Mattar and Daw, 2018; Evans and Burgess, 2019). Recently, Liu et al. (2021) showed how reversed hippocampal replays are prioritised due to its utility in non-local (model-based) inference and learning in humans. CCWM can be interpreted as an immediate model-based instantiation of the reversed hippocampal replay. Similar to intuitions from the computational neuroscience literature (Penny et al., 2013), we also find that "learning via retracing" brings a number of merits comparing to its counterparts that only uses forward rollouts. In addition to improved sample efficiency and asymptotic performance, we show that CCWM also supports stronger generalisability and extends the planning horizon, indicating that stronger model-based inferences are obtained. Moreover, as discussed previously, "learning via retracing" can enable the learning of reversible "controllable" internal states of the agent even when external features (e.g. location) are irreversible. Such representation could be combined with task-specific global contextual information/representation provided by an independent system to facilitate stronger policy learning. The independent system could be supported by the hippocampal area, where reversed hippocampal "replay" of the allocentric "cognitive map" could in turn drive reverse replay of egocentric sensory or motoric representations.
+
+# ACKNOWLEDGEMENT
+
+C.Y. is supported by the DeepMind studentship funded through UCL CDT in Foundational Artificial Intelligence. N.B. is supported by the Wellcome Trust. The authors would like to thank Maneesh Sahani, Peter Dayan, Jessica Hamricks, and the anonymous reviewers for helpful comments and discussions.
+
+# REFERENCES
+
+M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
+G. Barth-Maron, M. W. Hoffman, D. Budden, W. Dabney, D. Horgan, T. Dhruva, A. Muldal, N. Heess, and T. Lillicrap. Distributed distributional deterministic policy gradients. ArXiv, abs/1804.08617, 2018.
+Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798-1828, 2013.
+G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
+L. Buesing, T. Weber, S. Racanière, S. Eslami, D. J. Rezende, D. P. Reichert, F. Viola, F. Besse, K. Gregor, D. Hassabis, and D. Wierstra. Learning and querying fast generative models for reinforcement learning. *ArXiv*, abs/1802.03006, 2018.
+J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
+J. V. Dillon, I. Langmore, D. Tran, E. Brevdo, S. Vasudevan, D. Moore, B. Patton, A. Alemi, M. Hoffman, and R. A. Saurous. Tensorflow distributions. arXiv preprint arXiv:1711.10604, 2017.
+D. Dwibedi, Y. Aytar, J. Tompson, P. Sermanet, and A. Zisserman. Temporal cycle-consistency learning. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1801-1810, 2019.
+T. Evans and N. Burgess. Coordinated hippocampal-entorhinal replay as structural inference. In NeurIPS, volume 32. NIPS, 2019.
+N. Ferns, P. Panangaden, and D. Precup. Bisimulation metrics for continuous markov decision processes. SIAM J. Comput., 40:1662-1714, 2011.
+D. J. Foster and M. Wilson. Reverse replay of behavioural sequences in hippocampal place cells during the awake state. Nature, 440:680-683, 2006.
+C. Gelada, S. Kumar, J. Buckman, O. Nachum, and M. G. Bellemare. Deepmdp: Learning continuous latent space models for representation learning. In International Conference on Machine Learning, pages 2170-2179. PMLR, 2019.
+D. R. Ha and J. Schmidhuber. World models. *ArXiv*, abs/1803.10122, 2018.
+T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In ICML, 2018.
+D. Hafner, T. Lillicrap, I. S. Fischer, R. Villegas, D. R. Ha, H. Lee, and J. Davidson. Learning latent dynamics for planning from pixels. *ArXiv*, abs/1811.04551, 2019.
+
+D. Hafner, T. Lillicrap, J. Ba, and M. Norouzi. Dream to control: Learning behaviors by latent imagination. *ArXiv*, abs/1912.01603, 2020a.
+D. Hafner, T. Lillicrap, M. Norouzi, and J. Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020b.
+I. Higgins, L. Matthew, A. Pal, C. Burgess, X. Glorot, M. Botvinick, S. Mohamed, and A. Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
+R. E. Kalman. A new approach to linear filtering and prediction problems. 1960.
+D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+V. R. Konda and J. Tsitsiklis. Actor-critic algorithms. In NIPS, 1999.
+I. Kostrikov, D. Yarats, and R. Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. arXiv preprint arXiv:2004.13649, 2020.
+M. Laskin, K. Lee, A. Stooke, L. Pinto, P. Abbeel, and A. Srinivas. Reinforcement learning with augmented data. arXiv preprint arXiv:2004.14990, 2020.
+A. X. Lee, A. Nagabandi, P. Abbeel, and S. Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. ArXiv, abs/1907.00953, 2020a.
+L. Lee, B. Eysenbach, R. Salakhutdinov, S. Gu, and C. Finn. Weakly-supervised reinforcement learning for controllable behavior. ArXiv, abs/2004.02860, 2020b.
+S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334-1373, 2016.
+Y. Liu, M. G. Mattar, T. E. Behrens, N. D. Daw, and R. J. Dolan. Experience replay is associated with efficient nonlocal learning. Science, 372(6544), 2021.
+S. Mahadevan. Proto-value functions: Developmental reinforcement learning. In Proceedings of the 22nd international conference on Machine learning, pages 553-560, 2005.
+M. Mattar and N. Daw. Prioritized memory access explains planning and hippocampal replay. Nature neuroscience, 21:1609 - 1617, 2018.
+P. Mirowski, R. Pascanu, F. Viola, H. Soyer, A. Ballard, A. Banino, M. Denil, R. Goroshin, L. Sifre, K. Kavukcuoglu, D. Kumaran, and R. Hadsell. Learning to navigate in complex environments. ArXiv, abs/1611.03673, 2017.
+V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. A. Riedmiller. Playing atari with deep reinforcement learning. *ArXiv*, abs/1312.5602, 2013.
+V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. ArXiv, abs/1602.01783, 2016.
+K. P. Murphy. Machine learning: a probabilistic perspective. 2012.
+A. Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. ArXiv, abs/1807.03748, 2018.
+I. Osband, C. Blundell, A. Pritzel, and B. Van Roy. Deep exploration via bootstrapped dqn. Advances in neural information processing systems, 29, 2016.
+W. D. Penny, P. Zeidman, and N. Burgess. Forward and backward inference in spatial cognition. PLoS Comput Biol, 9(12):e1003383, 2013.
+J. Schrittwieser, I. Antonoglou, T. Hubert, K. Simonyan, L. Sifre, S. Schmitt, A. Guez, E. Lockhart, D. Hassabis, T. Graepel, T. Lillicrap, and D. Silver. Mastering atari, go, chess and shogi by planning with a learned model. Nature, 588 7839:604-609, 2020.
+
+J. Schulman, P. Moritz, S. Levine, M. Jordan, and P. Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015.
+M. Schwarzer, A. Anand, R. Goel, R. D. Hjelm, A. Courville, and P. Bachman. Data-efficient reinforcement learning with self-predictive representations. In ICLR, 2021.
+D. Silver, J. Schrittwieser, K. Simonyan, I. Antonoglou, A. Huang, A. Guez, T. Hubert, L. Baker, M. Lai, A. Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676): 354-359, 2017.
+R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. MIT press, 2018.
+Y. Tassa, Y. Doron, A. Muldal, T. Erez, Y. Li, D. Casas, D. Budden, A. Abdelmaleki, J. Merel, A. Lefrancq, T. Lillicrap, and M. A. Riedmiller. Deepmind control suite. ArXiv, abs/1801.00690, 2018.
+L. Van der Maaten and G. Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
+O. Vinyals, T. Ewalds, S. Bartunov, P. Georgiev, A. S. Vezhnevets, M. Yeo, A. Makhzani, H. Küttler, J. Agapiou, J. Schrittwieser, et al. Starcraft ii: A new challenge for reinforcement learning. arXiv preprint arXiv:1708.04782, 2017.
+M. Wainwright and M. Jordan. Graphical models, exponential families, and variational inference. Found. Trends Mach. Learn., 1:1-305, 2008.
+Z. Yang, W. Chen, F. Wang, and B. Xu. Improving neural machine translation with conditional sequence generative adversarial nets. arXiv preprint arXiv:1703.04887, 2017.
+D. Yarats, R. Fergus, A. Lazaric, and L. Pinto. Mastering visual continuous control: Improved data-augmented reinforcement learning. arXiv preprint arXiv:2107.09645, 2021.
+T. Yu, C. Lan, W. Zeng, M. Feng, and Z. Chen. Playvirtual: Augmenting cycle-consistent virtual trajectories for reinforcement learning. arXiv preprint arXiv:2106.04152, 2021.
+M. D. Zeiler, D. Krishnan, G. W. Taylor, and R. Fergus. Deconvolutional networks. In 2010 IEEE Computer Society Conference on computer vision and pattern recognition, pages 2528-2535. IEEE, 2010.
+A. Zhang, R. McAllister, R. Calandra, Y. Gal, and S. Levine. Learning invariant representations for reinforcement learning without reconstruction. *ArXiv*, abs/2006.10742, 2020.
+T. Zhou, P. Krahenbuhl, M. Aubry, Q. Huang, and A. A. Efros. Learning dense correspondence via 3d-guided cycle consistency. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 117-126, 2016.
+J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223-2232, 2017.
+
+# A PSEUDOCODE FOR CCWM
+
+The pseudocode for CCWM training is shown in Algorithm 1. In the current instance, we show the full algorithm with the augmentation of adaptive truncation (Section 3.3). Given the adaptive truncation, we need to slightly modify the loss function in Eq. 8.
+
+$$
+\mathcal {L} (\theta , \psi , \zeta) = \frac {1}{N T} \sum_ {n = 1} ^ {N} \sum_ {\tau = 1} ^ {T} \left[ \mathcal {L} _ {\mathrm {E L B O}} \left(O _ {\tau} ^ {n}; \theta , \psi\right) + \lambda M _ {\tau} ^ {n} \mathcal {L} _ {\text {r e t r a c e}} \left(\tilde {z} _ {\tau} ^ {n}, \tilde {z} _ {\tau} ^ {n}; \psi , \zeta\right) \right], \tag {9}
+$$
+
+where $M_{\tau}^{n}$ is the entry $\tau$ of the mask vector $M^n$ with values in $\{0,1\}$ , which we describe in Algorithm 1.
+
+Algorithm 1 Cycle-Consistency World Model (CCWM)
+1: Given: policy $\pi (a|s)$ , encoders $q_{\phi}(O)$ , $q_{\psi_1}(z'|z,a)$ , $q_{\psi_2}(z'|z,a,q_{\phi}(O'))$ , decoder $q_{\theta}(O|z)$ , reverse action approximator $\rho_{\zeta}(z,z')$ , latent horizon $K$ , average loss $\mathcal{L}_{\mathrm{avg}} = 0$ , counter $c = 0$ , adaptive truncation threshold, $\eta$ , adaptive truncation sliding window size, $S$ , current estimate of the Q-function, $Q_{\gamma}$ , CCWM parameters: $\Theta = \{\phi, \psi_1, \psi_2, \theta, \zeta\}$ .
+2: Input: Batch of $N$ sampled trajectories of length $T$ , $\{\mathbf{O}_{t_n:t_n + T}^n,\mathbf{a}_{t_n:t_n + T}^n\}_{n = 1}^N$ .
+3: for $n = 1$ to $N$ do
+4: $O = \{\mathbf{O}_{t_n + k}^n\}_{k = 1}^T$ , $a = \{\mathbf{a}_{t_n + k}^n\}_{k = 0}^{T - 1}$ .
+5: for $k = 1$ to $T - K$ do
+6: Compute prior $\hat{z}_{k + 1:k + K}$ and posterior estimates $\tilde{z}_{k + 1:k + K}$ using Eq. 5
+7: Compute the sliding window average, $[Q_1,\dots,\bar{Q}_{K-S}]$ , where $\bar{Q}_i = \frac{1}{S}\sum_{s=1}^{S}Q_{\gamma}(\tilde{z}_{i+s},a_{i+s})$
+8: Compute the step-wise difference, $\Delta = [|\frac{\bar{Q}_2 - \bar{Q}_1}{\bar{Q}_1}|,\dots,|\frac{\bar{Q}_{K-S} - \bar{Q}_{K-S-1}}{\bar{Q}_{K-S-1}}|]$
+9: Compute the adaptive truncation mask, $M \in \{0,1\}^K$ , where $M_k = 1$ if $\forall_{j=k-S}^{k}(\Delta_j < \eta)$ , and 0 otherwise
+10: Compute retraced states $\tilde{z}_{k:k+K}$ using Eq. 6
+11: Compute the latent model loss $\mathcal{L}_k$ using Eq. 9.
+12: Update $\mathcal{L}_{\mathrm{avg}} \gets \frac{c}{c+1}\mathcal{L}_{\mathrm{avg}} + \frac{1}{c+1}\mathcal{L}_k$ .
+13: Increment counter, $c \gets c + 1$ .
+14: end for
+15: end for
+16: Compute the gradient, $\nabla_\Theta \mathcal{L}_{\mathrm{avg}}$ .
+17: Update the model parameters, $\Theta \gets \Theta + \alpha\nabla_\Theta \mathcal{L}_{\mathrm{avg}}$ .
+
+# B MODEL-FREE INSTANTIATION OF "LEARNING VIA RETRACING"
+
+As mentioned in Section 3, "learning via retracing" admits many degrees of freedom in its implementation. CCWM provides one such instantiation under the model-based RL setting, here we provide an alternative model based on "learning via retracing" under the model-free RL setting. The graphical illustration of the model-free instantiation is shown in Figure 6.
+
+Visual inspection indicates the high similarity between the graphical models of the model-free version and the model-based version (CCWM), but there are essential differences. Similar to PlayVirtual (Yu et al., 2021), due to the model-free nature of the model, we no longer requires further supervisory signals obtained from "learning via retracing" to contribute to training of the dynamics model, hence we are free to employ an independent "reversed" dynamics model (denoted by the red arrows in the reversed direction in Figure 6) for performing the retracing operations. Moreover, given the independent "reversed" dynamics model, we no longer requires approximation of the "reversed" actions, hence removing the necessity of using $\rho$ as in Figure 2b, and we only need to use the ground-truth forward actions for the retracing operations. The learned representation in this case would benefit the downstream model-free RL agent since the resulting state representation is efficient for the prediction of future states. We note a key difference between our model-free instantiation of learning via retracing and PlayVirtual (Yu et al., 2021), that we have consistently employed probabilistic
+
+
+Figure 6: Graphical illustration of a model-free instantiation of "learning via retracing". The forward model is a state-space model and is trained in a generative fashion under the variational principles. The retracing operations are now performed with a separate "reversed" dynamics model (indicated by the red arrows). Given the independent "reversed" dynamics model, we can use the same action as in the forward model for retracing, removing the necessity of using the "reversed" action approximator.
+
+models over deterministic models for modelling the embedding and latent transitions, which naturally provides posterior predictive uncertainty that can be used for various downstream tasks, such as exploration (Osband et al., 2016).
+
+Here we stick with the general architectural choice of using a sequential state-space model for the forward dynamics model as in CCWM, but the "reversed" dynamics model can be chosen to be deterministic and trained discriminatively jointly with the entire model. Note that Figure 6, like CCWM, only describes one of many possible instantiations of "learning via retracing", we leave further investigation to future work.
+
+# C FURTHER DISCUSSION ON TRUNCATION AND THE DEGREE OF "IRREVERSIBILITY"
+
+In Section 3.3, we introduced the adaptive truncation as a general-purpose method for improving the performance of CCWM in continuous control tasks. On a high level, we choose to remove the transitions from model/representation learning through "learning via retracing" whenever large changes in the Q-values occur, hence the "irreversibility" of the transitions depend on the local continuity of the corresponding Q-values. Our argument is largely based on Theorem 1 from Gelada et al. (2019), which we re-iterate below for consistency.
+
+Theorem 1 For an MDP $\mathcal{M} = \langle \mathcal{S},\mathcal{A},\mathcal{R},\mathcal{P},\gamma \rangle$ and the corresponding DeepMDP $\bar{\mathcal{M}} = \langle \bar{\mathcal{S}},\mathcal{A},\bar{\mathcal{R}},\bar{\mathcal{P}},\gamma \rangle$ (see Section 2.2 in Gelada et al. (2019) for detailed definition of DeepMDP), let $d_{\bar{S}}$ be a metric over $\bar{S}$ , $\phi : S \to \bar{S}$ be the embedding function, $L_{\bar{\mathcal{R}}}^{\infty} = \sup_{s \in \mathcal{S}, a \in \mathcal{A}} |\mathcal{R}(s,a) - \bar{\mathcal{R}}(\phi(s),a)|$ and $L_{\bar{\mathcal{P}}}^{\infty} = \sup_{s \in \mathcal{S}, a \in \mathcal{A}} W(\phi \mathcal{P}(\cdot|s,a), \bar{\mathcal{P}}(\cdot|\phi(s),a))$ be the global loss function (for training the DeepMDP, where $W(\cdot,\cdot)$ is the Wasserstein distance). For any $K_{\bar{V}}$ -Lipschitz policy $\bar{\pi} \in \bar{\Pi}$ , the representation $\phi$ guarantees that for all $s_1, s_2 \in S$ , and $a \in \mathcal{A}$ ,
+
+$$
+\left| Q ^ {\bar {\pi}} \left(s _ {1}, a\right) - Q ^ {\bar {\pi}} \left(s _ {2}, a\right) \right| \leq K _ {\bar {V}} d _ {\bar {S}} \left(\phi \left(s _ {1}\right), \phi \left(s _ {2}\right)\right) + 2 \frac {L _ {\bar {\mathcal {R}}} ^ {\infty} + \gamma K _ {\bar {V}} L _ {\bar {\mathcal {P}}} ^ {\infty}}{1 - \gamma} \tag {10}
+$$
+
+The proof of Theorem 1 can be found in Appendix A.2 in Gelada et al. (2019). The high-level interpretation for Theorem 1 is that the learned representation space should admit the situation where two states with different values collapse onto the same representations. Theorem 1 tells us that given a good representation (embedding function), the absolute difference between the Q-values
+
+of two latent states should lower-bound the distance (some metric over the representation space) between the representations of the two states (up to some additive and scalar multiplicative constants). Hence whenever there is a large change in the Q-values of between the adjacent states in a trajectory, there must also be a large jump in the representation space, which we interpret as an "irreversible" transition. The latter interpretation can be substantiated with the visualisation of the low-dimensional embeddings of the learned representations at different stages in Figure 7 and Figure 8. Figure 7 shows the TSNE embeddings of a trajectory taken by a successfully trained agent in the Cheetah Run task (we focus on the left figure in both Figure 7(a) and (b), please refer to the full discussion of Figure 7 in Appendix E). We see that the resulting TSNE-embeddings of the representation along a trajectory show that the magnitude of the transitions in the representation space is consistently low, hence respecting the temporal locality of the states along the trajectory. However, in Figure 8, where we show the TSNE-embeddings of the representation along a trajectory in an under-trained CCWM agent in the Hopper Stand task ( $\sim 2 \times 10^5$ training steps), we observe clear clusters of the state representations along the same trajectory. Moreover, the clustered structure also shows locality with respect to the temporal ordering (along the trajectory), showing that even in tasks such as Hopper Stand, which we view as the more "irreversible" task, a large proportion of all transitions allows retracing operations, which can contribute as additional samples for the training of representation and the dynamics model through "learning via retracing". The quality of the overall representation learning is dependent on the correct identification of the "irreversible" transitions (large jumps between adjacent states in Figure 8), which necessitates the usage of the adaptive truncation approach to identify and remove the "irreversible" transitions from corrupting the learning process. These evidence further substantiate our proposal of the overall framework of "learning via retracing" and the adaptive truncation technique.
+
+We note that as the agent is undergoing a sequence of consecutive "irreversible" transitions, such as when the walker agent is falling down shown in Figure 1(b) of the main paper, the transitions the agent goes through are "irreversible" albeit having similar Q-values (all leading to the inevitable fallen down state). In order to deal with such "continuity" in the "irreversibility" of the transitions along the same trajectory, the adaptive truncation is introduced by detecting the changes in the average Q-values over a sliding window instead of the single Q-values, which allows a delayed detection of the sudden (and extended) changes in the state values along the same trajectory (the degree of delay depends on the choice of the threshold of adaptive truncation and the sliding window size, see Section 3.3 and Algorithm 1 for more details). Hence upon the "delayed" identification of the "irreversible" transition at state $s_t$ , we remove the state as well as a certain number of states preceding $s_t$ (i.e., $\{s_{t - \tau}, s_{t - \tau + 1}, \dots, s_t\}$ ) from "learning via retracing". We note that the choice of the sliding window size, $S$ , threshold, $\eta$ and the number of preceding states to remove, $\tau$ , are all chosen based on hyperparameter tuning at this stage. We leave the automatic determination of the parameters associated with adaptive truncation to future work.
+
+We additionally propose an intermediate approach for ruling out the "irretraceable" states from "learning via retracing", based on fixed scheduling of truncating out the final proportions of each collected episode (but still use these samples for representation learning in the forward direction). In many episodic environments, (e.g., LunarLander; Brockman et al. (2016)), each episode terminates upon either successful completion of the task or failing the task (e.g., crashing in LunarLander). For the failure cases, which is more often during the early phase of training, even the transitions leading to the failure states might be considered "irreversible" (falling android; Figure 1b). Hence early truncation of each episode is able to rule out many such "irreversible" transitions from contributing to representation/model learning. We additionally propose annealing schedules for the truncation proportion as given the training of the controller, successful completion will be more frequently encountered comparing to the failure cases.
+
+# D IMPLEMENTATION DETAILS
+
+We implement the latent transition dynamics model of CCWM using the RSSM (Hafner et al., 2019), utilising a Gated Recurrent Unit (GRU) as the core component (Chung et al., 2014) in combination with multi-layer perceptrons (MLP). The RSSM is used for modelling the predictive inferences, $q_{\psi_1}(z_{t + 1}|z_t,a_t)$ and $q_{\psi_2}(z_{t + 1}|z_t,a_t,e_{t + 1})$ , from Eq. 2. The context embedding function is given by a convolutional encoder that deterministically embeds the high-dimensional observation into a context vector. The dimension of the latent space is set to equal 32, there is low sensitivity of
+
+the performance with respect to the dimension of the latent embedding. The generative function $q_{\theta}(O_t|z_t)$ is implemented with the combination of an MLP and a deconvolution network (Zeiler et al., 2010), outputting the means of the Gaussian distributions for each pixel value of the decoded observation. The reward distribution $\hat{\mathcal{R}}(r|z)$ is modelled by an MLP, outputting a univariate Gaussian distribution. The supervision of the model learning is based on the ELBO and the bisimulation metric as described in Section 3.
+
+In the implementation of our policy agent, A3C, we implement the critic (value network) using an MLP, with latent state inputs. The value network models a Gaussian distribution with means and variances. The policy network also describes a Gaussian distribution, with means and variances parameterised by an MLP. We used distributed actors for interacting with the environment for more efficiency collection of sampled episodes as in (Mnih et al., 2016). The value function is optimised by maximising the probability of the "ground-truth" values estimated by the lambda return (Sutton and Barto, 2018). The policy network is updated using policy gradient estimated based on generalised advantage estimation (GAE) ()schulman2015high.
+
+We use the Adam optimiser for updating the parameters for the model, value function, and policy networks (Kingma and Ba, 2014).
+
+The specific configurations for the neural network implementations is summarised in Table 2. Note that the activation functions for all non-output layers are assumed to be ReLU activation function unless otherwise stated.
+
+All neural network implementation are carried out using TensorFlow (Abadi et al., 2015) and TensorFlow Distributions (Dillon et al., 2017).
+
+For the actual training, the batch size is chosen to be 64, and all sampled trajectories are taken to be 50 timesteps long. Greedy evaluation is performed every $10^{4}$ training steps. The reported evaluation scores are averaged values over 5 random seeds. We adopt the same scheme for setting the action repeats equal to 2 across all tested environments as in (Hafner et al., 2020a). The parameter $\lambda$ controlling the weights of the retrace auxiliary loss in Eq. 8 is set to 1.0. The discounting factor for the expected value function is set to 0.99.
+
+The predictive reconstruction (Figure 4, Figure 10) is performed by firstly applying the dynamics model to the first 5 frames of the trajectory, and starting from the posterior latent estimates at step 5, the latent predictions are performed given solely the action inputs, and the predicted latent estimates are then decoded back into the observable space. To ensure fair comparison, as well as to demonstrate that CCWM improves model learning beyond solely sample efficiency, the model of the baseline Dreamer is provided further training, until the training steps is twice the training steps of CCWM and the final performance reaches a comparable score of CCWM. Specifically, for both the walker walk and cheetah run tasks, the Dreamer model used for reconstruction is provided with $2 \times 10^{6}$ training steps.
+
+For the implementation details of the generalisability experiments in Section 5.3, we manually changed the corresponding settings of the agent in the task-dependent XML file (see e.g., https://github.com/deepmind/dm_control/blob/master/dm_control/suite/cheetah.xml). We choose the semantically interpretable physical quantities that we hypothesise to alter the underlying task MDP, including changing mass from 14 to any one of the list: [6,8,10,20], changing the friction constants from (0.4,0.1,0.1) to any element of the list: $\{(i,j,k)|i\in \{0.6,0.8\} ,j\in \{0.4,0.5\} ,k\in \{0.3,0.4\} \}$ , changing the stiffness constants from 8 to any of the element in $\{2,6,10\}$ . We directly evaluate (without any further training) the trained CCWM and Dreamer on the original task structure on the tasks corresponding to each of the above changes and any combination of the individual changes. The change in reward setting is merely a constant reward reshaping across all transitions, and should not result in any difference in the task dynamics, hence the evaluations, and we use this as the sanity check and a baseline.
+
+Note that in Eq. 7, we follow (Zhang et al., 2020) to replace the 1-Wasserstein distance with the 2-Wasserstein distance, since the 2-Wasserstein distance between two Gaussians has closed-form expression:
+
+$$
+W _ {2} \left(\mathcal {N} \left(\mu_ {i}, \Sigma_ {i}\right), \mathcal {N} \left(\mu_ {j}, \Sigma_ {j}\right) = \left\| \mu_ {i} - \mu_ {j} \right\| _ {2} ^ {2} + \left\| \Sigma_ {i} ^ {1 / 2} - \Sigma_ {j} ^ {1 / 2} \right\| _ {\mathcal {F}} ^ {2} \right. \tag {11}
+$$
+
+where $||\cdot ||_{\mathcal{F}}$ is the matrix Frobenius norm. This admits analytical computation instead of having sample from the joint distribution hence reducing the variance of loss function.
+
+| COMPONENT | ATTRIBUTE | VALUE |
| RSSM | INTERNAL STATE DIMENSION | 256 |
| MLP LAYER 1 UNITS | 256 |
| MLP LAYER 2 UNITS | 64 |
| EMBEDDING FUNCTION | CONV LAYER 1 NUMBER OF FILTERS | 32 |
| CONV LAYER 1 KERNEL SIZE | 4 |
| CONV LAYER 2 NUMBER OF FILTERS | 64 |
| CONV LAYER 2 KERNEL SIZE | 4 |
| CONV LAYER 3 NUMBER OF FILTERS | 128 |
| CONV LAYER 3 KERNEL SIZE | 4 |
| CONV LAYER 4 NUMBER OF FILTERS | 256 |
| CONV LAYER 4 KERNEL SIZE | 4 |
| FINAL OUTPUT OPERATION | CONCATENATION |
| GENERATIVE MODEL | MLP LAYER 1 NUMBER OF UNITS | 1024 |
| DECONVOLUTION LAYER 1 NUMBER OF FILTERS | 128 |
| DECONVOLUTION LAYER 1 KERNEL SIZE | 5 |
| DECONVOLUTION LAYER 2 NUMBER OF FILTERS | 64 |
| DECONVOLUTION LAYER 2 KERNEL SIZE | 5 |
| DECONVOLUTION LAYER 3 NUMBER OF FILTERS | 32 |
| DECONVOLUTION LAYER 3 KERNEL SIZE | 6 |
| DECONVOLUTION LAYER 4 NUMBER OF FILTERS | 3 |
| DECONVOLUTION LAYER 4 KERNEL SIZE | 6 |
| REWARD MODEL | MLP LAYER 1 NUMBER OF UNITS | 512 |
| MLP LAYER 2 NUMBER OF UNITS | 512 |
| MLP LAYER 3 NUMBER OF UNITS | 1 |
| VALUE MODEL | MLP LAYER 1 NUMBER OF UNITS | 512 |
| MLP LAYER 2 NUMBER OF UNITS | 512 |
| MLP LAYER 3 NUMBER OF UNITS | 512 |
| MLP LAYER 4 NUMBER OF UNITS | 1 |
| POLICY MODEL | ALL FULLY CONNECTED LAYERS ACTIVATION | ELU |
| MLP LAYER 1 NUMBER OF UNITS | 512 |
| MLP LAYER 2 NUMBER OF UNITS | 512 |
| MLP LAYER 3 NUMBER OF UNITS | 512 |
| MLP LAYER 4 NUMBER OF UNITS | 512 |
| MLP LAYER 5 NUMBER OF UNITS | 2 |
| ADAM OPTIMISER | LEARNING RATE FOR MODEL LEARNING | 6 × 10-4 |
| LEARNING RATE FOR VALUE MODEL | 8 × 10-5 |
| LEARNING RATE FOR POLICY MODEL | 8 × 10-5 |
+
+Table 2: Configurations for the neural network implementations of CCWM.
+
+For our implementation of the adaptive truncation technique (Section 3.3), the associated parameters that require pre-specification are the detection threshold, $\eta$ , adaptive truncation sliding window size, $S$ . There are also the optional parameters, the number of states preceding the detected changes to be omitted from "learning via retracing" (which is set to equal to $S$ by default, see Line 9 in Algorithm 1 and Section 3.3), $\tau$ , and the number of initial steps to be omitted from adaptive truncation (due to under-training of the critic, which is set to 0 by default), $\xi$ . The default values for the parameters we used for the empirical evaluation shown in Figure 5 are: $\eta = 0.10$ , $S = 10$ , $\tau = 5$ , $\xi = 1 \times 10^5$ . The hyperparameters are determined through standard grid search, and we leave the automatic determination of the parameters associated with adaptive truncation to future work.
+
+The python implementation of CCWM can be found at https://github.com/changmin-yu/CCWM_code.
+
+
+(a)
+
+
+Figure 7: Visualisation of similarity between the ground-truth states and retraced states using tSNE. The two-dimensional embeddings for a 500-step trajectory (a) and a 76-step subtrajectory (b) is shown. Color of the scatters indicates the temporal ordering of the states within the trajectories.
+
+
+(b)
+
+
+
+
+Figure 8: Visualisation of state representations along the same trajectory in Hopper Stand task. We show the TSNE-embeddings of the state representations over a trajectory of length 500 steps in Hopper Stand task, with a standard CCWM agent (without adaptive truncation) that has received $2 \times 10^{5}$ training steps. Clear clustered structured can be observed in the visualisation, which indicates: (a) the existence of "irreversible" transitions, and (b) the majority of the transitions are "reversible", hence "learning via retracing" should still apply to facilitate improved sample efficiency.
+
+
+Figure 9: Visualisation of the structure of the state representations with respect to the Q-values. We show the TSNE-embeddings of the state representations of 10000 randomly sampled states (from the cached replay buffer) of CCWM (left) and Dreamer (right) in the Walker Walk task. Visual inspections show that CCWM leads to more disentangled state representations with respect to the state-values, hence potentially supports stronger generalisability (Higgins et al., 2016).
+
+
+
+
+Figure 10: Qualitative comparison of long-range predictive reconstruction of CCWM and Dreamer. Predictive rollouts over 45 time-steps given the actions are computed using the representation models. Comparing to Dreamer, CCWM consistently generates more accurate predictive reconstructions over longer time spans. CCWM generates accurate predictions up to $\sim 18$ steps on Walker task, and $\sim 35$ steps on Cheetah task; Dreamer generates accurate predictions up to $\sim 8$ steps on Walker task, and $\sim 15$ steps on Cheetah task (evaluated over 5 randomly sampled trajectories).
+
+# E FURTHER INVESTIGATION OF THE EFFECTS OF “LEARNING VIA RETRACING” IN THE SAMPLE EFFICIENCY OF LEARNING
+
+In order to demonstrate that "learning via retracing" indeed brings additional "valid" supervision signals for model learning, we need to examine whether the retracing operation is correctly learned. In Figure 7 we show the t-SNE embeddings of the true and retracted latent states over a trajectory of 500 steps of the trained agent on the cheetah run task (Van der Maaten and Hinton, 2008). We observe a similar dominant ring structure in both embeddings. This matches our intuition, since during running, the simulated cheetah repeats its states periodically to resume running at a high speed. This is more clearly observed from a sub-trajectory towards the end of the entire episode in Figure 7b, where most states are densely distributed on both sides of the ring and more loosely distributed on the paths connecting the two sides for both the original and retracted states. Moreover, during the early stage of the episode (darker dots in Figure 7a), the agent starts to accelerate from stationary and the states of the agent are periodic in nature but differs from the states when the agent is running at full speed. Such early-phase structure is correctly captured by the retracing operation. Collectively these evidence support that the retracing is correctly learned hence provides useful supervision signals for model training.
+
+# F LONG-RANGE PREDICTION RECONSTRUCTION
+
+In Figure 10, we show the complete 45-step predictive reconstructions for CCWM and Dreamer on "walker walk" and "cheetah run" tasks. We see that CCWM is able to retain accurate predictions over the entire 45 predictive time-steps in the cheetah task, whereas Dreamer fails to do so. By looking more carefully at Figure 10, latent rollouts in the embedding space learned by CCWM yield less accurate predictions for the "irrecoverable" states (e.g., when the agent is falling, see Section 5.4 for further discussion). This property of the learned representation enables "task-aware planning", i.e., the behaviour learning agent is trained to acquire more precise control policy such that the "irrecoverable" states that might hinder the overall learning process are minimally encountered, leading to improved efficiency and quality of learning.
+
+
+
+
+
+
+
+
+
+
+Figure 11: Full ablation studies of the retracing loss function. CCWM with bisimulation metrics as the retracing loss function consistently outperforms the alternatives using the $L2$ and reconstruction retracing error.
+
+
+L2 CCWM-A3C reconstruction
+
+
+
+
+
+| CHANGED COMPONENTS | CCWM (MEAN ±1 S.D.) | DREAMER (MEAN ±1 S.D.) | P-VALUE (3 S.F.) | SIGNIFICANT? (α = 0.01) |
| R | 630.40 ± 6.49 | 629.00 ± 47.01 | 5.22 × 10-1 | No |
| R + M | 635.37 ± 40.12 | 597.43 ± 87.68 | 7.84 × 10-2 | No |
| R + F | 643.58 ± 9.29 | 649.27 ± 3.96 | 9.76 × 10-1 | No |
| R + S | 634.80 ± 10.92 | 646.07 ± 7.78 | 9.98 × 10-1 | No |
| R + M + F | 628.07 ± 36.95 | 468.82 ± 94.73 | 7.27 × 10-6 | YES |
| R +M + S + F | 641.89 ± 28.67 | 562.58 ± 93.91 | 3.97 × 10-3 | YES |
+
+Table 3: Evaluation of trained CCWM and Dreamer on the ability of zero-shot transfer in cheetah run tasks with different configurations. (R: Reward; M: Mass; F: Friction; S: Stiffness.)
+
+# G FULL ABLATION STUDIES ON THE RETRACE LOSS FUNCTION
+
+In Figure 11, we show the full ablation studies of the retracing loss function in CCWM. We observe that the bisimulation metric retracing loss function consistently outperforms the other alternatives (L2 and reconstruction error). This result conforms with our hypothesis that cycle-consistency supervision given bisimulation metrics poses a stronger constraint on the learning of the representation, leading to a learned representation that better respect the cycle-consistency properties of the environment.
+
+# H FULL RESULTS OF ZERO-SHOT TRANSFER
+
+Please refer to Table 3 for full results on the zero-shot transfer experiment. Note that the $R$ -changes only rescale the reward function by a constant, hence should not count towards a transfer task.
\ No newline at end of file
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/images.zip b/learningstaterepresentationsviaretracinginreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..1284d79d6f8beabe5b29de6687513c2317418b95
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e13113abffe193e49026b1fca321568e277ffb5a0771167e2b2162674833583a
+size 888207
diff --git a/learningstaterepresentationsviaretracinginreinforcementlearning/layout.json b/learningstaterepresentationsviaretracinginreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ca5fa69918f000d17b1182f328b74b36bdf45f36
--- /dev/null
+++ b/learningstaterepresentationsviaretracinginreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b1ea7b33daa57c8025dd53756f4fdc5faf0d6d8777742fab8ccec1b0dc5814d
+size 619269
diff --git a/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_content_list.json b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c48a32dc0ce34a1b152ae0d680917455f039b4d6
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5200ca41f1a2bd9a716e725f5c4fa6d7e32c57142c1c44228b0b74f69b24f0a9
+size 119538
diff --git a/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_model.json b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..879e913f27f6e33ff878290f652834f31a6a15fb
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:924439f719b2fd7c45b1ce615bee8893f0b7a14f7358ddfbac023e4b3b35b08b
+size 141815
diff --git a/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_origin.pdf b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..52f5f702662b0f4e6cb912b6945240dd101ecae4
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/9c653a34-f808-4414-a727-c5affac7e215_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:486a2cadbff550f0a06baddf6f7378e859a673428ac254b26b1d823a2f4d61b3
+size 4932938
diff --git a/learningsuperfeaturesforimageretrieval/full.md b/learningsuperfeaturesforimageretrieval/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..88eb20da5851859ba1318ba12c8198585ee6728c
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/full.md
@@ -0,0 +1,449 @@
+# LEARNING SUPER-FEATURES FOR IMAGE RETRIEVAL
+
+Philippe Weinzaepfel, Thomas Lucas, Diane Larlus, and Yannis Kalantidis
+NAVER LABS Europe, Grenoble, France
+
+# ABSTRACT
+
+Methods that combine local and global features have recently shown excellent performance on multiple challenging deep image retrieval benchmarks, but their use of local features raises at least two issues. First, these local features simply boil down to the localized map activations of a neural network, and hence can be extremely redundant. Second, they are typically trained with a global loss that only acts on top of an aggregation of local features; by contrast, testing is based on local feature matching, which creates a discrepancy between training and testing. In this paper, we propose a novel architecture for deep image retrieval, based solely on mid-level features that we call Super-features. These Super-features are constructed by an iterative attention module and constitute an ordered set in which each element focuses on a localized and discriminant image pattern. For training, they require only image labels. A contrastive loss operates directly at the level of Super-features and focuses on those that match across images. A second complementary loss encourages diversity. Experiments on common landmark retrieval benchmarks validate that Super-features substantially outperform state-of-the-art methods when using the same number of features, and only require a significantly smaller memory footprint to match their performance.
+
+Code and models are available at: https://github.com/naver/FIRE.
+
+# 1 INTRODUCTION
+
+Image retrieval is a task that models exemplar-based recognition, i.e. a class-agnostic, fine-grained understanding task which requires to retrieve all images matching a query image over an (often very large) image collection. It requires learning features that are discriminative enough for a highly detailed visual understanding but also robust enough to extreme viewpoint/pose or illumination changes. A popular image retrieval task is landmark retrieval, whose goal is to single out pictures of the exact same landmark out of millions of images, possibly containing a different landmark from the exact same fine-grained class (e.g. 'gothic-era churches with twin bell towers').
+
+While early approaches relied on handcrafted local descriptors, recent methods use image-level (global) or local Convolutional Neural Networks (CNN) features, see Csurka & Humenberger (2018) for a review. The current state of the art performs matching or re-ranking using CNN-based local features (Noh et al., 2017; Cao et al., 2020; Tolias et al., 2020) and only learns with global (i.e. image-level) annotations and losses. This is done by aggregating all local features into a global representation on which the loss is applied, creating a discrepancy between training and inference.
+
+Attention maps from modules like the ones proposed by Vaswani et al. (2017) are able to capture intermediate scene-level information, which makes them fundamentally similar to mid-level features (Xiao et al., 2015; Chen et al., 2019). Unlike individual neurons in CNNs which are highly localized, attention maps may span the full input tensor and focus on more global or semantic patterns. Yet, the applicability of mid-level features for instance-level recognition and image retrieval is currently underwhelming; we argue that this is due to the following reasons: generic attention maps are not localized and may fire on multiple unrelated locations; at the same time, object-centric attentions such as the one proposed by Locatello et al. (2020) produce too few attentional features and there is no mechanism to supervise them individually. In both cases, methods apply supervision at the global level, and the produced attentional features are simply not discriminative enough.
+
+In this paper, we present a novel image representation and training framework based solely on attentional features we call Super-features. We introduce an iterative Local feature Integration Trans
+
+
+
+
+
+
+Figure 1: Super-features attention maps produced by our iterative attention module (LIT) for three images (left), with the first two that match, for five Super-features. They tend to consistently fire on some semantic patterns, e.g. circular shapes, windows, building tops (second to fourth columns).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+former (LIT), which tailors existing attention modules to the task of image retrieval. Compared to the slot attention (Locatello et al., 2020) for example, it is able to output an ordered and much larger set of features, as it is based on learned templates, and has a simplified recurrence mechanism. For learning, we devise a loss that is applied directly to Super-features, yet it only requires image-level annotations. It pairs a contrastive loss on a set of matching Super-features across matching images, with a decorrelation loss on the attention maps of each image, to encourage Super-feature diversity. In the end, our network extracts for each image a fixed-size set of Super-features that are semantically ordered, i.e., each firing on different types of patterns; see Figure 1 for some examples.
+
+At test time, we follow the protocol of the best performing recent retrieval methods and use ASMK (Tolias et al., 2013), except that we aggregate and match Super-features instead of local features. Our experiments show that the proposed method significantly outperforms the state of the art on common benchmarks like ROxford and Paris (Radenovic et al., 2018a), while requiring less memory. We further show that performance gains persist in the larger scale, i.e. after adding 1M distractor images. Exhaustive ablations suggest that Super-features are less redundant and more discriminative than local features.
+
+Contributions. Our contribution is threefold: (a) an image representation based on Super-features and an iterative module to extract them; (b) a framework to learn such representations, based on a loss applied directly on Super-features yet only requiring image-level labels; (c) extensive evaluations that show significant performance gains over the state of the art for landmark image retrieval. We call our method Feature Integration-based Retrieval or FIRe for short.
+
+# 2 BACKGROUND: LEARNING LOCAL FEATURES WITH A GLOBAL LOSS
+
+Let function $f: \mathcal{G} \to \mathbb{R}^{W \times H \times D}$ denote a convolutional neural network (CNN) backbone that encodes an input image $\boldsymbol{x} \in \mathcal{G}$ into a $(W \times H \times D)$ -sized tensor of $D$ -dimensional local activations over a $(W \times H)$ spatial grid. After flattening the spatial dimensions, the output of $f$ can also be seen as set of $L = W \cdot H$ feature vectors denoted by $\mathcal{U} = \{\boldsymbol{u}_l \in \mathbb{R}^D : l \in 1..L\}$ ; note that the size of this set varies with the resolution of the input image. These local features are then typically whitened and their dimension reduced, a process that we represent by function $o(\cdot)$ in this paper. Global representations, i.e. image-level feature vectors, are commonly produced by averaging all local features, e.g. via global average or max pooling (Babenko & Lempitsky, 2015; Tolias et al., 2016; Gordo et al., 2016).
+
+A global contrastive loss for training. Tolias et al. (2020) argue that optimizing global representations is a good surrogate for learning local features to be used together with efficient match kernels for image retrieval. When building their global representation $g(\mathcal{U})$ , they weight the contribution of
+
+
+(a) The FIRe training process.
+
+
+(b) The LIT module architecture.
+Figure 2: An overview of FIRe. Given a pair of matching images encoded by a CNN encoder, the iterative attention module LIT (Section 3.1) outputs an ordered set of Super-features. A filtering process keeps only reliable Super-feature pairs across matching images (Section 3.2§1), which are fed into a Super-feature-level contrastive loss (Section 3.2§2), while a decorrelation loss reduces the spatial redundancy of the Super-features attention maps for each image (Section 3.2§3).
+
+each local feature to the aggregated vector using its $l_{2}$ norm:
+
+$$
+g (\mathcal {U}) = \frac {\hat {g} (\mathcal {U})}{\| \hat {g} (\mathcal {U}) \| _ {2}}, \quad \hat {g} (\mathcal {U}) = \sum_ {l = 1} ^ {L} \| \boldsymbol {u} _ {l} \| _ {2} \cdot o (\boldsymbol {u} _ {l}), \tag {1}
+$$
+
+where $\| \cdot \| _2$ denotes the $l_{2}$ norm. Given a database where each image pair is annotated as matching with each other or not, they minimize a contrastive loss over tuples of global representations. Intuitively, this loss encourages the global representations of matching images to be similar and those of non-matching images to be dissimilar. Let tuple $(\mathcal{U},\mathcal{U}^{+},\mathcal{V}_{1}^{-},\ldots ,\mathcal{V}_{n}^{-})$ represent the sets of local features of images $(x,x^{+},y_{1}^{-},\dots,y_{n}^{-})$ , where $x$ and $x^{+}$ are matching images (i.e. a positive pair) and none of the images $y_{1}^{-},\ldots ,y_{n}^{-}$ is matching with image $x$ (i.e. they are negatives). Let $[\cdot ]^{+}$ denote the positive part and $\mu$ a margin hyper-parameter. They define a contrastive loss over global representations as:
+
+$$
+\mathcal {L} _ {\text {g l o b a l}} = \left\| g (\mathcal {U}) - g \left(\mathcal {U} ^ {+}\right) \right\| _ {2} ^ {2} + \sum_ {j = 1} ^ {n} \left[ \mu - \left\| g (\mathcal {U}) - g \left(\mathcal {V} _ {j} ^ {-}\right) \right\| _ {2} ^ {2} \right] ^ {+}. \tag {2}
+$$
+
+In $HOW$ , Tolias et al. (2020) employ the global contrastive loss of Eq.(2) to learn a model whose local features are then used with match kernels such as ASMK (Tolias et al., 2013) for image retrieval. ASMK is a matching process defined over selective matching kernels of local features; it is a much stricter and more precise matching function than comparing global representations, and is crucial for achieving good performance. By learning solely using a loss defined over global representations and directly using ASMK over local features $\mathcal{U}$ , HOW achieves excellent image retrieval performance.
+
+# 3 LEARNING WITH SUPER-FEATURES
+
+Methods using a global loss for training but local features for matching have a number of disadvantages. First, using local activations as local features leads to high redundancy, as they exhaustively cover highly overlapping patches of the input image. Second, using ASMK on local features from a model trained with a global loss introduces a mismatch between training and testing: the local features used for ASMK are only trained implicitly, but are expected to individually match in the matching kernel. To obtain less redundant feature sets, we propose to learn Super-features using a loss function that operates directly on those features, and to also use the latter during retrieval; the train/testing discrepancy of the pipeline presented in Section 2 is thus eliminated.
+
+In this section, we first introduce the Local feature Integration Transformer (LIT), an iterative attention module which produces an ordered set of Super-features (Section 3.1). We then present a framework for effectively learning such features (Section 3.2) that consists of two losses: A contrastive loss that matches individual Super-features across positive image pairs, and a decorrelation
+
+loss on the Super-feature attention maps that encourages them to be diverse. An overview of the pipeline is depicted in Figure 2. We refer to our approach as Feature Integration-based Retrieval or FIRe for short, an homage to the feature integration theory of Treisman & Gelade (1980).
+
+# 3.1 LOCAL FEATURE INTEGRATION TRANSFORMER (LIT)
+
+Inspired by the recent success of attention mechanisms for encoding semantics from global context in sequences (Vaswani et al., 2017) or images (Caron et al., 2021), we rely on attention to design our Local feature Integration Transformer (LIT), a module that outputs an ordered set of Super-features.
+
+Let LIT be represented by function $\Phi (\mathcal{U}):\mathbb{R}^{L\times D}\to \mathbb{R}^{N\times d}$ that takes as input the set of local features $\mathcal{U}$ and outputs $N$ Super-features. We define LIT as an iterative module:
+
+$$
+\Phi (\mathcal {U}) = \mathcal {Q} ^ {T}, \quad \mathcal {Q} ^ {t} = \phi (\mathcal {U}; \mathcal {Q} ^ {t - 1}), \tag {3}
+$$
+
+where $\phi$ denotes the core function of the module applied $T$ times, and $\mathcal{Q}^0\in \mathbb{R}^{N\times d}$ denotes a set of learnable templates, i.e. a matrix of learnable parameters. Super-features are progressively formed by iterative refinement of the templates, conditioned on the local features from the CNN.
+
+The architecture of the core function $\phi$ is inspired by the Transformer architecture (Vaswani et al., 2017) and is composed of a dot-product attention function $\psi$ , followed by a multi-layer perceptron (MLP). The dot-product attention function $\psi$ receives three inputs, the key, the value and the query1 which are passed through layer normalization and fed to linear projection functions $K$ , $V$ and $Q$ that project them to dimensions $d_{k}$ , $d_{v}$ and $d_{q}$ , respectively. In practice, we set $d_{k} = d_{v} = d_{q} = d = 1024$ .
+
+The key and value inputs are set as the local features $\boldsymbol{u}_l \in \mathcal{U}$ across all iterations. The query input is the set of templates $\mathcal{Q}^t = \{\boldsymbol{q}_n^t \in \mathbb{R}^d, n = 1..N\}$ . It is initialized as the learnable templates $\mathcal{Q}^0$ for iteration 0, and is set as the previous output of function $\phi$ for the following iterations. After projecting with the corresponding linear projection functions, the key and the query are multiplied to construct a set of $N$ attention maps over the local features, i.e., the columns of matrix $\alpha \in \mathbb{R}^{L \times N}$ , while the $L$ rows $\alpha_l$ of that matrix can be seen as the responsibility that each of the $N$ templates has for each local feature $l$ , and is given by:
+
+$$
+\boldsymbol {\alpha} = \left[ \begin{array}{c} \boldsymbol {\alpha} _ {1} \\ \vdots \\ \boldsymbol {\alpha} _ {L} \end{array} \right] \in \mathbb {R} ^ {L \times N}, \quad \boldsymbol {\alpha} _ {l} = \frac {\hat {\boldsymbol {\alpha}} _ {l}}{\sum_ {i = 1} ^ {L} \hat {\boldsymbol {\alpha}} _ {i}}, \quad \hat {\boldsymbol {\alpha}} _ {l} = \frac {\boldsymbol {e} ^ {\boldsymbol {M} _ {l}}}{\sum_ {n = 1} ^ {N} e ^ {M _ {l n}}}, \quad M _ {l n} = \frac {K (\boldsymbol {u} _ {l}) \cdot Q (\boldsymbol {q} _ {n} ^ {t})}{\sqrt {d}}. \tag {4}
+$$
+
+The dot product between keys and templates can be interpreted as a tensor of compatibility scores between local features and templates. These scores are normalized across templates via a softmax function, and are further turned into attention maps by $l_{1}$ normalization across all $L$ spatial locations. This is a common way of approximating a joint normalization function across rows and columns, also used by Locatello et al. (2020). The input value is first projected with $V$ , re-weighted with the attention maps and then residually fed to a $\mathsf{MLP}^3$ to produce the output of function $\phi$ :
+
+$$
+\mathcal {Q} ^ {t} = \phi (\mathcal {U}; \mathcal {Q} ^ {t - 1}), \quad \phi (\mathcal {U}; \mathcal {Q}) = \operatorname {M L P} (\psi (\mathcal {U}; \mathcal {Q})) + \psi (\mathcal {U}; \mathcal {Q}), \quad \psi (\mathcal {U}; \mathcal {Q}) = V (\mathcal {U}) \cdot \boldsymbol {\alpha} + \mathcal {Q}. \tag {5}
+$$
+
+Following standard image retrieval practice, we further whiten and $l_{2}$ -normalize the output of $\Phi(\mathcal{U})$ to get the final set of Super-features. Specifically, let $\Phi(\mathcal{U}) = [\hat{s}_1; \ldots; \hat{s}_N] \in \mathbb{R}^{N \times d}$ be the raw output of our iterative attention module, we define the ordered set of Super-features as:
+
+$$
+\mathcal {S} = \left\{\boldsymbol {s} _ {n}: \boldsymbol {s} _ {n} = \frac {o \left(\hat {\boldsymbol {s}} _ {n}\right)}{\left\| o \left(\hat {\boldsymbol {s}} _ {n}\right) \right\| _ {2}}, \quad n = 1,.., N \right\}, \tag {6}
+$$
+
+where, as in Section 2, $o(\cdot)$ denotes dimensionality reduction and whitening. Figure 2 (right) illustrates the architecture of LIT. Note that all learnable parameters of $\phi$ are shared across all iterations.
+
+What do Super-features attend to? Each Super-feature in $\mathcal{S}$ is a function of all local features in $\mathcal{U}$ , invariant to permutation of its elements, and can thus attend arbitrary regions of the image.
+
+To visualize the patterns captured by Super-features, Figure 1 shows the attention maps of the same five Super-features for three images, including two of the same landmark (first two rows). The type of patterns depends on the learned initialization templates $\mathcal{Q}^0$ ; this explains why the Super-features form an ordered set, a property which allows to directly compare Super-features with the same ID. We observe the attention maps to be similar across images of the same landmark and to contain some mid-level patterns (such as a half-circle on the second column, or windows on the third one).
+
+# 3.2 LEARNING WITH SUPER-FEATURES
+
+We jointly fine-tune the parameters of the CNN and of the LIT module using contrastive learning. However, departing from recent approaches like HOW (Tolias et al., 2020) or DELG (Cao et al., 2020) that use a global contrastive loss similar to the one presented in Eq. (2), we introduce a contrastive loss that operates directly on Super-features, the representations we use at test time, and yet only requires image-level labels. Given a positive pair (i.e. matching images of the same landmark) and a set of negative images, we select promising Super-feature pairs by exploiting their ordered nature and without requiring any extra supervision signal. We then minimize their pairwise distance, while simultaneously reducing the spatial redundancy of Super-features within an image.
+
+Selecting matching Super-features. Since we are only provided with pairs of matching images, i.e. image-level labels, defining correspondences at the Super-feature level is not trivial. Instead of approximating sophisticated metrics (Liu et al., 2020; Mialon et al., 2021)-see Section 5 for a discussion-, we leverage the fact that Super-features are ordered and we select promising matches and filter out erroneous ones only relying on simple, nearest neighbor-based constraints.
+
+For any $s \in \mathcal{S}$ , let $i(s)$ be the function that returns the position/order or Super-feature ID, i.e. $i(\pmb{s}_i) = i$ , $\forall \pmb{s}_i \in \mathcal{S}$ . Further let function $n(\pmb{s},\mathcal{S}) = \arg \min_{\pmb{s}_i \in \mathcal{S}} \| \pmb{s} - \pmb{s}_i \|_2$ be the function that returns the nearest neighbor of $s$ from set $\mathcal{S}$ . Now, given a positive pair of images $x, x^+$ , let $s \in \mathcal{S}$ , $s' \in \mathcal{S}'$ be two Super-features from their Super-feature sets $\mathcal{S}, \mathcal{S}'$ , respectively. In order for Super-feature pair $(s, s')$ to be eligible, all of the following criteria must be met: a) $s, s'$ have to be reciprocal nearest neighbors, b) they need to pass Lowe's first-to-second neighbor ratio test (Lowe, 2004) and c) they need to have the same Super-feature ID. Let $\mathcal{P}$ be the set of eligible pairs and $\tau$ the hyper-parameter that controls the ratio test; the conditions above can formally be written as:
+
+$$
+\left(\boldsymbol {s}, \boldsymbol {s} ^ {\prime}\right) \in \mathcal {P} \Longleftrightarrow \left\{ \begin{array}{l} s = n \left(\boldsymbol {s} ^ {\prime}, \mathcal {S}\right) \\ s ^ {\prime} = n \left(\boldsymbol {s}, \mathcal {S} ^ {\prime}\right) \end{array} \right. \quad \text {a n d} \quad \left\{ \begin{array}{l} i (\boldsymbol {s}) = i \left(\boldsymbol {s} ^ {\prime}\right) \\ \| \boldsymbol {s} - \boldsymbol {s} ^ {\prime} \| _ {2} / \| \boldsymbol {s} ^ {\prime} - n \left(\boldsymbol {s} ^ {\prime}, \mathcal {S} \backslash \{\boldsymbol {s} \}\right) \| _ {2} \geqslant \tau \end{array} \right. . \tag {7}
+$$
+
+We set $\tau = 0.9$ . Our ablations (Section 4.1) show that all criteria are important. Note that the pair selection step is non-differentiable and no gradients are computed for Super-features not in $\mathcal{P}$ . We further discuss this in Appendix B.4 and empirically show that all Super-features are trained.
+
+A contrastive loss on Super-features. Once the set $\mathcal{P}$ of all eligible Super-feature pairs has been constructed, we define a contrastive margin loss on these matches. Let pair $p = (s, s^{+}) \in \mathcal{P}$ be a pair of Super-features, selected from a pair of matching images $\boldsymbol{x}, \boldsymbol{x}^{+}$ , and let $\mathcal{N}(j) = \{\pmb{n}_j^k : k = 1 \dots n\}$ for $j = 1 \dots N$ be the set of Super-features with Super-feature ID $j$ extracted from negative images $(y_1^{-}, \ldots, y_n^{-})$ . The contrastive Super-feature loss can be written as:
+
+$$
+\mathcal {L} _ {\text {s u p e r}} = \sum_ {(\boldsymbol {s}, \boldsymbol {s} ^ {+}) \in \mathscr {P}} \left[ \left\| \boldsymbol {s} - \boldsymbol {s} ^ {+} \right\| _ {2} ^ {2} + \sum_ {\boldsymbol {n} \in \mathcal {N} (i (\boldsymbol {s}))} \left[ \mu^ {\prime} - \| \boldsymbol {s} - \boldsymbol {n} \| _ {2} ^ {2} \right] ^ {+} \right], \tag {8}
+$$
+
+where $\mu^{\prime}$ is a margin hyper-parameter and the negatives for each $s$ are the Super-features from all $n$ negative images of the training tuple with Super-feature ID equal to $i(s)$ .
+
+Reducing the spatial correlation between attention maps. To obtain Super-features that are as complementary as possible, we encourage them to attend to different local features, i.e. different locations of the image. To this end, we minimize the cosine similarity between the attention maps of all Super-features of every image.
+
+Specifically, let matrix $\alpha = [\tilde{\alpha}_1,\dots ,\tilde{\alpha}_N]$ now be seen as column vectors denoting the $N$ attention maps after the last iteration of LIT. The attention decorrelation loss is given by:
+
+$$
+\mathcal {L} _ {\text {a t t n}} (\boldsymbol {x}) = \frac {1}{N (N - 1)} \sum_ {i \neq j} \frac {\tilde {\alpha} _ {i} ^ {\mathrm {T}} \cdot \tilde {\alpha} _ {j}}{\| \tilde {\alpha} _ {i} \| _ {2} \| \tilde {\alpha} _ {j} \| _ {2}}, \quad i, j \in \{1,.., N \}. \tag {9}
+$$
+
+| reci-
+proc. | ratio
+test | same
+ID | SfM-120k
+val | R Oxford | R Paris |
| med | hard | med | hard |
| | | 68.3 | 64.3 | 39.8 | 74.1 | 52.4 |
| ✓ | | | 79.6 | 69.2 | 44.3 | 79.2 | 60.9 |
| ✓ | ✓ | | 80.8 | 70.7 | 45.1 | 80.3 | 61.9 |
| | ✓ | 75.9 | 63.8 | 35.1 | 77.3 | 56.5 |
| ✓ | ✓ | ✓ | 89.7 | 81.8 | 61.2 | 85.3 | 70.0 |
+
+Table 1: Ablation on matching constraints: Impact of removing constraints on reciprocity, Lowe's ratio test and the Super-feature ID.
+
+
+Figure 3: Evolution of the matching quality measured as the ratio of matches coming from the positive pair over all pairs with the query in each training tuple.
+
+In other words, this loss minimizes the off-diagonal elements of the $N\times N$ self-correlation matrix of $\tilde{\alpha}$ . We ablate the benefit of this loss and others components presented in this section in Section 4.1.
+
+Image retrieval with Super-features. Our full pipeline, FIRE, is composed of a model that outputs Super-features, trained with the contrastive Super-feature loss of Eq.(8) and the attention decorrelation loss of Eq.(9). As our ablations show (see Section 4), the combination of these two losses is required for achieving state-of-the-art performance, while adding a third loss on the aggregated global features as in Eq.(2) does not bring any gain.
+
+# 4 EXPERIMENTS
+
+This section validates our proposed FIRe approach on standard landmark retrieval tasks. We use the SfM-120k dataset (Radenović et al., 2018b) following the 551/162 3D model train/val split from Tolias et al. (2020). For testing, we evaluate instance-level search on the ROxford (Philbin et al., 2007) and the RParis (Philbin et al., 2008) datasets in their revisited version (Radenović et al., 2018a), with and without the 1 million distractor set called R1M. They both contain 70 queries, with 4993 and 6322 images respectively. We report mean average precision (mAP) on the Medium (med) and Hard (hard) setups, or the average over these two setups (avg).
+
+Image search with Super-features. At test time, we follow the exact procedure described by Tolias et al. (2020) and extract Super-features from each image at 7 resolutions/scales $\{2.0, 1.414, 1.0, 0.707, 0.5, 0.353, 0.25\}$ . We then keep the top Super-features (the top 1000 unless otherwise stated) according to their L2 norm and use the binary version of ASMK with a codebook of 65536 clusters. Note that one can measure the memory footprint of a database image $x$ via the number of non-empty ASMK clusters, i.e. clusters with at least one assignment, denoted as $|\mathcal{C}(x)|$ .
+
+Implementation details. We build our codebase on HOW (Tolias et al., 2020) $^4$ and sample tuples composed of one query image, one positive image and 5 hard negatives. Each epoch is composed of 400 batches of 5 tuples each, while hard negatives are updated at each epoch using the global features of Eq.(1). We train our model for 200 epochs on SfM-120k using an initial learning rate of $3.10^{-5}$ and random flipping as data augmentation. We multiply the learning rate by a factor of 0.99 at each epoch, and use an Adam optimizer with a weight decay of $10^{-4}$ . We use a ResNet50 (He et al., 2016) without the last convolutional block as backbone $(\mathrm{R}50^{-})$ . For LIT, we use $D = d_{k} = d_{q} = d_{v} = d = 1024$ . Following HOw, we reduce the dimensionality of features to 128 and initialize $o(\cdot)$ using PCA and whitening before training and keep it frozen. We pretrain the LIT module with the backbone on ImageNet-1K for image classification, see details in Appendix B.6. We use $\mu^{\prime} = 1.1$ in Eq.(8) and weight $\mathcal{L}_{super}$ and $\mathcal{L}_{attn}$ with 0.02 and 0.1, respectively.
+
+# 4.1 ANALYSIS AND ABLATIONS
+
+In this section, we analyze the proposed FIRe framework and perform exhaustive ablations on the training losses and the matching constraints. The impact of the number of iterations $(T)$ and templates $(N)$ in LIT is studied in Appendix A.1. For the rest of the paper, we set $T = 6$ and $N = 256$ .
+
+Matching constraints ablation. Table 1 reports the impact of the different matching constraints: nearest neighbor, reciprocity, Lowe ratio test and constraint on Super-features ID. Adding reciprocity
+
+| \( \mathcal{L}_{global} \) | \( \mathcal{L}_{attn} \) | \( \mathcal{L}_{super} \) | SfM-120k val | \( \mathcal{R} \)Oxford med | hard | \( \mathcal{R} \)Paris med | hard |
| ✓ | | | 79.0 | 64.3 | 38.0 | 75.4 | 51.7 |
| ✓ | ✓ | | 87.7 | 75.8 | 51.2 | 79.0 | 57.0 |
| ✓ | ✓ | ✓ | 88.4 | 79.0 | 57.2 | 83.0 | 65.6 |
| | ✓ | 61.7 | 59.3 | 32.8 | 69.9 | 47.3 |
| ✓ | ✓ | 89.7 | 81.9 | 61.5 | 85.3 | 70.1 |
+
+Table 2: Ablation on loss components: Impact of removing $\mathcal{L}_{\mathrm{attn}}$ , using either a global loss $\mathcal{L}_{\mathrm{global}}$ or a loss directly on Super-features $\mathcal{L}_{\mathrm{super}}$ or a combination of both.
+
+
+Figure 4: Impact of $\mathcal{L}_{\mathrm{attn}}$ on the correlation matrix between attention maps (the darker, the lower is the correlation) at the last iteration of LIT when training with (left) and without (right). This is averaged over the 70 queries of ROxford.
+
+
+Figure 5: Performance versus memory for HOW and FIRe. The x-axis shows the average number of clusters per image used in ASMK (proportional to memory usage). We vary the number of features extracted per image before aggregation in $\{200, \dots, 2000, 2500, \dots, 5000\}$ ; solid markers denote the commonly used settings (1000/2000). FIRe has at most 1,792 features (256 per scale).
+
+
+
+and Lowe's ratio test significantly improves performance, which indicates that it reduces the number of incorrect matches. Keeping all pairs with the same ID yields lower performance: the ID constraint alone is not enough. One possible explanation is that two images from the same landmark may differ significantly, e.g. when some parts are visible in only one of the two images. In that case, the other constraints allow features attending non-overlapping regions of a positive image pair to be excluded from $\mathcal{P}$ . Finally, combining the selective ID constraint with the others yields the best performance.
+
+In order to better understand the impact of the Super-feature ID constraint, a constraint only applicable for Super-features due to their ordered nature, we measure the quality of selected matches during training with and without it. Since there is no ground-truth for such localized matches on landmark retrieval datasets, we measure instead the ratio of matches coming from the positive pair, over all matches (from the positive and all negatives). Ideally, a minimal number of matches should come from the negatives, hence this ratio should be close to 1. In Figure 3 we plot this match ratio for all epochs; we observe that it is significantly higher when using the Super-features ID constraint.
+
+Training losses ablation. We study the impact of the different training losses in Table 2. We start from a global loss similar to HOW (first row). We then add the decorrelation loss (second row) and observe a clear gain. It can be explained by the fact that without this loss, Super-features tend to be redundant (see the correlation matrices in Figure 4). Adding the loss operating directly on the Super-features further improves performance (third row). Next, we remove the global loss and keep only the loss on Super-features alone (fourth row) or with the decorrelation loss (last row). The latter performs best (fourth vs last row). Figure 4 displays the correlation matrix of Super-features attention maps with and without $\mathcal{L}_{\mathrm{attn}}$ . Without it, we observe that most Super-features have correlated attention. In contrast, training with $\mathcal{L}_{\mathrm{attn}}$ leads to uncorrelated attention maps. This is illustrated in Figure 1 which shows several attention maps focusing on different areas.
+
+Varying the number of features at test time. Figure 5 compares HOW (Tolias et al., 2020) with our approach, as we vary the number of local features / Super-features. The x-axis shows the average number of clusters used in ASMK for the database images, i.e., which is proportional to the average memory footprint of an image. We observe that our approach does not only significantly improve
+
+
+Figure 6: Statistics on the feature selected across scales for HOW and FIRe, averaged over the 70 queries from $\mathcal{R}$ Oxford. Left: Among the 1000 selected features, we show the percentage coming from each scale. Middle: For each scale, we show the ratio of features that are selected. Right: Total number of features per scale; we extract $N = 256$ Super-features regardless of scale.
+
+
+
+
+
+accuracy compared to HOW, but also requires overall less memory. Notably, FIRe matches the best performance of HOW with a memory footprint reduced by a factor of 4. For both methods, performance goes down once feature selection no longer discards background features. The gain in terms of performance is even larger when considering a single scale at test time (see Appendix B.1).
+
+Statistics on the number of selected features per scale. The left plot of Figure 6 shows the percentage of the 1000 selected features that comes from each scale, for HOW and FIRe. For HOW most selected features come from the higher resolution inputs; by contrast, selected Super-features are almost uniformly distributed across scales. Interestingly, Figure 6 (middle) shows that HOW keeps a higher percentage of the features coming from coarser scales. Yet, the final feature selection for HOW is still dominated by features from higher scales, due to the fact that the number of local features significantly increases with the input resolution (see Figure 6 right).
+
+# 4.2 COMPARISON TO THE STATE OF THE ART
+
+We compare our method to the state of the art in Table 3. All reported methods are trained on SfM-120k for a fair comparison. $^{5}$ First, we observe that methods based on global descriptors (Tolias et al., 2016; Revaud et al., 2019a) compared with a L2 distance tend to be less robust than methods based on local features (Noh et al., 2017; Tolias et al., 2020). DELG (Cao et al., 2020) shows better performance, owing to a re-ranking step based on local features, at the cost of re-extracting local features for the top-ranked images of a given query, given that local features would take too much memory to store. Our FIRe method outperforms DELF (Noh et al., 2017) as well as HOW (Tolias et al., 2020) by a significant margin when extracting 1000 features per image. Importantly, our approach also requires less memory, as it uses fewer ASMK clusters per image, as shown in Figure 5: for the whole $\mathcal{R}1\mathrm{M}$ set, HOW uses 469 clusters per image while FIRe uses only 383, on average.
+
+# 5 RELATED WORK
+
+Image descriptors for retrieval. The first approaches for image retrieval were based on handcrafted local descriptors and bag-of-words representations borrowed from text retrieval (Sivic & Zisserman, 2003; Csurka et al., 2004), or other aggregation techniques like Fisher Vectors (Perronnin et al., 2010), VLAD (Jégou et al., 2010) or ASMK (Tolias et al., 2013). First deep learning techniques were extracting a global vector per image either directly or by aggregating local activations (Gordo et al., 2016; Radenović et al., 2018b) and have shown to highly outperform handcrafted local features, see (Csurka & Humenberger, 2018) for a review. Methods that perform matching or re-ranking using CNN-based local features are currently the state of the art in the area (Noh et al., 2017; Teichmann et al., 2019; Cao et al., 2020; Tolias et al., 2020). They are able to learn with global (i.e. image-level) annotations. Most of them use simple variants of attention mechanisms (Noh et al., 2017; Ng et al., 2020) or simply the feature norm (Tolias et al., 2020) to weight local activations.
+
+Low-level features aggregation. Aggregating local features into regional features has a long history. Crucial to the success of traditional approaches, popular methods include selecting discriminative patches in the input image (Singh et al., 2012; Gordo, 2015), regressing saliency map scores
+
+| method | FCN | Mem (GB) | \( \mathcal{R} \)Oxford med | hard | \( \mathcal{R} \)Oxford + \( \mathcal{R} \)1M med | hard | \( \mathcal{R} \)Paris med | hard | \( \mathcal{R} \)Paris + \( \mathcal{R} \)1M med | hard |
| Global descriptors |
| RMAC (Tolias et al., 2016) | R101 | 7.6 | 60.9 | 32.4 | 39.3 | 12.5 | 78.9 | 59.4 | 54.8 | 28.0 |
| \( AP-GeM^{\ddagger}_{\text{(Revaud et al., 2019a)}} \) | R101 | 7.6 | 67.1 | 42.3 | 47.8 | 22.5 | 80.3 | 60.9 | 51.9 | 24.6 |
| \( GeM+SOLAR_{\text{(Ng et al., 2020)}} \) | R101 | 7.6 | 69.9 | 47.9 | 53.5 | 29.9 | 81.6 | 64.5 | 59.2 | 33.4 |
| Global descriptors + reranking with local features |
| DELG (Cao et al., 2020) | R50 | 7.6 | 75.1 | 54.2 | 61.1 | 36.8 | 82.3 | 64.9 | 60.5 | 34.8 |
| DELG (Cao et al., 2020) | R101 | 7.6 | 78.5 | 59.3 | 62.7 | 39.3 | 82.9 | 65.5 | 62.6 | 37.0 |
| Local features + ASMK matching (max. 1000 features per image) |
| DELF (Noh et al., 2017) | \( R50^{-} \) | 9.2 | 67.8 | 43.1 | 53.8 | 31.2 | 76.9 | 55.4 | 57.3 | 26.4 |
| SELF-R-ASMK (Teichmann et al., 2019) | \( R50^{-} \) | 27.4 | 76.0 | 52.4 | 64.0 | 38.1 | 80.2 | 58.6 | 59.7 | 29.4 |
| HOW (Tolias et al., 2020) | \( R50^{-} \) | 7.9 | 78.3 | 55.8 | 63.6 | 36.8 | 80.1 | 60.1 | 58.4 | 30.7 |
| FIRE (ours) | \( R50^{-} \) | 6.4 | 81.8 | 61.2 | 66.5 | 40.1 | 85.3 | 70.0 | 67.6 | 42.9 |
| (standard deviation over 5 runs) | | | (±0.6) | (±1.0) | (±0.8) | (±1.1) | (±0.4) | (±0.6) | (±0.7) | (±0.8) |
| (mAP gains over HOW) | | | (↑3.5) | (↑5.4) | (↑2.9) | (↑3.3) | (↑5.2) | (↑9.9) | (↑9.2) | (↑12.2) |
+
+Table 3: Comparison to the state of the art. All models are trained on SfM-120k. FCN denotes the fully-convolutional network backbone, with $\mathbb{R}50^{-}$ denoting a ResNet-50 without the last block. Memory is reported for the image representation of the full R1M set (without counting local features for the global descriptors + reranking methods). $^{\ddagger}$ result from (Tolias et al., 2020). Bold denotes best performance, underlined second best among methods using ASMK, italics second best overall.
+
+at different resolutions (Jiang et al., 2013), aggregating SIFT descriptors with coding and pooling schemes (Boureau et al., 2010), or mining frequent patterns in sets of SIFT features (Singh et al., 2012). More recently, Hausler et al. (2021) introduced a multi-scale fusion of patch features.
+
+Supervision for local features. Several works provide supervision at the level of local features in the context of contrastive learning. Xie et al. (2021) and Chen et al. (2021) obtain several views of an input image using data augmentations with known pixel displacements. Similarly, Liu et al. (2020) train a model to predict the probability for a pair of local features to match, evaluated using known displacements. Wang et al. (2020) and Zhou et al. (2021) obtain local supervision by relying on epipolar coordinates and relative camera poses. Positive pairs in image retrieval depart from these setups, as pixel-level correspondences cannot be known. To build matches, Wang et al. (2021) use a standard nearest neighbor algorithm to build pairs of features, similarly to our approach, but without the use of filtering which is critical to our final performance. Using the current model predictions to define targets is reminiscent of modern self-supervised learning approaches which learn without any label (Caron et al., 2021; Grill et al., 2020). The additional filtering step can be seen as a way to keep only the most reliable model predictions, similar to self-distillation as in e.g. Sohn et al. (2020).
+
+Attention modules. Our LIT module is an iterative variant of standard attention (Bahdanau et al., 2015; Vaswani et al., 2017), adapted to map a variable number of input features to an ordered set of $N$ output features, similar to Lee et al. (2019). The Perceiver model (Jaegle et al., 2021) has demonstrated the flexibility of such constructions by using it to scale attention-based deep networks to large inputs. Our design was heavily inspired by slot-attention (Locatello et al., 2020), but has some key differences that enable us to achieve high performance in more complex visual environments: a) unlike the slot attention which initializes its slots with i.i.d sampling, we learn the initial templates and therefore define an ordering on the output set, a crucial property for selecting promising matches; b) we replace the recurrent network gates with a residual connection across iterations. These modifications, together with the attention decorrelation loss enable our module to go from a handful of object-oriented slots to a much larger set of output features. For object detection, Carion et al. (2020) rely on a set of learned object queries to initialize a stack of transformer layers. Unlike ours, their module is not recurrent; Appendix A.1 experimentally shows substantial benefits from applying LIT $T$ times, with weight sharing, to increase model flexibility without extra parameters.
+
+# 6 CONCLUSIONS
+
+We present an approach that aggregates local features into Super-features for image retrieval, a task that has up to now been dominated by approaches that work at the local feature level. We design an attention mechanism that outputs an ordered set of such features that are more discriminative and expressive than local features. Exploiting their ordered nature and without any extra supervision, we present a loss working directly on the proposed features. Our method not only significantly improves performance, but also requires less memory, a crucial requirement for scalable image retrieval.
+
+# REFERENCES
+
+Artem Babenko and Victor Lempitsky. Aggregating deep convolutional features for image retrieval. In Proc. ICCV, 2015.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. ICLR, 2015.
+Y-Lan Boureau, Francis Bach, Yann LeCun, and Jean Ponce. Learning mid-level features for recognition. In Proc. CVPR, 2010.
+Bingyi Cao, André Araujo, and Jack Sim. Unifying deep local and global features for image search. In Proc. ECCV, 2020.
+Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. Proc. ECCV, 2020.
+Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proc. ICCV, 2021.
+Kai Chen, Lanqing Hong, Hang Xu, Zhenguo Li, and Dit-Yan Yeung. Multisiam: Self-supervised multi-instance siamese representation learning for autonomous driving. In Proc. ICCV, 2021.
+Yunpeng Chen, Marcus Rohrbach, Zhicheng Yan, Yan Shuicheng, Jiashi Feng, and Yannis Kalantidis. Graph-based global reasoning networks. In Proc. CVPR, 2019.
+Gabriela Csurka and Martin Humenberger. From handcrafted to deep local invariant features. arXiv preprint arXiv:1807.10254, 2018.
+Gabriela Csurka, Christopher Dance, Lixin Fan, Jutta Willamowski, and Cedric Bray. Visual categorization with bags of keypoints. In Proc. ECCV Worshops, 2004.
+Albert Gordo. Supervised mid-level features for word image representation. In Proc. CVPR, 2015.
+Albert Gordo, Jon Almazán, Jerome Revaud, and Diane Larlus. Deep image retrieval: Learning global representations for image search. In Proc. ECCV, 2016.
+Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Kavukcuoglu Koray, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to self-supervised learning. In Proc. NeurIPS, 2020.
+Stephen Hausler, Sourav Garg, Ming Xu, Michael Milford, and Tobias Fischer. Patch-netvlad: Multi-scale fusion of locally-global descriptors for place recognition. In Proc. CVPR, 2021.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. CVPR, 2016.
+Martin Humenberger, Yohann Cabon, Nicolas Guerin, Julien Morat, Jérôme Revaud, Philippe Rerole, Noël Pion, Cesar de Souza, Vincent Leroy, and Gabriela Csurka. Robust image retrieval-based visual localization using kapture. arXiv preprint arXiv:2007.13867, 2020.
+Andrew Jaegle, Felix Gimeno, Andrew Brock, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. Perceiver: General perception with iterative attention. In Proc. ICML, 2021.
+Hervé Jégou, Matthijs Douze, Cordelia Schmid, and Patrick Pérez. Aggregating local descriptors into a compact image representation. In Proc. CVPR, 2010.
+Huaizu Jiang, Jingdong Wang, Zejian Yuan, Yang Wu, Nanning Zheng, and Shipeng Li. Salient object detection: A discriminative regional feature integration approach. In Proc. CVPR, 2013.
+Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R. Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer a framework for attention-based permutation-invariant neural networks. In Proc. ICML, 2019.
+Songtao Liu, Zeming Li, and Jian Sun. Self-emd: Self-supervised object detection withoutImagenet. arXiv preprint arXiv:2011.13677, 2020.
+Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-centric learning with slot attention. In Proc. NeurIPS, 2020.
+
+David G Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 2004.
+Grégoire Mialon, Dexiong Chen, Alexandre d'Aspremont, and Julien Mairal. A trainable optimal transport embedding for feature aggregation and its relationship to attention. In Proc. ICLR, 2021.
+Tony Ng, Vassileios Balntas, Yurun Tian, and Krystian Mikolajczyk. Solar: second-order loss and attention for image retrieval. In Proc. ECCV, 2020.
+Hyeonwoo Noh, Andre Araujo, Jack Sim, Tobias Weyand, and Bohyung Han. Large-scale image retrieval with attentive deep local features. In Proc. ICCV, 2017.
+Florent Perronnin, Yan Liu, Jorge Sánchez, and Hervé Poirier. Large-scale image retrieval with compressed fisher vectors. In Proc. CVPR, 2010.
+James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In Proc. CVPR, 2007.
+James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Lost in quantization: Improving particular object retrieval in large scale image databases. In Proc. CVPR, 2008.
+Filip Radenovic, Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. Revisiting oxford and paris: Large-scale image retrieval benchmarking. In Proc. CVPR, 2018a.
+Filip Radenovic, Giorgos Tolias, and Ondrej Chum. Fine-tuning cnn image retrieval with no human annotation. IEEE Trans PAMI, 2018b.
+Jerome Revaud, Jon Almazán, Rafael S Rezende, and Cesar Roberto de Souza. Learning with average precision: Training image retrieval with a listwise loss. In Proc. ICCV, 2019a.
+Jerome Revaud, Cesar De Souza, Martin Humenberger, and Philippe Weinzaepfel. R2D2: Reliable and repeatable detector and descriptor. In Proc. NeurIPS, 2019b.
+Torsten Sattler, Will Maddern, Carl Toft, Akihiko Torii, Lars Hammarstrand, Erik Stenberg, Daniel Safari, Masatoshi Okutomi, Marc Pollefeys, Josef Sivic, et al. Benchmarking 6dof outdoor visual localization in changing conditions. In Proc. CVPR, 2018.
+Saurabh Singh, Abhinav Gupta, and Alexei A Efros. Unsupervised discovery of mid-level discriminative patches. In Proc. ECCV, 2012.
+Josef Sivic and Andrew Zisserman. Video google: A text retrieval approach to object matching in videos. In Proc. ICCV, 2003.
+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. Proc. NeurIPS, 2020.
+Marvin Teichmann, Andre Araujo, Menglong Zhu, and Jack Sim. Detect-to-retrieve: Efficient regional aggregation for image search. In Proc. CVPR, 2019.
+Giorgos Tolias, Yannis Avrithis, and Hervé Jégou. To aggregate or not to aggregate: Selective match kernels for image search. In Proc. ICCV, 2013.
+Giorgos Tolias, Ronan Sicre, and Hervé Jégou. Particular object retrieval with integral max-pooling of cnn activations. In Proc. ICLR, 2016.
+Giorgos Tolias, Tomas Jenicek, and Ondrej Chum. Learning and aggregating deep local descriptors for instance-level recognition. In Proc. ECCV, 2020.
+Anne M Treisman and Garry Gelade. A feature-integration theory of attention. Cognitive psychology, 1980.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proc. NeurIPS, 2017.
+Qianqian Wang, Xiaowei Zhou, Bharath Hariharan, and Noah Snavely. Learning feature descriptors using camera pose supervision. In Proc. ECCV, 2020.
+Xinlong Wang, Rufeng Zhang, Chunhua Shen, Tao Kong, and Lei Li. Dense contrastive learning for self-supervised visual pre-training. In Proc. CVPR, 2021.
+
+Tobias Weyand, Andre Araujo, Bingyi Cao, and Jack Sim. Google landmarks dataset v2-a large-scale benchmark for instance-level recognition and retrieval. In Proc. CVPR, 2020.
+Tianjun Xiao, Yichong Xu, Kuiyuan Yang, Jiaxing Zhang, Yuxin Peng, and Zheng Zhang. The application of two-level attention models in deep convolutional neural network for fine-grained image classification. In Proc. CVPR, 2015.
+Zhenda Xie, Yutong Lin, Zheng Zhang, Yue Cao, Stephen Lin, and Han Hu. Propagate yourself: Exploring pixel-level consistency for unsupervised visual representation learning. In Proc. CVPR, 2021.
+Shuhei Yokoo, Kohei Ozaki, Edgar Simo-Serra, and Satoshi Iizuka. Two-stage discriminative re-ranking for large-scale landmark retrieval. In Proc. CVPR Worshops, 2020.
+Qunjie Zhou, Torsten Sattler, and Laura Leal-Taixe. Patch2pix: Epipolar-guided pixel-level correspondences. In Proc. CVPR, 2021.
+
+# Appendix
+
+# Table of Contents
+
+A Additional ablations 14
+
+A.1 Impact of the iteration and the number of templates hyper-parameters 14
+A.2 Impact of hard negatives 14
+A.3 Impact of the update function 15
+A.4 Extended ablation on matching constraints 15
+A.5 Impact of the template initialization 15
+
+B Analysis and discussions 16
+
+B.1 Single-scale results 16
+B.2 Consistency of attention maps across scales 16
+B.3 Redundancy in Super-features 16
+B.4 Are all Super-features trained? 17
+B.5 Using the Super-feature loss with local features 17
+B.6 Pretraining the backbone together with LIT 18
+B.7 Computational cost of Super-features extraction 18
+B.8 Is Google Landmarks v2 clean an appropriate training dataset for testing on Oxford and Paris? 18
+
+C Application to visual localization 18
+
+In this appendix, we present additional ablations (Appendix A), a deeper analysis of our framework (Appendix B) as well as results of the application of our FIRe framework for image retrieval to the task of visual localization (Appendix C). We briefly summarize the findings in the following paragraphs.
+
+Ablations. We study the impact of some hyper-parameters of our model, namely the size $N$ of the set of Super-features, and the number of iterations $T$ in the LIT module, in Appendix A.1. We show that 256 Super-features and 6 iterations offer the best trade-off between performance and computational cost. We also show in Appendix A.2 that we obtain further performance gains of over $1\%$ by increasing the number of negatives to 10 or 15. We then study the impact of replacing the residual connection inside the LIT module by a recurrent network (Appendix A.3). In Appendix A.4 we present an extended version of Table 1 with further matching constraints and we finally study the impact of the template initialization on performance in Appendix A.5.
+
+Properties of Super-features. We show single-scale results in Appendix B.1. In Appendix B.2, we display the attention maps of Super-features, at different scales for a fixed Super-feature ID. We further study the amount of redundancy in Super-features, compared to local features, in Appendix B.3. Next, we verify in Appendix B.4 that all Super-features receive training signal, as a sanity check. We discuss the case of applying a loss directly on local features in Appendix B.5 and give details about the pretraining on ImageNet in Appendix B.6. In Appendix B.7 we report the average extraction time for the proposed Super-features, while in Appendix B.8 we discuss the fact that there is an overlap between the queries from the common $\mathcal{R}$ Oxford and $\mathcal{R}$ Paris datasets and the Google Landmarks-v2-clean dataset that is commonly used as training set for retrieval on $\mathcal{R}$ Oxford and $\mathcal{R}$ Paris.
+
+Application to visual localization. We further evaluate our model using a visual localization setting on the Aachen Day-Night v1.1 dataset (Sattler et al., 2018) in Appendix C. To do so, we leverage a retrieval + local feature matching pipeline, and show that it is beneficial to use our method, especially in hard settings.
+
+# A ADDITIONAL ABLATIONS
+
+# A.1 IMPACT OF THE ITERATION AND THE NUMBER OFTEMPLATES HYPER-PARAMETERS
+
+In this section, we perform ablations on the number of Super-features $N$ and the number of iterations $T$ in the Local feature Integration Transformer. We first study the impact of the number $N$ of Super-features extracted for each scale of each image in Figure 7a. We observe that the best value is 256 on both the validation and test sets (R.Oxford and RParis). We then study the impact of the number of iterations T in Figure 7b. While the performance decreases when doing 2 or 3 iterations compared to just 1, a better performance is reached for 6 iterations, after which the performance saturates while requiring more computations. We thus use $T = 6$ .
+
+
+(a) Impact of the number of Super-features
+Figure 7: Varying the number of Super-features $N$ and of iterations $T$ in the Local feature Integration Transformer.
+
+
+$\text{一} =$ SfM-120k val. $\text{一} =$ ROxford (avg) $\text{一} =$ RParis (avg)
+(b) Impact of the number of iterations
+
+# A.2 IMPACT OF HARD NEGATIVES
+
+Each training tuple is composed of one image pair depicting the same landmark, and 5 negative images (i.e. from different landmarks). We plot the performance when varying this number in Figure 8. We observe that adding more negatives improves overall the performance on all datasets, i.e. by more than $1\%$ when increasing it to 10 or 15 negatives, but at the cost of a longer training time as more images need to be processed at each iteration. This is why we use 5 negatives in the rest of the paper as it offers a good compromise between performance and cost.
+
+
+Figure 8: Varying the number of hard negatives per training tuple.
+
+# A.3 IMPACT OF THE UPDATE FUNCTION
+
+The formula for $\psi$ in Equation (5) sums the previous $\mathcal{Q}$ with the output of the attention component $V(\mathcal{U})\cdot \alpha$ , i.e., with a residual connection. This is a different choice than the one made in the object-centric slot attention of Locatello et al. (2020), which proposes to use a Gated Recurrent Unit: $\psi (\mathcal{U};\mathcal{Q}) = \mathrm{GRU}(V(\mathcal{U})\cdot \alpha ,\mathcal{Q})$ . We thus compare the residual connection we use to a GRU function and report results in Table 4 with $T = 3$ . We observe that the residual connection reaches a better performance in all datasets while having the interest of not adding extra parameters.
+
+| update function | SfM-120k val | R Oxford | R Paris |
| med | hard | med | hard |
| residual | 79.9 | 71.3 | 43.9 | 78.7 | 59.4 |
| GRU | 74.7 | 66.7 | 41.4 | 77.2 | 57.8 |
+
+In summary, we propose the LIT module to obtain a few hundred features for image retrieval while slot attention handles a handful of object attentions. Technical differences to the slot attention include: a) we use a learned initialization of the templates instead of i.i.d. sampling, which allows to obtain an ordered set of features, and thus to apply the constraint on the ID for the matching, leading to a clear gain, see Table 1 and Figure 3, b) to handle a larger number of templates, we also add a decorrelation loss on the attention maps, which has clear benefit, see Table 2 and Figure 4, c) we use a residual connection with 6 iterations instead of a GRU, leading to improved performance for our task (see Table 4).
+
+# A.4 EXTENDED ABLATION ON MATCHING CONSTRAINTS
+
+Table 4: Impact of the update function in the LIT module. We compare the performance of the residual combination of the previous template value with the cross-attention tensor compared to a GRU as used in slot attention (Locatello et al., 2020). In this experiment, we use $T = 3$ .
+
+| reci-
+proc. | ratio
+test | same
+ID | SfM-120k
+val | R Oxford | R Paris |
| med | hard | med | hard |
| | | 68.3 | 64.3 | 39.8 | 74.1 | 52.4 |
| ✓ | | | 79.6 | 69.2 | 44.3 | 79.2 | 60.9 |
| ✓ | | ✓ | 89.9 | 81.9 | 61.1 | 85.1 | 69.6 |
| ✓ | | 73.5 | 64.6 | 39.0 | 75.5 | 55.0 |
| ✓ | ✓ | 84.2 | 75.0 | 49.8 | 79.4 | 61.1 |
| ✓ | ✓ | | 80.8 | 70.7 | 45.1 | 80.3 | 61.9 |
| | ✓ | 75.9 | 63.8 | 35.1 | 77.3 | 56.5 |
| ✓ | ✓ | ✓ | 89.7 | 81.8 | 61.2 | 85.3 | 70.0 |
+
+Table 5: Extended ablation on matching constraints. We study the impact of removing constraints on reciprocity, Lowe's ratio test and the Super-feature ID.
+
+We show in Table 5 an extended version of Table 1 of the main paper, where we evaluate all possible combinations of constraints among reciprocity, Lowe's ratio test and the Super-feature ID. We observe that the reciprocity constraint and the Super-feature ID constraint are the two most important ones, while the Lowe's ratio only only brings a small improvement.
+
+# A.5 IMPACT OF THE TEMPLATE INITIALIZATION
+
+In the LIT module, initial templates $\mathcal{Q}^0\in \mathbb{R}^{N\times d}$ are learned together with the LIT module. We can therefore assume that they are adapted to the task at hand. To explore the sensitivity to the initial templates, we run a variant of FIRe where the initializations are not fine-tuned, but instead frozen to the values after pretraining on ImageNet. We report performance in Table 6. We observe that the two variants perform overall similarly. This ablation suggests that the initial templates are up to some point transferable to other tasks.
+
+| Template Initialization | SfM-120k val | R Oxford | R Paris |
| med | hard | med | hard |
| Frozen from ImageNet pretraining | 89.5 | 81.3 | 59.6 | 85.3 | 70.2 |
| Fine-tuned for landmark retrieval | 89.7 | 81.8 | 61.2 | 85.3 | 70.0 |
+
+Table 6: Fine-tuning the initial templates. Comparison where we either fine-tune the initial templates $\mathcal{Q}^0$ of LIT (bottom row, as in the main paper) or keep them frozen after ImageNet pretraining (top row).
+
+
+Figure 9: Performance versus memory when varying the number of selected features at a single scale for HOW and FIRe. The x-axis represents the average number of vectors per image in ASMK, which is proportional to the memory, when varying the number of selected features in (25, 50, 100, 150, 200, 300, 400, 500, 600), FIRe is limited to 256 features.
+
+
+
+# B ANALYSIS AND DISCUSSIONS
+
+# B.1 SINGLE-SCALE RESULTS
+
+Similar to Figure 5 of the main paper, we perform the same ablation in Figure 9 when extracting features at a single scale (1.0). We observe that FIRe significantly improves the mAP on the two datasets compared to HOW. The average number of clusters, i.e. the memory footprint of images, remains similar for both methods at a same number of selected features. This stands in contrast to the multi-scale case where our approach allows to save memory (about $20\%$ ), which we hypothesize is due to the correlation of our features across scales that we discuss below.
+
+# B.2 CONSISTENCY OF ATTENTION MAPS ACROSS SCALES
+
+At test time, we extract Super-features at different image resolutions. We propose here to study if the attention maps of the Super-features across different image scales are correlated. We show in Figure 10 the attention maps at the last iteration of LIT for the different image scales. We observe that they fire at the same image location at the different scales. Note that the attention maps are larger/sm smoother at small scales (right columns), as for visualization, we resize lower resolution attention maps to the original image size.
+
+# B.3 REDUNDANCY IN SUPER-FEATURES
+
+To evaluate the redundancy of Super-features versus local features, Figure 11 displays the average cosine similarity between every local feature / Super-feature and its $K$ nearest local features / Super-features from the same image, for different values of $K$ . We observe that Super-features are significantly less correlated to the most similar other ones, compared to local features used in HOW.
+
+
+Figure 10: Attention consistency across scales. For three images, we select one Super-feature per image and show the attention maps of the latest iteration of LIT for different image scales, with from left to right 0.25, 0.353, 0.5, 0.707, 1.0, 1.414 and 2.0. We clearly observe that attention maps are correlated. They show larger regions at small scales as for visualization, we resize the lower resolution attention to the original image size.
+
+
+Figure 11: Measuring Super-feature redundancy. We compute the average cosine similarity between every feature (local feature from HOW or Super-feature from FIRe) and its K most similar features from the same image, for varying K. Results are averaged over the 70 query images of the ROxford dataset. Only 256 Super-features can be extracted per image, explaining its maximum x value.
+
+# B.4 ARE ALL SUPER-FEATURES TRAINED?
+
+The loss in Equation (8) only operates on a subset of the Super-feature pairs that pass the criteria of Equation (7); if a Super-feature ID is not matched, it receives no training signal. To investigate if all of the IDs contribute to the loss, we monitored how many times each ID is matched at each epoch and report the percentage over all 2000 training tuples per epoch. In Figure 12 we report mean, standard deviation and minimum number of matches for the $N$ Super-feature ID. We clearly observe that all Super-features receive training signals regularly and each Super-feature is matched about one quarter of the time on average.
+
+# B.5 USING THE SUPER-Feature Loss With LOCAL FEATURES
+
+It is worth noting that the loss in Equation (8) could also theoretically be used over local feature activations. It could be computed on pairs of local features that pass the conditions described in Equation (7), after removing the constraint on having the same Super-feature ID. Unfortunately, we were unable to get any gains over HOW (Tolias et al., 2020) when appending such a loss side-by-side with the global loss over local features. Empirically, our ablations (see Section 4.1) show that adding the constraint on the Super-features ID, which is only possible with ordered feature sets, is key to the success of our approach, and significantly improves the quality of the matching.
+
+
+Figure 12: Are all Super-features trained? As a sanity check, this plot shows the average number (in percentage) of times (with standard deviation) that the Super-features receive training signal, across training epochs. We also plot the minimum value, which is always significantly positive, showing that each Super-feature ID receives training signal. Thus our loss $\mathcal{L}_{\mathrm{super}}$ proposed in Equation (8) does not lead to degenerate solutions where some IDs are never selected and never trained.
+
+# B.6 PRETRAINING THE BACKBONE TOGETHER WITH LIT
+
+Before training on landmark retrieval, we pretrain the backbone network, with the proposed LIT module appended after the last layer, for image classification on ImageNet-1K. Given that we remove the last convolutional block similar to HOW, to avoid overfitting we further append a classification head composed of one fully-connected layer, batch norm, leaky ReLU, dropout and another fully-connected layer at the end of the network and train it for 80 epochs using a standard cross-entropy loss and in addition the decorrelation loss $\mathcal{L}_{\mathrm{att}}$ weighted by 0.1, the same weight as during fine-tuning. We start with a learning rate of 0.01 and divide it by 10 every 20 epochs. This new architecture reaches a top-1 (resp. top-5) accuracy of $73.48\%$ (resp. $91.54\%$ ) on the ImageNet validation set. Note that this performance is a bit lower than a standard ResNet-50: this is because we have removed the last convolutional block which contains most parameters in the ResNet architecture.
+
+# B.7 COMPUTATIONAL COST OF SUPER-FEATURES EXTRACTION
+
+We report the time required for extracting multi-scale features for 5000 images, for HOW and FIRe. On our server, it took 157 seconds for HOW and 172 for FIRe, i.e. extraction for Super-features only requires $10\%$ more wall-clock time.
+
+# B.8 IS GOOGLE LANDMARKS V2 CLEAN AN APPROPRIATE TRAINING DATASET FOR TESTING ON $\mathcal{R}$ OXFORD AND $\mathcal{R}$ PARIS?
+
+In the comparison to the state of the art (Table 3), all reported methods are trained on the SfM-120k dataset. Several recent works have also released a model trained on the Google Landmarks v2 dataset (Weyand et al., 2020) or its clean version (Yokoo et al., 2020) with excellent performance on $\mathcal{R}$ Paris. However, we find out that several of the query landmarks from $\mathcal{R}$ Paris and $\mathcal{R}$ Oxford were present in the training set of the cleaned version of Google Landmarks v2, such as 'La Defense', 'Eiffel Tower', 'Sacré Coeur' or 'Hotel les Invalides' for $\mathcal{R}$ Paris or such as 'Mary Madgalen', 'Bodleian Library', 'All Souls College' or 'Radcliffe' for $\mathcal{R}$ Oxford.
+
+# C APPLICATION TO VISUAL LOCALIZATION
+
+In this section, we evaluate FIRe for the task of visual localization, where retrieval is used as a first-stage filtering and before more precise, local feature-based geometric matching. To this end, we follow the pipeline proposed by Kapture $^{6}$ (Humenberger et al., 2020) on the Aachen Day-Night v1.1 dataset (Sattler et al., 2018). In this scenario, a global Structure-from-Motion map is built
+
+| Retrieval method | Day images | Night images |
| 0.25m, 2° | 0.5m, 5° | 5m, 10° | 0.25m, 2° | 0.5m, 5° | 5m, 10° |
| AP-GeM (Revaud et al., 2019a) | 88.8 | 96.6 | 99.6 | 72.3 | 86.9 | 97.9 |
| HOW (Tolias et al., 2020) | 90.8 | 96.2 | 99.6 | 72.8 | 90.1 | 97.9 |
| FIRE (ours) | 90.7 | 96.5 | 99.5 | 74.3 | 90.1 | 98.4 |
+
+Table 7: Visual localization results. Percentage of successfully localized images on the Aachen Day-Night v1.1 dataset when changing the retrieval method in the Kapture pipeline from Humenberger et al. (2020). In the most challenging scenario, i.e. night images at strictest localization threshold, using FIRe yields a $2\%$ improvement compared to AP-GeM and a $1.5\%$ improvement compared to HOW. Bold number denotes the best performance, underlined indicates performance within a 0.1 margin to the best one.
+
+from the training images using R2D2 local descriptors (Revaud et al., 2019b). At test time, given a query image to localize, image retrieval is used to retrieve the top-50 nearest images. On these retrieved images, R2D2 local features are extracted and matched with the ones on the query image, and this is used to estimate the position of the camera. The percentage of successfully localized images within three levels of thresholds is then reported on the day or night images, following the visual localization benchmark protocol7, the latter ones being more challenging as training images are taken during daytime.
+
+We compare our retrieval method to AP-GeM (Revaud et al., 2019a) and HOW (Tolias et al., 2020) and report results in Table 7. AP-GeM is the default method used in Kapture (Humenberger et al., 2020). We observe that using FIRe leads to better visual localization, specially in the most challenging scenario of night image localization and the strictest localization threshold: Performance improves by $2\%$ compared to AP-GeM and by $1.5\%$ compared to HOW on night images at a threshold of $0.25\mathrm{m}$ and $2^{\circ}$ . Overall, for either day or night images, FIRe either improves or performs on par to both methods compared.
\ No newline at end of file
diff --git a/learningsuperfeaturesforimageretrieval/images.zip b/learningsuperfeaturesforimageretrieval/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..237a45c3ab877355f0b85c72bf030c3bbac276bc
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:871ae0cb9c2c81d62726715b7f0b5fa51a77776d0bd302ca0fa0ba25558595b7
+size 886534
diff --git a/learningsuperfeaturesforimageretrieval/layout.json b/learningsuperfeaturesforimageretrieval/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..93bc15e7f024815bd07baf4c41a5b021c16f738f
--- /dev/null
+++ b/learningsuperfeaturesforimageretrieval/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ba20c89dc8ff30c681aca94b4b0e3a002283184c00aa37e61a3ae9686776b8c0
+size 618246
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_content_list.json b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf4fe97468ad8305fc2d321cba1d667183bc027e
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4d2ba31a47479cccbce98b80501e9e84ae9c7bbe84f149930edbf3510d0ed4ec
+size 202004
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_model.json b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..6a6be3f38f869949d7b20697e536ae19b7ccf1a6
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:715d14722651a6e54ef88162f8fccbaf0afa9693ab05bad4888ae78736d896a2
+size 228368
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_origin.pdf b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..695ea7eb536dff973cbdeec82bc59095604d1307
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/38a862ec-8093-4806-b2f8-bc7bb30e099b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f2956afff2e66a862e16104ef475326707709d439dc5d64b7ae080c33a840927
+size 20544366
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/full.md b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..822213050f256e55fd2ef7cafa314ec61c90334e
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/full.md
@@ -0,0 +1,828 @@
+# LEARNING SYNTHETIC ENVIRONMENTS AND REWARD NETWORKS FOR REINFORCEMENT LEARNING
+
+Fabio Ferreira $^{1}$ Thomas Nierhoff $^{1}$ Andreas Salinger $^{1}$ Frank Hutter $^{1,2}$
+
+1 University of Freiburg 2 Bosch Center for Artificial Intelligence {ferreira, fh}@cs.uni-freiburg.de
+
+# ABSTRACT
+
+We introduce Synthetic Environments (SEs) and Reward Networks (RNs), represented by neural networks, as proxy environment models for training Reinforcement Learning (RL) agents. We show that an agent, after being trained exclusively on the SE, is able to solve the corresponding real environment. While an SE acts as a full proxy to a real environment by learning about its state dynamics and rewards, an RN is a partial proxy that learns to augment or replace rewards. We use bi-level optimization to evolve SEs and RNs: the inner loop trains the RL agent, and the outer loop trains the parameters of the SE / RN via an evolution strategy. We evaluate our proposed new concept on a broad range of RL algorithms and classic control environments. In a one-to-one comparison, learning an SE proxy requires more interactions with the real environment than training agents only on the real environment. However, once such an SE has been learned, we do not need any interactions with the real environment to train new agents. Moreover, the learned SE proxies allow us to train agents with fewer interactions while maintaining the original task performance. Our empirical results suggest that SEs achieve this result by learning informed representations that bias the agents towards relevant states. Moreover, we find that these proxies are robust against hyperparameter variation and can also transfer to unseen agents.
+
+# 1 INTRODUCTION
+
+Generating synthetic data addresses the question of what data is required to achieve a rich learning experience in machine learning. Next to increasing the amount of available data, synthetic data can enable higher training efficiency that opens up new applications for Neural Architecture Search (Such et al., 2020), may improve algorithm analysis or facilitate custom datasets (Jhang et al., 2020).
+
+In this paper, we consider learning neural synthetic data generators for Reinforcement Learning (RL). We investigate the question of whether we can learn a synthetic Markov Decision Process of a real (target) environment which is capable of producing synthetic data to allow effective and more efficient agent training, that is, to achieve similar or higher performance more quickly compared to when training purely on the real environment. When learning to produce both states and rewards, we refer to these neural network proxies as synthetic environments (SEs). Additionally, we investigate the same question for learning reward proxies that do not learn about the state dynamics and which we refer to as a Reward Networks (RNs).
+
+We depict our procedure in Figure 1 which resembles a bi-level optimization scheme consisting of an outer and inner loop. The inner loop trains the agent on an SE or RN. Since our method is agnostic to both domain and agent, we can interchangeably adopt standard RL algorithms in the inner loop. In the outer loop, we assess the agent's performance by evaluating it on the real environment; we then take the collected reward as a score to update the SE's or RN's neural parameters used in the inner loop. In this way, the SE/RN is gradually updated such that an agent being trained on it, scores higher on a real environment. For the outer loop we use Evolution Strategies (Rechenberg, 1973; Salimans et al., 2017) with a population of SE/RN parameters.
+
+After discussing related work (Section 2), we make the following contributions:
+
+
+Figure 1: We use an agent-agnostic meta-learning approach to learn neural proxy RL environments (left) and reward networks (right) for a target task. In the inner loop, we train RL agents on the proxy and use the evaluation performance on the target task in the outer loop to evolve the proxy.
+
+- We introduce synthetic environments (Section 3), a novel concept that focuses on the environment instead of agent learning using a bi-level optimization scheme, which is guided purely by the agent performance. This concept goes beyond the usual learning of a one-time internal environment model inside an agent (such as in Dyna (Sutton, 1990)).
+- As a sub-problem of SEs, we investigate reward networks (Section 4), contrasting several types of potential-based reward shaping (Ng et al., 1999) variants.
+- We show that it is possible to learn SEs (Section 5) and RNs (Section 6) that, when used for agent training, yield agents that successfully solve the Gym tasks (Brockman et al., 2016) CartPole and Acrobot (SEs), as well as Cliff Walking, CartPole, MountainCarContinuous, and HalfCheetah (RNs).
+- We show that SEs and RNs are efficient and robust in training agents, require fewer training steps compared to training on the real environment and are able to train unseen agents
+- We report empirical evidence showing that SEs and RNs achieve their efficiency gains for training new agents through condensed and informed state and reward representations.
+
+Overall, we find it noteworthy that it is actually possible to learn such proxies, and we believe our research will improve their understanding. Since these learned proxies can train agents quickly and transfer to unseen agents, we believe this work might open up possible avenues of research in RL. Possible future applications include cheap-to-run environments for AutoML (Hutter et al., 2019) or for robotics when training on targets is expensive, as well as agent and task analysis, or efficient RL agent pre-training. Our PyTorch (Paszke et al., 2019) code and models are made available publicly. $^{1}$
+
+# 2 RELATED WORK
+
+Synthetic Environments In the context of RL, learning synthetic environments is related to model-based RL (MBRL) where the dynamics model can be viewed as an SE. In MBRL, one jointly learns both a dynamics model and a policy as in Dyna (Sutton, 1990) or an existing dynamics model is used with planning methods to learn a policy (Silver et al., 2017; Moerland et al., 2020). Our work does not involve planning, nor does it use supervised learning for the dynamics model and it does not mix synthetic and real data during policy learning. Instead, we use purely synthetic data to train agents similar to World Models (Ha & Schmidhuber, 2018) but use the cumulative rewards from the real environment in a bi-level optimization for learning our model jointly with our agent. For a more extensive discussion on the differences between our work and model-based RL, we refer the reader to Appendix D.
+
+Analogous to learning SEs is Procedural Content Generation (Togelius et al., 2011) and Curriculum Learning that concerns automatically selecting (Matiisen et al., 2020) or generating the content of training environments (Volz et al., 2018; Shaker et al., 2016; Wang et al., 2019; Cobbe et al., 2020), with the closest work being Generative Playing Networks (GPNs) (Bontrager & Togelius, 2020). GPNs learn an environment generator that creates increasingly difficult SEs according to what a critic's value function estimates as challenging. While GPNs are a method to generate environment curricula, our approach studies learning an SE for effective and efficient agent training by compressing the relevant information into a single model of the environment. We also use a more generally
+
+applicable objective that does not rely on actor-critic formulations but purely on the achieved cumulative reward. Less related areas are methods like domain randomization (Tobin et al., 2017) that generate environments regardless of agent performance or minimax methods that adversarially (instead of cooperatively) generate environments based on the difference between the reward of two competing agents that are trying to solve the generated environment (Dennis et al., 2020).
+
+Related to our work, and inspiring it, are Generative Teaching Networks (Such et al., 2020). While we similarly use a bi-level optimization to learn a synthetic data generator, our approach is different in central aspects: we use Evolution Strategies to avoid the need for explicitly computing Hessians, we do not use noise vectors as input to our SEs, and we target sequential decision-making problems instead of supervised learning.
+
+Reward Networks Reward shaping concerns the question of how to enhance the reward signal to allow agents to be trained more effectively or efficiently. Common learned reward shaping approaches are curiosity or count-based exploration (Pathak et al., 2017; Burda et al., 2019; Singh et al., 2010; Bellemare et al., 2016; Tang et al., 2017). Others achieve reward shaping with prior knowledge through expert demonstrations (Judah et al., 2014; Brys et al., 2015; Ibarz et al., 2018). In contrast to our work, these contributions all apply a single-level optimization. When using a bilevel optimization, the reward shaping function is usually learned in the outer loop while the policy using the learned rewards is optimized in the inner loop. Here, one way is to meta-learn the parameterization of reward functions (Faust et al., 2019; Hu et al., 2020; Jaderberg et al., 2019). Another way is to learn a neural network that resembles the reward function.
+
+While learning full synthetic environments is entirely novel, there exists prior work on learning reward shaping networks. The most related works are (Zheng et al., 2018) for single tasks, (Zou et al., 2019) for entire task distributions, or (Zheng et al., 2020) that additionally take into account the entire lifetime of an agent to learn a "statefulness across episodes"-reward function. Despite the similarities, some noteworthy differences exist. Importantly, the approaches in (Zheng et al., 2018; Zou et al., 2019) are not agent-agnostic, making it less straightforward to exchange agents as in our work. Moreover, the transferability of learned shaped rewards is studied only limitedly (Zheng et al., 2018), not at all (Zou et al., 2019) or only for grid world-like environments (Zheng et al., 2020).
+
+# 3 LEARNING SYNTHETIC ENVIRONMENTS
+
+Problem Statement Let $(S, \mathcal{A}, \mathcal{P}, \mathcal{R})$ be a Markov Decision Process (MDP) with the set of states $S$ , the set of actions $\mathcal{A}$ , the state transition probabilities $\mathcal{P}$ and the immediate rewards $\mathcal{R}$ when transitioning from state $s \in S$ to the next state $s' \in S$ through action $a \in \mathcal{A}$ . The MDPs we consider are either human-designed environments $\mathcal{E}_{real}$ or learned synthetic environments $\mathcal{E}_{syn,\psi}$ (SE) represented by a neural network with parameters $\psi$ . Interfacing with the environments is identical in both cases, i.e. $s', r = \mathcal{E}(s, a)$ . The crucial difference is that for SEs, the state dynamics and rewards are learned. The main objective of an RL agent when acting on an MDP $\mathcal{E}_{real}$ is to find a policy $\pi_{\theta}$ parameterized by $\theta$ that maximizes the cumulative expected reward $F(\theta; \mathcal{E}_{real})$ . We consider the following bi-level optimization problem: find the parameters $\psi^{*}$ , such that the agent policy $\pi_{\theta}$ parameterized with $\theta$ that results from training on $\mathcal{E}_{syn,\psi^{*}}$ achieves the highest reward on a target environment $\mathcal{E}_{real}$ . Formally that is:
+
+$$
+\begin{array}{r l} \psi^ {*} = \underset {\psi} {\arg \max } & F \left(\theta^ {*} (\psi); \mathcal {E} _ {\text {r e a l}}\right) \\ \text {s . t .} \quad \theta^ {*} (\psi) = \underset {\theta} {\arg \max } & F \left(\theta ; \mathcal {E} _ {\text {s y n}, \psi}\right). \end{array} \tag {1}
+$$
+
+We use standard RL algorithms for optimizing the agents on the SE in the inner loop. Although gradient-based optimization methods can be applied in the outer loop, we chose Natural Evolution Strategies (Wierstra et al., 2008) (NES) to allow the optimization to be independent of the choice of the agent in the inner loop and to avoid potentially expensive, unstable meta-gradients (Metz et al., 2019). Additional advantages of NES are that it is better suited for long episodes, sparse or delayed rewards, and parallelization (Salimans et al., 2017).
+
+Algorithm We now explain our method. The overall scheme is adopted from (Salimans et al., 2017) and depicted in Algorithm 1. It consists of an Evolutionary Strategy in the outer loop
+
+to learn the SE and an inner loop which trains RL agents. The performances of the trained agents are then used in the outer loop to update the SE. We instantiate the population search distribution as a multivariate Gaussian with mean 0 and a fixed covariance $\sigma^2 I$ . The main difference to (Salimans et al., 2017) is that, while they maintain a population over agent parameter vectors, our population consists of SE parameter vectors. Moreover, our approach involves two optimizations (the agent and the SE parameters) instead of one (agent parameters).
+
+Our algorithm first stochastically perturbs each population member $i$ which results in $\psi_{i}$ (Line 5). Then, a new randomly initialized agent is trained on the SE parameterized by $\psi_{i}$ for $n_e$ episodes (L6). The trained agent with fixed parameters is then tested across 10 episodes on the real environment (L7), yielding the average cumulative reward which we use as a score $F_{\psi ,i}$ . Finally, we update $\psi$ with a stochastic gradient estimate based on all member scores (L8). We use a parallelized version of the algorithm and an early stopping heuristic to stop in fewer than
+
+Algorithm 1: Learning Synthetic Env. with NES
+1 Input: initial SE parameters $\psi$ , real environment $\mathcal{E}_{\mathrm{real}}$ , NES noise std. dev. $\sigma$ , number of episodes $n_e$ , population size $n_p$ , NES step size $\alpha$
+2 repeat
+3 foreach member of pop. $i = 1,2,\dots ,n_{p}$ do
+4 $\begin{array}{r}\epsilon_i\sim \mathcal{N}(0,\sigma^2 I)\\ \psi_i = \psi +\epsilon_i\\ \theta_i = \mathrm{TrainAgent}(\theta_i,\mathcal{E}_{\mathrm{syn},\psi_i},n_e)\\ F_{\psi ,i} = \mathrm{EvaluateAgent}(\theta_i,\mathcal{E}_{\mathrm{real}}) \end{array}$
+5
+6
+7
+8 Update SE: $\psi \gets \psi +\alpha \frac{1}{n_p\sigma}\sum_i^{n_p}F_i\epsilon_i$
+9 until no steps
+
+$n_e$ episodes when progress plateaus (more in Appendix A.1).
+
+# 4 LEARNING REWARD NETWORKS
+
+Learning both the state dynamics and rewards can be challenging (see Section 7). To reduce computational complexity but still be able to achieve training efficiency, one can therefore reduce the problem formulation to only learn (to augment) the rewards and make use of the real environment for the state dynamics (and original rewards) as illustrated in Figure 1. We reuse the formulation of $\mathcal{E}_{syn}$ and $\mathcal{E}_{real}$ from the problem statement (Eq. 1) and describe learning reward networks as getting the next state and reward $s'$ , $r = \mathcal{E}_{real}(s,a)$ and a corresponding synthetic reward $r_{syn} = \mathcal{E}_{rn,\psi}(s,a,s')$ with a (reward) environment represented by a neural network $\psi$ . In the domain of reward shaping, $r_{syn}$ is usually added to $r$ to generate an augmented reward $r_{aug} = r + r_{syn}$ . A popular approach in reward shaping is potential-based reward shaping (PBRS) (Ng et al., 1999), which defines $\mathcal{E}_{rn}$ as $\mathcal{E}_{rn,\psi}(s,a,s') = \gamma \Phi(s') - \Phi(s)$ with a potential function $\Phi: S \rightarrow \mathbb{R}$ and a discount factor $\gamma \in (0,1]$ . We adopt PBRS for finding $\mathcal{E}_{rn,\psi}$ , represent $\Phi$ as a neural network with parameters $\psi$ and use Algorithm 1 to learn $\psi$ . PBRS has the useful property of preserving optimality of policies (Ng et al., 1999) but we also introduce additional variants of $\mathcal{E}_{rn,\psi}$ , listed in Table 1, which are motivated by PBRS but are not typically referred to as PBRS as they may not have such guarantees. These variants are motivated by the idea that fewer constraints may enable better reward learning (e.g., in case the difference of potential functions imposes a too strong constraint on the hypothesis space). For simplicity, we refer to the output of Reward Networks (RNs) as $r_{aug}$ .
+
+We now point out the differences between the RN and the SE case. When training on SEs, we use a heuristic for determining the number of required training episodes since both rewards and states are synthetic (see Appendix A.1). In the RN case, the real states allow us to directly observe episode termination, thus such a heuristic is not needed. Another difference to SEs lies in the
+
+Table 1: Overview of Reward Network variants.
+
+| Reward Network | raug |
| Additive Potential RN (Ng et al., 1999) | r + γΦ(s') - Φ(s) |
| Exclusive Potential RN | γΦ(s') - Φ(s) |
| Additive Non-Potential RN | r + Φ(s') |
| Exclusive Non-Potential RN | Φ(s') |
+
+EvaluateAgent function of Algorithm 1: Optimizing SEs for the maximum cumulative reward automatically yielded fast training of agents as a side-product, likely due to efficient synthetic state dynamics. Since we do not learn state dynamics in RNs and motivated by the efficiency gains, we now directly optimize the number of training steps $n_{tr}$ the TrainAgent function requires to solve the real environment when being trained on an RN. Additionally, we include the cumulative reward threshold of the real environment $C_{sol}$ and the cumulative reward at the end of training $C_{fin}$ , yielding the final objective $n_{tr} + w_{sol} * \max(0, C_{sol} - C_{fin})$ (to be minimized) where $w_{sol} \in \mathbb{R}_{>0}$ gives
+
+us control over efficiency and effectiveness an RN should achieve. In Appendix B.4, we study the influence of alternative RN optimization objectives.
+
+# 5 EXPERIMENTS WITH SYNTHETIC ENVIRONMENTS
+
+Experimental Setup So far we have described our proposed method on an abstract level and before we start with individual SE experiments we describe the experimental setup. In our work, we refer to the process of optimizing for suitable SEs with Algorithm 1 as SE training and the process of training agents on SEs as agent training). For both SE and agent training on the discrete-action-space CartPole-v0 and Acrobot-v1 environments, we use DDQN (van Hasselt et al., 2016). We also address generalization from an algorithmic viewpoint by varying the agent hyperparameters during SE training (Line 6) after each outer loop iteration. Also, we study how robustly found SEs can train agents under varying agent hyperparameters and how well they transfer in training unseen agents. For studying transferability of SEs, we use Dueling DDQN (Wang et al., 2016) and TD3 (Fujimoto & H. Hoof, 2018). TD3 is chosen because it does not solely rely on Q-Learning and is an algorithm of the actor-critic family. Both our tasks employ a discrete action space and to be able to use TD3 we use a Gumbel-Softmax distribution (Jang et al., 2017).
+
+We wrap our algorithm in another outer loop to optimize some of the agent and NES HPs with the multi-fidelity Bayesian optimization method BOHB (Falkner et al., 2018) to identify stable HPs. The optimized HPs are reported in Table 3 in the appendix. We did not optimize some of the HPs that would negatively affect run time (e.g., population size, see Table 4 in the appendix). After identifying the agent and NES HPs, we removed BOHB and used the found HPs for SE training. Once SEs were found, we reverted from specific agent HPs that worked best for training SEs to default agent HPs as reported in Table 5 (appendix) to test out-of-the-box applicability.
+
+Feasibility After introducing the core concept of learning SEs, we now investigate its efficacy of learning SEs for the CartPole and Acrobot tasks. First, we identified stable DDQN and NES hyperparameters. Then, we ran Algorithm 1 with 16 population members for 200 NES outer loop iterations to generate the SEs. We depict the result in Figure 2, which shows the average of the 16 members' evaluation scores (given by EvaluateAgent in Algorithm 1) as a function of the NES outer loop iterations for multiple NES optimization runs (thin lines). The thick solid lines show the average of these. Notice that 50 NES iterations are often sufficient to find SEs that teach agents to solve a task (for more details, we refer the reader to the Appendix Section A).
+
+
+Figure 2: Multiple NES runs of Alg. 1 for CartPole (top) and Acrobot (bottom) which can teach agents the task effectively. Each thin line is the average of 16 worker scores from EvaluateAgent of such a run.
+
+Performance of SE-trained Agents As we have shown in the last section, learning SEs that can teach agents the CartPole and Acrobot task is feasible with the proposed concept. Now, we investigate how efficient and hyperparameter-sensitive the generated SEs are. For this, we distinguish three different cases: 1) train: real, 2) train: synth., HPs: varied, and 3) train: synth.,
+
+HPs: fixed. The first is our baseline for which we train agents only on the real environment without any involvement of SEs. The second case denotes SEs for which we randomly sampled agent hyperparameters (HPs) from the ranges in Table 2 before each TrainAgent call during SE training. Lastly, the third case is similar to the second except that we did not randomly sample agent HPs but rather used the optimized ones reported in Table 3 which we kept fixed during SE training.
+
+Table 2: Agent hyperparameter ranges sampled from for training SEs and agents.
+
+| Agent hyperparam. | Value range | log scale |
| learning rate | [10-3/3, 10-3*3] | ✓ |
| batch size | [42, 384] | ✓ |
| hidden size | [42, 384] | ✓ |
| hidden layer | [1, 3] | x |
+
+
+
+
+
+
+
+
+Figure 3: Top row: Densities based on each 4000 cumulative test rewards collected by DDQN (left), Dueling DDQN (center), and discrete TD3 (right) agents on CartPole. We show three settings: agents trained on a real environment without any involvement of SEs (blue, baseline), on SEs where the agent HPs were fixed during SE training (green), and on SEs when agent HPs were varied during SE training (orange). After training, the evaluation is always done on the real environment. In all three settings, we randomly sample the agent HPs before agent training. Bottom row: Average train steps and episodes corresponding to the densities along with the mean reward (below bars). When training on SEs, we train $30 - 65\%$ faster compared to training on the real environment.
+
+
+
+We first trained 40 SEs for each of the cases 2) and 3); then, we evaluated all approaches with the following procedure: on each SE we trained 10 DDQN agents with randomly sampled HPs according to Table 2. After agent training, we evaluated each agent on the real environment across 10 test episodes, resulting in 4000 evaluations. For our baseline, where no SE is involved, the procedure was identical except that we used 40 real environment instantiations instead of SEs to obtain the same number of evaluations. We then used the cumulative rewards from the test episodes for generating the densities in Figure 3 and report the average episodes and training steps required until the heuristic for stopping agent training on SEs/real environment is triggered (Appendix A.1).
+
+Training DDQN agents on DDQN-trained SEs without varying the agent's HPs (green) during SE training clearly yielded the worst results. We attribute this to overfitting of the SEs to the specific agent HPs. Instead, when varying the agent HPs (orange) during SE training, we observe that the SEs are consistently able to train agents using $\sim 60\%$ fewer steps (6818 vs. 16887) on average while being more stable than the baseline (fewer train steps / lower episode standard deviations and little mass on density tails). Lastly, the SEs also show little sensitivity to HP variations.
+
+Transferability of SEs In the previous section we evaluated the performance of DDQN-trained SEs in teaching DDQN agents. However, since many environment observations are needed for SE training, it would be beneficial if DDQN-trained SEs are capable of effectively training unseen agents as well. To study this question, we reuse the DDQN-trained SEs from above but now train Dueling DDQN agents on the SEs. From Figure 3 (top and bottom center) we conclude that the transfer to the Dueling DDQN agent succeeds and it facilitates a $\sim 50\%$ faster (6781 vs. 12745 train steps), a more effective (higher reward), and noticeably more stable training (lower std. dev.; smaller tails) on average when compared to the baseline (orange vs. blue). As before, not varying the DDQN agent HPs during SE training reduces transfer performance (green).
+
+We also analyzed the transfer from Q-Learning to a discrete version of TD3 (see Section 3). The result shown in Figure 3 (top right) indicates a limited transferability. We believe this may be due to the different learning dynamics of actor-critics compared to learning with DDQN. However, we also noticed that individual SE models can consistently train TD3 agents successfully while remaining efficient. To show this, we repeated the evaluation procedure from Figure 3 individually for each SE model (see Appendix F.1.1) and selected five SE models that yielded high rewards when training TD3 agents. As a consequence, we can again significantly improve the performance (black curve) with a $\sim 65\%$ speed-up (6287 vs. 17874 train steps; 187 vs. 152 reward) over the baseline.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Top row: Histograms of next state $s'$ and reward $r$ produced by 10 DDQN agents when trained on a CartPole SE (blue) and afterwards tested for 10 episodes on a real environment (orange). We also show the SE responses when fed with real environment data seen during testing (green). Bottom row: The same for Acrobot (subset of state dimensions shown due to brevity).
+
+
+
+
+
+
+
+
+
+We executed these experiments with similar results for the Acrobot task (solved with a reward $\geq -100$ , see Figure 7 in the appendix). In short, we find that the transfer to Dueling DDQN facilitates a $\sim 38\%$ faster training on average (18376 vs. 29531 steps, mean reward: -111). The discrete TD3 transfer shows a $\sim 82\%$ (14408 vs. 80837 steps, five best models) speed-up but many of the runs also fail (reward: -343) which partly may be due to a sub-optimal hyperparameter selection. Simultaneously, we see that SE-learned policies in the Dueling DDQN transfer case are substantially better on average than those learned on the real environment. All in all, we believe these results are intriguing and showcase the potential of our concept to learn proxy RL environments.
+
+Analyzing SE Behavior In the following, we try to illuminate the inner workings to explain the efficacy of the learned SEs. We exploit CartPole's and Acrobot's small state space and visualize an approximation of the state and reward distributions generated by agents trained on SEs and evaluated on real environments. First, we trained 10 DDQN agents on a randomly selected SE with default HPs and logged all $(s,a,r,s^{\prime})$ tuples. Second, we evaluated the SE-trained DDQN agents on the real environment for 10 test episodes each and again logged the tuples. Lastly, we visualized the histograms of the collected next states and rewards in Figure 4. We observe distribution shifts between the SE and the real environment on both tasks, indicating the agent encounters states and rewards it has rarely seen during training, yet it can solve the task (reward: 199.3 on CartPole and -91.62 on Acrobot). Moreover, some of the synthetic state distributions are narrower or wider than their real counterparts, e.g., the real pole angle in CartPole is box-bounded inside $\pm 0.418$ rad but the SEs may benefit from not having such a constraint. The synthetic reward distribution is wider than the real one, indicating that the sparse reward distribution becomes dense. The green histograms show the SE responses when fed with real environment data based on the logged state-action the agents have seen during testing. Since the green distributions align better with the blue than the orange ones, we conclude it is more likely the shifts are generated by the SE than the agents itself.
+
+Based on these findings, we hypothesize the SEs produce an informed representation of the target environment by modifying the state distributions to bias agents towards relevant states. These results are likely to explain the efficacy of SEs and can be understood as efficient agent "guiding systems". We also observed similar patterns with Dueling DDQN and discrete TD3 (see Appendix A.4).
+
+# 6 EXPERIMENTS WITH REWARD NETWORKS
+
+Experimental Setup To better understand our RN experiments, we first describe similarities and dissimilarities to the experimental setup used for SEs. Similar to SEs, to learn RNs, we first identified stable agent and NES HPs (see Appendix B.3) for each of a total of four environments. Contrary to training SEs, we do not vary the agent HPs during RN training as we did not observe improvements in doing so. Now, given these HPs, we then trained multiple RNs for 50 NES outer loop iterations with 16 workers for each environment. For CartPole-v0 we used DDQN for RN training and, similar to SEs, evaluated the transferability of DDQN-trained RNs to train Dueling DDQN agents. For the custom environment Cliff Walking (Sutton & Barto, 2018) (see Appendix B.2 for more details) we used Q-Learning (Watkins, 1989) and show transfer to SARSA (Rummery & Niranjan, 1994). We
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 5: The average cumulative test rewards of agents when trained on different RN variants for one episode and evaluated on the real environments for one episode alternatingly. Top row: Training and evaluation with the same agent using default agent hyperparameters (HPs). Center row: With varied agent HPs. Bottom row: Transfer to unseen agents. We show the std. error of the mean and the flat curves in TD3 are due to filling the replay buffer before training.
+
+
+
+
+
+also include MountainCarContinuous-v0 (Brockman et al., 2016) and HalfCheetah-v3 (Todorov & Tassa, 2012) with TD3 and transfer to PPO (Schulman et al., 2017). With these, we cover a wide range of variation (discrete and continuous state/action spaces, sparse/dense rewards) and computational complexity for training an RN (see Appendix C for details). All RN plots show the average cumulative test reward as a function of RN train steps. We alternated episodes of training on the RN and evaluation on the real environment and performed 100 runs ( $10\mathrm{RNs} \times 10$ agents) per curve on each environment except for HalfCheetah where we used 25 runs ( $5\mathrm{RNs} \times 5$ agents).
+
+Baselines For all environments, we compare our approach to multiple baselines, namely the bare agent and the bare agent extended by an Intrinsic Curiosity Module (ICM) (Pathak et al., 2017) that uses the error of predicted action effects as the synthetic reward. Additionally, for Cliff Walking we use count-based exploration (Strehl & Littman, 2008) with a synthetic reward $\frac{\beta}{n(s,a)}$ to encourage exploration of less visited (s,a)-pairs with $\beta \in \mathbb{R}_{\geq 0}$ and $n: S \times \mathcal{A} \to \mathbb{N}_0$ a visitation count. For HalfCheetah, we also consider the observation vectors $v$ and $v'$ with the position and velocity of the current and next state that HalfCheetah provides. We use these as input to the RNs with $\Phi(s,v)$ or $\Phi(s',v')$ , combine them with the existing variants from Table 1 and tag them with "+" augm."
+
+Evaluating the Performance of RN-trained Agents Like in the SE case, we study how efficient and hyperparameter-sensitive the RNs are. Consider the top and middle row of Figure 5 that show how the RNs perform in training seen agents (used to optimize the RNs) as well as the performance when we vary the agents' HPs (i.e., learning rate, discount factor, etc., see Appendix B.3).
+
+For all environments, we see that there always exists an RN variant that offers significant speed-ups compared to the baselines not involving RNs. The variant additive potential $RN(r + \gamma \Phi(s') - \Phi(s))$ implementing the original PBRS formulation (Ng et al., 1999) seems to be a good default choice. However, it often does not outperform the baseline, presumably trading reliability and formal guarantees with performance. The variant additive non-potential $RN(r + \Phi(s'))$ seems to often be the better choice, as it never failed completely and often outperformed the original PBRS variant. We argue that additive non-potential $RN$ can be seen as an undiscounted additive potential $RN(\gamma = 1$ vs. $\gamma = 0.99)$ that may be better in sparse-reward and long-trajectory tasks as in ContinuousMountain-Car. In contrast, exclusive potential $RN(\gamma \Phi(s') - \Phi(s))$ shows an increased risk of failing and we hypothesize that not involving the real reward may result in a challenging RN optimization. Across all tasks, RNs do not seem to overfit to the HPs (Figure 5, 2nd row). The results and a discussion for HalfCheetah are given in Appendix B.1.
+
+Transferability of RNs In this experiment, we investigate the ability of RNs to train unseen agents. For this, consider the bottom row of Figure 5 (Appendix Figure 9 for HalfCheetah). We used the default agent HPs reported in Appendix B.3 without varying them. The results show that RNs can also train unseen RL agents efficiently. However, for both Cliff Walking and CartPole some RN variants cause a deterioration of the learned policies after initially teaching well-performing policies. While the reason for this is unclear, a workaround is to apply early-stopping since additive potential $RN$ and additive non-potential $RN$ deliver significant (Cliff W., CartPole) to moderate (Mountain-Car) speedups or higher final performance (HalfCheetah) even in the agent-transfer scenario.
+
+We noticed that RNs are generally less prone to overfitting than SEs and are overall easier to train. However, the components of the RN variants seem to induce important inductive biases that beg a deeper understanding and may require a more isolated analysis. Nevertheless, we see clear evidence of the benefits of using RNs for efficient RL agent training. All in all, we argue that the RN efficiency, like for SEs, stems from a learned informed representation that biases agents towards helpful states for completing the task quickly. In the same spirit of the qualitative analysis of SEs in Section 5, a similar study for Cliff Walking RNs that supports this hypothesis is in Appendix B.2.
+
+# 7 LIMITATIONS OF THE APPROACH
+
+As reported in (Salimans et al., 2017), NES methods strongly depend on the number of workers and require a lot of parallel computational resources. We observed this limitation in preliminary SE experiments when we applied our method to more complex environments, such as the HalfCheetah or Humanoid task. Here, 16 workers were insufficient to learn SEs able to solve them. Moreover, non-Markovian states and partial observability may add further complexity to the optimization of SEs and RNs. In contrast to the SE case, in the RN case, scaling our method to more complex tasks was straightforward since learning rewards is intuitively easier than learning complex state dynamics. Nevertheless, the success of learning efficient proxy models also depends significantly on hyperparameter optimization. Lastly, we observed that optimized NES HPs were transferable among different target environments in the RN case but usually not in the SE case.
+
+# 8 CONCLUSION
+
+We proposed a novel method for learning proxy models outside the current learning schemes. We apply it to learn synthetic environments and reward networks for RL environments. When training agents on SEs without involving the real environment at all, our results on two environments show significant reductions in the number of training steps while maintaining the target task performance. In the RN case, we also noticed similar benefits in three of four environments. Our experiments showed that the proxies produce narrower and shifted states as well as dense reward distributions that resemble informed representations to bias agents towards relevant states. We illustrated that these proxies are robust against hyperparameter variation and can transfer to unseen agents, allowing for various applications (e.g., as agent-agnostic, cheap-to-run environments for AutoML, for agent and task analysis or agent pre-training). Overall, we see our method as a basis for future research on more complex tasks and we believe that our results open an exciting new avenue of research.
+
+# ACKNOWLEDGEMENTS
+
+The authors acknowledge funding by Robert Bosch GmbH, by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant number 417962828, by the state of Baden-Württemberg through bwHPC and the German Research Foundation (DFG) through grant no INST 39/963-1 FUGG, and by TAILOR, a project funded by the EU Horizon 2020 research and innovation programme under GA No 952215.
+
+# ETHICS STATEMENT
+
+As learned data generating processes that teach learners, our proxies may have ethical and societal consequences. On the application side, we see the risk of learning proxies on maliciously re-purposed environments, for example, that allow efficiently learning policies for weapon systems. Ways to control this may include ethically reviewing both environment releases (staging releases) and the used optimization objectives, as well as regulations to enforce their disclosure. In contrast, proxies can also be used for good-natured applications, such as elderly care robotics to help analyze human safety.
+
+Methodologically, we see risks in generating proxies that are purely optimized for efficiency or effectiveness as they may elicit agent policies that achieve the objective by neglecting established societal and moral rules. Effects like these may be reinforced by the design of the target environment. While the latter could be addressed through the democratized design of target environments, the former could be tackled by using multi-objective optimization during proxy learning and by adopting fair-efficient rewards (Jabbari et al., 2017). The flexibility that the proxy optimization allows can also be beneficial to society, for example, by using objectives that enable fuel-saving in (autonomous) vehicles. Moreover, our proxies can have a positive effect on the environment as they target sample inefficiency in RL, e.g., by using them for efficiently pre-training RL agents like in supervised learning and, as addressed in our work, by targeting proxy transferability to exploit invested resources across agent families. In summary, despite the possible negative implications of learning environment proxies, we find that there exist possibilities to successfully address them and that the laid out merits outweigh the potential harms.
+
+# REPRODUCIBILITY STATEMENT
+
+In our repository, we include the full code, SE / RN models, hyperparameter configurations, and instructions to reproduce all figures reported in the main paper. All our experiments use random seeds and all results are based on multiple random runs for which standard deviations are reported. Moreover, we dedicate individual experiments to investigate the robustness to variation of randomly sampled hyperparameters in results denoted by vary HP in Sections 5 and 6. Additionally, we report the total run-time for SEs and RNs in Sections 5 and 6 and discuss the computational complexity in more detail in Appendix C. Our code can be found here: https://github.com/autom1/ learning_environments
+
+# REFERENCES
+
+M. G. Bellemare, S. Srinivasan, G. Ostrovski, T. Schaul, D. Saxton, and R. Munos. Unifying count-based exploration and intrinsic motivation. In Proc. of NeurIPS'16, pp. 1471-1479, 2016.
+Philip Bontrager and Julian Togelius. Fully differentiable procedural content generation through generative playing networks. arXiv:2002.05259, 2020.
+G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI Gym. CoRR, abs/1606.01540, 2016.
+T. Brys, A. Harutyunyan, H. B. Suay, S. Chernova, M. E. Taylor, and A. Nowé. Reinforcement learning from demonstration through shaping. In Proc. of IJCAI'15, 2015.
+Y. Burda, H. Edwards, D. Pathak, A. J. Storkey, T. Darrell, and A. A. Efros. Large-scale study of curiosity-driven learning. In Proc. of ICLR'19, 2019.
+
+K. Cobbe, C. Hesse, J. Hilton, and J. Schulman. Leveraging procedural generation to benchmark reinforcement learning. In Proc. of ICML'20, pp. 2048-2056, 2020.
+M. Dennis, N. Jaques, E. Vinitsky, A. M. Bayen, S. Russell, A. Critch, and S. Levine. Emergent complexity and zero-shot transfer via unsupervised environment design. In Proc. of NeurIPS'20, pp. 13049-13061, 2020.
+S. Falkner, A. Klein, and F. Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In Proc. of ICML'18, pp. 1437-1446, 2018.
+A. Faust, A. Francis, and D. Mehta. Evolving rewards to automate reinforcement learning. In ICML 2019 Workshop on Automated Machine Learning, 2019.
+S. Fujimoto and D. Meger H. Hoof. Addressing Function Approximation Error in Actor-Critic Methods. In Proc. of ICML'18, pp. 1582-1591, 2018.
+David Ha and Jürgen Schmidhuber. World models. arXiv:1803.10122, 2018.
+Y. Hu, W. Wang, H. Jia, Y. Wang, Y. Chen, J. Hao, F. Wu, and C. Fan. Learning to utilize shaping rewards: A new approach of reward shaping. In Proc. of NeurIPS'20, 2020.
+F. Hutter, L. Kotthoff, and J. Vanschoren (eds.). Automated Machine Learning: Methods, Systems, Challenges. Springer, 2019.
+B. Ibarz, J. Leike, T. Pohlen, G. Irving, S. Legg, and D. Amodei. Reward learning from human preferences and demonstrations in atari. In Proc. of NeurIPS'18, pp. 8022-8034, 2018.
+S. Jabbari, M. J., M. Kearns, J. Morgenstern, and A. Roth. Fairness in reinforcement learning. In Proc. of ICML'18, pp. 1617-1626, 2017.
+M. Jaderberg et al. Human-level performance in 3d multiplayer games with population-based reinforcement learning. Science, 364(6443):859-865, 2019.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In Proc. of ICLR'17, 2017.
+You-Cyuan Jhang et al. Training a performant object detection ML model on synthetic data using Unity Perception tools. https://blogsunity3d.com/2020/09/17/training-a-performant-object-detection-ml-model-on-synthetic-data-using-unity-computer-vision-tools/, Sep 2020.
+K. Judah, A. P. Fern, P. Tadepalli, and R. Goetschalckx. Imitation learning with demonstrations and shaping rewards. In Proc. of AAAI'14, pp. 1890-1896, 2014.
+T. Matiisen, A. Oliver, T. Cohen, and J. Schulman. Teacher-student curriculum learning. IEEE Trans. Neural Networks Learn. Syst., 31(9):3732-3740, 2020.
+Luke Metz, Niru Maheswaranathan, Jeremy Nixon, Daniel Freeman, and Jascha Sohl-Dickstein. Understanding and correcting pathologies in the training of learned optimizers. In Proc. of ICML'19, 2019.
+T. M. Moerland, J. Broekens, and C. M. Jonker. Model-based reinforcement learning: A survey. arXiv:2006.16712, 2020.
+A. Y. Ng, D. Harada, and S. J. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In Proc. of ICML '99, pp. 278-287, 1999.
+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 Proc. of NeurIPS'19, pp. 8024-8035, 2019.
+D. Pathak, P. Agrawal, A. A. Efros, and T. Darrell. Curiosity-driven exploration by self-supervised prediction. In Proc. of CVPR'17, pp. 488-489, 2017.
+
+Ingo Rechenberg. *Evolutionstrategie: Optimierung technischer systeme nach prinzipien der biologischen evolution.* frommann-holzbog, Stuttgart, 1973. PPSN 1973, 1973.
+G. A. Rummery and M. Nirananjan. On-line $Q$ -learning using connectionist systems, volume 37. University of Cambridge, Department of Engineering Cambridge, UK, 1994.
+T. Salimans, J. Ho, X. Chen, and I. Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv:1703.03864, 2017.
+J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv:1707.06347 [cs.LG], 2017.
+N. Shaker, J. Togelius, and M. J. Nelson. Procedural content generation in games. Springer, 2016.
+D. Silver, J. Schrittwieser, K. Simonyan, I Antonoglou, A. Huang, A. Guez, T. Hubert, L. Baker, M. Lai, A. Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676): 354-359, 2017.
+S. Singh, R. L. Lewis, A. G. Barto, and J. Sorg. Intrinsically motivated reinforcement learning: An evolutionary perspective. IEEE Transactions on Autonomous Mental Development, 2(2):70-82, 2010.
+A. L. Strehl and M. L. Littman. An analysis of model-based interval estimation for markov decision processes. Journal of Computer and System Sciences, 74(8):1309-1331, 2008. ISSN 0022-0000.
+Felipe Petroski Such, Aditya Rawal, Joel Lehman, Kenneth O. Stanley, and Jeffrey Clune. Generative teaching networks: Accelerating neural architecture search by learning to generate synthetic training data. In Proc. of ICML'20, 2020.
+R. S. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In B. Porter and R. Mooney (eds.), Machine Learning Proceedings 1990, pp. 216-224. Morgan Kaufmann, San Francisco (CA), 1990.
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Proc. of NeurIPS'20, 2020.
+H. Tang, R. Houthooft, D. Foote, A. Stooke, X. Chen, Y. Duan, J. Schulman, F. De Turck, and P. Abbeel. #exploration: A study of count-based exploration for deep reinforcement learning. In Proc. of NeurIPS'17, pp. 2753-2762, 2017.
+J. Tobin, R. Fong, A. Ray, J. Schneider, W. Zaremba, and P. Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In Proc. of IROS'17, pp. 23-30, 2017.
+E. Todorov and T. Erezand Y. Tassa. Mujoco: A physics engine for model-based control. In Proc. of IROS'12, pp. 5026-5033, 2012.
+J. Togelius, G. N. Yannakakis, K. O. Stanley, and C. Browne. Search-based procedural content generation: A taxonomy and survey. IEEE Transactions on Computational Intelligence and AI in Games, 3(3):172-186, 2011.
+Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. In Proc. of AAAI'16, pp. 2094-2100, 2016.
+V. Volz, J. Schrum, J. Liu, S. M. Lucas, A. Smith, and S. Risi. Evolving mario levels in the latent space of a deep convolutional generative adversarial network. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 221-228, 2018.
+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. arXiv:1901.01753, 2019.
+
+Ziyu Wang, Tom Schaul, Matteo Hessel, Hado van Hasselt, Marc Lanctot, and Nando de Freitas. *Dueling network architectures for deep reinforcement learning*. In *Proc. of ICML'16*, pp. 1995–2003, 2016.
+Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. PhD thesis, King's College, 1989.
+Daan Wierstra, Tom Schaul, Jan Peters, and Juergen Schmidhuber. Natural evolution strategies. In Proc. of CEC'08, pp. 3381-3387, 2008.
+Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Proc. of NeurIPS'18, pp. 4644-4654, 2018.
+Zeyu Zheng, Junhyuk Oh, Matteo Hessel, Zhongwen Xu, Manuel Kroiss, Hado Van Hasselt, David Silver, and Satinder Singh. What can be learned intrinsic rewards capture? In Proc. of ICML'20, pp. 11436-11446, 2020.
+H. Zou, T. Ren, D. Yan, H. Su, and J. Zhu. Reward shaping via meta-learning. arXiv:1901.09330, 2019.
+
+# APPENDIX A SYNTHETIC ENVIRONMENTS
+
+# A.1 HEURISTICS FOR AGENT TRAINING AND EVALUATION
+
+Determining the number of required training episodes $n_e$ on an SE is challenging as the rewards of the SE may not provide information about the current agent's performance on the real environment. Thus, we use a heuristic to early-stop training once the agent's training performance on the SE converged. Specifically, let $C_k$ be the cumulative reward of the $k$ -th training episode. The two values $\bar{C}_d$ and $\bar{C}_{2d}$ maintain a non-overlapping moving average of the cumulative rewards over the last $d$ and $2d$ episodes up to episode $k$ . Now, if $\frac{|\bar{C}_d - \bar{C}_{2d}|}{|\bar{C}_{2d}|} \leq C_{diff}$ the training is stopped. In all SE experiments we choose $d = 10$ and $C_{diff} = 0.01$ . Agent training on real environments is stopped when the average cumulative reward across the last $d$ test episodes exceeds the solved reward threshold. In case no heuristic is triggered, we train for $n_e = 1000$ episodes at most on SEs and real environments. Independent of whether we train an agent on $\mathcal{E}_{real}$ or $\mathcal{E}_{syn}$ , the process to assess the actual agent performance is equivalent: we run the agent on 10 test episodes from $\mathcal{E}_{real}$ for a fixed number of task-specific steps (200 on CartPole and 500 on Acrobot) and use the cumulative rewards as the performance.
+
+# A.2 DISCUSSION ON THE FEASIBILITY OF LEARNING SES WITH OUR ALGORITHM
+
+After identifying stable DDQN and NES hyperparameters (HPs), we ran Algorithm 1 in parallel with 16 workers for 200 NES outer loop iterations for both CartPole and Acrobot. Each worker had one Intel Xeon Gold 6242 CPU core at its disposal, resulting in an overall runtime of 6-7h on Acrobot and 5-6h on CartPole for 200 NES outer loop iterations. For reference, we note that (Salimans et al., 2017) used 80 workers each having access to 18 cores for solving the Humanoid task.
+
+In Figure 6 it becomes evident that the proposed method with the given resources and used hyperparameters given by Table 3 allows identifying SEs that can teach agents to solve CartPole and Acrobot tasks respectively. Each thin line in the plot corresponds to the average of 16 worker evaluation scores given by EvaluateAgent in Algorithm 1 as a function of the NES outer loop iteration. We repeat this for 40 separate NES optimization runs and visualize the average across the thin lines as a thick line for each task. We note that we only show a random subset of the 40 thin lines for better visualization and randomly sample the seeds at all times in this work. We believe that the stochasticity introduced by this may lead to the variance visible in the plot when searching for good SEs.
+
+Both the stochasticity of natural gradients and the sensitivity of RL agents to seeds and parameter initializations may additionally contribute to this effect. Notice, it is often sufficient to run approximately 50 NES outer loops to find SEs that solve a task. Besides early-stopping, other regularization techniques (e.g. regularizing the SE parameters) can be applied to address overfitting which we likely observe in the advanced training of the Acrobot task.
+
+# A.3 EVALUATION OF PERFORMANCE AND TRANSFERABILITY OF SES ON THE ACROBOT TASK
+
+Similar to Figure 3, we visualize the performance and transferability evaluation results of SEs for the Acrobot-v1 task. Again, the top row depicts the density functions of the average cumulative rewards collected by DDQN, Dueling DDQN and discrete TD3 agents based on 4k evaluations per density and DDQN-trained SEs. Like in the CartPole case, we show three different SE training settings: agents trained on real env. with varying agent HPs (blue), on DDQN-trained SEs when varying agent HPs during NES runs (orange), on DDQN-trained SEs where the agent HPs were fixed during training of the SEs (green). The bottom row visualizes the average reward, train steps, and episodes across the 4k evaluations and each bar correspond to one of the shown densities. We achieve on Dueling DDQN a $\sim$ $38\%$ (18376 vs. 29531 train steps) and on discrete TD3 a $\sim$ $82\%$ faster and more stable training compared to the baseline. However, we point out that many of the runs with discrete TD3 also fail (mean reward: -343). This is likely caused by the limited transferability already observed in the Cartpole case but may also due to sub-optimal hyperparameter selection since we reused the DDQN HPs found on Cartpole for Acrobot (as well as the HPs and ranges for
+
+
+Figure 6: Results from 40 different NES runs with 16 workers each (using random seeds) show that our method is able to identify SEs that allow agents to solve the target tasks. Each thin line corresponds to the average of 16 worker evaluation scores returned by EvaluateAgent in our algorithm as a function of the NES outer loop iterations.
+
+variation from Table 2). We further point out that training on SEs consistently yields a more stable training as can be seen in the standard deviations of the train steps and episodes bars.
+
+
+
+
+
+
+
+
+Figure 7: Evaluation of performance and transferability of SEs on the Acrobot-v1 task.
+
+
+
+
+
+# A.4 QUALITATIVE STUDY OF SYNTHETIC ENVIRONMENTS FOR THE CARTPOLE AND ACROBOT TASKS
+
+To extend the qualitative analysis of SE behavior from Section 9, we depict in Figure 8 additional histograms for the approximate next state $s'$ and reward $r$ distributions produced by 10 agents with random seeds and default hyperparameters from Table 5 for each histogram plot. We here additionally show the behavior for Acrobot and also for Dueling DDQN and discrete TD3 agents. For the histograms with discrete TD3 we chose well-performing but arbitrary SE model according the individual model analysis, see Section F.1.1 and F.1.2). We chose a well-performing model in the case of discrete TD3 since we assumed that the significant number of failing runs would deteriorate the discrete TD3 performance and distort the comparison to the other (well-performing) DDQN and Dueling DDQN agents. For the DDQN and Dueling DDQN agents, we chose the SE model completely at random, independent of their performance. In summary, we see the same patterns that we
+
+observed for CartPole and DDQN in Section 9 also with Dueling DDQN and discrete TD3 on both tasks: distribution shift, narrower synthetic distributions (and state-stabilizing or control behavior, meaning that the number of large positive and negative states are rarely encountered, for example, this can be seen in the cart velocity (CartPole) and the joint angular velocity (Acrobot) plots), and wider/dense reward distributions. The histograms in green show the SE responses when fed with real environment data based on the logged state-action the agents have seen during testing. Since the green distributions align better with the blue than the orange ones, we conclude it is more likely the shifts are generated by the SE than the agent. For CartPole we show all state dimensions and for Acrobot we show four of the six state dimensions due to brevity.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 8: Histograms of approximate next state $s'$ and reward $r$ distributions produced by 10 DDQN or Dueling DDQN agents when trained on an SE (blue) and when afterwards tested for 10 episodes on a real environment (orange) for each task. 1st row: CartPole and DDQN, 2nd row: CartPole and Dueling DDQN, 3rd row: CartPole and discrete TD3, 4th row: Acrobot and DDQN, 5th row: Acrobot and Dueling DDQN, 6th row: Acrobot and discrete TD3
+
+
+
+
+
+
+
+
+
+The average cumulative rewards across the 10 runs for each agent variant and task are:
+
+- CartPole and DDQN (1st row): 199.3
+- CartPole and Dueling DDQN (2nd row): 193.75
+- CartPole and discrete TD3 (3rd row): 197.26
+
+- Acrobot and DDQN (4th row): -91.62
+- Acrobot and Dueling DDQN (5th row): -88.56
+- Acrobot and discrete TD3 (6th row): -93.17
+
+# A.5 SYNTHETIC ENVIRONMENT HYPERPARAMETERS
+
+The following table provides an overview of the agent and NES hyperparameter (HP) ranges that we optimized in an additional outer loop of our algorithm. The HPs in the 2nd and 3rd columns represent the results of this optimization and which we used for learning SEs. Note that in experiments where we sampled agent HPs from ranges given by Table 2 we overwrite a small subset (namely DDQN learning rate, batch size, DDQN no. of hidden layers, and DDQN hidden layer size) of the listed HPs below (runs denoted by "HPs: varied").
+
+Table 3: Hyperparameter configuration spaces optimized for learning SEs.
+
+| Hyperparameter | CartPole-v0 | Acrobot-v1 | Optimization value range | log. scale |
| NES step size (α) | 0.148 | 0.727 | 0.1 - 1 | True |
| NES noise std. dev. (σ) | 0.0124 | 0.0114 | 0.01 - 1 | True |
| NES mirrored sampling | True | True | False/True | - |
| NES score transformation | All Better 2 | All Better 2 | see Appendix Section E.1 | - |
| NES SE no. of hidden layers | 1 | 1 | 1 - 2 | False |
| NES SE hidden layer size | 83 | 167 | 48 - 192 | True |
| NES SE activation function | LReLU | PReLU | Tanh/ReLU/LReLU/PReLU | - |
| DDQN initial episodes | 1 | 20 | 1 - 20 | True |
| DDQN batch size | 199 | 149 | 64 - 256 | False |
| DDQN learning rate | 0.000304 | 0.00222 | 0.0001 - 0.005 | True |
| DDQN target net update rate | 0.00848 | 0.0209 | 0.005 - 0.05 | True |
| DDQN discount factor | 0.988 | 0.991 | 0.9 - 0.999 | True (inv.) |
| DDQN initial epsilon | 0.809 | 0.904 | 0.8 - 1 | True |
| DDQN minimal epsilon | 0.0371 | 0.0471 | 0.005 - 0.05 | True |
| DDQN epsilon decay factor | 0.961 | 0.899 | 0.8 - 0.99 | True (inv.) |
| DDQN no. of hidden layers | 1 | 1 | 1 - 2 | False |
| DDQN hidden layer size | 57 | 112 | 48 - 192 | True |
| DDQN activation function | Tanh | LReLU | Tanh/ReLU/LReLU/PReLU | - |
+
+The following table lists the hyperparameters that we always kept fixed and which were never optimized:
+
+Table 4: Subset of the hyperparameter configuration spaces that we kept fixed (not optimized) for learning SEs.
+
+| Hyperparameter | Symbol | CartPole-v0 | Acrobot-v1 |
| NES number of outer loops | no | 200 | 200 |
| NES max. number of train episodes | ne | 1000 | 1000 |
| NES number of test episodes | nte | 10 | 10 |
| NES population size | np | 16 | 16 |
| DDQN replay buffer size | - | 100000 | 100000 |
| DDQN early out number | d | 10 | 10 |
| DDQN early out difference | Cdiff | 0.01 | 0.01 |
| env. max. episode length | - | 200 | 500 |
| env. solved reward | - | 195 | -100 |
+
+The table below lists the agent hyperparameters (HPs) that we chose as default. We used these HPs in all experiments after SEs were found, i.e. for evaluations in Figures 3, 4, and 7. Note that in some cases we sampled agent HPs from ranges given by Table 2. In these cases (runs denoted by "HPs: varied", "HPs: fixed", and also the individual SE models plots below) the HPs of the table are overwritten by the sampled ones.
+
+Table 5: Default agent hyperparameters for the evaluations depicted in Figure 3, 4, and 7. DDQN early out number and DDQN early out difference are equivalent to Table 4.
+
+| Agent hyperparameter | Default value |
| initial episodes | 10 |
| batch size | 128 |
| learning rate (DDQN & D.DDQN / TD3) | 0.001 / 0.0005 |
| target network update rate | 0.01 |
| discount factor | 0.99 |
| epsilon decay factor | 0.9 |
| number of hidden layers | 2 |
| hidden layer size | 128 |
| activation function (DDQN & D. DDQN / TD3) | ReLU / Tanh |
| replay buffer size | 100000 |
| max. train episodes | 1000 |
| Gumbel Softmax start temperature / one-hot-encoded actions (TD3) | 1 / False |
+
+# APPENDIX B REWARD NETWORKS
+
+# B.1 HALFCHEETAH RNS PLOTS
+
+For HalfCheetah, we see that additive non-potential $RN$ (and also exclusive non-potential $RN$ ) trains well-performing agents the fastest but saturates at a cumulative reward of $\sim 3k$ which corresponds to the used solved reward threshold. This may be due to the used objective function since its term $max(0, C_{sol} - C_{fin})$ does not incentivize RNs to improve after reaching the threshold.
+
+
+Figure 9: Performance of different RN variants for the HalfCheetah-v3 environment. Left: performance of RNs that train the known TD3 agent with default hyperparameters. Center: performance of RNs when the hyperparameters of known agents are varied. Right: Transfer performance to the unseen PPO agents with default hyperparameters. All curves denote the mean cumulative reward across 25 runs (5 agents $\times$ 5 RNs). Shaded areas show the standard error of the mean and the flat curves in TD3 stem from a fixed number of episodes that are used to fill the replay buffer before training. Notice that using the observation vector $v$ in the RN variants (denoted by "+"augm.) only marginally yields a higher train efficiency.
+
+
+
+
+
+
+Figure 10: This is the zoomed in version of Figure 9.
+
+
+
+
+
+# B.2 QUALITATIVE STUDY OF REWARD NETWORKS ON THE CLIFF WALKING TASK
+
+Like in Section A.4, we again make use of the small state and action space and analyze the learned augmented rewards of the proposed different RN variants across 50 generated RN models on our Cliff Walking environment (Sutton et al., 2020). Cliff Walking consists of a two-dimensional grid with $4 \times 12$ states in which the agent, starting at the start state (S), has to reach the goal state (G) by moving up, down, left, or right to adjacent states. 10 of the states in the lower row are cliffs. The agent receives a reward of $-1$ for every action it takes and a reward of $-100$ if it enters a cliff state. The episode terminates if the agent enters either the goal state or a cliff state. The environment is further bounded by walls, e.g. if the agent moves left when being in the state (S), it stays in the state (S).
+
+In Figure 11 we depict a visual representation of the learned rewards for different RN variants averaged across 50 RN models taken from the RN experiment in Section 6 (i.e. trained with a Q-Learning agent with non-varying HPs, no early stopping criterion in the outer loop, 50 outer loop iterations). To do this, we color-coded the rewards we received from the RNs for all possible state-action pairs. To visualize the rewards corresponding to each of the four actions, every state is split up into four triangles corresponding to the different actions (move up, down, left, right) that the agent can perform when being in this state. We show small, average, and high rewards in red, yellow, and green, respectively. The left column of Figure 11 shows the grids with all rewards
+
+where we can observe that the negative rewards of $-100$ of the additive RNs distort the color plot such that the fine-grained reward structure learned by the RNs becomes invisible. To address this, the right column features the same plots while ignoring any rewards $\leq -50$ . This implies for the additive RN variants, that the rewards in the cliff states are ignored (white color) since the additive RN variants produce large negative rewards and lead to the described distortion of fine-grained rewards. For the goal state we further note that, although actions were never executed in this terminal state, the (neural network of the) RNs still compute rewards in this case which we did not ignore in the plot simply because it did not lead to distortions.
+
+Matching the performances shown in Figure 5 (top row, left), the reward structure learned by the exclusive potential RN is sub-optimal as the high rewards are nearly randomly distributed. In contrast, the additive potential RNs clearly assign low rewards to any state-action pair that lets the agent enter a cliff state. The RNs further output a low reward for transitions that go from the third row up to the second row and a high reward for the contrarily directed transitions. This keeps the agents close to the cliff and reduces the exploration space which results in faster training. The exclusive non-potential RNs assign useful rewards around the start and goal states but fail to adequately shape the reward along the shortest path from the start to the goal state. Lastly, the additive non-potential RNs clearly assign high rewards that guide the agent along the shortest path towards the goal state while avoiding cliff states. As expected, the well-performing RN variants seem to learn informed reward representations of the task that guide the agent towards relevant states for completing the task like in the SE case.
+
+# B.3 REWARD NETWORK HYPERPARAMETERS
+
+# B.3.1 GENERAL NES AND ENVIRONMENT HYPERPARAMETERS
+
+The below table lists all HPs for learning RNs that we kept fixed (not optimized) and which are identical across all RN experiments:
+
+Table 6: Hyperparameters that we kept fixed (not optimized) for learning RNs.
+
+| Hyperparameter | Symbol | Value |
| NES number of outer loops | no | 50 |
| NES number of test episodes | nte | 1 |
| NES population size | np | 16 |
| NES unsolved weight | w sol | 100 |
+
+Below table lists all HPs for learning RNs that we optimized and which are identical across all experiments. The NES score transformations are described in detail in Appendix Section E.1 and we also report the results for the BOHB hyperparameter optimization of different score transformation variants in Appendix Section E.2.
+
+Table 7: Hyperparameters that we optimized and which are identical across all RN experiments
+
+| Hyperparameter | Symbol | Optimized value |
| NES mirrored sampling | - | True |
| NES score transformation | - | All Better 2 (see Appendix Section E.1) |
| NES step size | α | 0.5 |
| NES noise std. dev. | σG | 0.1 |
+
+Below table lists the environment-specific HPs:
+
+Table 8: Environment-specific hyperparameters
+
+| Hyperparameter | Cliff Walking | CartPole-v0 | MountainCarContinuous-v0 | HalfCheetah-v3 |
| max. episode length | 50 | 200 | 999 | 1000 |
| solved reward | -20 | 195 | 90 | 3000 |
| NES max. number of train episodes | 100 | 100 | 100 (TD3) | 100 (TD3) |
| 1000 (PPO) | 1000 (PPO) |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 11: Learned Cliff Walking reward for different reward network types. Shown is the start state (S), goal state (G), all cliff states in the lower row and the learned reward of each state-action pair (red: low reward, yellow: medium reward, green: high reward). The plots on the left side show averaged values across 50 reward networks when considering all rewards, the plots on the right side ignore all rewards that are $\leq -50$ . Values have been normalized to be in a [0,1] range in both cases (left with full reward range, right without ignored rewards range).
+
+
+
+# B.3.2 VARIORED AGENT HYPERPARAMETERS
+
+The following tables list the for Q-Learning, DDQN and TD3 agent hyperparameter ranges from which we sampled in the HP variation experiment.
+
+Table 9: Hyperparameter sampling ranges for the reward networks HP variation experiment
+
+| QL hyperparameter | Value Range | log. scale |
| learning rate | 0.1 - 1 | False |
| discount factor | 0.1 - 1 | False |
+
+| DDQN hyperparameter | Value range | log. scale |
| learning rate | 8.3 · 10-5-7.5 · 10-4 | True |
| batch size | 11 - 96 | True |
| hidden size | 21 - 192 | True |
| hidden layer | 1 - 2 | False |
+
+| TD3 hyperparameter | Value range | log. scale |
| learning rate | 10-4-9·10-4 | True |
| batch size | 85-768 | True |
| hidden size | 42-384 | True |
| hidden layer | 1-3 | False |
+
+# B.3.3 AGENT AND NES HYPERPARAMETERS FOR CLIFF WALKING
+
+In Table 10 we list the NES and Q-Learning hyperparameter configuration spaces that we optimized for learning RNs on Cliff Walking. In Table 11 we list the default Q-Learning and SARSA (transfer) hyperparameters that we used once RNs have been learned. In Table 12 we list the hyperparameter configuration spaces that we used (and optimized over) for the count-based Q-Learning baseline.
+
+Table 10: Hyperparameter configuration spaces optimized for learning RNs on Cliff Walking.
+
+| Hyperparameter | Optimized value | Value range | log. scale |
| NES RN number of hidden layers | 1 | 1 - 2 | False |
| NES RN hidden layer size | 32 | 32 - 192 | True |
| NES RN activation function | PReLU | Tanh/ReLU/LReLU/PReLU | - |
| Q-Learning learning rate | 1 | 0.001 - 1 | True |
| Q-Learning discount factor | 0.8 | 0.001 - 1 | True (inv.) |
| Q-Learning initial epsilon | 0.01 | 0.01 - 1 | True |
| Q-Learning minimal epsilon | 0.01 | 0.01 - 1 | True |
| Q-Learning epsilon decay factor | 0.0 | 0.001 - 1 | True (inv.) |
+
+Table 11: Default Q-Learning and SARSA hyperparameters that we used after learning RNs.
+
+| Hyperparameter | Default value |
| Q-Learning & SARSA learning rate | 1 |
| Q-Learning & SARSA discount factor | 0.8 |
| Q-Learning & SARSA initial epsilon | 0.1 |
| Q-Learning & SARSA minimal epsilon | 0.1 |
| Q-Learning & SARSA epsilon decay factor | 0.0 |
+
+Table 12: Used baseline hyperparameter configuration spaces
+
+| Hyperparameter | Optimized value | Value range | log. scale |
| Count-based Q-Learning β | 0.1 | 0.0001 – 2 | False |
+
+# B.3.4 AGENT AND NES HYPERPARAMETERS FOR CARTPOLE-V0
+
+In Table 13 we list the NES and DDQN hyperparameter configuration spaces that we optimized for learning RNs on CartPole. We do not list the optimization value range in this table since they are equivalent as in the learning SE case described in Table 3. In Table 14 we list the default DDQN and Dueling DDQN (transfer) hyperparameters that we used once RNs have been learned. In Table 13 we list the hyperparameter configuration spaces that we used (and optimized over) for the ICM baseline (Pathak et al., 2017). We note that, despite optimizing the ICM HPs, we did not find that the optimized ICM HPs yielded better results than the default ones which is why we use the default ICM HPs in all experiments that involve ICM.
+
+Table 13: Optimized hyperparameters for learning RNs on CartPole. The value ranges are the same as in Table 3. Hyperparameters not listed were not optimized.
+
+| Hyperparameter | Optimized value |
| NES RN number of hidden layers | 1 |
| NES RN hidden layer size | 64 |
| NES RN activation function | PReLU |
| DDQN initial episodes | 1 |
| DDQN batch size | 192 |
| DDQN learning rate | 0.003 |
| DDQN target network update rate | 0.01 |
| DDQN discount factor | 0.99 |
| DDQN initial epsilon | 0.8 |
| DDQN minimal epsilon | 0.03 |
| DDQN epsilon decay factor | 0.95 |
| DDQN number of hidden layers | 1 |
| DDQN hidden layer size | 64 |
| DDQN activation function | LReLU |
| DDQN replay buffer size | 1000000 |
+
+Table 14: Default DDQN and Dueling DDQN hyperparameters that we used after learning RNs.
+
+| Hyperparameter | Default value |
| DDQN & Dueling DDQN initial episodes | 1 |
| DDQN & Dueling DDQN batch size | 32 |
| DDQN & Dueling DDQN learning rate | 0.00025 |
| DDQN & Dueling DDQN target network update rate | 0.01 |
| DDQN & Dueling DDQN discount factor | 0.99 |
| DDQN & Dueling DDQN initial epsilon | 1.0 |
| DDQN & Dueling DDQN minimal epsilon | 0.1 |
| DDQN & Dueling DDQN epsilon decay factor | 0.9 |
| DDQN & Dueling DDQN number of hidden layers | 1 |
| DDQN & Dueling DDQN hidden layer size | 64 |
| DDQN & Dueling DDQN activation function | ReLU |
| DDQN & Dueling DDQN replay buffer size | 1000000 |
| Dueling DDQN feature dimension | 128 |
| Dueling DDQN value and adv. stream no. hidden layers | 1 |
| Dueling DDQN value and adv. stream hidden layer size | 128 |
+
+# B.3.5 AGENT AND NES HYPERPARAMETERS FOR MOUNTAINCARCONTINUOUS-V0 AND HALFCHEETAH-V3
+
+In Table 16 we list the NES and TD3 hyperparameter configuration spaces that we optimized for learning RNs on MountainCarContinuous (CMC) and HalfCheetah (HC). In Table 17 we list the default TD3 hyperparameters that we used once RNs have been learned. Table 18 shows the PPO agent hyperparameters we used for showing transfer of RNs to train PPO agents. In Table 19 we list the hyperparameter configuration spaces that we used (and optimized over) for the ICM baseline (Pathak et al., 2017). We note that, despite optimizing the ICM HPs, we did not find that the optimized ICM HPs yielded better results than the default ones which is why we use the default ICM HPs in all experiments that involve ICM.
+
+Table 15: Used ICM (Pathak et al., 2017) baseline hyperparameter configuration spaces optimized with CartPole and DDQN. We additionally report the default values taken from the ICM reference implementation.
+
+| Hyperparameter | Default value | Optimized value | Value range | log. scale |
| ICM learning rate | 0.0001 | 0.00001 | 0.00001 – 0.001 | True |
| ICM β | 0.2 | 0.05 | 0.001 – 1 | True |
| ICM η | 0.5 | 0.03 | 0.001 – 1 | True |
| ICM feature dimension | 64 | 32 | 16-256 | True |
| ICM hidden layer size (forward, feature and inverse model) | 128 | 128 | 16-256 | True |
| ICM number of hidden layers (forward, feature and inverse model) | 2 | - | not optimized | - |
| ICM activation function | LReLU | - | not optimized | - |
| ICM number of residual blocks | 4 | - | not optimized | - |
+
+Table 16: Optimized hyperparameters for learning RNs on MountainCarContinuous-v0 (short "CMC") and HalfCheetah-v3 (short "HC"). Hyperparameters not listed were not optimized.
+
+| Hyperparameter | Optimized value | Value range | log. scale |
| NES RN number of hidden layers | 1 | 1-2 | False |
| NES RN hidden layer size | 128 | 48-192 | True |
| NES RN activation function | PReLU | Tanh/ReLU/LReLU/PReLU | - |
| TD3 initial episodes (CMC/HC) | 50 / 20 | 1-50 | True |
| TD3 batch size | 192 | 64 - 256 | False |
| TD3 learning rate | 0.003 | 0.0001 - 0.005 | True |
| TD3 target network update rate | 0.01 | 0.005 - 0.05 | True |
| TD3 discount factor (CMC/HC) | 0.99 / 0.98 | 0.9 - 0.99 | True |
| TD3 policy update delay factor | 1 | 1-3 | False |
| TD3 number of action repeats (CMC/HC) | 2 / 1 | 1-3 | False |
| TD3 action noise std. dev. | 0.05 | 0.05 - 0.2 | True |
| TD3 policy noise std. dev. | 0.2 | 0.1 - 0.4 | True |
| TD3 policy noise std. dev. clipping | 0.5 | 0.25 - 1 | True |
| TD3 number of hidden layers | 2 | 1-2 | False |
| TD3 hidden layer size | 128 | 48 - 192 | True |
| TD3 activation function (CMC/HC) | LReLU / ReLU | Tanh/ReLU/LReLU/PReLU | - |
| TD3 replay buffer size | 100000 | not optimized | - |
+
+Table 17: Default TD3 hyperparameters that we used after learning RNs on MountainCarContinuous-v0 (short "CMC") and HalfCheetah-v3 (short "HC").
+
+| Hyperparameter | Default value |
| TD3 initial episodes (CMC/HC) | 50 / 20 |
| TD3 batch size | 256 |
| TD3 learning rate | 0.0003 |
| TD3 target network update rate | 0.005 |
| TD3 discount factor | 0.99 |
| TD3 policy update delay factor | 2 |
| TD3 number of action repeats (CMC/HC) | 2 / 1 |
| TD3 action noise std. dev. | 0.1 |
| TD3 policy noise std. dev. | 0.2 |
| TD3 policy noise std. dev. clipping | 0.5 |
| TD3 number of hidden layers | 2 |
| TD3 hidden layer size | 128 |
| TD3 activation function | ReLU |
| TD3 replay buffer size | 100000 |
+
+Table 18: PPO (clip) hyperparameters that we used for showing the transfer of RNs on MountainCarContinuous-v0 (short "CMC") and HalfCheetah-v3 (short "HC").
+
+| Hyperparameter | Default value |
| PPO epochs (CMC/HC) | 80 / 10 |
| PPO learning rate | 0.0003 / 0.00001 |
| PPO number of episode updates (CMC/HC) | 10 / 1 |
| PPO discount factor | 0.99 |
| PPO policy update delay factor | 2 |
| PPO number of action repeats (CMC/HC) | 5 / 1 |
| PPO value function coefficient | 1 |
| PPO entropy coefficient (CMC/HC) | 0.01 / 0.001 |
| PPO clip ratio | 0.2 |
| PPO number of hidden layers | 2 |
| PPO hidden layer size (CMC/HC) | 64 / 128 |
| PPO activation function (CMC/HC) | ReLU / tanh |
+
+Table 19: Used ICM (Pathak et al., 2017) baseline hyperparameter configuration spaces optimized on MountainCarContinuous-v0 (short "CMC") and HalfCheetah-v3 (short "HC") with TD3. We additionally report the default values taken from the ICM reference implementation.
+
+| Hyperparameter | Default value | Optimized value | Value range | log scale |
| ICM learning rate (CMC/HC) | 0.0001 | 0.0005 / 0.00001 | 0.00001 – 0.001 | True |
| ICM β (CMC/HC) | 0.2 | 0.1 / 0.001 | 0.001 – 1 | True |
| ICM η (CMC/HC) | 0.5 | 0.01 / 0.1 | 0.001 – 1 | True |
| ICM feature dimension | 64 | 32 | 16-256 | True |
| ICM hidden layer size (forward, feature and inverse model) | 128 | 128 | 16-256 | True |
| ICM number of hidden layers (forward, feature and inverse model) | 2 | - | not optimized | - |
| ICM activation function | LReLU | - | not optimized | - |
| ICM number of residual blocks | 4 | - | not optimized | - |
+
+# B.4 STUDYING THE INFLUENCE OF DIFFERENT REWARD NETWORK OPTIMIZATION OBJECTIVES
+
+After we noticed the efficiency improvements of SEs, we tested whether RNs could also yield such improvements by directly optimizing for efficiency. Another reason for optimizing for efficiency directly was that the real environment is involved in the RN case and we pursued the goal to reduce real environment interactions. Based on this, we developed the RN objective reported in the paper in Section 4 which we refer to as the Reward Threshold objective. However, to analyse whether different objectives would yield similar results, we conducted a small study on the environments to assess the influence of different objectives.
+
+For this, we considered the area-under-the-curve of the cumulative returns objective (AUC) as well as the cumulative reward maximization objective (max reward) which is the reward threshold objective with just the $C_{fin}$ term.
+
+The overall conclusion from these results is that an AUC objective generally yields similar results as for the reward threshold objective, but in some cases it seems to minorly reduce the efficiency. However, the overall significant efficiency gains remain. Moreover, in contrast to SEs, efficiency improvements in the RN case seem to arise more often when explicitly optimized for it (compare AUC vs. reward threshold below) while maximizing reward (only tested for CartPole and Cliff environments) leads to efficiency improvements only in the CartPole but not in the Cliff environment.
+
+
+B.4.1 CLIFF
+
+
+
+
+
+
+Figure 12: The Cliff environment RNs optimized with the AUC objective.
+
+
+Figure 13: The Cliff environment RNs optimized with the max reward objective.
+
+
+
+
+Figure 14: The Cliff environment RNs optimized with the reward threshold objective (similar to the results reported in Section 6).
+
+
+
+
+
+
+B.4.2 CARTPOLE
+
+
+
+
+
+
+Figure 15: The CartPole environment RNs optimized with the AUC objective.
+
+
+Figure 16: The CartPole environment RNs optimized with the max reward objective.
+
+
+
+
+Figure 17: The CartPole environment RNs optimized with the reward threshold objective (similar to the results reported in Section 6).
+
+
+
+
+
+
+B.4.3 MOUNTAINCARCONTINUOUS
+
+
+
+
+
+
+Figure 18: The MountainCarContinuous environment RNs optimized with the AUC objective.
+
+
+Figure 19: The MountainCarContinuous environment RNs optimized with the reward threshold objective (similar to the results reported in Section 6).
+
+
+
+
+B.5 HALFCHEETAH
+
+
+Figure 20: The HalfCheetah environment RNs optimized with the AUC objective.
+
+
+
+
+Figure 21: The HalfCheetah environment RNs optimized with the reward threshold objective (similar to the results reported in Appendix Section B.1).
+
+
+
+
+
+# APPENDIX C COMPUTATIONAL COMPLEXITY FOR TRAINING SYNTHETIC ENVIRONMENTS AND REWARD NETWORKS
+
+Training both SEs and RNs can be computationally demanding, depending on the environment complexity and the available resources per worker. Table 20 lists approximate timings for a single NES outer loop iteration based on our log files. Every population member had one Intel Xeon Gold 6242 CPU core at its disposal.
+
+Table 20: Approximate timings for one NES outer loop for SEs and RNs
+
+| Environment | Synthetic Environment | Reward Network |
| Cliff Walking | - | 10s |
| Acrobot-v1 | 100s | - |
| CartPole-v0 | 100s | 100s |
| MountainCarContinuous-v0 | - | 500s |
| HalfCheetah-v3 | - | 2000s |
+
+Given 200 NES outer loop iterations in the SE case and 50 steps in the RN case, these timings result in the following overall runtime for finding one SE or RN, respectively:
+
+# SEs:
+
+- Acrobot: $\sim$ 6-7 hours
+- CartPole: $\sim 5 - 6$ hours
+
+# RNs:
+
+- Cliff Walking: $\sim 8$ minutes
+- CartPole: $\sim 7$ hours
+- MountainCarContinuous: $\sim 7$ hours
+HalfCheetah: $\sim 28$ hours
+
+We note that the required time can vary by more than a magnitude, depending on how quickly the RL agent can solve the environment in the inner loop.
+
+# APPENDIX D SUPERVISED LEARNING AND SYNTHETIC ENVIRONMENTS
+
+One might ask how our proposed way of learning synthetic environments relates and compares to purely learning a synthetic environment model through a supervised learning (or model-based RL (MBRL)) objective. In this Section, we discuss the differences from our view point and show results of a small experiment that aimed at giving some answers to this question.
+
+# D.1 CONTRASTING BOTH APPROACHES
+
+First, our interpretation can be summarized with the following table:
+
+We now elaborate in more detail what we believe are the core differences between both concepts and their resulting effects.
+
+In the case of the supervised learning of the model as a jointly learned mapping from (state, action) pairs to the next state and the reward, we are limited by the human prior in regards to what is beneficial and informative to achieve a certain given task. This prior typically is encoded in the reward. Whereas the states of a problem almost always arise from a physical (e.g. Cartpole) or a logical/rule based (e.g. board games) foundation, the reward is to a much higher degree based on a human perspective. This limits the supervised approach to almost only a replication of the problem designer's choices. Now, it might be argued that therefore it is a pure approach for modeling a world or an environment, but by shifting the perspective towards the artificial nature of a reward signal,
+
+Table 21: Comparing attributes between supervised learning and SE learning.
+
+ | Synthetic Environments | Supervised Learning |
| Learning Objective | Mapping (S,A) → (S,Rdefined) | Mapping (S,A) → (S,Rbeneficial) |
| Signal of Information | Error in mapping like MSE, MLE | Performance of agent on given real environment |
| Learned Function | mapping defined by environment; quality in terms of closeness | A functional mapping of same input-output dimensionality as in the supervised case but defined to increase agents performance; Quality is in terms of reward on a given real environment |
| Potential | Imitate/replicate the given environment | Can imitate state transitions but is not restricted to this and can learn a very different environment that nevertheless helps to quickly train agents to do well on the real environment |
+
+the choice of reward might as well be a source of misguidance or at least a potential hindrance to learning in an effective / efficient, and more unbiased fashion.
+
+We believe that our approach reduces the potential shortcomings of human bias and choice of design to some degree by taking a more "task-aware" perspective. In our approach, the feedback signal for the model training comes from the given environment (similar to supervised model learning), but does not constrict the model to explicitly learn an approximate duplicate mapping. Rather, by using the performance of the agent as the only information, the model gains the ability to construct a mapping of states actions to the next states and a reward signal of which the sole purpose is to improve the future performance of the agent (task-awareness). With this, we allow the model to converge to a different kind of distribution (mapping) and potentially one that might squeeze or extend either or both state and rewards. This could be seen as a compression of information on the one hand and (by having a larger space) also as storing and extending additional information explicitly. Of course, our approach is not completely unbiased by the choice of reward because here as well the human-designed reward influences the performance signal on which the model is trained.
+
+# D.2 COMPARING SUPERVISED LEARNING WITH SYNTHETIC ENVIRONMENTS ON CARTPOLE
+
+We have conducted an experiment on the CartPole environment to compare SEs to models trained purely with supervised learning. Before we show results, we will explain our setup:
+
+Setup: To train such a supervised learning model and also to maintain comparability to SEs, we used the data coming from SE runs (i.e. executing Alg. 1). More precisely, we recorded all the real environment data from each outer loop step on which agents are evaluated (10 test episodes), across 5 populations with each 16 workers/agents over 25-50 outer loop steps. The $(s,a,s^{\prime},r)$ tuples coming from each population run were used to fit a supervised model, yielding in total 5 models. We note that the amount of data that each supervised model has been trained with corresponds to the same amount that we would use to learn an SE. The models have the identical architecture as the SEs and we used an MSE loss to optimize the error between predicted $(s^{\prime},r)$ and ground truth $(s^{\prime},r)$ pairs given $(s,a)$ as input. We trained the models for 100 epochs with Adam and a batch size of 1024, finally yielding an average error of 5e-07.
+
+After fitting the supervised baseline models, we executed the same train and evaluation pipeline for SEs that we describe in Section 5. First, we trained agents with randomly sampled hyperparameters on the supervised model. Second, we evaluated them on the real environment and used the resulting rewards to fit the density plot curves. We hereby ensured the same number of reward data points (4000) as for the curves given in the paper by sampling more agent configurations. To also show transfer performance of the supervised baseline models, we executed the same procedure for unseen agents (Dueling DDQN & discrete TD3).
+
+Result: In Figure 22 we can observe that the supervised baseline underperforms the other models significantly in terms of the reward distribution and the average cumulative reward (15.01 vs. 190.7 for SEs). In terms of training efficiency we can see a low number of steps and episodes but this
+
+stems from inferior policies that cause an early termination. We also ran an experiment where we only considered two of the "best" models which we depict in Figure 23. Hereby "best" means that the majority of samples in the dataset come from high-quality trajectories achieving rewards $\geq 190$ (i.e. which effectively solve the environment). However, in this case, we can only observe a slight increase in performance compared to using all five models (15.01 vs 17.73 average cumulative reward).
+
+The reasons for underperformance can be manifold and their analysis were not part of this experiment. Potential explanations for this are (but are not limited to):
+
+- The supervised baseline models may be subject to overfitting, resulting in inaccurate dynamics models and rendering policy learning a difficult task (it also may increase agent hyperparameter sensitivity).
+- Catastrophic forgetting / sensitivity to the order of seen trajectories during baseline training may not allow to recover accurate dynamics at, for example, early stages of policy learning.
+- The supervised baseline models may entail other sources of inaccuracies, for example, smoothness or noise, resulting in an inferior approximation of the real environment that may also hinder policy learning.
+- In the case of SEs, the task-aware meta-loss (and the meta-learning itself) may be a good regularizer for preventing the above failure cases.
+
+
+
+
+
+
+
+
+Figure 22: Top: Comparing the cumulative test reward densities of agents trained on SEs (green and orange), supervised baseline (purple), and baseline on real environment (blue). Agents trained on the supervised model underperform the SE models and the real baseline. Bottom: Comparing the needed number of test steps and test episodes to achieve above cumulative rewards. Left: real baseline, center: SEs, right: supervised (MBRL) baseline.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 23: Top: Comparing the cumulative test reward densities of agents trained on SEs (green and orange), supervised baseline (purple), and baseline on real environment (blue). Agents trained on the supervised model underperform the SE models and the real baseline and using only the best two supervised models (purple) does not seem to change this. Bottom: Comparing the needed number of test steps and test episodes to achieve above cumulative rewards only using the best two of the five models. Left: real baseline, center: SEs, right: supervised (MBRL) baseline
+
+
+
+# APPENDIX E NES SCORE TRANSFORMATION
+
+# E.1 SCORE TRANSFORMATION VARIANTS
+
+The following overview lists eight score transformations for calculating $F_{i}$ based on the expected cumulative reward (ECR) $K_{i}$ or the associated rank $R_{i}$ . These score transformations where also used in the hyperparameter optimization configuration space for finding SEs and RNs (e.g., in Tables 3 and 7). The rank $R_{i}$ is defined as the number of population members that have a lower ECR than the i-th member, i.e. the rank associated with the lowest ECR is 0, the one with the highest ECR $n_{p} - 1$ (the population size minus 1). We denote the ECR associated with the current SE or RN incumbent as $K_{\psi}$ .
+
+- Linear Transformation: The linear transformation maps all fitness values to the $[0;1]$ range as
+
+$$
+F _ {i} = \frac {K _ {i} - \min _ {i} \left(K _ {i}\right)}{\max _ {i} \left(K _ {i}\right) - \min _ {i} \left(K _ {i}\right)}, \tag {2}
+$$
+
+with $\min_i(K_i)$ as the lowest of all ECRs and $\max_i(K_i)$ as the highest of all ECRs.
+
+- Rank Transformation: For the rank transform the individual rewards are first ranked with respect to each other, resulting in $R_{i}$ . The ranks are then linearly mapped to the [0; 1] range as
+
+$$
+F _ {i} = \frac {R _ {i} - \operatorname* {m i n} _ {i} \left(R _ {i}\right)}{\operatorname* {m a x} _ {i} \left(R _ {i}\right) - \operatorname* {m i n} _ {i} \left(R _ {i}\right)}, \tag {3}
+$$
+
+with $\min_i(R_i)$ as the lowest rank and $\max_i(R_i)$ as the highest rank.
+
+- NES: Originally published in (Wierstra et al., 2008) and hence named after the paper "Natural Evolution Strategies" (NES), this method first transforms the rewards to their ranks $R_{i}$ in a similar manner as the rank transformation. In the next step, the fitness values are calculated from the individual ranks as
+
+$$
+\hat {F} _ {i} = \frac {\operatorname* {m a x} \left(0 , \log \left(\frac {n _ {p}}{2} + 1\right) - \log \left(R _ {i}\right)\right)}{\sum_ {j = 1} ^ {n _ {p}} \max \left(0 , \log \left(\frac {n _ {p}}{2} + 1\right) - \log \left(R _ {j}\right)\right)} - \frac {1}{n _ {p}}, \tag {4}
+$$
+
+$$
+F _ {i} = \frac {\hat {F} _ {i}}{\max \left(\left| \hat {F} _ {i} \right|\right)}, \tag {5}
+$$
+
+with $n_p$ as the size of the population. Whereas Eq. (4) constitutes the essential transformation, Eq. (5) acts solely as a scaling to the range $[x; 1]_{x < 0}$ and is used for convenience. The NES transformation also allows negative fitness values $F_i$ through the $-\frac{1}{n_p}$ term in Eq. (4).
+
+- NES unnormalized: We also consider an unnormalized NES score transformation variant. Eq. (4) and Eq. (5) here become
+
+$$
+\hat {F} _ {i} = \frac {\operatorname* {m a x} \left(0 , \log \left(\frac {n _ {p}}{2} + 1\right) - \log \left(R _ {i}\right)\right)}{\sum_ {j = 1} ^ {n _ {p}} \max \left(0 , \log \left(\frac {n _ {p}}{2} + 1\right) - \log \left(R _ {j}\right)\right)}, \tag {6}
+$$
+
+$$
+F _ {i} = \frac {\hat {F} _ {i}}{\max \left(\left| \hat {F} _ {i} \right|\right)}. \tag {7}
+$$
+
+Although not directly visible from the equations above, the worse half of all fitness values becomes 0.
+
+- Single Best: We can induce a strong bias towards the best performing population member by only assigning a nonzero weight to the incumbent of the current ES iteration. The corresponding transformation scheme can be expressed by
+
+$$
+F _ {i} = \left\{ \begin{array}{l} 1 \text {i f} R _ {i} = \max _ {i} (R _ {i}), \\ 0 \text {e l s e}, \end{array} \right. \tag {8}
+$$
+
+with $\max_i(R_i)$ as the best rank.
+
+- Single Better: It might be advantageous to update the SE and RN parameters only if their performance is supposed to improve. By calculating the ECR $K_{\psi}$ associated with the parameters, the adapted "single best" transformation becomes
+
+$$
+F _ {i} = \left\{ \begin{array}{l} 1 \text {i f} K _ {i} > K _ {\psi} \text {a n d} K _ {i} = \max _ {i} \left(K _ {i}\right), \\ 0 \text {e l s e .} \end{array} \right. \tag {9}
+$$
+
+- All Better 1: The "single best" transformation relies at most on a single population member to update the SE or RN parameters in each ES iteration. A more regularized version considers all population members whose ECR $K_{i}$ is better than the ECR $K_{\psi}$ of the current SE or RN parameters. In a more mathematical notation, this can be expressed as
+
+$$
+\hat {F} _ {i} = \left\{ \begin{array}{l} \frac {K _ {i} - K _ {\psi}}{\max _ {i} (K _ {i}) - K _ {\psi}} \text {i f} K _ {i} > K _ {\psi}, \\ 0 \text {e l s e ,} \end{array} \right. \tag {10}
+$$
+
+$$
+F _ {i} = \frac {\hat {F} _ {i}}{\max _ {i} \hat {F} _ {i}}, \tag {11}
+$$
+
+with $K_{\psi}$ being evaluated similarly as the individual ECRs $K_{i}$ .
+
+- All Better 2: This transformation is almost identical to the "all better 1" transformation, except that we divide by the sum of all $\hat{F}_i$ values when calculating the $F_i$ values and not by the maximum $\hat{F}_i$ value:
+
+$$
+\hat {F} _ {i} = \left\{ \begin{array}{l} \frac {K _ {i} - K _ {\psi}}{\max _ {i} (K _ {i}) - K _ {\psi}} \text {i f} K _ {i} > K _ {\psi}, \\ 0 \text {e l s e ,} \end{array} \right. \tag {12}
+$$
+
+$$
+F _ {i} = \frac {\hat {F} _ {i}}{\sum_ {i} \hat {F} _ {i}}, \tag {13}
+$$
+
+# E.2 EVALUATION OF SCORE TRANSFORMATION VARIANTS
+
+Below we visualize the BOHB hyperparameter optimization results of different score transformation variants for SEs and plot these as a function of the NES step size with (left) and without (right)
+
+mirrored sampling. The colors indicate the number of outer loop iterations of Algorithm 1 required to solve the target task (here: $2 \times 2$ grid world environment). Green signifies 0, yellow 25, and red 50 outer loop iterations. Each of the roughly 3500 dots corresponds to a single evaluation. We can observe multiple things:
+
+- none of the rank transformations fails completely for the given simple environment
+- mirrored sampling is only marginally better (if at all) while doubling the computational load (at least in this simple 2x2 grid world environment)
+- noise: good performing samples in regions with bad performing samples and vice versa
+- the "all better" score transformation seems to perform best
+
+
+Figure 24: Evaluation of different score transformation schemes for synthetic environments: Shown is the required number of NES outer loop iterations (green: 0, yellow: 25, red: 50) for different hyperparameter configurations until an SE is found that solves the real environment (here: a 2x2 grid world environment).
+
+
+
+# APPENDIX F ADDITIONAL PLOTS
+
+# F.1 SYNTHETIC ENVIRONMENTS
+
+# F.1.1 EVALUATION OF INDIVIDUAL SE MODELS (CARTPOLE)
+
+Below we show the individual or model-based violin plots for the 40 SE models which we calculated based on the cumulative rewards of 1000 randomly sampled agents that were each evaluated across 10 test episodes. For agent sampling we again chose the hyperparameters ranges denoted in Table 2. As the best five models for discrete TD3 (Figure 3) we chose the models CartPole-v0_25_4I271D, CartPole-v0_22_CW9CSH, CartPole-v0_21_DRWNIK, CartPole-v0_8_QGN9IF, and CartPole-v0_17_WPWK3R.
+
+
+Figure 25: Model-wise evaluation: 1000 randomly sampled DDQN agents à 10 test episodes per SE model.
+
+
+Figure 26: Model-wise evaluation based on the cumulative rewards of 1000 randomly sampled. Dueling DDQN agents à 10 test episodes per SE model.
+
+# F.1.2 EVALUATION OF INDIVIDUAL SE MODELS (ACROBOT)
+
+Below we show the individual or model-based violin plots for the 40 SE models which we calculated based on the cumulative rewards of 1000 randomly sampled agents that were each evaluated across 10 test episodes. For agent sampling we again chose the hyperparameters ranges denoted in Table 2. As the best five models for discrete TD3 (Figure 7) we chose the models Acrobot-v1_223R5W, Acrobot-v1_2XMO40, Acrobot-v1_7DQP5Z, Acrobot-v1_9MA9G8 and Acrobot-v1_8MYN67.
+
+
+Figure 27: Model-wise evaluation based on the cumulative rewards of 1000 randomly sampled discrete TD3 agents à 10 test episodes per SE model.
+
+
+Figure 28: Model-wise evaluation based on the cumulative rewards of 1000 randomly sampled DDQN agents à 10 test episodes per SE model.
+
+
+Figure 29: Model-wise evaluation based on the cumulative rewards of 1000 randomly sampled Dueling DDQN agents à 10 test episodes per SE model.
+
+
+Figure 30: Model-wise evaluation based on the cumulative rewards of 1000 randomly sampled discrete TD3 agents à 10 test episodes per SE model.
\ No newline at end of file
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/images.zip b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..73f656b0561ad7e82eeb48123dd25153a052d460
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b70691825e5e035f3bfefcc23676a213e334c48f3f976e4deabc6b49d6032f1a
+size 3081123
diff --git a/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/layout.json b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f8495884b4b5a3a72211c314ea6544b1c45f9bf7
--- /dev/null
+++ b/learningsyntheticenvironmentsandrewardnetworksforreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e2a7e101b8b12325cac6c5b9358adb2e794813c7083b983a249b454c93285c24
+size 998618
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_content_list.json b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7970c10af040f661e83c9e1cac98aee8f23e7d3d
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:88b137f269169a7e84ec96e51ee86d549d0563c719e040933c0221878c01142f
+size 212361
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_model.json b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4e9267cdd9db4af8119f276a70a652b9c079ec18
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98f0348672b638e63d7da70475e36166f37e0a3e38dd946b9c76b5996a9a82ba
+size 252730
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_origin.pdf b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..382ac8d018d1f7680994bef9e9a20007d5d9de4c
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/21cc8aba-d7cc-4c00-86df-afe03e035127_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ef8bce1366cb76a03dcf9f7acf68c30967a6db35353e94156be547e4576c0867
+size 4055321
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/full.md b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f0b9b83665d54b58bd69c894e742ff2e7434ac23
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/full.md
@@ -0,0 +1,904 @@
+# LEARNING TEMPORALLY CAUSAL LATENT PROCESSES FROM GENERAL TEMPORAL DATA
+
+Weiran Yao†* Yuewen Sun‡* Alex Ho° Changyin Sun† Kun Zhang†
+
+†Carnegie Mellon University, Pittsburgh PA, USA
+$^{\ddagger}$ Southeast University, Nanjing, China
+Rice University, Houston TX, USA
+Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, United Arab Emirates
+
+# ABSTRACT
+
+Our goal is to recover time-delayed latent causal variables and identify their relations from measured temporal data. Estimating causally-related latent variables from observations is particularly challenging as the latent variables are not uniquely recoverable in the most general case. In this work, we consider both a nonparametric, nonstationary setting and a parametric setting for the latent processes and propose two provable conditions under which temporally causal latent processes can be identified from their nonlinear mixtures. We propose LEAP, a theoretically-grounded framework that extends Variational AutoEncoders (VAEs) by enforcing our conditions through proper constraints in causal process prior. Experimental results on various datasets demonstrate that temporally causal latent processes are reliably identified from observed variables under different dependency structures and that our approach considerably outperforms baselines that do not properly leverage history or nonstationarity information. This demonstrates that using temporal information to learn latent processes from their invertible nonlinear mixtures in an unsupervised manner, for which we believe our work is one of the first, seems promising even without sparsity or minimality assumptions.
+
+# 1 INTRODUCTION AND RELATED WORK
+
+Causal discovery seeks to identify the underlying structure of the data generation process by exploiting an appropriate class of assumptions (Spirtes et al., 1993; Pearl, 2000). Despite its success in certain domains, most existing work either focuses on estimating the causal relations between observed variables (Spirtes & Glymour, 1991; Chickering, 2002; Shimizu et al., 2006), or starts from the premise that causal variables are given beforehand (Spirtes et al., 2013). Real-world observations (e.g., image pixels, sensor measurements, etc.), however, are not structured into causal variables to begin with. Estimating latent causal variable graphs from observations is particularly challenging as the latent variables, even with independent factors of variation (Locatello et al., 2019), are not identifiable or "uniquely" recoverable in the most general case (Hyvarinen & Pajunen, 1999). There exist several pieces of work aiming to uncover causally related latent variables. For instance, by exploiting the vanishing Tetrad conditions (Spearman, 1928) one is able to identify latent variables in linear-Gaussian models (Silva et al., 2006), and the so-called Generalized Independent Noise (GIN) condition was proposed to estimate linear, non-Gaussian latent variable causal graph (Xie et al., 2020), with follow-up studies such as (Adams et al., 2021). However, these approaches are constrained within linear relations, need certain types of sparsity or minimality assumptions, and require a relatively large number of measured variables as children of the latent variables. The work of (Bengio et al., 2019; Ke et al., 2019) used "quick adaptation" as the training criteria for learning latent structure but the identifiability results have not been theoretically established yet.
+
+Recent advances in the theory of nonlinear Independent Component Analysis (ICA) have proven strong identifiability results (Hyvarinen & Morioka, 2016; 2017; Hyvarinen et al., 2019; Khemakhem et al., 2020; Sorrenson et al., 2020) by exploiting certain side information in addition to independence. By assuming that the generative latent factors $z_{i}$ are conditionally independent
+
+given auxiliary variables $\mathbf{u}$ that may be time index, domain index, class label, etc. and augmenting observation data $\mathbf{x}$ with $\mathbf{u}$ , deep generative models fit with such tuples $(\mathbf{x},\mathbf{u})$ may be identifiable in function space; they can recover independent factors up to a certain transformation of the original latent variables under proper assumptions (note that we use "latent factor" and "latent processe" interchangeably). Although the temporal structure is widely used for nonlinear ICA, existing work that establishes identifiability results considers only independent sources, or further with linear transitions. However, these assumptions may severely distort the results if the real latent factors have causal relations in between, or if the relations are nonlinear. It is not clear yet how the temporal structure may help in learning temporally causally-related latent factors, together with their causal structure, from temporal observation data.
+
+In this paper, we focus on the scenario where the observed temporal variables $\mathbf{x}_t$ do not have direct causal edges but are generated by latent processes or confounders $\mathbf{z}_t$ that have time-delayed causal relations in between. That is, the observed data $\mathbf{x}_t$ are unknown nonlinear (but invertible) mixtures of the underlying sources: $\mathbf{x}_t = g(\mathbf{z}_t)$ . Our first goal is hence to understand under what conditions the latent temporally causal processes can be identified. Inspired by real situations, we consider both a nonparametric, nonstationary setting and a parametric setting for the latent processes. In the nonparametric setting, the generating process of each latent causal factor $z_{it}$ is characterized by nonparametric assignment $z_{it} = f_i(\mathbf{Pa}(z_{it}),\epsilon_{it})$ , in which the parents of $z_{it}$ (i.e., the set of latent factors that directly cause $z_{it}$ ) together with noise term $\epsilon_{it}\sim p_{\epsilon}$ (where $p_{\epsilon}$ denotes the distribution of $\epsilon_{it}$ ) generate $z_{it}$ via unknown nonparametric function $f_{i}$ with some time delay. In the parametric setting, the time-delayed causal influences among latent factors follow a linear form. In both settings, we establish the identifiability of the latent factors and their causal influences, rendering them recoverable from the observed data.
+
+
+Figure 1: Our approach: we leverage nonstationarity in process noise or functional and distributional forms of temporal statistics to identify temporally causal latent processes from observation.
+
+Our second goal is then to develop a theoretically-grounded training framework that enforces the assumed conditions through proper constraints. To this end, we propose Latent tEmporally cAusal Processes estimation (LEAP), a novel architecture that extends VAEs with a learned causal process prior network that enforces the Independent Noise (IN) condition and models possible nonstationarity through flow-based estimators. We evaluate LEAP on a number of synthetic and real-world datasets, including video and motion capture data with the properties required by our conditions. Experimental results demonstrate that temporally causal latent processes are reliably identified from observed variables under different dependency structures, and that our approach considerably outperforms existing methods which do not leverage history or nonstationarity information.
+
+The closest work to ours includes (Klindt et al., 2020; Hyvarinen & Morioka, 2017), which require the underlying sources to be mutually independent for identifiability. Our work extends the theories for the discovery of conditionally independent sources to the setting with temporally causally-related latent processes, by leveraging nonstationarity or functional and distributional constraint on temporal relations. To the best of our knowledge, this is one of the first works that successfully recover time-delayed latent processes from their nonlinear mixtures without using sparsity or minimality assumptions. The proposed framework may serve as an alternative tool for creating versatile models robust to domain shifts and may be extended for more general conditions with changing causal relations over time.
+
+# 2 IDENTIFIABILITY THEORY
+
+# 2.1 IDENTIFIABILITY PROPERTY
+
+We summarize the recent literature related to our work from four perspectives and compare our proposed theory with them in Table 1. The detailed comparisons of the problem settings are given in Appendix A.4. Following prior work, we define identifiability in representation function space.
+
+Table 1: Attributes of existing theories. A green check denotes that a method has an attribute, whereas a red cross denotes the opposite. $\dagger$ indicates an approach we implemented.
+
+| Approach | Temporal Data | Causally-related Factors | Nonparametric Expression | Stationary Process |
| TCL (Hyvarinen & Morioka, 2016) | ✓ | ✗ | ✗ | ✗ |
| PCL (Hyvarinen & Morioka, 2017) | ✓ | ✗ | ✓ | ✓ |
| GCL (Hyvarinen et al., 2019) | ✓ | ✗ | ✓ | ✗ |
| iVAE (Khemakhem et al., 2020) | ✗ | ✗ | ✗ | ✗ |
| GIN (Sorrenson et al., 2020) | ✗ | ✗ | ✗ | ✗ |
| HM-NLICA (Hälvä & Hyvarinen, 2020) | ✓ | ✗ | ✓ | ✗ |
| SlowVAE (Klindt et al., 2020) | ✓ | ✗ | ✗ | ✓ |
| CausalVAE (Yang et al., 2021) | ✗ | ✓ | ✗ | ✗ |
| LEAP (Theorem 1)† | ✓ | ✓ | ✓ | ✗ |
| LEAP (Theorem 2)† | ✓ | ✓ | ✗ | ✓ |
+
+Definition 1 (Componentwise Identifiability) Let $\mathbf{x}_t$ be a sequence of observed variables generated by the true temporally causal latent processes specified by $(f_i, p_{\epsilon_i})$ and nonlinear mixing function $g$ , given in the introduction. A learned generative model $(\hat{g}, \hat{f}_i, \hat{p}_{\epsilon_i})$ is observationally equivalent to $(g, f_i, p_{\epsilon_i})$ if the joint distribution $p_{\hat{g}, \hat{f}, \hat{p}_{\epsilon}}(\mathbf{x}_t)$ matches $p_{g, f, p_{\epsilon}}(\mathbf{x}_t)$ everywhere. We say latent causal processes are identifiable if observational equivalence can always lead to identifiability of the latent variables up to permutation $\pi$ and component-wise invertible transformation $T$ :
+
+$$
+p _ {\hat {g}, \hat {f}, \hat {p} _ {\epsilon}} \left(\mathbf {x} _ {t}\right) = p _ {g, f, p _ {\epsilon}} \left(\mathbf {x} _ {t}\right) \Rightarrow \hat {g} = g \circ T \circ \pi . \tag {1}
+$$
+
+Once the latent causal processes are identifiable up to componentwise transformations, latent causal relations are also identifiable because conditional independence relations fully characterize time-delayed causal relations in a time-delayed causally sufficient system. Note that invertible componentwise transformations on latent causal processes do not change their conditional independence relations.
+
+# 2.2 OUR PROPOSED CONDITIONS
+
+We consider two novel conditions that ensure the identifiability of temporally causal latent processes using (1) nonstationarity or (2) functional and distributional constraints on their temporal relations. The corresponding identifiability of the latent processes is established in the following two theorems, with proofs and discussions of the assumed conditions provided in Appendix A.
+
+Theorem 1 (Nonparametric Processes) Assume nonparametric processes in Eq. 2, where the transition functions $f_{i}$ are third-order differentiable functions and mixing function $g$ is injective and differentiable almost everywhere; let $\mathbf{Pa}(z_{it})$ denote the set of (time-delayed) parent nodes of $z_{it}$ :
+
+$$
+\underbrace {\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right)} _ {\text {N o n l i n e a r m i x i n g}}, \quad \underbrace {z _ {i t} = f _ {i} \left(\left\{z _ {j , t - \tau} \mid z _ {j , t - \tau} \in \mathbf {P a} \left(z _ {i t}\right) \right\} , \epsilon_ {i t}\right)} _ {\text {N o n p a r a m e t r i c t r a n s i t i o n}} w i t h \underbrace {\epsilon_ {i t} \sim p _ {\epsilon_ {i} | \mathbf {u}}} _ {\text {N o n s t a t i o n a r y n o i s e}}. \tag {2}
+$$
+
+# Here we assume:
+
+1. (Nonstationary Noise): Noise distribution $p_{\epsilon_i|\mathbf{u}}$ is modulated (in any way) by the observed categorical auxiliary variables $\mathbf{u}$ , which denotes nonstationary regimes or domain index;
+2. (Independent Noise): The noise terms $\epsilon_{it}$ are mutually independent (i.e., spatially and temporally independent) in each regime of $\mathbf{u}$ (note that this directly implies that $\epsilon_{it}$ are independent from $\mathbf{P}\mathbf{a}(z_{it})$ in each regime);
+3. (Sufficient Variability): For any $\mathbf{z}_t \in \mathbb{R}^n$ there exist $2n + 1$ values for $\mathbf{u}$ , i.e., $\mathbf{u}_j$ with $j = 0, 1, \dots, 2n$ , such that the $2n$ vectors $\mathbf{w}(\mathbf{z}_t, \mathbf{u}_{j+1}) - \mathbf{w}(\mathbf{z}_t, \mathbf{u}_j)$ , with $j = 0, 1, \dots, 2n$ , are linearly independent with $\mathbf{w}(\mathbf{z}_t, \mathbf{u})$ defined below, where $q_i$ is the log density of the conditional distribution and $\mathbf{z}_{Hx} = \{\mathbf{z}_{t-\tau}\}$ denotes history information up to maximum time lag $L$ :
+
+$$
+\mathbf {w} (\mathbf {z} _ {t}, \mathbf {u}) \triangleq \left(\frac {\partial q _ {1} \left(z _ {1 t} | \mathbf {z} _ {H x} , \mathbf {u}\right)}{\partial z _ {1 t}}, \dots , \frac {\partial q _ {n} \left(z _ {n t} | \mathbf {z} _ {H x} , \mathbf {u}\right)}{\partial z _ {n t}}, \frac {\partial^ {2} q _ {1} \left(z _ {1 t} | \mathbf {z} _ {H x} , \mathbf {u}\right)}{\partial z _ {1 t} ^ {2}}, \dots , \frac {\partial^ {2} q _ {n} \left(z _ {n t} | \mathbf {z} _ {H x} , \mathbf {u}\right)}{\partial z _ {n t} ^ {2}}\right). \tag {3}
+$$
+
+Then the componentwise identifiability property of temporally causal latent processes is ensured.
+
+Theorem 2 (Parametric Processes) Assume the vector autoregressive process in Eq. 4, where the state transition functions are linear and additive and mixing function $g$ is injective and differentiable almost everywhere. Let $\mathbf{B}_{\tau} \in \mathbb{R}^{n \times n}$ be the state transition matrix at lag $\tau$ . The process noises $\epsilon_{it}$
+
+
+Figure 2: LEAP: Encoder (A) and Decoder (D) with MLP or CNN for specific data types; (B) Bidirectional inference network that approximates the posteriors of latent variables $\hat{z}_{1:T}$ , and (C) Causal process network that (1) models nonstationary latent causal processes $\hat{\mathbf{z}}_t$ with Independent Noise constraint (Thm 1) or (2) models the linear transition matrix with Laplacian constraints (Thm 2).
+
+are assumed to be stationary and both spatially and temporally independent:
+
+$$
+\underbrace {\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right)} _ {\text {N o n l i n e a r m i x i n g}}, \quad \underbrace {\mathbf {z} _ {t} = \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} + \epsilon_ {t}} _ {\text {L i n e a r a d d i t i v e t r a n s i t i o n}} \text {w i t h} \underbrace {\epsilon_ {i t} \sim p _ {\epsilon_ {i}}} _ {\text {I n d e p e n d e n t n o i s e}}. \tag {4}
+$$
+
+Here we assume:
+
+1. (Generalized Laplacian Noise): Process noises $\epsilon_{it} \sim p_{\epsilon_i}$ are mutually independent and follow the generalized Laplacian distribution $p_{\epsilon_i} = \frac{\alpha_i \lambda_i}{2 \Gamma(1 / \alpha_i)} \exp \left(-\lambda_i |\epsilon_i|^{\alpha_i}\right)$ with $\alpha_i < 2$ ;
+2. (Nonsingular State Transitions): For at least one $\tau$ , the state transition matrix $\mathbf{B}_{\tau}$ is of full rank.
+
+Then the componentwise identifiability property of temporally causal latent processes is ensured.
+
+# 3 LEAP: LATENT TEMPORALLY CAUSAL PROCESSES ESTIMATION
+
+Given our identifiability results, we further propose a Latent tEmporally cAusal Processes (LEAP) estimation framework, which is built upon the framework of VAEs while enforcing the conditions in Section 2.2 as constraints for identification of the latent causal processes. The model architecture is shown in Fig. 2. Here $\mathbf{x}_{1:T}$ and $\hat{\mathbf{x}}_{1:T}$ are the observed and reconstructed time series, and $\overleftrightarrow{H}_t$ and $\overleftarrow{H}_t$ denote the forward and backward embeddings. Implementation details are in Appendix C.
+
+# 3.1 CAUSAL PROCESS PRIOR NETWORK
+
+We model latent causal processes in the learned prior network. To enforce the Independent Noise (IN) condition, latent transition priors $p(z_{it}|\mathbf{Pa}(z_{it}))$ are reparameterized into factorized noise distributions using the change of variable formula. To enforce the nonstationary noise condition, the noise distributions are learned by flow-based estimators, and independence constraints are enforced through the contrastive approach. Finally, for interpretation purposes of the causal relations, we use pruning techniques based on masked inputs and soft-thresholding.
+
+# 3.1.1 TRANSITION PRIOR MODELING
+
+Nonparametric and parametric transition priors are modeled below, leading to two separate methods. The IN condition is used to reparameterize transition priors into factorized noise distributions.
+
+Nonparametric Transition We propose a novel way to inject the IN condition into the transition prior. Let $\{r_i\}$ be a set of learned inverse causal transition functions that take the estimated latent causal variables and output the noise terms, i.e., $\hat{\epsilon}_{it} = r_i(\hat{z}_{it},\{\hat{\mathbf{z}}_{t - \tau}\})$ . We model each output component $\hat{\epsilon}_{it}$ with a separate Multi-Layer Perceptron (MLP) network, so we can easily disentangle the effects from inputs to outputs. Design transformation $\mathbf{A}\rightarrow \mathbf{B}$ with low-triangular Jacobian as follows:
+
+$$
+\underbrace {\left[ \hat {\mathbf {z}} _ {t - L} , \dots , \hat {\mathbf {z}} _ {t - 1} , \hat {\mathbf {z}} _ {t} \right] ^ {\top}} _ {\mathbf {A}} \text {m a p p e d t o} \underbrace {\left[ \hat {\mathbf {z}} _ {t - L} , \dots , \hat {\mathbf {z}} _ {t - 1} , \hat {\epsilon} _ {t} \right] ^ {\top}} _ {\mathbf {B}}, w i t h \mathbf {J} _ {\mathbf {A} \rightarrow \mathbf {B}} = \left(\begin{array}{c c}\mathbb {I} _ {n L}&0\\*&\operatorname {d i a g} \left(\frac {\partial r _ {i}}{\partial \hat {z} _ {i t}}\right)\end{array}\right). \tag {5}
+$$
+
+By applying the change of variables formula to the map from $\mathbf{A}$ to $\mathbf{B}$ and because of the IN condition in Assumption 2 of Theorem 1, one can obtain the joint distribution of the latent causal variables as:
+
+$$
+\begin{array}{l} \log p (\mathbf {A} | \mathbf {u}) = \log p (\mathbf {B} | \mathbf {u}) + \log (| \det (\mathbf {J} _ {\mathbf {A} \rightarrow \mathbf {B}}) |) (6) \\ = \underbrace {\log p \left(\hat {\mathbf {z}} _ {t - L} , \dots , \hat {\mathbf {z}} _ {t - 1}\right) + \sum_ {i = 1} ^ {n} \log p \left(\hat {\epsilon} _ {i} \mid \mathbf {u}\right)} _ {\text {B e c a u s e o f t h e I N c o n d i t i o n (S e e A s s u m p t i o n 2 i n T h m 1)}} + \log \left(| \det \left(\mathbf {J} _ {\mathbf {A} \rightarrow \mathbf {B}}\right) |\right). (7) \\ \end{array}
+$$
+
+The transition prior $p\left(\hat{\mathbf{z}}_t|\{\hat{\mathbf{z}}_{t - \tau}\}_{\tau = 1}^L\right)$ can thus be evaluated using factorized noise distributions by cancelling out the margins of time-delayed causal variables on both sides of Eq. 7. Given that this Jacobian is triangular, we can efficiently compute its determinant as $\prod_i\frac{\partial r_i}{\partial\hat{z}_{i,t}}$
+
+$$
+\log p \left(\hat {\mathbf {z}} _ {t} \mid \{\hat {\mathbf {z}} _ {t - \tau} \} _ {\tau = 1} ^ {L}, \mathbf {u}\right) = \sum_ {i = 1} ^ {n} \log p \left(\hat {\epsilon} _ {i} \mid \mathbf {u}\right) + \sum_ {i = 1} ^ {n} \log \left| \frac {\partial r _ {i}}{\partial \hat {z} _ {i t}} \right| \tag {8}
+$$
+
+Parametric Transition A group of state transition matrices $\{\mathbf{r}_{\tau}\}$ is used to model the inverse transition functions: $\hat{\epsilon}_t = \hat{\mathbf{z}}_t - \sum_{\tau=1}^{L} \mathbf{r}_{\tau} \hat{\mathbf{z}}_{t-\tau}$ . Because of additive noise, the transition priors can be directly written in terms of factorized noise distributions.
+
+$$
+\log p \left(\hat {\mathbf {z}} _ {t} \mid \{\hat {\mathbf {z}} _ {t - \tau} \} _ {\tau = 1} ^ {L}\right) = \sum_ {i = 1} ^ {n} \log p (\hat {\epsilon} _ {t}) \tag {9}
+$$
+
+# 3.1.2 NONSTATIONARY NOISE ESTIMATION
+
+A flow-based density estimator is used to fit the residuals (e.g., non-Gaussian noises) and score the likelihood in Eqs. 8 and 9. The independence of residuals is enforced inside the density estimator.
+
+Flow-based Noise Estimation We apply the componentwise neural spline flow model (Dolatabadi et al., 2020) to fit the estimated noise terms. The distribution of each noise component $\epsilon_{it} \sim p_{\epsilon_i|\mathbf{u}}$ is modeled separately by transforming standard normal noises through linear rational splines $s_{i,\mathbf{u}}$ . To model nonstationarity, we keep a copy of spline flows $\{s_{i,\mathbf{u}}\}$ for each nonstationary regime $\mathbf{u}$
+
+and trigger it when data falls into this category: $\underbrace{p(\hat{\epsilon}_i|\mathbf{u}) = p_{\mathcal{N}(0,1)}\left(s_{i,\mathbf{u}}^{-1}(\hat{\epsilon}_i)\right)\left|\frac{ds_{i,\mathbf{u}}^{-1}(\hat{\epsilon}_i)}{d\hat{\epsilon}_i}\right|}_{\text{Nonstationary noise condition}}$ . Stationary
+
+sources are considered as special cases where the nonstationary regime $\mathbf{u} = 1$ for all data samples.
+
+Independence by Contrastive Learning We further force the estimated noises $\{\hat{\epsilon}_{it}\}$ to be mutually independent (corresponding to the IN condition) across values of $(i,t)$ . Similar to FactorVAE (Kim & Mnih, 2018), we train a discriminator $\mathcal{D}(\{\hat{\epsilon}_{it}\})$ together with the latent variable model, to distinguish positive samples which are the estimated noise terms, against negative samples $\{\hat{\epsilon}_{it}^{\mathrm{perm}}\}$ which are random permutations of the noise terms across the batch for each noise dimension $(i,t)$ . The Total Correlation (TC) of noise terms can be estimated by the density-ratio trick and is added to the Evidence Lower BOund (ELBO) objective function to enforce joint independence of noise
+
+terms: $\mathcal{L}_{TC} = \mathbb{E}_{\{\hat{\epsilon}_{it}\} \sim (q(\hat{\mathbf{z}}_t),r_i)}\log \frac{\mathcal{D}(\{\hat{\epsilon}_{it}\})}{1 - \mathcal{D}(\{\hat{\epsilon}_{it}\})}.$
+
+# 3.1.3 STRUCTURE ESTIMATION
+
+For visualization purposes, we apply sparsity-encouraging regularizations to the learned causal relations in latent processes. Specifically, we use a combination of masked inputs and pruning approaches. Note that our identifiability results do not rely on sparsity of causal relations in latent processes. It is used only for visualizing causal relations when the causal processes are nonlinear.
+
+Masked Input and Regularization For latent processes of sparse causal relations, each MLP of the inverse transition function $r_i$ has a learned n-dimensional soft mask vector $\sigma(\gamma_i) \in [0,1]$ with the $j$ -th time-delayed inputs of the MLP being multiplied by $\sigma(\gamma_{ij})$ . A fixed $L_1$ penalty is added to the mask during training: $\mathcal{L}_{\mathrm{Mask}} = \| \sigma(\gamma_{ij}) \|_1$ . For linear transition, the penalty is added to the transition matrices since the weights directly indicate whether an edge exists.
+
+Pruning For nonlinear relations, we use LassoNet (Lemhadri et al., 2021) as a post-processing step to remove weak edges. This approach prunes input nodes by jointly passing the residual layer and the first hidden layer through a hierarchical soft-thresholding optimizer. We fit the model on a
+
+subset of the recovered latent causal variables. Though the true causal relations may not follow the causal additive assumption, the pruning step usually produces sparse causal relations.
+
+# 3.2 INFERENCE NETWORK
+
+A bidirectional Gated Recurrent Unit is used to infer latent variables. We approximate the posterior $q_{\phi}(\hat{\mathbf{z}}_{1:T}|\mathbf{x}_{1:T})$ with an isotropic Gaussian with mean and variance terms from the inference network. The KL divergence is $\mathcal{L}_{\mathrm{KLD}} = D_{KL}(q_{\phi}(\hat{\mathbf{z}}_{1:T}|\mathbf{x}_{1:T})||p(\hat{\mathbf{z}}_{1:T}))$ and is estimated via sampling approach because prior distribution is not specified but rather learned by causal process network.
+
+# 3.3 ENCODER AND DECODER
+
+The reconstruction likelihood is $\mathcal{L}_{\mathrm{Recon}} = p_{\mathrm{reconstruct}}(\mathbf{x}_t|\hat{\mathbf{z}}_t)$ , where $p_{\mathrm{reconstruct}}$ is the decoder distribution. For synthetic and point cloud data, we use MLP with LeakyReLU units as encoder and decoder and MSE loss is used for reconstruction. For video datasets with single objects (e.g., KiT-TiMask), vanilla CNNs and binary cross-entropy loss are used. For videos with multiple objects, we apply a disentangled design (Kulkarni et al., 2019) with two separate CNNs, one for extracting visual features and the other for locating object locations with spatial softmax units. The decoder retrieves object features using object locations and reconstructs the scene with MSE loss. The network architecture details are given in Appendix C.1.
+
+# 3.4 OPTIMIZATION
+
+We train the VAE and noise discriminator jointly. The VAE parameters are updated using the augmented ELBO objective $\mathcal{L}_{\mathrm{ELBO}}$ . The discriminator is trained to distinguish between residuals from $q(\{\hat{\epsilon}_{it}\})$ and $q(\{\hat{\epsilon}_{it}^{\mathrm{perm}}\})$ with $\mathcal{L}_{\mathcal{D}}$ , thus learning to approximate the density ratio for estimating $\mathcal{L}_{\mathrm{TC}}$ :
+
+$$
+\mathcal {L} _ {\mathrm {E L B O}} = \frac {1}{N} \sum_ {i \in N} \mathcal {L} _ {\mathrm {R e c o n}} - \beta \mathcal {L} _ {\mathrm {K L D}} - \gamma \mathcal {L} _ {\mathrm {M a s k}} - \sigma \mathcal {L} _ {\mathrm {T C}}, \mathcal {L} _ {\mathcal {D}} = \frac {1}{2 N} \sum_ {i \in N} \left[ \log \mathcal {D} (\{\hat {\epsilon} _ {i t} \}) + \sum_ {i \in N ^ {\prime}} \log (1 - \mathcal {D} (\{\hat {\epsilon} _ {i t} ^ {\mathrm {p e r m}} \})) \right].
+$$
+
+The discussions of the hyperparameter selection and sensitivity analysis are in Appendix C.2.1.
+
+# 4 EXPERIMENTS
+
+We comparatively evaluate LEAP on a number of temporal datasets with the required assumptions satisfied or violated. We aim to answer the following questions:
+
+1. Does LEAP reliably learn temporally-causal latent processes from scratch under the proposed conditions? What is the contribution of each module in the architecture?
+2. Is history/nonstationary information necessary for the identifiability of latent causal variables?
+3. How do common assumptions in nonlinear ICA (i.e., independent sources or linear relations assumptions) distort identifiability if there are time-delayed causal relations between the latent factors, or if the latent processes are nonlinearly related?
+4. Does LEAP generalize when some critical assumptions in the proposed conditions are violated? For instance, how does it perform in the presence of instantaneous or changing causal influences?
+
+Evaluation Metrics To measure the identifiability of latent causal variables, we compute Mean Correlation Coefficient (MCC) on the validation dataset, a standard metric in the ICA literature for continuous variables. MCC reaches 1 when latent variables are perfectly identifiable up to permutation and componentwise invertible transformation in the noiseless case (we use Pearson correlation and rank correlation for linearly and nonlinearly related latent processes, respectively). To evaluate the recovery performance on causal relations, we use different approaches for (1) linear and (2) nonlinear transitions: (1) the entries of estimated state transition matrices are compared with the true ones after permutation, signs, and scaling are adjusted, and (2) the estimated causal skeleton is compared with the true data structure, and Structural Hamming Distance (SHD) is computed.
+
+Baselines and Ablation We experimented with three kinds of nonlinear ICA baselines: (1) BetaVAE (Higgins et al., 2016) and FactorVAE (Kim & Mnih, 2018) which ignore both history and nonstationarity information; (2) iVAE (Khemakhem et al., 2020) and TCL (Hyvarinen & Morioka, 2016) which exploit nonstationarity to establish identifiability, and (3) SlowVAE (Klindt et al., 2020) and PCL (Hyvarinen & Morioka, 2017) which exploit temporal constraints but assume independent sources. Model variants are built to disentangle the contributions of different modules. As in Table 2, we start with BetaVAE and add our proposed modules successively without any change on the training settings. Finally, (4), we fit our LEAP that uses linear transitions (LEAPVAR) with nonstationary data to show if linear relation assumptions distort identifiability.
+
+# 4.1 SYNTHETIC EXPERIMENTS
+
+We first design synthetic datasets with the properties required by NonParametric (NP) and parametric Vector AutoRegressive (VAR) conditions in Section 2.2. We set latent size $n = 8$ . The lag number of the process is set to $L = 2$ . The mixing function $g$ is a random three-layer MLP with LeakyReLU units. We give the data generation procedures for nonparametric conditions, parametric conditions, and five types of datasets that violate our assumptions separately in Appendix B.1.
+
+
+(a)
+
+
+(c)
+Figure 3: Results for synthetic nonparametric processes (NP) datasets: (a) MCC for causally-related factors; (b) recovered causal skeletons with $(\mathrm{SHD} = 5)$ ; (c) scatterplots between estimated and true factors; and (d) MCC trajectories comparisons between LEAP and baselines.
+
+
+(d)
+
+Main Results Fig. 3 gives the results on NP datasets. The latent processes are successfully recovered, as indicated by (a) high MCC for the casually-related factors and (b) the recovery of the causal relations $(\mathrm{SHD} = 5)$ . Panel (c) suggests that the latent causal variables are estimated up to permutation and componentwise invertible transformation. The comparisons with baselines are in (d). In general, the baselines that do not exploit history or nonstationarity cannot recover the latent processes. SlowVAE and PCL distort the results due to independent source assumptions. Interestingly, LEAP-VAR, which uses linear causal transitions, gains partial identifiability on NP datasets. This might promote the usage of linear components of transition signals to guide the learning of latent causal variables.
+
+The results for VAR datasets are in Fig. 4. Similarly, the latent processes are recovered, as indicated by (a) high MCC and (b) recovery of state transition matrices. The latent causal variables are estimated up to permutation and scaling (c). The baselines without using history or assume independent sources again fail to recover the latent processes (d). We show the contributions of different
+
+components of LEAP in Table 2. Causal process prior and nonstationary flow significantly improve identifiability. Noise discriminator further increases MCC and reduces variance. Note that we use a dense network without the input masks on the NP dataset for ablation studies, to validate that our proposed framework does not rely on sparse causal structure for latent causal discovery.
+
+Table 2: Contribution of each module to MCC.
+
+| Module | NP (Dense) | VAR |
| Baseline (β-VAE) | 0.446 ± 0.004 | 0.495 ± 0.007 |
| + Causal Process Prior | 0.721 ± 0.121 | 0.752 ± 0.035 |
| + Nonstationary Flow | 0.939 ± 0.008 | 0.935 ± 0.014 |
| + Noise Discriminator | 0.983 ± 0.002 | 0.978 ± 0.004 |
+
+Robustness We show the consequences of the violation of each of the assumptions on the synthetic datasets to mimic real situations. For VAR processes, we create datasets: (1) with causal relations changing over regime, and (2) with instantaneous causal relations, (3) with Gaussian noise, and (4) with low-rank state transition matrices. For NP processes, we violate (5) the sufficient variability by creating datasets with fewer than the required $2n + 1 = 17$ regimes. We fit LEAP on these datasets without any modification. Our framework can gain partial identifiability under (1,4) but violating (2) conditional independence and (3) non-Gaussianity distort the results obviously. Our approach, although designed to model nonstationarity by noise, can be extended to model changing causal relations. The partial identifiability of (4) is because the low-dimensional projections of the latent processes are recovered, as illustrated by a numerical example in Appendix A.2.4. For NP processes, nonstationarity is necessary for identifiability. Furthermore, the differences of the MCC trajectories under 15 and 20 regimes seem marginal, suggesting that our approach does not always require at least $2n + 1 = 17$ regimes to achieve full identifiability of the latent processes.
+
+
+(a)
+
+
+
+
+(b)
+(c)
+
+
+(d)
+
+
+Figure 5: MCC trajectories of LEAP for temporal data with clear assumption violations.
+
+
+Figure 4: Results for synthetic parametric processes (VAR) datasets: (a) MCC for causally-related factors; (b) scatterplots of the entries of $\mathbf{B}_{\tau}$ ; (c) scatterplots between estimated and true factors; and (4) MCC trajectories comparisons between LEAP and baselines.
+
+# 4.2 REAL-WORLD APPLICATIONS: PERCEPTUAL CAUSALITY
+
+Three public datasets including KiTTiMask (Klindt et al., 2020), Mass-Spring system (Li et al., 2020), and CMU MoCap database are used. The data descriptions are in Appendix B.2; depending on its property (e.g., whether it has multiple regimes), we apply the corresponding method. We first compare the MCC performances between our approach and the baselines on KiTTiMask and Mass-Spring system in Fig. 6. Our parametric method considerably outperforms the baselines that do not use history information. Because the true latent variables for CMU-MoCap are unknown, we visualize the latent traversals and the recovered skeletons in Appendix D.1, qualitatively comparing our nonparametric method with the baselines in terms of how intuitively sensible the recovered processes and skeletons are.
+
+
+Figure 6: MCC trajectories comparisons on KiTTiMasks and Mass-Spring system.
+
+
+
+Parametric Transition - KiTTiMask LEAP with VAR transitions is used. We set latent size $n = 10$ and the lag number $L = 1$ . The gap between our result and that by SlowVAE is relatively small, as seen in Fig. 6; this is because the latent processes on this dataset seem rather independent (according to the transition matrix learned by LEAP, given in Fig. 7(c)) and when the latent processes are independent, our VAR method reduces to SlowVAE, as its special case. As shown in Fig. 7, the latent causal processes are recovered, as seen from (a) high MCC for independent sources; (b) latent factors estimated up to componentwise transformation; (c) the estimated state transition matrix, which is almost diagonal (independent sources); and (d) latent traversals confirming that the three latent causal variables correspond to the vertical, horizontal, and scale of pedestrian masks.
+
+Parametric Transition - Mass-Spring System Mass-Spring system is a linear dynamical system with ball locations $(x_{t}^{i},y_{t}^{i})$ as state variables and lag number $L = 2$ . LEAP with VAR transitions is used. In Fig. 8, the time-delayed cross causal relations are recovered as: (a) causal variables keypoint $(x_{t}^{i},y_{t}^{i})$ are successfully estimated; (b) the spring connections between balls are recovered (SHD=0). Visualizations of recovery of latent variables and skeletons are showcased in Appendix D.2.
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+Figure 7: KiTTiMask dataset results: (a) MCC for independent sources; (b) scatterplots between estimated and true factors; (c) entries of $\mathbf{B}_1$ ; and (d) latent traversal on a fixed video frame.
+(a)
+Figure 8: Mass-Spring system results: (a) MCC for causally-related sources; (b) entries of $\mathbf{B}_{1,2}$ .
+
+
+(b)
+
+Nonparametric Transition - CMU-MoCap We fit LEAP with nonparametric transitions on 12 trials of motion capture data for subject 7 with 62 observed variables of skeleton-based measurements at each time step. The 12 trials contain walk cycles with slightly different dynamics (e.g., walk, slow walk, brisk walk). We set latent size $n = 8$ and lag number $L = 2$ . The differences between trials are modeled by nonstationary noise with one regime for each trial. The results are in Fig. 9. Three latent variables (which seem to be pitch, yaw, roll rotations, respectively) are found to explain most of the variances of human walk cycles (Panel c). The learned latent coordinates show smooth cyclic patterns with slight differences among trials (Panel a). Finally, we find that pitch (e.g., limb movement) and roll (e.g., shoulder movement) of human walking are coupled while yaw has independent dynamics (Panel b).
+
+
+(a)
+Figure 9: MoCap dataset results: (a) latent coordinates dynamics for 12 trials; (b) estimated skeleton; and (c) latent traversal by rendering the reconstructed point clouds into the video frame.
+
+
+(b)
+
+
+(c)
+
+# 5 CONCLUSION AND FUTURE WORK
+
+In this work, we proposed two provable conditions under which temporally causal latent processes can be identified from their observed nonlinear mixtures. The theories have been validated on a number of datasets with the properties required by the conditions. The main limitations of this work lie in our two major assumptions: (1) there is no instantaneous causal influence between latent causal processes, and (2) causal influences do not change across regimes. Both of them may not be true for some specific types of temporal data. The existence of instantaneous relations distorts identifiability results, but the amount of these relations can be controlled by time resolution. While we do not establish theories under changing causal relations, we have demonstrated through experiments the possibilities of generalizing our identifiability results to changing dynamics. Extending our identifiability theories and framework to accommodate such properties is our future directions.
+
+# 6 REPRODUCIBILITY STATEMENT
+
+Our code for the proposed framework and experiments can be found at https://github.com/weirayao/leap. For theoretical results, the assumptions and complete proof of the claims are in Appendix A. For synthetic experiments, the data generation process is described in Appendix B.1. The implementation details of our framework are given in Appendix C.
+
+# ACKNOWLEDGEMENT
+
+KZ would like to acknowledge the support by the National Institutes of Health (NIH) under Contract R01HL159805, by the NSF-Convergence Accelerator Track-D award #2134901, and by the United States Air Force under Contract No. FA8650-17-C7715. YS and CS would like to acknowledge the support by the National Key R&D Program of China (No. 2018AAA0101400), National Natural Science Foundation of China (No. 61921004), and the Natural Science Foundation of Jiangsu Province of China (No. BK20202006).
+
+# REFERENCES
+
+J. Adams, N. R. Hansen, and K. Zhang. Identification of partially observed linear causal models: Graphical conditions for the non-gaussian and heterogeneous cases. In Conference on Neural Information Processing Systems (NeurIPS), 2021.
+Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Rosemary Ke, Sébastien Lachapelle, Olexa Bilaniuk, Anirudh Goyal, and Christopher Pal. A meta-transfer objective for learning to disentangle causal mechanisms. arXiv preprint arXiv:1901.10912, 2019.
+David Maxwell Chickering. Optimal structure identification with greedy search. Journal of machine learning research, 3(Nov):507-554, 2002.
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnnc encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
+D. Danks and S. Plis. Learning causal structure from undersampled time series. In JMLR: Workshop and Conference Proceedings, pp. 1-10, 2013.
+Martijn de Jongh and Marek J Druzdzel. A comparison of structural distance measures for causal bayesian network models. *Recent Advances in Intelligent Information Systems*, Challenging Problems of Science, Computer Science series, pp. 443-456, 2009.
+Hadi Mohagheh Dolatabadi, Sarah Erfani, and Christopher Leckie. Invertible generative modeling using linear rational splines. In International Conference on Artificial Intelligence and Statistics, pp. 4236-4246. PMLR, 2020.
+M. Gong*, K. Zhang*, D. Tao, P. Geiger, and B. Schölkopf. Discovering temporal causal relations from subsampled data. In Proc. 32th International Conference on Machine Learning (ICML 2015), 2015.
+M. Gong, K. Zhang, B. Scholkopf, C. Glymour, and D. Tao. Causal discovery from temporally aggregated time series. In Proc. Conference on Uncertainty in Artificial Intelligence (UAI'17), 2017.
+Clive WJ Granger. Implications of aggregation with common factors. *Econometric Theory*, 3(02): 208-222, 1987.
+Hermanni Halva and Aapo Hyvarinen. Hidden markov nonlinear ica: Unsupervised learning from nonstationary time series. In Conference on Uncertainty in Artificial Intelligence, pp. 939-948. PMLR, 2020.
+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.
+
+Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
+Aapo Hyvarinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ica. Advances in Neural Information Processing Systems, 29:3765-3773, 2016.
+Aapo Hyvarinen and Hiroshi Morioka. Nonlinear ica of temporally dependent stationary sources. In Artificial Intelligence and Statistics, pp. 460-469. PMLR, 2017.
+Aapo Hyvarinen and Petteri Pajunen. Nonlinear independent component analysis: Existence and uniqueness results. Neural networks, 12(3):429-439, 1999.
+Aapo Hyvarinen, 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. PMLR, 2019.
+Nan Rosemary Ke, Olexa Bilaniuk, Anirudh Goyal, Stefan Bauer, Hugo Larochelle, Bernhard Scholkopf, Michael C Mozer, Chris Pal, and Yoshua Bengio. Learning neural causal models from unknown interventions. arXiv preprint arXiv:1910.01075, 2019.
+Ilyes Khemakhem, Diederik Kingma, Ricardo Monti, and Aapo Hyvarinen. Variational autoencoders and nonlinear ica: A unifying framework. In International Conference on Artificial Intelligence and Statistics, pp. 2207-2217. PMLR, 2020.
+Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pp. 2649-2658. PMLR, 2018.
+David Klindt, Lukas Schott, Yash Sharma, Ivan Ustyuzhaninov, Wieland Brendel, Matthias Bethge, and Dylan Paiton. Towards nonlinear disentanglement in natural data with temporal sparse coding. arXiv preprint arXiv:2007.10930, 2020.
+Tejas Kulkarni, Ankush Gupta, Catalin Ionescu, Sebastian Borgeaud, Malcolm Reynolds, Andrew Zisserman, and Volodymyr Mnih. Unsupervised learning of object keypoints for perception and control. arXiv preprint arXiv:1906.11883, 2019.
+Ismael Lemhadri, Feng Ruan, Louis Abraham, and Robert Tibshirani. Lassonet: A neural network with feature sparsity. Journal of Machine Learning Research, 22(127):1-29, 2021.
+Yunzhu Li, Antonio Torralba, Animashree Anandkumar, Dieter Fox, and Animesh Garg. Causal discovery in physical systems from videos. arXiv preprint arXiv:2007.00631, 2020.
+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, 2019.
+Kiyotoshi Matsuoka, Masahiro Ohoya, and Mitsuru Kawamoto. A neural net for blind separation of nonstationary signals. Neural networks, 8(3):411-419, 1995.
+Stanisław Mazur and Stanisław Ulam. Sur les transformations isométriques d'espaces vectoriels normés. CR Acad. Sci. Paris, 194(946-948):116, 1932.
+J. Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, Cambridge, 2000.
+Judea Pearl et al. Models, reasoning and inference. Cambridge, UK: Cambridge University Press, 19, 2000.
+Hans Reichenbach. The direction of time, volume 65. Univ of California Press, 1956.
+Shohei Shimizu, Patrik O Hoyer, Aapo Hyvarinen, Antti Kerminen, and Michael Jordan. A linear non-gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7(10), 2006.
+
+R. Silva, R. Scheines, C. Glymour, and P. Spirtes. Learning the structure of linear latent variable models. Journal of Machine Learning Research, 7:191-246, 2006.
+Peter Sorrenson, Carsten Rother, and Ullrich Köthe. Disentanglement by nonlinear ica with general incompressible-flow networks (gin). arXiv preprint arXiv:2001.04872, 2020.
+Charles Spearman. Pearson's contribution to the theory of two factors. *British Journal of Psychology*, 19:95–101, 1928.
+P. Spirtes, C. Glymour, and R. Scheines. Causation, Prediction, and Search. Spring-Verlag Lectures in Statistics, 1993.
+Peter Spirtes and Clark Glymour. An algorithm for fast recovery of sparse causal graphs. Social science computer review, 9(1):62-72, 1991.
+Peter L Spirtes, Christopher Meek, and Thomas S Richardson. Causal inference in the presence of latent variables and selection bias. arXiv preprint arXiv:1302.4983, 2013.
+Henning Sprekeler, Tiziano Zito, and Laurenz Wiskott. An extension of slow feature analysis for nonlinear blind source separation. The Journal of Machine Learning Research, 15(1):921-947, 2014.
+Feng Xie, Ruichu Cai, Biwei Huang, Clark Glymour, Zhifeng Hao, and Kun Zhang. Generalized independent noise condition for estimating latent variable causal graphs. arXiv preprint arXiv:2010.04917, 2020.
+Mengyue Yang, Furui Liu, Zhitang Chen, Xinwei Shen, Jianye Hao, and Jun Wang. Causalvae: disentangled representation learning via neural structural causal models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9593-9602, 2021.
+Kun Zhang and Aapo Hyvarinen. A general linear non-gaussian state-space model: Identifiability, identification, and applications. In *Asian Conference on Machine Learning*, pp. 113-128. PMLR, 2011.
+
+# Supplement to "Learning Temporally Causal Latent Processes from General Temporal Data"
+
+The supplementary materials are divided into five main sections. In Appendix A, we provide the explanations of each assumption and give the proof of the identifiability theory. We also give side-by-side comparisons, by providing the mathematical formulations of the closest works and making comparisons in terms of problem setups and critical assumptions. Finally, how the theory is connected to the training framework is discussed. In Appendix B, we provide the details of the synthetic and real-world datasets and explain the evaluation metrics. In Appendix C, we describe our network architecture, hyperparameters setting, and training details. The additional experiment results are given in Appendix D. The related work is summarized in Appendix E.
+
+# A Identifiability Theory 14
+
+A.1 Notation and Terminology 14
+A.2 Discussion of our Assumed Conditions 14
+
+A.2.1 Independent Noise (IN) Condition 14
+A.2.2 Nonstationary Noise and Sufficient Variability Condition 15
+A.2.3 Generalized Laplacian Noise Condition 16
+A.2.4 Nonsingular State Transitions Condition 16
+
+A.3 Proof of Identifiability Theory 17
+
+A.3.1 Preliminaries 17
+A.3.2 Proof of Theorem 1 18
+A.3.3 Proof of Theorem 2 20
+
+A.4 Comparisons with Existing Theories 22
+A.5 Connecting Theories to Model 23
+
+# BExperiment Settings 23
+
+B.1 Synthetic Dataset 23
+B.2 Real-world Dataset 24
+B.3 Evaluation Metrics 25
+
+# C Implementation Details 25
+
+C.1 Network Architecture 25
+C.2 Hyperparameters and Training Details 27
+
+C.2.1 Hyperparameter Selection and Sensitivity Analysis 27
+C.2.2 Training 29
+
+# D Additional Experiment Results 29
+
+D.1 Comparisons between LEAP and Baselines on CMU-Mocap Dataset 29
+D.2 Mass-Spring Systems 30
+
+# E Extended Related Work 31
+
+# A IDENTIFIABILITY THEORY
+
+# A.1 NOTATION AND TERMINOLOGY
+
+We summarize the notations used throughout the paper in Table A.1.
+
+Table A.1: List of notations.
+
+| Index |
| t | Time index |
| i, j | Variable element (channel) index |
| τ | Time lag index |
| perm | Random permuted variable index across the data batch |
| Variable |
| xt | Observation data |
| xt | Reconstructed observation |
| u | Auxiliary nonstationary regime variable |
| zt | Underlying sources |
| zHx | Time-delayed latent causal variables |
| Pa(zit) | Set of direct cause nodes/parents of node zit |
| et | Measurement error |
| H, H | Forward or backward embeddings in bidirectional RNN |
| σ(γ) | Soft mask vector |
| w | Modulation parameter vector |
| B | State transition matrix |
| εit | Process noise term |
| ˆit | Estimated process noise term |
| ẑit | Estimated sources |
| zit | True underlying sources |
| Function and Hyperparameter |
| p | Distribution function (e.g., pεit is the distribution of εit.) |
| g | Arbitrary nonlinear and injective mixing function |
| fi | Nonlinear transition function for zit |
| h | Indeterminancy mappings between zt andẑt |
| ri | Learned inverse transition function for residualˆi |
| si,u | Spline flow function for residualˆi in regime u |
| β, γ, σ | Weights in the augmented ELBO objective |
| n | Latent size |
| L | Maximum time lag |
| T | Total length of time series |
| π | Permutation operation |
| T | Component-wise invertible nonlinearities |
| q | Log density function |
| λ, α | Parameters of Laplacian distribution |
+
+# A.2 DISCUSSION OF OUR ASSUMED CONDITIONS
+
+We first explain and justify each critical assumption in the proposed conditions. We then discuss how restrictive or mild the conditions are in real applications.
+
+# A.2.1 INDEPENDENT NOISE (IN) CONDITION
+
+The IN condition was introduced in the Structural Equation Model (SEM), which represents effect $Y$ as a function of direct causes $X$ and noise $E$ :
+
+$$
+Y = f (X, E) \quad \text {w i t h} \quad \underbrace {X \perp E} _ {\text {}}. \tag {10}
+$$
+
+$$
+\text {I N}
+$$
+
+If $X$ and $Y$ do not have a common cause, as seen from the causal sufficiency assumption of structural equation models in Chapter 1.4.1 of Pearl's book (Pearl et al., 2000), the IN condition states that the unexplained noise variable $E$ is statistically independent of cause $X$ . IN is a direct result of assuming causal sufficiency in SEM. The main idea for the proof is that if IN is violated, then by the common cause principle (Reichenbach, 1956), there exist hidden confounders that cause their dependence, thus violating the causal sufficiency assumption. Furthermore, for a causally sufficient system with acyclic causal relations, the noise terms in different variables are mutually independent. The main idea is that when the noise terms are dependent, it is customary to encode such dependencies by augmenting the graph with hidden confounder variables (Pearl et al., 2000), which means that the system is not causally sufficient.
+
+In this paper, we assume the underlying latent processes form a casually-sufficient system without latent causal confounders. Then, the process noise terms $\epsilon_{it}$ are mutually independent, and moreover, the process noise terms $\epsilon_{it}$ are independent of direct cause/parent nodes $\mathbf{P}\mathbf{a}(z_{it})$ because of time information (the causal graph is acyclic because of the temporal precedence constraint).
+
+Applicability Loosely speaking, if there are no latent causal confounders in the (latent) causal processes and the sampling frequency is high enough to observe the underlying dynamics, then the IN condition assumed in this paper is satisfied in a causally-sufficient system and, moreover, there is no instantaneous causal influence (because of the high enough resolution). At the same time, we acknowledge that there exist situations where the resolution is low and there appears to be instantaneous dependence. However, there are several pieces of work dealing with causal discovery from measured time series in such situations; see. e.g., Granger (1987); Gong* et al. (2015); Danks & Plis (2013); Gong et al. (2017). In case there are instantaneous causal relations among latent causal processes, one would need additional sparsity or minimality conditions to recover the latent processes and their relations, as demonstrated in Silva et al. (2006); Adams et al. (2021). How to address the issue of instantaneous dependency or instantaneous causal relations in the latent processes will be one line of our future work.
+
+# A.2.2 NONSTATIONARY NOISE AND SUFFICIENT VARIABILITY CONDITION
+
+Nonstationary Noise For nonparametric processes, temporal constraints are not sufficient for the identification of latent causal transition dynamics whose functional or distributional form is not constrained. Otherwise, there is no need for Theorem 2 to assume the generalized Laplacian noise and the full-rankness of state transitions at all. In this paper, an alternative way is to exploit the (temporal) nonstationarity of the data caused by changing noise distribution (hence called nonstationary noise condition). We assume the functions of the temporal causal influences denoted by $f_{i}$ remain the same across across the $|\mathbf{u}|$ regimes or domains of data we have observed, but the distributions $p_{\epsilon_i|\mathbf{u}}$ , of noise terms that serve as arguments to the structural equation models, may change. One special case of this principle uses nonstationary variances, i.e., the noise variances change across nonstationary regimes. This kind of perturbation has been widely used in linear ICA (Matsuoka et al., 1995). Additionally, the nonstationary noise condition in this paper allows for any kinds of modulation of noise distribution by nonstationary regimes $\mathbf{u}$ , such as changing distributional forms, scale, and location by $\mathbf{u}$ , as long as the modulated sources satisfy sufficient variability condition described below.
+
+Sufficient Variability The sufficient variability condition was introduced in GCL (Hyvarinen et al., 2019) to extend the modulated exponential families (Hyvarinen & Morioka, 2016) to general modulated distributions. Essentially, the condition says that the nonstationary regimes $\mathbf{u}$ must have a sufficiently complex and diverse effect on the transition distributions. In other words, if the underlying distributions are composed of relatively many domains of data, the condition generally holds true. For instance, in the linear Auto-Regressive (AR) model with Gaussian innovations where only the noise variance changes, the condition reduces to the statement in (Matsuoka et al., 1995) that the variance of each noise term fluctuates somewhat independently of each other in different nonstationary regimes. Then the condition is easily attained if the variance vector of noise terms in any regime is not a linear combination of variance vectors of noise terms in other regimes.
+
+We further illustrate the condition using the example of modulated conditional exponential families in (Hyvarinen et al., 2019). Let the log-pdf $q(\mathbf{z}_t|\{\mathbf{z}_{t - \tau}\} ,\mathbf{u})$ be a conditional exponential family
+
+distribution of order $k$ given nonstationary regime $\mathbf{u}$ and history $\mathbf{z}_{\mathrm{Hx}} = \{\mathbf{z}_{t - \tau}\}$ :
+
+$$
+q \left(z _ {i t} \mid \mathbf {z} _ {\mathrm {H x}}, \mathbf {u}\right) = q _ {i} \left(z _ {i t}\right) + \sum_ {j = 1} ^ {k} q _ {i j} \left(z _ {i t}\right) \lambda_ {i j} \left(\mathbf {z} _ {\mathrm {H x}}, \mathbf {u}\right) - \log Z \left(\mathbf {z} _ {\mathrm {H x}}, \mathbf {u}\right), \tag {11}
+$$
+
+where $q_{i}$ is the base measure, $q_{ij}$ is the function of the sufficient statistic, $\lambda_{ij}$ is the natural parameter, and $\log Z$ is the log-partition. Loosely speaking, the sufficient variability holds if the modulation of by $\mathbf{u}$ on the conditional distribution $q(z_{it}|\mathbf{z}_{\mathrm{Hx}},\mathbf{u})$ is not too simple in the following sense:
+
+1. Higher order of $k$ ( $k > 1$ ) is required. If $k = 1$ , the sufficient variability cannot hold;
+2. The modulation impacts $\lambda_{ij}$ by $\mathbf{u}$ must be linearly independent across regimes $\mathbf{u}$ . The sufficient statistics functions $q_{ij}$ cannot be all linear, i.e., we require higher-order statistics.
+
+Further details of this example can be found in Appendix B of (Hyvarinen et al., 2019). In summary, we need the modulation by $\mathbf{u}$ to have diverse (i.e., distinct influences) and complex impacts on the underlying data generation process.
+
+Applicability The nonstationarity of process noise seems to be prominent in many kinds of temporal data. For example, nonstationary variances are seen in EEG/MEG, natural video, and closely related to changes in volatility in financial time series (Hyvarinen & Morioka, 2016). As we assume the transition functions $f_{i}$ are fixed across regimes, the data that most likely satisfy the proposed condition is a collection of multiple trials/segments of data with slightly different temporal dynamics in between, where the differences can be well modeled by different noise distributions. For instance, in MEG data, temporal nonstationarity can be modeled by segmenting the measured data into different sessions (e.g., stimuli, rest, etc.) where the session index modulates the noise variance.
+
+# A.2.3 GENERALIZED LAPLACIAN NOISE CONDITION
+
+In the parametric (VAR) processes in Theorem 2, we exploit the non-Gaussianity of noise perturbations to achieve identifiability. Specifically, we constrain the process noise distribution to be within the generalized Laplacian distribution family in this paper. This L1-sparse temporal prior is motivated by the natural statistics of video data, where the uncertainty could have sharp impacts on some latent factors, but most other factors are not perturbed between two adjacent frames. This transition prior has strong connections with slow feature analysis (Sprekeler et al., 2014; Klindt et al., 2020) which measures slowness in terms of the L2 distance between temporally adjacent encodings as temporal constraints for nonlinear ICA. Note that although the Laplacian-like distributional form is pre-defined, the generalized Laplacian distribution can still be used to fit a broad family of perturbations with different shapes by changing $\alpha$ and $\lambda$ of the distribution.
+
+Applicability L1-sparse transition priors are widely used to model video datasets and natural scene measurements. This condition is applicable to video datasets where the external factors have sharp effects on some but not all latent factors in two adjacent frames.
+
+# A.2.4 NONSINGULAR STATE TRANSITIONS CONDITION
+
+Nonsingularity is a standard assumption made in the previous studies (Zhang & Hyvarinen, 2011) to achieve identifiability of linear state-space models. We give a two-dimensional low-rank vector autoregressive (VAR) process example below to illustrate the concept. Define a low-rank VAR process with time lag $L = 1$ below:
+
+$$
+\mathbf {z} _ {t} = \mathbf {B} \mathbf {z} _ {t - 1} + \epsilon_ {t} \quad w i t h \quad \mathbf {B} = \left[ \begin{array}{c c} a & b \\ \alpha \times a & \alpha \times b \end{array} \right] = \left[ \begin{array}{l} 1 \\ \alpha \end{array} \right] \times [ a \quad b ], \tag {12}
+$$
+
+where $\mathbf{z}_t = [z_{1t}, z_{2t}]^\top$ and $\epsilon_t = [\epsilon_{1t}, \epsilon_{2t}]^\top$ . Multiplying both sides of the VAR process with a row vector $[a, b]$ , we have:
+
+$$
+\begin{array}{l} \underbrace {\left[ \begin{array}{l l} a & b \end{array} \right] \times \mathbf {z} _ {t}} _ {\tilde {\mathbf {z}} _ {t}} = \left[ \begin{array}{l l} a & b \end{array} \right] \times \left[ \begin{array}{l} 1 \\ \alpha \end{array} \right] \times \left[ \begin{array}{l l} a & b \end{array} \right] \mathbf {z} _ {t - 1} + \left[ \begin{array}{l l} a & b \end{array} \right] \times \epsilon_ {t} (13) \\ = (a + b \alpha) \underbrace {\left[ \begin{array}{l l} a & b \end{array} \right] \times \mathbf {z} _ {t - 1}} _ {\tilde {\mathbf {z}} _ {t - 1}} + \underbrace {\left[ \begin{array}{l l} a & b \end{array} \right] \times \epsilon_ {t}} _ {\tilde {\epsilon} _ {t}}. (14) \\ \end{array}
+$$
+
+Hence, the two-dimensional VAR process reduces to a single linear AR process with $\tilde{\mathbf{z}}_t = [a\quad b]\times$ $\mathbf{z}_t = az_{1t} + bz_{2t}$ and $\tilde{\epsilon}_{t} = [a\quad b]\times \epsilon_{t} = a\epsilon_{1t} + b\epsilon_{2t}$ , which is a linear combination of the original two processes. In this case, we cannot recover $\mathbf{z}_t$ at all, but only the linear combination $\tilde{\mathbf{z}}_t$ .
+
+In summary, when the state transition matrices are not of full rank, there exist low-dimensional projections of the underlying latent processes that satisfy the observational equivalence everywhere. By assuming the nonsingular state transitions, one could prevent from recovering low-dimensional projections of latent causal factors and time-delayed relations.
+
+# A.3 PROOF OF IDENTIFIABILITY THEORY
+
+# A.3.1 PRELIMINARIES
+
+Equivalent Relations on Latent Space Our proof of identifiability starts from deriving relations on estimated latent space from observational equivalence: the joint distribution $p_{\hat{g},\hat{f},\hat{p}_{\epsilon}}(\mathbf{x}_{\mathrm{Hx}},\mathbf{x}_t)$ matches $p_{g,f,p_{\epsilon}}(\mathbf{x}_{\mathrm{Hx}},\mathbf{x}_t)$ everywhere. Note that we consider only one future time step $\mathbf{x}_t$ for simplicity as the joint probability of the whole sequence can be decomposed into product of these terms. Since the learned mixing function $\mathbf{x}_t = \hat{g} (\mathbf{z}_t)$ can be written as $\mathbf{x}_t = (g\circ (g)^{-1}\circ \hat{g})(\mathbf{z}_t)$ because of injective properties of $(g,\hat{g})$ , we can see that $\hat{g} = g\circ ((g)^{-1}\circ \hat{g}) = g\circ h$ for some function $h = (g)^{-1}\circ \hat{g}$ on the latent space. Our goal here is really to show that this function $h$ , which represents the indeterminacy of the learned latent space, is a permutation with component-wise nonlinearities. It has been proved in (Klindt et al., 2020) that:
+
+1. Indeterminancy $h$ on latent space can only be a bijection on the latent space if both $g$ and $\hat{g}$ are injective functions, and $h$ preserves the prior distribution in the latent space. The proofs are in Appendix A.1 of (Klindt et al., 2020) on Page 18;
+2. Eq. 15 can be directly derived from observational equivalence using the injective properties of $(g,\hat{g})$ . The proofs are in Appendix A.1 of (Klindt et al., 2020) on Page 19:
+
+$$
+p \left(\mathbf {z} _ {t} \mid \left\{\mathbf {z} _ {t - \tau} \right\}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}\right) \frac {p \left(\mathbf {z} _ {t}\right)}{p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right)} \quad \forall \left(\mathbf {z} _ {t}, \left\{\mathbf {z} _ {t - \tau} \right\}\right). \tag {15}
+$$
+
+Identifiability of Linear Non-Gaussian State-Space Model Linear State Space Model (SSM) defined below has been proved to be fully identifiable in (Zhang & Hyvarinen, 2011) when both the process noise $\epsilon_{t}$ and measurement error $\mathbf{e}_t$ are temporally white and independent of each other, and at most one component of the process noise $\epsilon_{t}$ is Gaussian. The observation error $\mathbf{e}_t$ can be either Gaussian or non-Gaussian:
+
+$$
+\mathbf {x} _ {t} = \mathbf {A} \mathbf {z} _ {t} + \mathbf {e} _ {t}, \tag {16}
+$$
+
+$$
+\mathbf {z} _ {t} = \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} + \epsilon_ {t}. \tag {17}
+$$
+
+We will make use of this property of linear non-Gaussian SSM for deriving Theorem 2. The main idea is if we can prove $h$ of parametric conditions (which also has vector autoregressive processes as in Eq. 17 with non-Gaussian noise) is within affine transformations, the componentwise identifiability of true latent variables can be directly derived because we can treat the affine indeterminacy as a "high-level" affine mixing of sources same as $\mathbf{A}$ in Eq. 16 without measurement error.
+
+# A.3.2 PROOF OF THEOREM 1
+
+Theorem A.1 (Nonparametric Processes) Assume nonparametric processes in Eq. 18, where the transition functions $f_{i}$ are third-order differentiable functions and mixing function $g$ is injective and differentiable almost everywhere; let $\mathbf{Pa}(z_{it})$ denote the set of (time-delayed) parent nodes of $z_{it}$ :
+
+$$
+\underbrace {\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right)} _ {\text {N o n l i n e a r m i x i n g}}, \quad \underbrace {z _ {i t} = f _ {i} \left(\left\{z _ {j , t - \tau} \mid z _ {j , t - \tau} \in \mathbf {P a} \left(z _ {i t}\right) \right\} , \epsilon_ {i t}\right)} _ {\text {N o n p a r a m e t r i c t r a n s i t i o n}} \text {w i t h} \underbrace {\epsilon_ {i t} \sim p _ {\epsilon_ {i} | \mathbf {u}}} _ {\text {N o n s t a t i o n a r y n o i s e}}. \tag {18}
+$$
+
+Here we assume:
+
+1. (Nonstationary Noise): Noise distribution $p_{\epsilon_z|\mathbf{u}}$ is modulated (in any way) by the observed categorical auxiliary variables $\mathbf{u}$ , which denotes nonstationary regimes or domain index;
+2. (Independent Noise): The noise terms $\epsilon_{it}$ are mutually independent (i.e., spatially and temporally independent) in each regime of $\mathbf{u}$ (note that this directly implies that $\epsilon_{it}$ are independent from $\mathbf{Pa}(z_{it})$ in each regime);
+3. (Sufficient Variability): For any $\mathbf{z}_t \in \mathbb{R}^n$ there exist $2n + 1$ values for $\mathbf{u}$ , i.e., $\mathbf{u}_j$ with $j = 0,1,\dots,2n$ , such that the $2n$ vectors $\mathbf{w}(\mathbf{z}_t, \mathbf{u}_{j+1}) - \mathbf{w}(\mathbf{z}_t, \mathbf{u}_j)$ , with $j = 0,1,\dots,2n$ , are linearly independent with $\mathbf{w}(\mathbf{z}_t, \mathbf{u})$ defined below, where $q_i$ is the log density of the conditional distribution and $\mathbf{z}_{Hx} = \{\mathbf{z}_{t-\tau}\}$ denotes history information up to maximum time lag $L$ :
+
+$$
+\mathbf {w} (\mathbf {z} _ {t}, \mathbf {u}) \triangleq \left(\frac {\partial q _ {1} (z _ {1 t} | \mathbf {z} _ {H x} , \mathbf {u})}{\partial z _ {1 t}}, \dots , \frac {\partial q _ {n} (z _ {n t} | \mathbf {z} _ {H x} , \mathbf {u})}{\partial z _ {n t}}, \frac {\partial^ {2} q _ {1} (z _ {1 t} | \mathbf {z} _ {H x} , \mathbf {u})}{\partial z _ {1 t} ^ {2}}, \dots , \frac {\partial^ {2} q _ {n} (z _ {n t} | \mathbf {z} _ {H x} , \mathbf {u})}{\partial z _ {n t} ^ {2}}\right). \tag {19}
+$$
+
+Then the componentwise identifiability property of temporally causal latent processes is ensured.
+
+Proof: We first extend Eq. 15 to include conditioning on the nonstationary regime $\mathbf{u}$ . We then show that if sufficient variability condition is satisfied, the indeterminancy function $h$ can only be permutation with component-wise nonlinearities.
+
+Step 1 We first derive equivalent relations on the latent space by conditioning on the nonstationary regime $\mathbf{u}$ . This can be directly achieved by applying the change of variable formula on the $L + 1$ invertible maps: $\mathbf{z}_t \Rightarrow h^{-1}(\mathbf{z}_t)$ , $\mathbf{z}_{t-1} \Rightarrow h^{-1}(\mathbf{z}_{t-1})$ , ..., $\mathbf{z}_{t-L} \Rightarrow h^{-1}(\mathbf{z}_{t-L})$ . W.l.o.g, let's assume $L = 1$ for now. We then have the following three equalities:
+
+$$
+p \left(\mathbf {z} _ {t}, \mathbf {z} _ {t - 1}, \mathbf {u}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right), h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right), \mathbf {u}\right) \left| \det \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t}\right)}{\partial \mathbf {z} _ {t}} \right| \left| \det \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)}{\partial \mathbf {z} _ {t - 1}} \right|, \tag {20}
+$$
+
+$$
+p \left(\mathbf {z} _ {t}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right) \left| \det \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t}\right)}{\partial \mathbf {z} _ {t}} \right|, \tag {21}
+$$
+
+$$
+p \left(\mathbf {z} _ {t - 1}, \mathbf {u}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right), \mathbf {u}\right) \left| \det \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)}{\partial \mathbf {z} _ {t - 1}} \right|. \tag {22}
+$$
+
+Solving for the determinant terms in Eq. 21 and Eq. 22 and plugging them into Eq. 20, we have:
+
+$$
+p \left(\mathbf {z} _ {t} \mid \mathbf {z} _ {t - 1}, \mathbf {u}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right), \mathbf {u}\right) \frac {p \left(\mathbf {z} _ {t}\right)}{p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right)}. \tag {23}
+$$
+
+It is straightforward to see that this relation holds for multiple time lags where $L > 1$ . We take logs on both sides, and we now define $\bar{q}(\mathbf{z}_t) \triangleq q(\mathbf{z}_t)$ as the marginal log-density of the components $\mathbf{z}_t$ when $\mathbf{u}$ is integrated out. We then have:
+
+$$
+q \left(\mathbf {z} _ {t} \mid \left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right) - q \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid h ^ {- 1} \left(\left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right)\right) = \bar {q} \left(\mathbf {z} _ {t}\right) - \bar {q} \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right), \tag {24}
+$$
+
+and using the Independent Noise (IN) assumption, the conditional log-pdf $q(\mathbf{z}_t|\{\mathbf{z}_{t - \tau}\} ,\mathbf{u})$ and its estimated version $q(h^{-1}(\mathbf{z}_t)|\{h^{-1}(\mathbf{z}_{t - \tau})\} ,\mathbf{u})$ are conditional independent (note this has been enforced in causal process network as constraints) and LHS can be factorized as:
+
+$$
+\sum_ {i} q _ {i} \left(z _ {i t} \mid \left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right) - q _ {i} \left(\left[ h ^ {- 1} (\mathbf {z} _ {t}) \right] _ {i} \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) = \bar {q} (\mathbf {z} _ {t}) - \bar {q} \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right). \tag {25}
+$$
+
+where $\bar{q}$ is the marginal log-density of the components $\mathbf{z}_t$ when $\mathbf{u}$ is integrated out and it does not need to be factorial.
+
+Step 2 Now we do the following simplification of notations. Let $h_i^{-1}(\mathbf{z}_t) = \left[h^{-1}(\mathbf{z}_t)\right]_i$ . Denote the first-order and second-order derivatives by a superscript as:
+
+$$
+q _ {i} ^ {1} \left(z _ {i t} | \left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right) = \frac {\partial q _ {i} \left(z _ {i t} \mid \left\{\mathbf {z} _ {t - \tau} \right\} , \mathbf {u}\right)}{\partial z _ {i t}}, \tag {26}
+$$
+
+$$
+q _ {i} ^ {2} \left(z _ {i t} \mid \left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right) = \frac {\partial^ {2} q _ {i} \left(z _ {i t} \mid \left\{\mathbf {z} _ {t - \tau} \right\} , \mathbf {u}\right)}{\partial z _ {i t} ^ {2}}, \tag {27}
+$$
+
+and take derivatives of both sides of Eq. 25 with respect to $z_{jt}$ , we have:
+
+$$
+q _ {j} ^ {1} \left(z _ {j t} \mid \left\{\mathbf {z} _ {t - \tau} \right\}, \mathbf {u}\right) - \sum_ {i = 1} ^ {n} q _ {i} ^ {1} \left(h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) \frac {\partial h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right)}{\partial z _ {j t}} \tag {28}
+$$
+
+$$
+= \bar {q} ^ {j} (\mathbf {z} _ {t}) - \sum_ {i} \bar {q} ^ {j} \left(h _ {i} ^ {- 1} (\mathbf {z} _ {t})\right) \frac {\partial h _ {i} ^ {- 1} (\mathbf {z} _ {t})}{\partial z _ {j t}}. \tag {29}
+$$
+
+Denote the first order derivative of $h^{-1}$ as $v_{i}^{j}(\mathbf{z}_{t}) = \frac{\partial h_{i}^{-1}(\mathbf{z}_{t})}{\partial z_{j t}}$ and $v_{i}^{jj^{\prime}}(\mathbf{z}_{t})$ is the second-order derivative with respect to a different component $z_{j't}$ for any $j \neq j'$ . Taking another derivative with respect to $z_{j't}$ on both sides of Eq. 29, the first term on LHS vanishes and we have:
+
+$$
+\sum_ {i} q _ {i} ^ {1 1} \left(h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) v _ {i} ^ {j} \left(\mathbf {z} _ {t}\right) v _ {i} ^ {j ^ {\prime}} \left(\mathbf {z} _ {t}\right) + q _ {i} ^ {1} \left(h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) v _ {i} ^ {j j ^ {\prime}} \left(\mathbf {z} _ {t}\right) = c ^ {j j ^ {\prime}}. \tag {30}
+$$
+
+where $c^{jj'}$ denotes the derivatives of RHS of Eq. 29 which does not depend on $\mathbf{u}$ . Same as (Hyvarinen et al., 2019), we collect all these equations in vector form by defining $\mathbf{a}_i(y)$ as a vector collecting all entries $v_i^j(\mathbf{z}_t)v_i^{j'}(\mathbf{z}_t)$ for $j \in [1, n]$ and $j' \in [1, j-1]$ . We omit diagonal terms, and by symmetry, take only one half of the indices. Likewise, collect all the entries $v_i^{jj'}(\mathbf{z}_t)$ for $j \in [1, n]$ and $j' \in [1, j-1]$ in the vector $\mathbf{b}(\mathbf{z}_t)$ . All the entries of $c^{jj'}$ are in $\mathbf{c}(\mathbf{z}_t)$ . These $n(n-1)/2$ equations can be written a single system of equations:
+
+$$
+\sum_ {i} \mathbf {a} _ {i} (y) q _ {i} ^ {1 1} \left(h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) + \mathbf {b} _ {i} \left(\mathbf {z} _ {t}\right) q _ {i} ^ {1} \left(h _ {i} ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid \left\{h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) \right\}, \mathbf {u}\right) = \mathbf {c} \left(\mathbf {z} _ {t}\right). \tag {31}
+$$
+
+Now, collect the a and b into a matrix M:
+
+$$
+\mathbf {M} (\mathbf {z} _ {t}) = \left(\mathbf {a} _ {1} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {a} _ {n} \left(\mathbf {z} _ {t}\right), \mathbf {b} _ {i} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {b} _ {n} \left(\mathbf {z} _ {t}\right)\right). \tag {32}
+$$
+
+Eq. 31 takes the form of the following linear system:
+
+$$
+\mathbf {M} (\mathbf {z} _ {t}) \mathbf {w} (\mathbf {z} _ {t}, \mathbf {u}) = \mathbf {c} (\mathbf {z} _ {t}), \tag {33}
+$$
+
+where $\mathbf{w}$ are the vectors defined in the sufficient variability assumption, and $\mathbf{w}$ is defined for any input $\mathbf{z}_t$ . Notice that the RHS of the linear system does not depend on $\mathbf{u}$ , so we fix $\mathbf{z}_t$ and consider the $2n + 1$ points $\mathbf{u}$ given for that $\mathbf{z}_t$ by the sufficient variability assumption.
+
+Collect Eq. 33 above for $2n$ points starting from index 1:
+
+$$
+\mathbf {M} \left(\mathbf {z} _ {t}\right) \left(\mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {1}\right), \dots , \mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {2 n}\right)\right) = \left(\mathbf {c} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {1}\right)\right), \tag {34}
+$$
+
+$$
+\mathbf {M} (\mathbf {z} _ {t}) \left(\mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {0}\right), \dots , \mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {2 n - 1}\right)\right) = \left(\mathbf {c} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {w} \left(\mathbf {z} _ {t}, \mathbf {u} _ {1}\right)\right). \tag {35}
+$$
+
+Subtract Eq. 35 from Eq. 34, we then have:
+
+$$
+\mathbf {M} \left(\mathbf {z} _ {t}\right) \underbrace {\left[ \mathbf {w} \left(\mathbf {z} _ {t} , \mathbf {u} _ {1}\right) - \mathbf {w} \left(\mathbf {z} _ {t} , \mathbf {u} _ {0}\right) , \dots , \mathbf {w} \left(\mathbf {z} _ {t} , \mathbf {u} _ {2 n}\right) - \mathbf {w} \left(\mathbf {z} _ {t} , \mathbf {u} _ {0}\right) \right]} _ {\mathbf {W}} = \mathbf {0}. \tag {36}
+$$
+
+By the suffienct variability assumption, the matrix $\mathbf{W}$ that has linearly independent columns and is a square matrix so is nonsingular. The only solution to the linear system above is thus:
+
+$$
+\mathbf {M} (\mathbf {z} _ {t}) = \left(\mathbf {a} _ {1} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {a} _ {n} \left(\mathbf {z} _ {t}\right), \mathbf {b} _ {i} \left(\mathbf {z} _ {t}\right), \dots , \mathbf {b} _ {n} \left(\mathbf {z} _ {t}\right)\right) = \mathbf {0}. \tag {37}
+$$
+
+Following (Hyvarinen et al., 2019), $\mathbf{a}(\mathbf{z}_t)$ being zero implies no row of the Jacobian of $h^{-1}(\mathbf{z}_t)$ can have more than one non-zero entry. This holds for any $\mathbf{z}_t$ . By continuity of the Jacobian and its invertibility, the non-zero entries in the Jacobian must be in the same places for all $\mathbf{z}_t$ : If they switched places, there would have to be a point where the Jacobian is singular, which would contradict the bijection properties of $h^{-1}$ derived in Section A.3.1. This means that each $h_i^{-1}(\mathbf{z}_t)$ is a function of only one $z_{kt}$ for $k \in [1, n]$ . The bijection $h^{-1}$ also implies that each of the componentwise functions is invertible. Thus, we have proven that latent variables are identifiable up to permutation and componentwise invertible transformations and temporally causal latent processes with conditions required by Theorem 1 are proved to be identifiable from observed variables.
+
+# A.3.3 PROOF OF THEOREM 2
+
+Theorem A.2 (Parametric Processes) Assume the vector autoregressive process in Eq. 38, where the state transition functions are linear and additive and mixing function $g$ is injective and differentiable almost everywhere. Let $\mathbf{B}_{\tau} \in \mathbb{R}^{n \times n}$ be the state transition matrix at lag $\tau$ . The process noises $\epsilon_{it}$ are assumed to be stationary and both spatially and temporally independent:
+
+$$
+\underbrace {\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right)} _ {\text {N o n l i n e a r m i x i n g}}, \quad \underbrace {\mathbf {z} _ {t} = \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} + \epsilon_ {t}} _ {\text {L i n e a r a d d i t i v e t r a n s i t i o n}} \text {w i t h} \underbrace {\epsilon_ {i t} \sim p _ {\epsilon_ {i}}} _ {\text {I n d e p e n d e n t n o i s e}}. \tag {38}
+$$
+
+Here we assume:
+
+1. (Generalized Laplacian Noise): Process noises $\epsilon_{it} \sim p_{\epsilon_i}$ are mutually independent and follow the generalized Laplacian distribution $p_{\epsilon_i} = \frac{\alpha_i \lambda_i}{2 \Gamma(1 / \alpha_i)} \exp \left(-\lambda_i |\epsilon_i|^\alpha_i\right)$ with $\alpha_i < 2$ ;
+2. (Nonsingular State Transitions): For at least one $\tau$ , the state transition matrix $\mathbf{B}_{\tau}$ is of full rank.
+
+Then the componentwise identifiability property of temporally causal latent processes is ensured.
+
+Proof: The following proof is inspired by Theorem 1 in (Klindt et al., 2020). The key differences are (i) allowing temporal causal relations $\mathbf{B}_{\tau}$ among the sources instead of independent sources assumption, (ii) extending the single time lag restriction to multiple time lags case.
+
+Identifiability on Causally-Related Sources Let us start from the simple case where the time lag $\tau = 1$ . In this case, the transition dynamic in Eq. 38 can be simplified as
+
+$$
+\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right), \quad \mathbf {z} _ {t} = \mathbf {B} \mathbf {z} _ {t - 1} + \epsilon_ {t}. \tag {39}
+$$
+
+Using Eq. 15 and by applying the distributional forms of generalized Laplacian noise, we have:
+
+$$
+\begin{array}{l} p \left(\mathbf {z} _ {t} \mid \mathbf {z} _ {t - 1}\right) = p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) \mid h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)\right) \frac {p \left(\mathbf {z} _ {t}\right)}{p \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right)\right)} \tag {40} \\ \Longrightarrow \quad M | | \mathbf {z} _ {t} - \mathbf {B z} _ {t - 1} | | _ {\alpha} ^ {\alpha} - N | | h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h ^ {- 1} (\mathbf {z} _ {t - 1}) | | _ {\alpha} ^ {\alpha} = \log \frac {p (\mathbf {z} _ {t})}{p (h ^ {- 1} (\mathbf {z} _ {t}))}, \\ \end{array}
+$$
+
+where $M$ and $N$ are the constants appearing in the exponentials in $p(\mathbf{z}_t|\mathbf{z}_{t - 1})$ and $p(h^{-1}(\mathbf{z}_t)|h^{-1}(\mathbf{z}_{t - 1}))$ .
+
+Taking the derivative w.r.t $\mathbf{z}_{t - 1}$ on both sides, we obtain
+
+$$
+\frac {\partial \left\| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \right\| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}} = \frac {\partial \left\| h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right) \right\| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}}. \tag {41}
+$$
+
+For the left hand of the Eq. 41, we can derive
+
+$$
+\begin{array}{l} \frac {\partial \left\| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \right\| _ {\alpha} ^ {\alpha}}{\partial \left\| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \right\| _ {\alpha}} \frac {\partial \left\| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \right\| _ {\alpha}}{\partial \mathbf {z} _ {t - 1}} = \frac {\partial \left\| h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h ^ {- 1} (\mathbf {z} _ {t - 1}) \right\| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}} \\ \Longrightarrow \quad \alpha \| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \| _ {\alpha} ^ {\alpha - 1} \frac {\partial \| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \| _ {\alpha}}{\partial \mathbf {z} _ {t - 1}} = \frac {\partial \| h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h ^ {- 1} (\mathbf {z} _ {t - 1}) \| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}} \\ \Longrightarrow \quad \alpha \| \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} \| _ {\alpha} ^ {\alpha - 1} \frac {\partial \| \epsilon_ {t} \| _ {\alpha}}{\partial \epsilon_ {t}} \frac {\partial \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1}}{\partial \mathbf {z} _ {t - 1}} = \frac {\partial \| h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h ^ {- 1} (\mathbf {z} _ {t - 1}) \| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}} \tag {42} \\ \Longrightarrow \quad - \alpha | | \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} | | _ {\alpha} ^ {\alpha - 1} \frac {\partial | | \epsilon_ {t} | | _ {\alpha}}{\partial \epsilon_ {t}} \mathbf {B} = \frac {\partial | | h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h ^ {- 1} (\mathbf {z} _ {t - 1}) | | _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}} \\ \Rightarrow - \alpha (\mathbf {z} _ {t} - \mathbf {B z} _ {t - 1}) \odot | \mathbf {z} _ {t} - \mathbf {B z} _ {t - 1} | ^ {\alpha - 2} \mathbf {B} = \frac {\partial | | h ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B h} ^ {- 1} (\mathbf {z} _ {t - 1}) | | _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - 1}}. \\ \end{array}
+$$
+
+Making the same derivation process on the right hand, we obtain
+
+$$
+\begin{array}{l} - \alpha (\mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1}) \odot | \mathbf {z} _ {t} - \mathbf {B} \mathbf {z} _ {t - 1} | ^ {\alpha - 2} \mathbf {B} \\ = - \alpha \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)\right) \odot | h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right) | ^ {\alpha - 2} \mathbf {B} \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)}{\mathbf {z} _ {t - 1}}. \tag {43} \\ \end{array}
+$$
+
+For any $\mathbf{z}_t$ we can choose $\mathbf{z}_t = \mathbf{B}\mathbf{z}_{t - 1}$ and thus the Eq. 43 can be written as:
+
+$$
+\left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)\right) \odot | h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right) | ^ {\alpha - 2} \mathbf {B} \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)}{\mathbf {z} _ {t - 1}} = \mathbf {0}. \tag {44}
+$$
+
+Considering the nonsingularity of matrix $\mathbf{B}$ (by assumption) and bijection of $h$ , we can derive
+
+$$
+\begin{array}{l} \left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right)\right) \odot \left| h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right) \right| ^ {\alpha - 2} = \mathbf {0} \\ \Rightarrow \quad (h _ {i} ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h _ {i} ^ {- 1} (\mathbf {z} _ {t - 1})) | h _ {i} ^ {- 1} (\mathbf {z} _ {t}) - \mathbf {B} h _ {i} ^ {- 1} (\mathbf {z} _ {t - 1}) | ^ {\alpha - 2} = 0. \\ \end{array}
+$$
+
+for all $i = 1,\dots ,d$ . Apparently $h^{-1}(\mathbf{z}_t) = \mathbf{B}h^{-1}(\mathbf{z}_{t - 1})$ is the only solution, thus
+
+$$
+h ^ {- 1} \left(\mathbf {B} \mathbf {z} _ {t - 1}\right) = \mathbf {B} h ^ {- 1} \left(\mathbf {z} _ {t - 1}\right). \tag {46}
+$$
+
+Substitute Eq. 46 to the right hand of Eq. 40, we have
+
+$$
+\begin{array}{l} \left| \left| z _ {t} - \mathbf {B} z _ {t - 1} \right| \right| _ {\alpha} ^ {\alpha} = \left| \left| h ^ {- 1} (z _ {t}) - \mathbf {B} h ^ {- 1} (z _ {t - 1}) \right| \right| _ {\alpha} ^ {\alpha} \\ \Rightarrow \quad | | z _ {t} - \mathbf {B} z _ {t - 1} | | _ {\alpha} ^ {\alpha} = | | h ^ {- 1} (z _ {t}) - h ^ {- 1} (\mathbf {B} z _ {t - 1}) | | _ {\alpha} ^ {\alpha}. \\ \end{array}
+$$
+
+This indicates that $h^{-1}$ preserves the $\alpha$ -distances between points. Since $h$ is bijective, then by Mazur-Ulam theorem Mazur & Ulam (1932), $h$ must be an affine transform. According to Theorem 2 in (Zhang & Hyvarinen, 2011), the model is identifiable, which proves the theorem.
+
+Extension to Multiple Time Lags We can extend the result in Eq. 41 and have
+
+$$
+\frac {\partial \left| \left| \mathbf {z} _ {t} - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} \right| \right| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - i}} = \frac {\partial \left| \left| h ^ {- 1} (\mathbf {z} _ {t}) - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} (\mathbf {z} _ {t - \tau}) \right| \right| _ {\alpha} ^ {\alpha}}{\partial \mathbf {z} _ {t - i}}, \tag {48}
+$$
+
+where $\mathbf{z}_{t - i}$ is any lag latents with the limitation that the $\mathbf{B}_i$ corresponding to $\mathbf{z}_{t - i}$ is of full rank. Following the same above-mentioned derivation process, we can obtain
+
+$$
+\begin{array}{l} \left(\mathbf {z} _ {t} - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau}\right) \odot | \mathbf {z} _ {t} - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} | ^ {\alpha - 2} \mathbf {B} _ {i} \\ = (h ^ {- 1} (\mathbf {z} _ {t}) - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} (\mathbf {z} _ {t - \tau})) \odot | h ^ {- 1} (\mathbf {z} _ {t}) - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} (\mathbf {z} _ {t - \tau}) | ^ {\alpha - 2} \mathbf {B} _ {i} \frac {\partial h ^ {- 1} (\mathbf {z} _ {t - i})}{\mathbf {z} _ {t - i}}. \\ \end{array}
+$$
+
+For any $\mathbf{z}_t$ we can choose $\mathbf{z}_t = \sum_{\tau=1}^{L} \mathbf{B}_{\tau} \mathbf{z}_{t-\tau}$ , thus the Eq. 49 can be written as:
+
+$$
+\left(h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right)\right) \odot | h ^ {- 1} \left(\mathbf {z} _ {t}\right) - \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right) | ^ {\alpha - 2} \mathbf {B} _ {i} \frac {\partial h ^ {- 1} \left(\mathbf {z} _ {t - i}\right)}{\mathbf {z} _ {t - i}} = \mathbf {0}. \tag {50}
+$$
+
+As mentioned above, $h^{-1}(\mathbf{z}_t) = \sum_{\tau = 1}^{L}\mathbf{B}_{\tau}h^{-1}(\mathbf{z}_{t - \tau})$ is the only solution, thus
+
+$$
+h ^ {- 1} \left(\sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau}\right) = \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} h ^ {- 1} \left(\mathbf {z} _ {t - \tau}\right). \tag {51}
+$$
+
+Following the same procedure in the simple case, the theorem is proven.
+
+# A.4 COMPARISONS WITH EXISTING THEORIES
+
+The closest work to ours includes (1) PCL (Hyvarinen & Morioka, 2017), which exploited temporal constraints to separate independent sources, (2) SlowVAE (Klindt et al., 2020), which leveraged sparse transition of adjacent video frames to separate independent sources, and (3) iVAE (Khemakhem et al., 2020), which leveraged the nonstationarity by the modulation of side information $\mathbf{u}$ on the prior distribution $p(\mathbf{z}|\mathbf{u})$ of conditional factorial latent variables. Our work extends the theories to the discovery of the conditional independent sources with time-delayed causal relations in between by leveraging nonstationarity, or functional and distribution forms of temporal statistics. To the best of our knowledge, this is one of the first works that successfully recover time-delayed latent processes from their nonlinear mixtures without using sparsity or minimality assumptions.
+
+PCL The sources $z_{it}$ in PCL were assumed to be mutually independent (see Assumption 1 of Theorem 1 in PCL). In contrast, we allow the sources to have time-delayed causal relations in between, which is much more realistic in real-world applications. They further assumed the sources are stationary, while we allow nonstationarity in the nonparametric setting (the nonstationary noise assumption). The underlying processes of PCL are described by Eq. 52:
+
+$$
+\log p \left(z _ {i, t} \mid z _ {i, t - 1}\right) = G \left(z _ {i, t} - \rho z _ {i, t - 1}\right) \quad \text {o r} \quad \log p \left(z _ {i, t} \mid z _ {i, t - 1}\right) = - \lambda \left(z _ {i, t} - r \left(z _ {i, t - 1}\right)\right) ^ {2} + \text {c o n s t .} \tag {52}
+$$
+
+where $G$ is some non-quadratic function corresponding to the log-pdf of innovations, $\rho < 1$ is regression coefficient, $r$ is some nonlinear, strictly monotonic regression, and $\lambda$ is a positive precision parameter. Both theorems of our work extend the theory to the discovery of the conditional independent sources with time-delayed causal relations in between. Furthermore, in the nonparametric process condition, we do not restrict the functional and distributional forms of underlying transitions. Our proposed nonparametric condition naturally includes PCL as a special case.
+
+SlowVAE Inspired by slow feature analysis, SlowVAE assumes the underlying sources to have identity transitions with generalized Laplacian innovations described in Eq. 53:
+
+$$
+p \left(\mathbf {z} _ {t} \mid \mathbf {z} _ {t - 1}\right) = \prod_ {i = 1} ^ {d} \frac {\alpha \lambda}{2 \Gamma (1 / \alpha)} \exp - (\lambda \left| z _ {i, t} - z _ {i, t - 1} \right| ^ {\alpha}) \quad w i t h \quad \alpha < 2. \tag {53}
+$$
+
+Our proposed parametric condition (Theorem 2) in Eq. 4 is a natural extension to the Laplacian innovation model above by allowing time-delayed vector autoregressive transitions in the latent process with multiple time lags. Consequently, temporally causally-related latent processes with linear transition dynamics can thus be modeled and recovered from their nonlinear mixtures with our parametric condition.
+
+iVAE Similar to TCL (Hyvarinen & Morioka, 2016) and GIN (Sorrenson et al., 2020), iVAE exploits the nonstationarity brought by the side information (i.e., class label) on the prior distribution of latent variables $\mathbf{z}_t$ . As one can see from Eq. 54, the latent variables are conditionally independent, without causal relations in between while both of our theorems consider (time-delayed) causal relations between latent variables. In addition, iVAE exploits the nonstationarity brought by side information (i.e., class label) on the prior distribution of latent variables $\mathbf{z}$ . On the contrary, our nonparametric condition, instead of relying on the change in the prior distribution of latent variables,
+
+exploits the nonstationarity in the noise distribution, which is more natural in real-world datasets. Finally, iVAE assumes modulated exponential families in Eq. 54 while our nonparametric condition (Theorem 1) allows any kinds of modulation by side information $\mathbf{u}$ without those strong assumptions on the transition functions or distributions.
+
+$$
+p _ {T, \lambda} (\mathbf {z} | \mathbf {u}) = \prod_ {i} \frac {Q _ {i} \left(z _ {i}\right)}{Z _ {i} (\mathbf {u})} \exp \left[ \sum_ {j = 1} ^ {k} T _ {i, j} \left(z _ {i}\right) \lambda_ {i, j} (\mathbf {u}) \right] \tag {54}
+$$
+
+In terms of architecture innovations, to remove distributional and functional form constraints of iVAE, we design a novel causal transition prior network for nonparametric transitions by injecting the IN condition inside reparameterization trick, resulting in an efficient scoring mechanism of transition prior which only needs to compute the determinant of a low-triangular Jacobian matrix. This module was never seen in previous work.
+
+# A.5 CONNECTING THEORIES TO MODEL
+
+As one can see from the proofs in Appendix A.3, what have been assumed for the estimation framework are the conditional factorial properties of $q(\hat{\mathbf{z}}_t|\{\hat{\mathbf{z}}_{t - \tau}\} ,\mathbf{u})$ where $\hat{\mathbf{z}}_t = h^{-1}(\mathbf{z}_t)$ and the model of temporal nonstationarities through nonstationary noises. The conditional factorial properties have been injected using the reparameterization trick (Eq. 7) with the IN condition in causal transition prior and the enforcing of spatiotemporal independence of estimated residuals through contrastive learning. The nonstationary noises are modeled with flow-based density estimators. We share the weights of the other modules (e.g., encoder, transition function, decoder, inference network, etc.) across nonstationary regimes while using separate flow models to estimate the density of residuals and evaluate the prior scores in each regime. We also use componentwise flow models so the learned residuals will not interact with each other in the estimation framework. Finally, in nonparametric processes, we warm-start the flow models to generate standard Gaussian noise. In parametric processes, the flow models are initialized to generate standard Laplacian noise. Note that the other assumed conditions in the two theorems, such as sufficient variability and nonsingular state transitions, are data properties and do not need to be encoded as constraints in the estimation framework.
+
+# B EXPERIMENT SETTINGS
+
+# B.1 SYNTHETIC DATASET
+
+Seven synthetic datasets, including two datasets (NP and VAR) which satisfy our assumptions, and five datasets, which violate each of the assumption in the proposed theorems, are used in this paper. We set the latent size $n = 8$ and the lag number of the process $L = 2$ . The mixing function $g$ is a random three-layer MLP with LeakyReLU units.
+
+Nonparametric (NP) Dataset For nonparametric processes, we generate 150,000 data points according to Eq. 2. In particular, we use a Gaussian additive noise model as the latent processes. The noises $\epsilon_{it}$ are sampled from i.i.d. Gaussian distribution with variance modulated by 20 different nonstationary regimes. In each regime, the variance entries are uniformly sampled between 0 and 1. A 2-layer MLP with LeakyReLU units is used as the state transition function $f_{i}$ . When we need sparse causal structure for visualization, a random binary mask is added to the input nodes.
+
+(Violation) Insufficient Variability For this dataset, we create datasets that violate the nonstationary noise condition and sufficient variability by restricting the number of nonstationary regimes observed in the NP dataset. When only one regime is observed, we violate the nonstationary noise condition by using stationary noise. Furthermore, we vary the number of the observed regimes $|\mathbf{u}| \in \{1, 5, 10, 15, 20\}$ to assess the impacts of variability on the recovery of nonparametric processes.
+
+Parametric (VAR) Dataset For parametric processes, we generate 50,000 data points according to Eq. 4. The noises $\epsilon_{it}$ are sampled from i.i.d. Laplacian distribution $(\sigma = 0.1)$ . The entries of state transition matrices $\mathbf{B}_{\tau}$ are uniformly distributed between $[-0.5, 0.5]$ .
+
+(Violation) Low-rank State Transition For this dataset, the transition matrix $\mathbf{B}_{\tau}$ in Eq. 4 is low-rank instead of full-rank. The datasets are created following the steps in the VAR dataset, but we restrict the rank of state transition matrix $\mathbf{B}_{\tau}$ to 4 and time lag $L = 1$ . The full matrix rank is 8.
+
+(Violation) Gaussian Noise Distribution For this dataset, the noise terms $\epsilon_{it}$ in Eq. 4 follow the Gaussian distribution $(\alpha_{i} = 2)$ instead of Generalized Laplacian distribution $(\alpha_{i} < 2)$ . In particular, the noise terms $\epsilon_{it}$ are sampled from i.i.d. Gaussian distribution $(\sigma = 0.1)$ .
+
+(Violation) Regime-Variant Causal Relations For regime-variant causal relations, we generate 240,000 data points according to Eq. 55:
+
+$$
+\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right), \quad \mathbf {z} _ {t} = \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} ^ {\mathbf {u}} \mathbf {z} _ {t - \tau} + \epsilon_ {t} \quad \text {w i t h} \quad \epsilon_ {i t} \sim p _ {\epsilon_ {i}}. \tag {55}
+$$
+
+The noises $\epsilon_{it}$ are sampled from i.i.d. Laplace distribution $(\sigma = 0.1)$ . In each regime $\mathbf{u}$ , the entries of state transition matrices $\mathbf{B}_{\tau}^{\mathbf{u}}$ are uniformly distributed between $[-0.5, 0.5]$ .
+
+(Violation) Instantaneous Causal Relations For instantaneous causal relations, we generate 45,000 data points according to Eq. 56:
+
+$$
+\mathbf {x} _ {t} = g \left(\mathbf {z} _ {t}\right), \quad \mathbf {z} _ {t} = \mathbf {A} \mathbf {z} _ {t} + \sum_ {\tau = 1} ^ {L} \mathbf {B} _ {\tau} \mathbf {z} _ {t - \tau} + \epsilon_ {t} \quad w i t h \quad \epsilon_ {i t} \sim p _ {\epsilon_ {i}}, \tag {56}
+$$
+
+where matrix $\mathbf{A}$ is a random Directed Acyclic Graph (DAG) which contains the coefficients of the linear instantaneous relations. The noises $\epsilon_{it}$ are sampled from i.i.d. Laplacian distribution with $\sigma = 0.1$ . The entries of state transition matrices $\mathbf{B}_{\tau}$ are uniformly distributed between $[-0.5, 0.5]$ .
+
+# B.2 REAL-WORLD DATASET
+
+Three public datasets, including KiTTiMask, Mass-Spring System, and CMU MoCap database, are used. The observations together with the true temporally causal latent processes are showcased in Fig. B.1. For CMU MoCap, the true latent causal variables and time-delayed relations are unknown.
+
+
+(a)
+
+
+
+
+
+
+(b)
+
+
+(c)
+
+
+Figure B.1: Real-world datasets: (a) KiTTiMask is a video dataset of binary pedestrian masks, (b) Mass-Spring system is a video dataset with ball movement rendered in color and invisible springs, and (c) CMU MoCap is a 3D point cloud dataset of skeleton-based signals.
+
+KiTTiMask The KiTTiMask dataset consists of pedestrian segmentation masks sampled from the autonomous driving vision benchmark KiTTi-MOTS. For each given frame, the position (vertical and horizontal) and the scale of the pedestrian masks are set using measured values. The difference in the sample time (e.g., $\Delta t = 0.15s$ ) generates the sparse Laplacian innovations between frames.
+
+Mass-Spring System The Mass-Spring system is a classical physical system that several objects are connected by some visible/invisible spring, which follows Hooke's law. In this work, we considered the system with five degrees of freedom and made linearization on the state without calculating the Euclidian distance between objects. Thus, there are ten causal relations, six of which were set connected, and the other four were disconnected. The rest length of the spring was uniformly distributed between [1, 10], and the stiffness of the spring relation was set as 20. The action was $a_{t} = 300e_{t}$ , where $e_t$ followed the Laplacian distribution with mean $\mu = 0$ and variance $\sigma = 1$ . We assumed there was no damping in the system and randomly assigned the objects in different positions at the beginning of each episode.
+
+CMU MoCap CMU MoCap (http://mocap.cs.cmu.edu/) is an open-source human motion capture dataset with various motion capture recordings (e.g., walk, jump, basketball, etc.) performed by over 140 subjects. In this work, we fit our model on 12 trials of "walk" recordings (Subject 7). Skeleton-based measurements have 62 observed variables corresponding to the locations of joints (e.g., head, foot, shoulder, wrist, throat, etc.) of the human body at each time step.
+
+# B.3 EVALUATION METRICS
+
+SHD: Structural Hamming Distance We use SHD (de Jongh & Druzdzel, 2009) to measure the distance between two causal graphs. It computes the number of edge insertions, deletions, or flips in order to transform one graph to another graph. SHD is one variant of Minimum Edit Distance (MED) in causal discovery area by allowing only insertions, deletions, and flips of edges.
+
+MCC: Mean Correlation Coefficient MCC is a standard metric for evaluating the recovery of latent factors in ICA literature. MCC first calculates the absolute values of correlation coefficient between every ground-truth factor against every estimated latent variable. Depending on whether componentwise invertible nonlinearities exist in the recovered factors, Pearson correlation coefficients or Spearman's rank correlation coefficients can be used. The possible permutation is adjusted by solving a linear sum assignment problem in polynomial time on the computed correlation matrix.
+
+In this work, we use the Pearson correlation coefficient for the VAR processes and Spearman's correlation coefficient for the NP processes.
+
+# C IMPLEMENTATION DETAILS
+
+In this section, we first provide the network architecture details of LEAP. The hyperparameter selection criteria and sensitivity analysis results are presented. The training settings are summarized.
+
+# C.1 NETWORK ARCHITECTURE
+
+We summarize our network architecture below and describe it in detail in Table C.1 and Table C.2.
+
+(1,2) MLP-Encoder and MLP-Decoder: These modules are used for the synthetic and motion capture datasets. They are composed of a series of fully-connected neural networks with LeakyReLU as the activation function. The universal approximation theorem guarantees that our model can approximate the mixing function. The encoder maps the raw observations into features, while the decoder maps the latent variables back to the inputs.
+- (3,4) CNN-Encoder and CNN-Decoder: For the KiTTiMask dataset, vanilla CNNs are used for both the encoder and decoder. For the Mass-Spring system dataset, the time-delayed causal variables use objects as the building blocks to factorize the scene. The object-centric representations contain object locations and some other attributes (e.g., color, size, etc.). We thus use two separate CNNs, one for extracting visual features (see Feature Extractor in Table C.2) and the other for locating object locations with a spatial softmax unit (see Keypoint Predictor in Table C.2). The decoder retrieves object features from feature maps using object locations and reconstructs the scene (see Refiner in Table C.2).
+(5) Inference Network: We apply the bidirectional Gated Recurrent Unit (GRU) (Cho et al., 2014) to preserve both the past and the future information. It processes the input sequence $\mathbf{x}_t$ in both directions: one for the forward pass and one for the backward pass. We denote the forward and backward embeddings as $\vec{H}$ and $\vec{H}$ . The other inference module (see TemporalDynamics in Table C.1) uses the sampled/inferred past latent variables to compute the posterior of $\mathbf{z}_t$ . We insert skip-connections (He et al., 2016) between the two inference modules to avoid the vanishing gradient problem and obtain better model convergence performances. Note that for the first $L$ temporally-earliest latent variables in the sequence, there is no time-delayed information, and we use isotropic Gaussian $\mathcal{N}(0,1)$ as their prior distributions. The prior of the remaining sequence is evaluated with the learned transition prior network described below.
+- (6,7) Causal Process Prior Network This module contains three components. (i) Inverse transition functions. For the NP transitions, we use MLPs to compute the estimated noises. For
+
+the VAR transitions, a group of state transition matrices, one for each time lag, is used. (ii) $\log(|\det(\mathbf{J})|)$ computation. For the NP transitions, the Jacobian matrix entries $\frac{\partial r_i}{\partial \hat{z}_{it}}$ are computed using torch.autogradfunctional.jacobian method. The log determinant is then evaluated by summing over log transformations of absolute values of Jacobian terms for $\hat{z}_{it}$ . For the VAR transitions, because of the additive noise assumption, the log determinant is directly 0. (iii) Spline flow model. Componentwise spline flow models use monotonic linear rational splines to transform standard Gaussian distribution to the estimated noise distribution. We use eight bins for the linear splines and set the bound as five so data points lying outside $[-5, 5]$ are evaluated using $\mathcal{N}(0,1)$ directly while the data points within the region are evaluated by spline flow models. For the nonparametric processes, we always warm-start the spline flows by training it on a dataset of standard Gaussian noises with steps=5000 and learning rate=0.001. For the parametric processes, we warm-start it instead on a dataset of standard Laplacian noises. All the three components of the transition prior network are set to be learnable during the VAE updates.
+
+Table C.1: Architecture details. BS: batch size, T: length of time series, i_dim: input dimension, z_dim: latent dimension, LeakyReLU: Leaky Rectified Linear Unit.
+
+| Configuration | Description | Output |
| 1. MLP-Encoder | Encoder for Synthetic/MoCap Data | |
| Input: x1:T | Observed time series | BS × T × i_dim |
| Dense | 128 neurons, LeakyReLU | BS × T × 128 |
| Dense | 128 neurons, LeakyReLU | BS × T × 128 |
| Dense | 128 neurons, LeakyReLU | BS × T × 128 |
| Dense | Temporal embeddings | BS × T × z_dim |
| 2. MLP-Decoder | Decoder for Synthetic/MoCap Data | |
| Input: ŷ1:T | Sampled latent variables | BS × T × z_dim |
| Dense | 128 neurons, LeakyReLU | BS × T × 128 |
| Dense | 128 neurons, LeakyReLU | BS × T × 128 |
| Dense | i_dim neurons, reconstructed x1:T | BS × T × i_dim |
| 5. Inference Network | Bidirectional Inference Network | |
| Input | Sequential embeddings | BS × T × z_dim |
| GRUInference | Bidirectional inference | BS × T × 2*z_dim |
| TemporalDynamics | Use past {z(t-τ)} to infer posteriors of z_t | BS × T × 2*z_dim |
| ResidualBlock | Skip-connection of the two inferences | BS × T × 2*z_dim |
| Bottleneck | Compute mean and variance of posterior | μ1:T, σ1:T |
| Reparameterization | Sequential sampling | x̂1:T |
| 6. Causal Process Prior (VAR) | Linear Transition Prior Network | |
| Input | Sampled latent variable sequence ŷ1:T | BS × T × z_dim |
| InverseTransition | Compute estimated residuals εit | BS × T × z_dim |
| SplineFlow | Score the likelihood of residuals | BS |
| 7. Causal Process Prior (NP) | Nonlinear Transition Prior Network | |
| Input | Sampled latent variable sequence ŷ1:T | BS × T × z_dim |
| InverseTransition | Compute estimated residuals εit | BS × T × z_dim |
| JacobianCompute | Compute log (|det(J)|) | BS |
| SplineFlow | Score the likelihood of residuals | BS |
+
+Model Ablations We start with BetaVAE and add our proposed modules successively as model variants. When the causal process prior network is added to the baseline, this model variant is equipped with the inference network and learned inverse transition functions. However, during the estimation of KL divergence in the causal process prior network, we use Mean Squared Error (MSE) directly, which corresponds to stationary Gaussian noise distribution, to replace the flow density estimators that evaluate the prior likelihood scores across nonstationary regimes. This variant shows the contributions of the learned causal transition functions. Furthermore, when the nonstationary flow estimator is added to the variant, this variant is implemented by removing the noise discriminator from LEAP while not changing any training settings.
+
+Table C.2: Architecture details on CNN encoder and decoder. BS: batch size, T: length of time series, h_dim: hidden dimension, z_dim: latent dimension, F: number of filters, (Leaky)ReLU: (Leaky) Rectified Linear Unit.
+
+| Configuration | Description | Output |
| 3.1.1 CNN-Encoder | Feature Extractor | |
| Input: x1:TConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2D Conv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv |
| 3.1.2 CNN-Encoder | Keypoint Predictor | |
| Input: x1:TConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2D Conv2DConv2DConv2D Conv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv |
| 3.2 KiTTiMask-Encoder | Mask Encoder | |
| Input: x1:TConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2D |
| 4.1 CNN-Decoder | Refiner | |
| Input: z1:TConvTranspose2DConv2DConvTranspose2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv2DConv | Sampled latent variable sequenceF: 64, BatchNorm2D, LeakyReLUF: 64, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32, BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 32,BatchNorm 2D, LeakyReLUF: 0 | BS × T × 64 × 2BS × T × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 ×1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1× 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 ×1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 1 × 64 × 64 × 3 × 0 |
| 4.2 KiTTiMask-Decoder | Mask Decoder | |
| Input: z1:TDenseConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DConvTranspose2DT | Sampled latent variable sequenceh_dim neuronsF: 64, BatchNorm2D, ReLUF: 64, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLUF: 32, BatchNorm2D, ReLU | BS × T × z_dimBS × T × h_dim × 1 × 1BS × T × 64 × 4 × 4BS × T × 64 × 8 × 8BS × T × 32 × 64 × 64BS × T × 32 × 64 × 64BS × T × 1 × 64 × 64 |
+
+# C.2 HYPERPARAMETERS AND TRAINING DETAILS
+
+We describe the hyperparameter selection criteria and discuss the impacts of hyperparameter values on the model performances. The training details are provided.
+
+# C.2.1 HYPERPARAMETER SELECTION AND SENSITIVITY ANALYSIS
+
+The hyperparameters of LEAP include $[\beta, \gamma, \sigma]$ , which are the weights of each term in the augmented ELBO objective, as well as the latent size $n$ and maximum time lag $L$ . We use the ELBO loss on the validation dataset to select the best pair of $[\beta, \gamma, \sigma]$ because low ELBO loss always leads to high
+
+
+(a) MCC trajectory with different $\beta$ and $\gamma$ .
+
+
+(b) Visualization of the final MCC.
+
+
+(c) MCC trajectory with different $\sigma$
+Figure C.1: Impacts of hyperparameters on VAR dataset.
+
+
+(d) MCC with different latent size and time lag.
+
+MCC. We always set a larger latent size than the true latent size. This is critical in video datasets because the image pixels contain more information than the annotated latent causal variables, and restricting the latent size will hurt the reconstruction performances. For the maximum time lag $L$ , we set it by the rule of thumb. For instance, we use $L = 2$ for temporal datasets with a latent physics process.
+
+However, it is known (Mita et al., 2021) that the performances of VAEs might change drastically as a function of the regularization strength. We thus conduct a sensitivity analysis on the impacts of hyperparameters on our identifiability performances. We report the MCC scores for the synthetic NP and VAR datasets on a hyperparameter grid. We found that the values of $\beta$ and $\gamma$ have a larger impact on the identifiability results, while the effects of $\sigma$ are relatively smaller. Furthermore, we have verified the robustness of our approach under different maximum time lags $L$ and latent size $n$ settings. The final MCC scores only show marginal differences, indicating that our approach is robust to the choices of $n$ and $L$ . In summary, the performance of our approach is robust to the values of some of the hyperparameters, and for the remaining hyperparameters, we use separate validation data to set their values.
+
+Parametric (VAR) Dataset We have performed a grid search of $\beta \in [3\mathrm{E - }4,3\mathrm{E - }3,3\mathrm{E - }2]$ and $\gamma \in [9\mathrm{E - }4,9\mathrm{E - }3,9\mathrm{E - }2]$ and reported the results in Fig. C.1(a). The best configuration is $[\beta ,\gamma ] =$ [3E-3, 9E-3]. We plot the final MCC score as a function of the value of the two hyperparameters in Fig. C.1(b). For $\sigma$ , we compare the MCC scores under different $\sigma \in [5\mathrm{E - }7,1\mathrm{E - }6,1\mathrm{E - }5]$ with the optimal $(\beta ,\gamma)$ value. The optimal configuration for $\sigma$ is 1E-6 as shown in Fig. C.1(c). Furthermore, we verify the robustness of our approach under different time lags $L\in [2,3,4]$ and latent dimensions $n\in [4,6,8]$ with $[\beta ,\gamma ,\sigma ] = [3\mathrm{E - }3,9\mathrm{E - }3,1\mathrm{E - }6]$ and the results are shown in Fig. C.1(d). We can see that the final MCC scores in all cases are around 0.9 with marginal differences, indicating that latent recovery performances of our approach is robust to the choices of $n$ and $L$
+
+Nonparametric (NP) Dataset Similarly, we have performed a grid search of $\beta \in [2\mathrm{E - 4},2\mathrm{E - 3},2\mathrm{E - 2}]$ and $\gamma \in [2\mathrm{E - 3},2\mathrm{E - 2},2\mathrm{E - 1}]$ on the NP dataset and reported the results in Fig. C.2(a). The best configuration is $[\beta ,\gamma ] = [2\mathrm{E - 3},2\mathrm{E - 2}]$ . The final MCC scores under parameter grids of $[\beta ,\gamma ]$ are shown in Fig. C.2(b). The optimal configuration for $\sigma$ is 1E-6 in the search space $\sigma \in [1\mathrm{E - 7},1\mathrm{E - 6},1\mathrm{E - 5}]$ with the optimal $[\beta ,\gamma ]$ value, as shown in Fig. C.2(c). We verify the robust
+
+ness in terms of latent size $n \in [6,7,8]$ and the maximum time lags $L \in [1,2,3]$ with the optimal configuration $[\beta ,\gamma ,\sigma ] = [2\mathrm{E} - 3,2\mathrm{E} - 2,1\mathrm{E} - 6]$ and the results are shown in Fig. C.2(d). The final MCC scores in all cases are around or higher than 0.85 with marginal differences.
+
+
+(a) MCC trajectory with different $\beta$ and $\gamma$ .
+
+
+(b) Visualization of the final MCC.
+
+
+(c) MCC trajectory with different $\sigma$
+Figure C.2: Impacts of hyperparameters on NP dataset.
+
+
+(d) MCC with different latent size and time lag.
+
+# C.2.2 TRAINING
+
+Training Details The models were implemented in PyTorch 1.8.1. The VAE network is trained using AdamW optimizer for a maximum of 200 epochs and early stops if the validation ELBO loss does not decrease for five epochs. A learning rate of 0.002 and a mini-batch size of 32 are used. For the noise discriminator, we use SGD optimizer with a learning rate of 0.001. We have used four random seeds in each experiment and reported the mean performance with standard deviation averaged across random seeds.
+
+Computing Hardware We used a machine with the following CPU specifications: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz; 8 CPUs, four physical cores per CPU, a total of 32 logical CPU units. The machine has two GeForce GTX 1080 Ti GPUs with 11GB GPU memory.
+
+Training Stability We have used several standard tricks to improve training stability: (1) we use a slightly larger latent size than the true latent size for real-world datasets in order to make sure the meaningful latent variables are among the recovered latents; (2) we use AdamW optimizer as a regularizer to prevent training from being interrupted by overflow or underflow of variance terms of VAE; (3) we use a larger learning rate for the VAE than for the noise discriminator to prevent extreme extrapolation behavior of discriminator.
+
+# D ADDITIONAL EXPERIMENT RESULTS
+
+# D.1 COMPARISONS BETWEEN LEAP AND BASELINESON CMU-MOCAP DATASET
+
+Because the true latent variables for CMU-Mocap are unknown, we visualize the latent traversals and the recovered skeletons, qualitatively comparing our nonparametric method with baselines in terms of the how intuitively sensible the recovered processes and skeletons are.
+
+
+Figure D.1: Latent traversal comparisons between LEAP and the baselines. LEAP represents the data with causally-related factors, thus can represent the data with only much fewer latent variables (three vs eight) with smooth transitions dynamics. Video demonstrations are in: https://bit.ly/3kEVQhf.
+
+Latent Traversal We fit LEAP and the baseline models using the same latent size $n = 8$ and the maximum time lags $L = 2$ . As shown in Fig. D.1, LEAP represents the data with causally-related factors, thus explaining the data with fewer latent variables and smooth transitions dynamics. Only three latent variables are in fact used by LEAP and while the other five latent variables only encode random noise as seen from the video demonstration. BetaVAE and SlowVAE, however, need to use all the latent variables to represent the data. Furthermore, we find the three latent variables discovered by LEAP encode pitch, yaw, and roll rotations of walking cycles, which is close to how human beings perceive walking movement.
+
+Recovered Skeleton As shown in Fig. D.2, LEAP recovers the cross relations between causal variables while BetaVAE and SlowVAE can only recover independent relations. The latent traversals of LEAP have shown that the three recovered latent variables may be the pitch, yaw, and roll rotations of the walk cycles. Therefore, the results of our approach indicate that the pitch (e.g., limb movement) and roll (e.g., shoulder movement) are causally-related while yaw has independent dynamics, which is closer to reality than the independent transitions discovered by BetaVAE and SlowVAE.
+
+# D.2 MASS-SPRING SYSTEMS
+
+We render the recovered latent variables using keypoint heatmaps in Fig. D.3(a). The learned representation successfully disentangles five objects in the scene, and the latent variables represent the horizontal and vertical locations of the balls. We further visualize the recovered skeletons from the estimated state transition matrices in Fig. D.3(b). The recovered skeleton is consistent with the underlying processes described in Fig. B.1(b) with $\mathrm{SHD} = 0$ .
+
+
+Figure D.2: Comparisons between LEAP and the baselines in terms of skeleton recovery. LEAP recovers cross relations between causal variables while baselines can only recover independent relations.
+
+
+Figure D.3: Visualization of recovered latent variables and the estimated skeletons for Mass-Spring system dataset.
+
+# E EXTENDED RELATED WORK
+
+Temporal dependencies and nonstationarities were recently used as side information $\mathbf{u}$ to achieve identifiability of nonlinear ICA on latent space $\mathbf{z}$ . Hyvarinen & Morioka (2016) proposed time-contrastive learning (TCL) based on the independent sources assumption. It gave the very first identifiability results for a nonlinear mixing model with nonstationary data segmentation. Hyvarinen & Morioka (2017) developed a permutation-based contrastive (PCL) learning framework to separate independent sources using temporal dependencies. Their approach learns to discriminate between true time series and permuted time series, and the model is identifiable under the uniformly dependent assumption. Halvä & Hyvarinen (2020) combined nonlinear ICA with a Hidden Markov Model (HMM) to automatically model nonstationarity without the need for manual data segmentation. Khemakhem et al. (2020) introduced VAEs to approximate the true joint distribution over observed and auxiliary nonstationary regimes. The conditional distribution in their work $p(\mathbf{z}|\mathbf{u})$ is assumed to be within exponential families to achieve identifiability on the latent space. A more recent study in causally-related nonlinear ICA was given by (Yang et al., 2021), which introduced a linear causal layer to transform independent exogenous factors into endogenous causal variables.
\ No newline at end of file
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/images.zip b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..8c7cb6dc22879551317e597163af421140679328
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6e0c19d3d2454aee0e921352e51ee2adb22c37b5720404a0c4b63e663af94a1
+size 1850236
diff --git a/learningtemporallycausallatentprocessesfromgeneraltemporaldata/layout.json b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..8f32b6cb2ac225926ee1dc97557632f7e5ae67ac
--- /dev/null
+++ b/learningtemporallycausallatentprocessesfromgeneraltemporaldata/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac6c0a786b818fdac2658f50917da87101a8a8a88bdaa6006dd1d4167e48b626
+size 1159159
diff --git a/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_content_list.json b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..529598b9766e2a90c8b25bf208764abc31b70db2
--- /dev/null
+++ b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5517326f4fb2c9801caf1d4d9d17772020853c718f71cdbc078391ae678c22a7
+size 239087
diff --git a/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_model.json b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a84403bdd05f85c101c5eb3a7a0b294df627c777
--- /dev/null
+++ b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7662ae8f305aa898e7c3f5476d2f8d98d3eaee91cf8abe01157666dd5a8b44a9
+size 286769
diff --git a/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_origin.pdf b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..47cfa1d46c3f4c60c2262b0f742604e8f80c75b1
--- /dev/null
+++ b/learningtowardsthelargestmargins/7bc340e8-211f-4ed5-ac1f-1d82ac9d6f25_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:92497e30b57e2eb9d4fd794fd00851dc4e81fc9b6604465b94a506a4fb41e373
+size 17394613
diff --git a/learningtowardsthelargestmargins/full.md b/learningtowardsthelargestmargins/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..d177c39aabcb056a519f428bc3ac674f775aac44
--- /dev/null
+++ b/learningtowardsthelargestmargins/full.md
@@ -0,0 +1,1006 @@
+# LEARNING TOWARDS THE LARGEST MARGINS
+
+Xiong Zhou $^{1*}$ , Xianming Liu $^{1,2\dagger}$ , Deming Zhai $^{1}$ , Junjun Jiang $^{1,2}$ , Xin Gao $^{3,2,4}$ , Xiangyang Ji $^{5}$
+
+$^{1}$ Harbin Institute of Technology $^{2}$ Peng Cheng Laboratory $^{3}$ King Abdullah University of Science and Technology
+
+$^{4}$ Gaoling School of Artificial Intelligence, Renmin University of China $^{5}$ Tsinghua University
+
+# ABSTRACT
+
+One of the main challenges for feature representation in deep learning-based classification is the design of appropriate loss functions that exhibit strong discriminative power. The classical softmax loss does not explicitly encourage discriminative learning of features. A popular direction of research is to incorporate margins in well-established losses in order to enforce extra intra-class compactness and interclass separability, which, however, were developed through heuristic means, as opposed to rigorous mathematical principles. In this work, we attempt to address this limitation by formulating the principled optimization objective as learning towards the largest margins. Specifically, we firstly define the class margin as the measure of inter-class separability, and the sample margin as the measure of intra-class compactness. Accordingly, to encourage discriminative representation of features, the loss function should promote the largest possible margins for both classes and samples. Furthermore, we derive a generalized margin softmax loss to draw general conclusions for the existing margin-based losses. Not only does this principled framework offer new perspectives to understand and interpret existing margin-based losses, but it also provides new insights that can guide the design of new tools, including sample margin regularization and largest margin softmax loss for the class-balanced case, and zero-centroid regularization for the class-imbalanced case. Experimental results demonstrate the effectiveness of our strategy on a variety of tasks, including visual classification, imbalanced classification, person re-identification, and face verification.
+
+# 1 INTRODUCTION
+
+Recent years have witnessed the great success of deep neural networks (DNNs) in a variety of tasks, especially for visual classification (Simonyan & Zisserman, 2014; Szegedy et al., 2015; He et al., 2016; Howard et al., 2017; Zoph et al., 2018; Touvron et al., 2019; Brock et al., 2021; Dosovitskiy et al., 2021). The improvement in accuracy is attributed not only to the use of DNNs, but also to the elaborated losses encouraging well-separated features (Elsayed et al., 2018; Musgrave et al., 2020).
+
+In general, the loss is expected to promote the learned features to have maximized intra-class compactness and inter-class separability simultaneously, so as to boost the feature discriminativeness. Softmax loss, which is the combination of a linear layer, a softmax function, and cross-entropy loss, is the most commonly-used ingredient in deep learning-based classification. However, the softmax loss only learns separable features that are not discriminative enough (Liu et al., 2017). To remedy the limitation of softmax loss, many variants have been proposed. Liu et al. (2016) proposed a generalized large-margin softmax loss, which incorporates a preset constant $m$ multiplying with the angle between samples and the classifier weight of the ground truth class, leading to potentially larger angular separability between learned features. SphereFace (Liu et al., 2017) further improved the performance of L-Softmax by normalizing the prototypes in the last inner-product layer. Subsequently, Wang et al. (2017) exhibited the usefulness of feature normalization when using feature vector dot products in the softmax function. Coincidentally, in the field of contrastive learning, Chen et al. (2020) also showed that normalization of outputs leads to superior representations. Due to its effectiveness, normalization on either features or prototypes or both becomes a standard procedure in margin-based losses, such as SphereFace (Liu et al., 2017), CosFace/AM-Softmax (Wang et al., 2018b;a) and ArcFace (Deng et al., 2019). However, there is no theoretical guarantee provided yet.
+
+Despite their effectiveness and popularity, the existing margin-based losses were developed through heuristic means, as opposed to rigorous mathematical principles, modeling and analysis. Although they offer geometric interpretations, which are helpful to understand the underlying intuition, the theoretical explanation and analysis that can guide the design and optimization is still vague. Some critical issues are unclear, e.g., why is the normalization of features and prototypes necessary? How can the loss be further improved or adapted to new tasks? Therefore, it naturally raises a fundamental question: how to develop a principled mathematical framework for better understanding and design of margin-based loss functions? The goal of this work is to address these questions by formulating the objective as learning towards the largest margins and offering rigorously theoretical analysis as well as extensive empirical results to support this point.
+
+To obtain an estimizable objective, firstly, we should define measures of intra-class compactness and inter-class separability. To this end, we propose to employ the class margin as the measure of inter-class separability, which is defined as the minimal pairwise angle distance between prototypes that reflects the angular margin of the two closest prototypes. Moreover, we define the sample margin following the classic approach in (Koltchinskii et al., 2002, Sec. 5), which denotes the similarity difference of a sample to the prototype of the class it belongs to and to the nearest prototype of other classes and thus measures the intra-class compactness. We provide a rigorous theoretical guarantee that maximizing the minimal sample margin over the entire dataset leads to maximizing the class margin regardless of feature dimension, class number, and class balancedness. It denotes that the sample margin also has the power of measuring inter-class separability.
+
+According to the defined measures, we can obtain categorical discriminativeness of features by the loss function promoting the largest margins for both classes and samples, which also meets to tighten the margin-based generalization bound in (Kakade et al., 2008; Cao et al., 2019). The main contributions of this work are highlighted as follows:
+
+- For a better understanding of margin-based losses, we provide a rigorous analysis about the necessity of normalization on prototypes and features. Moreover, we propose a generalized margin softmax loss (GM-Softmax), which can be derived to cover most of existing margin-based losses. We prove that, for the class-balance case, learning with the GM-Softmax loss leads to maximizing both class margin and sample margin under mild conditions.
+- We show that learning with existing margin-based loss functions, such as SphereFace, NormFace, CosFace, AM-Softmax and ArcFace, would share the same optimal solution. In other words, all of them attempt to learn towards the largest margins, even though they are tailored to obtain different desired margins with explicit decision boundaries. However, these losses do not always maximize margins under different hyper-parameter settings. Instead, we propose an explicit sample margin regularization term and a novel largest margin softmax loss (LM-Softmax) derived from the minimal sample margin, which significantly improves the class margin and the sample margin.
+- We consider the class-imbalanced case, in which the margins are severely affected. We provide a sufficient condition, which reveals that, if the centroid of prototypes is equal to zero, learning with GM-Softmax will provide the largest margins. Accordingly, we propose a simple but effective zero-centroid regularization term, which can be combined with commonly-used losses to mitigate class imbalance.
+- Extensive experimental results are offered to demonstrate that the strategy of learning towards the largest margins significantly can improve the performance in accuracy and class/sample margins for various tasks, including visual classification, imbalanced classification, person re-identification, and face verification.
+
+# 2 MEASURES OF INTRA-CLASS COMPACTNESS AND INTER-CLASS SEPARABILITY
+
+With a labeled dataset $D = \{(\pmb{x}_i, y_i)\}_{i=1}^N$ (where $\pmb{x}_i$ denotes a training example with label $y_i$ , and $y_i \in [1, k] = \{1, 2, \dots, k\}$ ), the softmax loss for a $k$ -classification problem is formulated as
+
+$$
+L = \frac {1}{N} \sum_ {i = 1} ^ {N} - \log \frac {\exp \left(\boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)}{\sum_ {j = 1} ^ {k} \exp \left(\boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)} = \sum_ {i = 1} ^ {N} - \log \frac {\exp \left(\| \boldsymbol {w} _ {y _ {i}} \| _ {2} \| \boldsymbol {z} _ {i} \| _ {2} \cos \left(\theta_ {i y _ {i}}\right)\right)}{\sum_ {j = 1} ^ {k} \exp \left(\| \boldsymbol {w} _ {j} \| _ {2} \| \boldsymbol {z} _ {i} \| _ {2} \cos \left(\theta_ {i j}\right)\right)}, \tag {2.1}
+$$
+
+where $\boldsymbol{z}_i = \phi_{\Theta}(\boldsymbol{x}_i) \in \mathbb{R}^d$ (usually $k \leq d + 1$ ) is the learned feature representation vector; $\phi_{\Theta}$ denotes the feature extraction sub-network; $W = (\boldsymbol{w}_1, \dots, \boldsymbol{w}_k) \in \mathbb{R}^{d \times k}$ denotes the linear classifier which is implemented with a linear layer at the end of the network (some works omit the bias and use an inner-product layer); $\theta_{ij}$ denotes the angle between $\boldsymbol{z}_i$ and $\boldsymbol{w}_j$ ; and $\| \cdot \|_2$ denotes the Euclidean norm, where $\boldsymbol{w}_1, \dots, \boldsymbol{w}_k$ can be regarded as the class centers or prototypes (Mettes et al., 2019). For simplicity, we use prototypes to denote the weight vectors in the last inner-product layer.
+
+The softmax loss intuitively encourages the learned feature representation $\mathbf{z}_i$ to be similar to the corresponding prototype $\mathbf{w}_{y_i}$ , while pushing $\mathbf{z}_i$ away from the other prototypes. Recently, some works (Liu et al., 2016; 2017; Deng et al., 2019) aim to achieve better performance by modifying the softmax loss with explicit decision boundaries to enforce extra intra-class compactness and inter-class separability. However, they do not provide the theoretical explanation and analysis about the newly designed losses. In this paper, we claim that a loss function to obtain better inter-class separability and intra-class compactness should learn towards the largest class and sample margin, and offer rigorously theoretical analysis as support. All proofs can be found in the Appendix A.
+
+In the following, we define class margin and sample margin as the measures of inter-class separability and intra-class compactness, respectively, which serve as the base for our further derivation.
+
+# 2.1 CLASS MARGIN
+
+With prototypes $\pmb{w}_1, \dots, \pmb{w}_k \in \mathbb{R}^d$ , the class margin is defined as the minimal pairwise angle distance:
+
+$$
+m _ {c} \left(\left\{\boldsymbol {w} _ {i} \right\} _ {i = 1} ^ {k}\right) = \min _ {i \neq j} \angle \left(\boldsymbol {w} _ {i}, \boldsymbol {w} _ {j}\right) = \operatorname {a r c c o s} \left[ \max _ {i \neq j} \frac {\boldsymbol {w} _ {i} ^ {\mathrm {T}} \boldsymbol {w} _ {j}}{\| \boldsymbol {w} _ {i} \| _ {2} \| \boldsymbol {w} _ {j} \| _ {2}} \right], \tag {2.2}
+$$
+
+where $\angle (\pmb{w}_i, \pmb{w}_j)$ denotes the angle between the vectors $\pmb{w}_i$ and $\pmb{w}_j$ . Note that we omit the magnitudes of the prototypes in the definition, since the magnitudes tend to be very close according to the symmetry property. To verify this, we compute the ratio between the maximum and minimum magnitudes, which tends to be close to 1 on different datasets, as shown in Fig. 1.
+
+To obtain better inter-class separability, we seek the largest class margin, which can be formulated as
+
+$$
+\max_{\{\boldsymbol{w}_{i}\}_{i = 1}^{k}}m_{c}(\{\boldsymbol{w}_{i}\}_{i = 1}^{k}) = \max_{\{\boldsymbol{w}_{i}\}_{i = 1}^{k}}\min_{i\neq j}\angle (\boldsymbol{w}_{i},\boldsymbol{w}_{j}).
+$$
+
+Since magnitudes do not affect the solution of the max-min problem, we perform $\ell_2$ normalization for each $w_i$ to effectively restrict the prototypes on the unit sphere $\mathbb{S}^{d-1}$ with center at the origin. Under this constraint, the maximization of the class margin is equivalent to
+
+
+Figure 1: The curves of ratio between maximum and minimum magnitudes of prototypes on MNIST and CIFAR-10/-100 using the CE loss. The ratio is roughly close to 1 (< 1.3).
+
+the configuration of $k$ points on $\mathbb{S}^{d - 1}$ to maximize their minimum pairwise distance:
+
+$$
+\underset {\{\boldsymbol {w} _ {i} \} _ {i = 1} ^ {k} \subset \mathbb {S} ^ {d - 1}} {\arg \max } \min _ {i \neq j} \angle (\boldsymbol {w} _ {i}, \boldsymbol {w} _ {j}) = \underset {\{\boldsymbol {w} \} _ {i = 1} ^ {k} \subset \mathbb {S} ^ {d - 1}} {\arg \max } \underset {i \neq j} {\min } \| \boldsymbol {w} _ {i} - \boldsymbol {w} _ {j} \| _ {2}, \tag {2.3}
+$$
+
+The right-hand side is well known as the $k$ -points best-packing problem on spheres (often called the Tammes problem), whose solution leads to the optimal separation of points (Borodachov et al., 2019). The best-packing problem turns out to be the limiting case of the minimal Riesz energy:
+
+$$
+\underset {\{\boldsymbol {w} \} _ {i = 1} ^ {k} \subset \mathbb {S} ^ {d - 1}} {\arg \min } \underset {t \rightarrow \infty} {\lim } \sum_ {i \neq j} \frac {1}{\| \boldsymbol {w} _ {i} - \boldsymbol {w} _ {j} \| _ {2} ^ {t}} = \underset {\{\boldsymbol {w} \} _ {i = 1} ^ {k} \subset \mathbb {S} ^ {d - 1}} {\arg \max } \underset {i \neq j} {\min } \| \boldsymbol {w} _ {i} - \boldsymbol {w} _ {j} \| _ {2}. \tag {2.4}
+$$
+
+Interestingly, Liu et al. (2018) utilized the minimum hyperspherical energy as a generic regularization for neural networks to reduce undesired representation redundancy. When $\pmb{w}_1,\dots,\pmb{w}_k\in \mathbb{S}^{d - 1}$ , $k\leq d + 1$ , and $t > 0$ , the solution of the best-packing problem leads to the minimal Riesz $t$ -energy:
+
+Lemma 2.1. For any $\mathbf{w}_1, \dots, \mathbf{w}_k \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , the solution of minimal Riesz t-energy and $k$ -points best-packing configurations are uniquely given by the vertices of regular $(k-1)$ -simplices inscribed in $\mathbb{S}^{d-1}$ . Furthermore, $\mathbf{w}_i^{\mathrm{T}}\mathbf{w}_j = \frac{-1}{k-1}, \forall i \neq j$ .
+
+This lemma shows that the maximum of $m_c(\{\pmb{w}_i\}_{i=1}^k)$ is $\arccos \left(\frac{-1}{k-1}\right)$ when $k \leq d+1$ , which is analytical and can be constructed artificially. However, when $k > d+1$ , the optimal $k$ -point configurations on the sphere $\mathbb{S}^{d-1}$ have no generic analytical solution, and are only known explicitly for a handful of cases, even for $d=3$ .
+
+# 2.2 SAMPLE MARGIN
+
+According to the definition in (Koltchinskii et al., 2002), for the network $\pmb{f}(\pmb{x};\Theta ,W) = W^{\mathrm{T}}\phi_{\Theta}(\pmb{x}):\mathbb{R}^{m}\to \mathbb{R}^{k}$ that outputs $k$ logits, the sample margin for $(\pmb{x},y)$ is defined as
+
+$$
+\gamma (\boldsymbol {x}, y) = \boldsymbol {f} (\boldsymbol {x}) _ {y} - \max _ {j \neq y} \boldsymbol {f} (\boldsymbol {x}) _ {j} = \boldsymbol {w} _ {y} ^ {\mathrm {T}} \boldsymbol {z} - \max _ {j \neq y} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z}, \tag {2.5}
+$$
+
+where $\mathbf{z} = \phi_{\Theta}(\mathbf{x})$ denotes the corresponding feature. Let $n_j$ be the number of samples in class $j$ and $S_j = \{i : y_i = j\}$ denote the sample indices corresponding to class $j$ . We can further define the sample margin for samples in class $j$ as
+
+$$
+\gamma_ {j} = \min _ {i \in S _ {j}} \gamma \left(\boldsymbol {x} _ {i}, y _ {i}\right). \tag {2.6}
+$$
+
+Accordingly, the minimal sample margin over the entire dataset is $\gamma_{\mathrm{min}} = \min \{\gamma_1,\dots,\gamma_k\}$ . Intuitively, learning features and prototypes to maximize the minimum of all sample margins means making the feature embeddings close to their corresponding classes and far away from the others:
+
+Theorem 2.2. For $\pmb{w}_1, \dots, \pmb{w}_k, \pmb{z}_1, \dots, \pmb{z}_N \in \mathbb{S}^{d-1}$ (where $n_j > 0$ for each $j \in [1,k]$ ), the optimal solution $\{\pmb{w}_i^*\}_{i=1}^k$ , $\{\pmb{z}_i^*\}_{i=1}^N = \arg \max_{\{\pmb{w}_i\}_{i=1}^k, \{\pmb{z}_i\}_{i=1}^N} \gamma_{\min}$ is obtained if and only if $\{\pmb{w}_i^*\}_{i=1}^k$ maximizes the class margin $m_c(\{\pmb{w}_i\}_{i=1}^k)$ , and $\pmb{z}_i^* = \frac{\pmb{w}_{y_i}^* - \overline{\pmb{w}}_{y_i}^*}{\|\pmb{w}_{y_i}^* - \overline{\pmb{w}}_{y_i}^*\|_2}$ , where $\overline{\pmb{w}}_{y_i}^*$ denotes the centroid of the vectors $\{\pmb{w}_j : j \text{ maximizes } \pmb{w}_{y_i}^{\mathrm{T}}\pmb{w}_j, j \neq y_i\}$ .
+
+As shown in the proof A, Theorem 2.2 guarantees that maximizing $\gamma_{\mathrm{min}}$ will provide the solution of the Tammes problem with respect to any feature dimension $d$ , class number $k$ , and both class-balanced and class-imbalance cases. When $2 \leq k \leq d + 1$ , we can derive the following proposition:
+
+Proposition 2.3. For any $\pmb{w}_1, \dots, \pmb{w}_k, \pmb{z}_1, \dots, \pmb{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , the maximum of $\gamma_{\min}$ is $\frac{k}{k-1}$ , which is obtained if and only if $\forall i \neq j$ , $\pmb{w}_i^{\mathrm{T}}\pmb{w}_j = -\frac{1}{k-1}$ , and $\pmb{z}_i = \pmb{w}_{y_i}$ .
+
+Theorem 2.2 and Proposition 2.3 show that the best separation of prototypes is obtained when maximizing the minimal sample margin $\gamma_{\mathrm{min}}$ .
+
+On the other hand, let $L_{\gamma,j}[f] = \operatorname{Pr}_{\boldsymbol{x} \sim \mathcal{P}_j}[\max_{j' \neq j} f(\boldsymbol{x})_{j'} > f(\boldsymbol{x})_j - \gamma]$ denote the hard margin loss on samples from class $j$ , and $\widehat{L}_{\gamma,j}$ denote its empirical variant. When the training dataset is separable (which indicates that there exists $f$ such that $\gamma_{\min} > 0$ ), Cao et al. (2019) provided a fine-grained generalization error bound under the setting with balanced test distribution by considering the margin of each class, i.e., for $\gamma_j > 0$ and all $f \in \mathcal{F}$ , with a high probability, we have
+
+$$
+\Pr_ {(\boldsymbol {x}, y)} [ f (\boldsymbol {x}) _ {y} < \max _ {l \neq y} f (\boldsymbol {x}) _ {l} ] \leq \frac {1}{k} \sum_ {j = 1} ^ {k} \left(\widehat {L} _ {\gamma_ {j}, j} [ f ] + \frac {4}{\gamma_ {j}} \widehat {\Re} _ {j} (\mathcal {F}) + \varepsilon_ {j} (\gamma_ {j})\right). \tag {2.7}
+$$
+
+In the right-hand side, the empirical Rademacher complexity $\frac{4}{\gamma_j}\widehat{\mathfrak{R}}_j(\mathcal{F})$ has a big impact. From the perspective of our work, a straightforward way to tighten the generalization bound is to enlarge the minimal sample margin $\gamma_{\mathrm{min}}$ , which further leads to the larger margin $\gamma_{j}$ for each class $j$ .
+
+# 3 LEARNING TOWARDS THE LARGEST MARGINS
+
+# 3.1 CLASS-BALANCED CASE
+
+According to the above derivations, to encourage discriminative representation of features, the loss function should promote the largest possible margins for both classes and samples. In (Mettes et al., 2019), the pre-defined prototypes positioned through data-independent optimization are used to obtain a large class margin. As shown in Figure 2, although they keep the particularly large margin
+
+
+(a) Test Accuracy
+
+
+(b) Class Margin
+
+
+(c) Sample Margin
+Figure 2: Test accuracies, class margins and sample margins on CIFAR-10 and CIFAR-100 with and without fixed prototypes, where fixed prototypes are pre-trained for very large class margins.
+
+from the beginning, the sample margin is smaller than that optimized without fixed prototypes, leading to insignificant improvements in accuracy.
+
+In recent years, in the design of variants of softmax loss, one popular approach (Bojanowski & Joulin, 2017; Wang et al., 2017; Mettes et al., 2019; Wang & Isola, 2020) is to perform normalization on prototypes or/and features, leading to superior performance than unnormalized counterparts (Parkhi et al., 2015; Schroff et al., 2015; Liu et al., 2017). However, there is no theoretical guarantee provided yet. In the following, we provide a rigorous analysis about the necessity of normalization. Firstly, we prove that minimizing the original softmax loss without normalization for both features and prototypes may result in a very small class margin:
+
+Theorem 3.1. $\forall \varepsilon \in (0,\pi /2]$ , if the range of $w_{1},\dots,w_{k}$ or $z_{1},\dots,z_{N}$ is $\mathbb{R}^d$ ( $2\leq k\leq d + 1$ ), then there exists prototypes that achieve the infimum of the softmax loss and have the class margin $\varepsilon$ .
+
+This theorem reveals that, unless both features and prototypes are normalized, the original softmax loss may produce an arbitrary small class margin $\varepsilon$ . As a corroboration of this conclusion, L-Softmax (Liu et al., 2016) and A-Softmax (Liu et al., 2017) that do not perform any normalization or only do on prototypes, cannot guarantee to maximize the class margin. To remedy this issue, some works (Wang et al., 2017; 2018a;b; Deng et al., 2019) proposed to normalize both features and prototypes.
+
+A unified framework (Deng et al., 2019) that covers A-Softmax (Liu et al., 2017) with feature normalization, NormFace (Wang et al., 2017), CosFace/AM-Softmax (Wang et al., 2018b;a), ArcFace (Deng et al., 2019) as special cases can be formulated with hyper-parameters $m_{1}$ , $m_{2}$ and $m_{3}$ :
+
+$$
+L _ {i} ^ {\prime} = - \log \frac {\exp \left(s \left(\cos \left(m _ {1} \theta_ {i y _ {i}} + m _ {2}\right) - m _ {3}\right)\right)}{\exp \left(s \left(\cos \left(m _ {1} \theta_ {i y _ {i}} + m _ {2}\right) - m _ {3}\right)\right) + \sum_ {j \neq y _ {i}} \exp \left(s \cos \theta_ {i j}\right)}, \tag {3.1}
+$$
+
+where $\theta_{ij} = \angle (\pmb{w}_j, \pmb{z}_i)$ . The hyper-parameters setting usually guarantees that $\cos(m_1\theta_{iy_i} + m_2) - m_3 \leq \cos m_2\cos\theta_{iy_i} - m_3$ , and $m_2$ is usually set to satisfy $\cos m_2 \geq \frac{1}{2}$ . Let $\alpha = \cos m_2$ and $\beta = -m_3 < 0$ , then we have
+
+$$
+L _ {i} ^ {\prime} \geq - \log \frac {\exp (s (\alpha \cos \theta_ {i y _ {i}} + \beta))}{\exp (s (\alpha \cos \theta_ {i y _ {i}} + \beta)) + \sum_ {j \neq y _ {i}} \exp (s \cos \theta_ {i j})}, \tag {3.2}
+$$
+
+which indicates that the existing well-designed normalized softmax loss functions are all considered as the upper bound of the right-hand side, and the equality holds if and only if $\theta_{iy_i} = 0$ .
+
+Generalized Margin Softmax Loss. Based on the right-hand side of (3.2), we can derive a more general formulation, called Generalized Margin Softmax (GM-Softmax) loss:
+
+$$
+L _ {i} = - \log \frac {\exp \left(s \left(\alpha_ {i 1} \cos \theta_ {i y _ {i}} + \beta_ {i 1}\right)\right)}{\exp \left(s \left(\alpha_ {i 2} \cos \theta_ {i y _ {i}} + \beta_ {i 2}\right)\right) + \sum_ {j \neq y _ {i}} \exp (s \cos \theta_ {i j})}, \tag {3.3}
+$$
+
+where $\alpha_{i1},\alpha_{i2},\beta_{i1}$ and $\beta_{i2}$ are hyper-parameters to handle the margins in training, which are set specifically for each sample instead of the same in (3.2). We also require that $\alpha_{i1}\geq \frac{1}{2}$ , $\alpha_{i2}\leq \alpha_{i1}$ , $s > 0$ , $\beta_{i1},\beta_{i2}\in \mathbb{R}$ . For class-balanced case, each sample is treated equally, thus setting $\alpha_{i1} = \alpha_{1}$
+
+$\alpha_{i2} = \alpha_{2}$ , $\beta_{i1} = \beta_{1}$ and $\beta_{i2} = \beta_{2}$ , $\forall i$ . For class-imbalanced case, the setting relies on the data distribution, e.g., the LDAM loss (Cao et al., 2019) achieves the trade-off of margins with $\alpha_{i1} = \alpha_{i2} = 1$ and $\beta_{i1} = \beta_{i2} = -Cn_{y_i}^{-1/4}$ . It is worth noting that we merely use the GM-Softmax loss as a theoretical formulation and will derive a more efficient form for the practical implementation.
+
+Wang et al. (2017) provided a lower bound for normalized softmax loss, which relies on the assumption that all samples are well-separated, i.e., each sample's feature is exactly the same as its corresponding prototype. However, this assumption could be invalid during training, e.g., for binary classification, the best feature of the first class $\mathbf{z}$ obtained by minimizing $-\log \frac{\exp(s\mathbf{w}_1^{\mathrm{T}}\mathbf{z})}{\exp(s\mathbf{w}_1^{\mathrm{T}}\mathbf{z}) + \exp(s\mathbf{w}_2^{\mathrm{T}}\mathbf{z})}$ is $\frac{\mathbf{w}_1 - \mathbf{w}_2}{\|\mathbf{w}_1 - \mathbf{w}_2\|_2}$ rather than $\mathbf{w}_1$ . In the following, we provide a more general theorem, which does not rely on such a strong assumption. Moreover, we prove that the solutions $\{\mathbf{w}_j^*\}_{j=1}^k$ , $\{\mathbf{z}_i^*\}_{i=1}^N$ minimizing the GM-Softmax loss will maximize both class margin and sample margin.
+
+Theorem 3.2. For class-balanced datasets, $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with GM-Softmax (where $\alpha_{i1} = \alpha_1$ , $\alpha_{i2} = \alpha_2$ , $\beta_{i1} = \beta_1$ and $\beta_{i2} = \beta_2$ ) leads to maximizing both class margin and sample margin.
+
+As can be seen, for any $\alpha_{1} \geq \frac{1}{2}$ , $\alpha_{2} \leq \alpha_{1}$ , $s > 0$ , and $\beta_{1}, \beta \in \mathbb{R}$ , minimizing the GM-Softmax loss produces the same optimal solution or leads to neural collapse (Papyan et al., 2020)), even though they are intuitively designed to obtain different decision boundaries. Moreover, we have
+
+Proposition 3.3. For class-balanced datasets, $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with the loss functions A-Softmax (Liu et al., 2017) with feature normalization, NormFace (Wang et al., 2017), CosFace (Wang et al., 2018b) or AM-Softmax (Wang et al., 2018a), and ArcFace (Deng et al., 2019) share the same optimal solution.
+
+Although these losses theoretically share the same optimal solution, in practice they usually meet sub-optimal solutions under different hyper-parameter settings when optimizing a neural network, which is demonstrated in Table 1. Moreover, these losses are complicated and possibly redundantly designed, leading to difficulties in practical implementation. Instead, we suggest a concise and easily implemented regularization term and a loss function in the following.
+
+Sample Margin Regularization. In order to encourage learning towards the largest margins, we may explicitly leverage the sample margin (2.5) as the loss, which is defined as:
+
+$$
+R _ {\mathrm {s m}} (\boldsymbol {x}, y) = - \left(\boldsymbol {w} _ {y} ^ {\mathrm {T}} \boldsymbol {z} - \max _ {j \neq y} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z}\right). \tag {3.4}
+$$
+
+Noticeably, the empirical risk $\frac{1}{N}\sum_{i=1}^{N}R_{\mathrm{sm}}(\pmb{x}_i,y_i)$ is a lower-bounded surrogate of $-\gamma_{\mathrm{min}}$ , i.e., $-\gamma_{\mathrm{min}}\geq \frac{1}{N}\sum_{i=1}^{N}R_{\mathrm{sm}}(\pmb{x}_i,y_i)$ , while directly minimizing $-\gamma_{\mathrm{min}}$ is too difficult to optimize neural networks. When $k\leq d + 1$ , learning with $R_{\mathrm{sm}}$ will promote the learning towards the largest margins:
+
+Theorem 3.4. For class-balanced datasets, $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with $R_{sm}$ leads to the maximization of both class margin and sample margin.
+
+Although learning with $R_{\mathrm{sm}}$ theoretically achieves the largest margins, in practical implementation, the optimization by the gradient-based methods shows unstable and non-convergent results for large scale datasets. Alternatively, we turn to combine $R_{\mathrm{sm}}$ as a regularization or complementary term with commonly-used losses, which is referred to as sample margin regularization. The empirical results demonstrate its superiority in learning towards the large margins, as depicted in Table 1.
+
+Largest Margin Softmax Loss (LM-Softmax). Theorem 2.2 provides a theoretical guarantee that maximizing $\gamma_{\mathrm{min}}$ will obtain the maximum of class margin regardless of feature dimension, class number, and class balancedness. It offers a straightforward approach to meet our purpose, i.e., learning towards the largest margins. However, directly maximizing $\gamma_{\mathrm{min}}$ is difficult to optimize a neural network with only one sample margin. As a consequence, we introduce a surrogate loss for balanced datasets, which is called the Largest Margin Softmax (LM-Softmax) loss:
+
+$$
+L (\boldsymbol {x}, y; s) = - \frac {1}{s} \log \frac {\exp \left(s \boldsymbol {w} _ {y} ^ {\mathrm {T}} \boldsymbol {z}\right)}{\sum_ {j \neq y} \exp \left(s \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z}\right)} = \frac {1}{s} \log \sum_ {j \neq y} \exp \left(s \left(\boldsymbol {w} _ {j} - \boldsymbol {w} _ {y}\right) ^ {\mathrm {T}} \boldsymbol {z}\right) \tag {3.5}
+$$
+
+which is derived by the limiting case of the logsumexp operator, i.e., we have $-\gamma_{\min} = \lim_{s\to \infty}\frac{1}{s}\log (\sum_{i = 1}^{N}\sum_{j\neq y_i}\exp (s(\pmb {w}_j^{\mathrm{T}}\pmb {z}_i - \pmb {w}_{y_i}^{\mathrm{T}}\pmb {z}_i)))$ . Moreover, since log is strictly concave, we
+
+can derive the following inequality
+
+$$
+\frac {1}{s} \log \left(\sum_ {i = 1} ^ {N} \sum_ {j \neq y _ {i}} \exp \left(s \left(\boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i} - \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)\right)\right) \geq \frac {1}{N} \sum_ {i = 1} ^ {N} L \left(\boldsymbol {x} _ {i}, y _ {i}; s\right) + \frac {1}{s} \log N. \tag {3.6}
+$$
+
+Minimizing the right-hand side of (3.6) usually leads to that $\sum_{j\neq y_i}\exp (s(\pmb {w}_j^{\mathrm{T}}\pmb {z} - \pmb{w}_{y_i}^{\mathrm{T}}\pmb {z}))$ is a constant, while the equality of (3.6) holds if and only if $\sum_{j\neq y_i}\exp (s(\pmb {w}_j^{\mathrm{T}}\pmb {z} - \pmb{w}_{y_i}^{\mathrm{T}}\pmb {z}))$ is a constant. Thus, we can achieve the maximum of $\gamma_{\mathrm{min}}$ by minimizing $L(\pmb {x},y;s)$ defined in (3.5).
+
+It can be found that, LM-Softmax can be regarded as a special case of the GM-Softmax loss when $\alpha_{2}$ or $\beta_{2}$ approaches $-\infty$ , which can be more efficiently implemented than the GM-Softmax loss. With respect to the original softmax loss, LM-Softmax removes the term $\exp(s w_{y}^{\mathrm{T}} z)$ in the denominator.
+
+# 3.2 CLASS-IMBALANCED CASE
+
+Class imbalance is ubiquitous and inherent in real-world classification problems (Buda et al., 2018; Liu et al., 2019). However, the performance of deep learning-based classification would drop significantly when the training dataset suffers from heavy class imbalance effect. According to (2.7), enlarging the sample margin can tighten the upper bound in case of class imbalance. To learn towards the largest margins on class-imbalanced datasets, we provide the following sufficient condition:
+
+Theorem 3.5. For class-balanced or -imbalanced datasets, $\pmb{w}_1,\dots,\pmb{w}_k,\pmb{z}_1,\dots,\pmb{z}_N\in \mathbb{S}^{d - 1}$ , $d\geq 2$ and $2\leq k\leq d + 1$ , if $\sum_{i = 1}^{K}\pmb{w}_{i} = 0$ , learning with GM-Softmax in (3.3) leads to maximizing both class margin and sample margin.
+
+This theorem reveals that, if the centroid of prototypes is equal to zero, learning with GM-Softmax will provide the largest margins.
+
+Zero-centroid Regularization. As a consequence, we propose a straight regularization term as follows, which can be combined with commonly-used losses to remedy the class imbalance effect:
+
+$$
+R _ {\mathrm {w}} \left\{\boldsymbol {w} _ {j} \right\} _ {j = 1} ^ {k} = \lambda \left\| \frac {1}{k} \sum_ {j = 1} ^ {k} \boldsymbol {w} _ {j} \right\| _ {2} ^ {2}. \tag {3.7}
+$$
+
+The zero-centroid regularization is only applied to prototypes at the last inner-product layer.
+
+# 4 EXPERIMENTS
+
+In this section, we provide extensive experimental results to show superiority of our method on a variety of tasks, including visual classification, imbalanced classification, person ReID, and face verification. More experimental analysis and implementation details can be found in the appendix.
+
+# 4.1 VISUAL CLASSIFICATION
+
+To verify the effectiveness of the proposed sample margin regularization in improving inter-class separability and intra-class compactness, we conduct experiments of classification on balanced datasets MNIST (LeCun et al., 1998), CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009). We evaluate performance with three metrics: 1) top-1 validation accuracy acc; 2) the class margin $m_{cls}$ defined in (2.2); 3) the average of sample margins $m_{samp}$ . We use a 4-layer CNN, ResNet-18, and ResNet-34 on MNIST, CIFAR-10, and CIFAR-100, respectively. Moreover, some commonly-used neural units are considered, such as ReLU, BatchNorm, and cosine learning rate annealing. We use CE, CosFace, ArcFace, NormFace as the compared baseline methods. Note that CosFace, ArcFace, NormFace have one identical hyper-parameter $s$ , which is used for comprehensive study.
+
+Results. As shown in Table 1, all baseline losses fail in learning with large margins for all $s$ , in which the class margin decreases as $s$ increases. There is no significant performance difference among them. In contrast, by coupling with the proposed sample margin regularization $R_{\mathrm{sm}}$ , the losses turn to have larger margins. The results demonstrate that the proposed sample margin regularization is really beneficial to learn towards the possible largest margins. Moreover, the enlargement on class margin and sample margin means better inter-class separability and intra-class compactness, which further brings the improvement of classification accuracy in most cases.
+
+Table 1: Test accuracies (acc), class margins $(m_{cls})$ and sample margins $(m_{samp})$ on MNIST, CIFAR-10 and CIFAR-100 using loss functions with/without $R_{\mathrm{sm}}$ in (3.4). The results with positive gains are highlighted.
+
+| Dataset | MNIST | CIFAR-10 | CIFAR-100 |
| Metric | acc | mcls | msamp | acc | mcls | msamp | acc | mcls | msamp |
| CE | 99.11 | 87.39° | 0.5014 | 94.12 | 81.73° | 0.6203 | 74.56 | 65.38° | 0.1612 |
| CE + 0.5Rsm | 99.13 | 95.41° | 1.026 | 94.45 | 96.31° | 0.9744 | 74.96 | 90.00° | 0.4955 |
| CosFace (s = 10) | 98.98 | 95.93° | 0.9839 | 94.39 | 96.00° | 0.9168 | 74.44 | 83.31° | 0.4578 |
| CosFace (s = 20) | 99.06 | 93.24° | 0.8376 | 94.13 | 91.22° | 0.7955 | 73.26 | 79.17° | 0.3078 |
| CosFace (s = 64) | 99.25 | 89.50° | 0.7581 | 93.53 | 64.14° | 0.6969 | 73.87 | 72.56° | 0.2233 |
| CosFace (s = 10) + 0.5Rsm | 99.16 | 95.56° | 1.033 | 94.42 | 96.26° | 0.9675 | 73.76 | 90.21° | 0.5089 |
| CosFace (s = 20) + 0.5Rsm | 99.24 | 95.41° | 1.030 | 94.27 | 96.18° | 0.9490 | 74.41 | 89.02° | 0.4780 |
| CosFace (s = 64) + 0.5Rsm | 99.27 | 95.35° | 1.019 | 94.20 | 95.48° | 0.9075 | 74.53 | 85.31° | 0.3817 |
| ArcFace (s = 10) | 99.05 | 94.64° | 0.8225 | 94.50 | 91.23° | 0.8501 | 73.96 | 76.91° | 0.4313 |
| ArcFace (s = 20) | 99.11 | 90.84° | 0.6091 | 94.11 | 53.98° | 0.5707 | 74.74 | 60.91° | 0.3010 |
| ArcFace (s = 64) | 99.21 | 82.63° | 0.4038 | - | - | - | - | - | - |
| ArcFace (s = 10) + 0.5Rsm | 99.14 | 95.42° | 1.034 | 94.21 | 96.27° | 0.9651 | 74.47 | 90.13° | 0.5143 |
| ArcFace (s = 20) + 0.5Rsm | 99.19 | 91.38° | 1.030 | 94.32 | 96.15° | 0.9571 | 74.64 | 88.73° | 0.4804 |
| ArcFace (s = 64) + 0.5Rsm | 99.14 | 95.29° | 1.019 | - | - | - | - | - | |
| NormFace (s = 10) | 99.06 | 94.34° | 0.7750 | 94.16 | 94.40° | 0.8004 | 74.23 | 79.10° | 0.4250 |
| NormFace (s = 20) | 99.09 | 89.27° | 0.5263 | 94.09 | 74.32° | 0.6001 | 73.87 | 77.47° | 0.2498 |
| NormFace (s = 64) | 99.00 | 82.08° | 0.2621 | 94.01 | 36.50° | 0.2633 | 73.42 | 52.37° | 0.0993 |
| NormFace (s = 10) + 0.5Rsm | 99.16 | 95.38° | 1.034 | 94.23 | 96.28° | 0.9650 | 74.54 | 90.10° | 0.5160 |
| NormFace (s = 20) + 0.5Rsm | 99.19 | 95.37° | 1.031 | 94.38 | 96.17° | 0.9519 | 74.75 | 88.86° | 0.4773 |
| NormFace (s = 64) + 0.5Rsm | 99.34 | 95.29° | 1.021 | 94.42 | 93.87° | 0.9508 | 74.33 | 76.02° | 0.3665 |
+
+# 4.2 IMBALANCED CLASSIFICATION
+
+To verify the effectiveness of the proposed zero-centroid regularization in handling class-imbalanced effect, we conduct experiments on imbalanced classification with two imbalance types: long-tailed imbalance (Cui et al., 2019) and step imbalance (Buda et al., 2018). The compared baseline losses include CE, Focal Loss, NormFace, CosFace, ArcFace, and the Label-Distribution-Aware Margin Loss (LDAM) with hyper-parameter $s = 5$ . We follow the controllable data imbalance strategy in (Maas et al., 2011; Cao et al., 2019) to create the imbalanced CIFAR-10/-100 by reducing the number of training examples per class and keeping the validation set unchanged. The imbalance ratio $\rho = \max_{i} n_{i} / \min_{i} n_{i}$ is used to denote the ratio between sample sizes of the most frequent and least frequent classes. We add zero-centroid regularization to the margin-based baseline losses and the proposed LM-Softmax to verify its validity. We report the top-1 validation accuracy acc and class margin $m_{cls}$ of compared methods.
+
+Table 2: Test accuracies (acc) and class margins $(m_{cls})$ on imbalanced CIFAR-10. The results with positive gains are highlighted (where * denotes coupling with zero-centroid regularization term).
+
+| Dataset | Imbalanced CIFAR-10 | Imbalanced CIFAR-100 |
| Imbalance Type | long-tailed | step | long-tailed | step |
| Imbalance Ratio | 100 | 10 | 100 | 10 | 100 | 10 | 100 | 10 |
| Metric | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls |
| CE | 70.88 | 77.41° | 88.17 | 79.63° | 62.21 | 76.50° | 85.06 | 82.24° | 40.38 | 64.73° | 60.42 | 66.24° |
| Focal | 66.30 | 74.14° | 87.33 | 74.48° | 60.55 | 63.31° | 84.49 | 75.16° | 38.04 | 54.67° | 60.09 | 59.29° |
| CosFace | 69.28 | 58.77° | 87.02 | 81.61° | 53.64 | 19.78° | 84.86 | 75.96° | 34.91 | 4.731° | 60.60 | 70.81° |
| CosFace* | 69.52 | 91.90° | 87.55 | 95.46° | 62.49 | 95.86° | 85.59 | 96.12° | 40.98 | 80.93° | 60.77 | 84.97° |
| ArcFace | 72.20 | 65.86° | 89.00 | 85.23° | 62.48 | 54.29° | 86.32 | 80.51° | 42.77 | 13.22° | 63.21 | 67.73° |
| ArcFace* | 72.23 | 92.30° | 89.22 | 96.23° | 64.38 | 93.51° | 86.65 | 96.23° | 44.68 | 56.60° | 63.80 | 73.45° |
| NormFace | 72.37 | 62.72° | 89.19 | 82.60° | 63.69 | 51.00° | 86.37 | 77.82° | 43.71 | 16.11° | 63.50 | 71.26° |
| NormFace* | 72.07 | 94.95° | 89.30 | 94.50° | 64.07 | 93.06° | 86.49 | 96.28° | 44.25 | 64.85° | 63.81 | 79.85° |
| LDAM | 72.86 | 73.30° | 88.92 | 88.19° | 63.27 | 61.42° | 87.04 | 85.21° | 43.28 | 7.733° | 63.62 | 73.19° |
| LDAM* | 72.86 | 91.75° | 89.51 | 96.26° | 64.99 | 96.04° | 86.74 | 96.26° | 45.23 | 70.96° | 64.18 | 85.03° |
| LM-Softmax | 65.32 | 4.420° | 88.69 | 68.91° | 50.47 | 0.452° | 86.08 | 52.20° | 41.52 | 4.500° | 63.26 | 68.31° |
| LM-Softmax* | 73.21 | 92.57° | 89.12 | 95.73° | 65.91 | 93.84° | 87.07 | 96.05° | 45.28 | 69.53° | 63.77 | 81.99° |
+
+Results. As can be seen from Table 2, the baseline margin-based losses have small class margins, although their classification performances are better than CE and Focal, which largely attribute to the normalization on feature and prototype. We can further improve their classification accuracy by
+
+enlarging their class margins through the proposed zero-centroid regularization, as demonstrated by results in Table 2. Moreover, it can be found that the class margin of our LM-Softmax loss is fairly low in the severely imbalanced cases, since it is tailored for balanced case. We can also achieve significantly enlarged class margins and improved accuracy by the zero-centroid regularization.
+
+# 4.3 PERSON RE-IDENTIFICATION
+
+We conduct experiments on the task of person re-identification. Specifically, we use the off-the-shelf baseline (Luo et al., 2019) as the main code to verify the effectiveness of our proposed LM-Softmax. We follow the default parameter settings and training strategy, and train the ResNet50 with Triplet Loss Schroff et al. (2015) coupling with the compared losses, including the Softmax loss (CE), ArcFace, CosFace, NormFace, and our proposed LM-Softmax. Experiments are conducted on Market-1501 (Zheng et al., 2015) and DukeMTMC (Ristani et al., 2016). As shown in Table 3, our proposed LM-Softmax obtains obvious improvements in mean Average Precision (mAP), rank-1(Rank@1), and rank-5
+
+Table 3: The results on Market-1501 and DukeMTMC for person re-identification task. The best three results are highlighted.
+
+| Dataset | Market-1501 | DukeMTMC |
| Method | mAP | Rank1 | Rank@5 | mAP | Rank@1 | Rank@5 |
| CE | 82.8 | 92.7 | 97.5 | 73.0 | 83.5 | 93.0 |
| ArcFace (s = 10) | 67.5 | 84.1 | 92.1 | 37.7 | 58.7 | 72.7 |
| ArcFace (s = 20) | 79.1 | 90.8 | 96.5 | 61.4 | 78.3 | 88.6 |
| ArcFace (s = 64) | 80.4 | 92.6 | 97.4 | 67.6 | 83.4 | 91.4 |
| CosFace (s = 10) | 68.0 | 84.9 | 92.7 | 39.3 | 60.6 | 73.1 |
| CosFace (s = 20) | 80.5 | 92.0 | 97.1 | 64.2 | 81.3 | 89.7 |
| CosFace (s = 64) | 78.7 | 92.0 | 97.1 | 68.2 | 83.1 | 92.5 |
| NormFace (s = 10) | 81.2 | 91.6 | 96.3 | 63.7 | 79.3 | 88.5 |
| NormFace (s = 20) | 83.2 | 93.5 | 97.9 | 71.6 | 83.8 | 93.3 |
| NormFace (s = 64) | 77.5 | 90.0 | 96.9 | 60.1 | 75.2 | 88.1 |
| LM-Softmax (s = 10) | 83.3 | 92.8 | 97.1 | 72.2 | 85.8 | 92.4 |
| LM-Softmax (s = 20) | 84.7 | 93.8 | 97.6 | 74.1 | 86.4 | 93.5 |
| LM-Softmax (s = 64) | 84.6 | 93.9 | 98.1 | 74.2 | 86.6 | 93.5 |
+
+(Rank@5) matching rate. Moreover, LM-Softmax exhibits significant robustness for different parameters, while ArcFace, CosFace, and NormFace show worse performance than ours and are more sensitive to parameter settings.
+
+# 4.4 FACE VERIFICATION
+
+We also verify our method on face verification that highly depends on the discriminability of feature embeddings. Following the settings in (An et al., 2020), we train the compared models on a large-scale dataset MS1MV3 (85K IDs/ 5.8M images) (Guo et al., 2016) and test on LFW (Huang et al., 2008), CFP-FP (Sengupta et al., 2016), AgeDB-30 (Moschoglou et al., 2017) and IJBC (Maze et al., 2018). We use ResNet34 as the backbone, and train it with batch size 512 for all compared methods. The comparison study includes CosFace, ArcFace, NormFace, and our LM-Softmax.
+
+Table 4: Face verification results on IJBC-C, Age-DB30, CFP-FP and LFW. The results with positive gains are highlighted.
+
+| Method | IJB-C | Age-DB30 | CFP-FP | LFW |
| ArcFace | 99.4919 | 98.067 | 97.371 | 99.800 |
| CosFace | 99.4942 | 98.033 | 97.300 | 99.800 |
| LM-Softmax | 99.4721 | 97.917 | 97.057 | 99.817 |
| ArcFace† | 99.5011 | 98.117 | 97.400 | 99.817 |
| ArcFace‡ | 99.5133 | 98.083 | 97.471 | 99.817 |
| CosFace† | 99.5112 | 98.150 | 97.371 | 99.817 |
| CosFace‡ | 99.5538 | 97.900 | 97.500 | 99.800 |
| LM-Softmax‡ | 99.5086 | 98.167 | 97.429 | 99.833 |
+
+$\dagger$ and $\ddagger$ denotes training with $R_{\mathrm{sm}}$ and $R_{\mathrm{w}}$ , respectively.
+
+As shown in Table 4, $R_{\mathrm{sm}}$ (sample margin regularization) and $R_{\mathrm{w}}$ (zero-centroid regularization) can improve the performance of these baselines in most cases. Moreover, it is worth noting that the results of LM-Softmax are slightly worse than ArcFace and CosFace, which is due to that in these large-scale datasets there exists class-imbalanced effect more or less. We can alleviate this issue by adding $R_{\mathrm{w}}$ , which can improve the performance further.
+
+# 5 CONCLUSION
+
+In this paper, we attempted to develop a principled mathematical framework for better understanding and design of margin-based loss functions, in contrast to the existing ones that are designed heuristically. Specifically, based on the class and sample margins, which are employed as measures of intra-class compactness and inter-class separability, we formulate the objective as learning towards the largest margins, and offer rigorously theoretical analysis as support. Following this principle, for class-balance case, we propose an explicit sample margin regularization term and a novel largest margin softmax loss; for class-imbalance case, we propose a simple but effective zero-centroid regularization term. Extensive experimental results demonstrate that the proposed strategy significantly improves the performance in accuracy and margins on various tasks.
+
+Acknowledgements. This work was supported by National Key Research and Development Project under Grant 2019YFE0109600, National Natural Science Foundation of China under Grants 61922027, 6207115 and 61932022.
+
+# REFERENCES
+
+Xiang An, Xuhan Zhu, Yang Xiao, Lan Wu, Ming Zhang, Yuan Gao, Bin Qin, Debing Zhang, and Fu Ying. Partial fc: Training 10 million identities on a single machine. In Arxiv 2010.05222, 2020.
+Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. In International Conference on Machine Learning, pp. 517-526. PMLR, 2017.
+Sergiy V Borodachov, Douglas P Hardin, and Edward B Saff. Discrete energy on rectifiable sets. Springer, 2019.
+Andrew Brock, Soham De, Samuel L Smith, and Karen Simonyan. High-performance large-scale image recognition without normalization. arXiv preprint arXiv:2102.06171, 2021.
+Mateusz Buda, Atsuto Maki, and Maciej A Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. *Neural Networks*, 106:249–259, 2018.
+Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, 2019.
+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.
+Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9268-9277, 2019.
+Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4690-4699, 2019.
+Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
+Gamaleldin Elsayed, Dilip Krishnan, Hossein Mobahi, Kevin Regan, and Samy Bengio. Large margin deep networks for classification. Advances in neural information processing systems, 31, 2018.
+Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315-323. JMLR Workshop and Conference Proceedings, 2011.
+Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In European conference on computer vision, pp. 87-102. Springer, 2016.
+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.
+Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
+
+Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. In Workshop on faces in 'Real-Life' Images: detection, alignment, and recognition, 2008.
+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.
+Sham M Kakade, Karthik Sridharan, and Ambuj Tewari. On the complexity of linear prediction: risk bounds, margin bounds, and regularization. In Proceedings of the 21st International Conference on Neural Information Processing Systems, pp. 793-800, 2008.
+Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In *Eighth International Conference on Learning Representations (ICLR)*, 2020.
+Vladimir Koltchinskii, Dmitry Panchenko, et al. Empirical margin distributions and bounding the generalization error of combined classifiers. Annals of statistics, 30(1):1-50, 2002.
+A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 1, 01 2009.
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning-Volume 48, pp. 507-516, 2016.
+Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherface: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 212-220, 2017.
+Weiyang Liu, Rongmei Lin, Zhen Liu, Lixin Liu, Zhiding Yu, Bo Dai, and Le Song. Learning towards minimum hyperspherical energy. Advances in Neural Information Processing Systems, 31:6222-6233, 2018.
+Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X Yu. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2537-2546, 2019.
+I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. In ICLR 2017 (5th International Conference on Learning Representations), 2016.
+Hao Luo, Youzhi Gu, Xingyu Liao, Shenqi Lai, and Wei Jiang. Bag of tricks and a strong baseline for deep person re-identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 0–0, 2019.
+Andrew Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th annual meeting of the association for computational linguistics: Human language technologies, pp. 142-150, 2011.
+Brianna Maze, Jocelyn Adams, James A Duncan, Nathan Kalka, Tim Miller, Charles Otto, Anil K Jain, W Tyler Niggel, Janet Anderson, Jordan Cheney, et al. Iarpa janus benchmark-c: Face dataset and protocol. In 2018 International Conference on Biometrics (ICB), pp. 158-165. IEEE, 2018.
+Pascal Mettes, Elise van der Pol, and Cees G M Snoek. Hyperspherical prototype networks. In Advances in Neural Information Processing Systems, 2019.
+Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: the first manually collected, in-the-wild age database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 51-59, 2017.
+
+Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. In European Conference on Computer Vision, pp. 681-699. Springer, 2020.
+Vardan Papyan, XY Han, and David L Donoho. Prevalence of neural collapse during the terminal phase of deep learning training. Proceedings of the National Academy of Sciences, 117(40): 24652-24663, 2020.
+Omkar M Parkhi, Andrea Vedaldi, and Andrew Zisserman. Deep face recognition. In *British Machine Vision Association*, 2015.
+Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
+Ergys Ristani, Francesco Solera, Roger S. Zou, R. Cucchiara, and Carlo Tomasi. Performance measures and a data set for multi-target, multi-camera tracking. In ECCV Workshops, 2016.
+Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 815-823, 2015.
+Soumyadip Sengupta, Jun-Cheng Chen, Carlos Castillo, Vishal M Patel, Rama Chellappa, and David W Jacobs. Frontal to profile face verification in the wild. In 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1-9. IEEE, 2016.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1-9, 2015.
+Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve Jegou. Fixing the train-test resolution discrepancy. 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.
+Feng Wang, Xiang Xiang, Jian Cheng, and Alan Loddon Yuille. Normface: L2 hypersphere embedding for face verification. In Proceedings of the 25th ACM international conference on Multimedia, pp. 1041-1049, 2017.
+Feng Wang, Jian Cheng, Weiyang Liu, and Hajjun Liu. Additive margin softmax for face verification. IEEE Signal Processing Letters, 25(7):926-930, 2018a.
+Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5265-5274, 2018b.
+Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pp. 9929-9939. PMLR, 2020.
+L. L. Whyte. Unique arrangements of points on a sphere. The American Mathematical Monthly, 59 (9):606-611, 1952. ISSN 00029890, 19300972. URL http://www.jstor.org/stable/2306764.
+Liang Zheng, Liyue Shen, Lu Tian, Shengjin Wang, Jingdong Wang, and Qi Tian. Scalable person re-identification: A benchmark. In Proceedings of the IEEE international conference on computer vision, pp. 1116-1124, 2015.
+Zhisheng Zhong, Jiequan Cui, Shu Liu, and Jiaya Jia. Improving calibration for long-tailed recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16489-16498, 2021.
+
+Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8697-8710, 2018.
+
+# Appendix for “Learning Towards the Largest Margin”
+
+# A PROOFS
+
+Lemma 2.1. For any $\pmb{w}_1, \dots, \pmb{w}_k \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , the solution of minimal Riesz t-energy and $k$ -points best-packing configurations are uniquely given by the vertices of regular $(k-1)$ -simplices inscribed in $\mathbb{S}^{d-1}$ . Furthermore, $\pmb{w}_i^{\mathrm{T}}\pmb{w}_j = \frac{-1}{k-1}, \forall i \neq j$ .
+
+Proof. See in Borodachov et al. (2019, Theorem 3.3.1).
+
+
+
+Theorem 2.2. For $\pmb{w}_1, \dots, \pmb{w}_k, \pmb{z}_1, \dots, \pmb{z}_N \in \mathbb{S}^{d-1}$ (where $n_j > 0$ for each $j \in [1, k]$ ), the optimal solution $\{\pmb{w}_i^*\}_{i=1}^k$ , $\{\pmb{z}_i^*\}_{i=1}^N = \arg \max_{\{\pmb{w}_i\}_{i=1}^k, \{\pmb{z}_i\}_{i=1}^N} \gamma_{\min}$ is obtained if and only if $\{\pmb{w}_i^*\}_{i=1}^k$ maximizes the class margin $m_c(\{\pmb{w}_i\}_{i=1}^k)$ , and $\pmb{z}_i^* = \frac{\pmb{w}_{y_i}^* - \overline{\pmb{w}}_{y_i}^*}{\|\pmb{w}_{y_i}^* - \overline{\pmb{w}}_{y_i}^*\|_2}$ , where $\overline{\pmb{w}}_{y_i}^*$ denotes the centroid of the vectors $\{\pmb{w}_j : j \text{ maximizes } \pmb{w}_{y_i}^{\mathrm{T}}\pmb{w}_j, j \neq y_i\}$ .
+
+Proof. According to the definition of $\gamma_{\mathrm{min}}$ , we have
+
+$$
+\begin{array}{l} \underset {\boldsymbol {w}} {\arg \max } \underset {\boldsymbol {z}} {\max } \gamma_ {\min } = \underset {\boldsymbol {w}} {\arg \max } \underset {\boldsymbol {z}} {\max } \underset {i} {\min } \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} - \underset {j \neq y _ {i}} {\max } \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i} \\ = \arg \max _ {\boldsymbol {w}} \min _ {i} \max _ {\boldsymbol {z} _ {i}} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} - \max _ {j \neq y _ {i}} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i} \\ = \arg \max _ {\boldsymbol {w}} \min _ {i} \max _ {\boldsymbol {z} _ {i}} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} - \boldsymbol {w} _ {k} ^ {\mathrm {T}} \boldsymbol {z} _ {i} \\ = \underset {\boldsymbol {w}} {\arg \operatorname * {m a x}} \underset {i} {\operatorname * {m i n}} \left\| \boldsymbol {w} _ {y _ {i}} - \boldsymbol {w} _ {k} \right\| _ {2} \\ \end{array}
+$$
+
+where $k = \arg \max_{j \neq y_i} \boldsymbol{w}_j^{\mathrm{T}} \boldsymbol{z}_i$ , and $z_i = \frac{\boldsymbol{w}_{y_i} - \boldsymbol{w}_k}{\|\boldsymbol{w}_{y_i} - \boldsymbol{w}_k\|_2}$ . Notice that $\boldsymbol{w}_k^{\mathrm{T}} \boldsymbol{z}_i = -\frac{1}{2} \| \boldsymbol{w}_{y_i} - \boldsymbol{w}_k \|_2$ , then $k = \arg \min_{j \neq y_i} \| \boldsymbol{w}_{y_i}^{\mathrm{T}} - \boldsymbol{w}_j \|_2$ . Therefore, we have
+
+$$
+\operatorname * {a r g \max _ {\boldsymbol {w}} \max _ {\boldsymbol {z}} \gamma_ {\min } = \operatorname * {m a x} _ {\boldsymbol {w}} \operatorname * {m i n} _ {i} \operatorname * {m i n} _ {k \neq y _ {i}} \| \boldsymbol {w} _ {y _ {i}} - \boldsymbol {w} _ {k} \| _ {2} = \operatorname * {a r g \max _ {\boldsymbol {w}} \operatorname * {m i n} _ {i \neq j} \| \boldsymbol {w} _ {i} - \boldsymbol {w} _ {j} \| _ {2}},
+$$
+
+i.e., maximizing $\gamma_{\mathrm{min}}$ will provide the solution of the Tammes Problem, which also maximizes the class margin.
+
+On the other hand, $z_{i}^{*}$ maximizes $\boldsymbol{w}_{y_i}^{*\mathrm{T}}\boldsymbol {z}_i - \max_{j\neq y_i}\boldsymbol {w}_j^{*\mathrm{T}}\boldsymbol {z}_i$ , i.e.,
+
+$$
+\begin{array}{l} \boldsymbol{z}_{i}^{*} = \operatorname *{arg max}_{\boldsymbol {z}_{i}\in \mathbb{S}^{d - 1}}\boldsymbol{w}_{y_{i}}^{*\mathrm{T}}\boldsymbol{z}_{i} - \max_{j\neq y_{i}}\boldsymbol{w}_{j}^{*\mathrm{T}}\boldsymbol{z}_{i} \\ = \operatorname * {a r g m a x} _ {\boldsymbol {z} _ {i} \in \mathbb {S} ^ {d - 1}} \boldsymbol {w} _ {y _ {i}} ^ {* \mathrm {T}} \boldsymbol {z} _ {i} - \overline {{\boldsymbol {w}}} _ {y _ {i}} ^ {* \mathrm {T}} \boldsymbol {z} _ {i} \quad , \\ = \frac {\pmb {w} _ {y _ {i}} ^ {*} - \overline {{\pmb {w}}} _ {y _ {i}} ^ {*}}{\| \pmb {w} _ {y _ {i}} ^ {*} - \overline {{\pmb {w}}} _ {y _ {i}} ^ {*} \| _ {2}} \\ \end{array}
+$$
+
+where $\overline{\boldsymbol{w}}_{y_i}^*$ denotes the centroid of the vectors $\{\boldsymbol{w}_j:j$ maximizes $\mathbf{w}_{y_i}^{\mathrm{T}}\mathbf{w}_j,j\neq y_i\}$ .
+
+
+
+Proposition 2.3. For any $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , the maximum of $\gamma_{\min}$ is $\frac{k}{k-1}$ , which is obtained if and only if $\forall i \neq j$ , $\mathbf{w}_i^{\mathrm{T}}\mathbf{w}_j = -\frac{1}{k-1}$ , and $\mathbf{z}_i = \mathbf{w}_{y_i}$ .
+
+Proof. Based on Theorem 2.2, the maximum of $\gamma_{\mathrm{min}}$ is obtained if and only if $\{\pmb{w}_i\}_{i=1}^k$ maximizes the class margin and $\pmb{z}_i = \frac{\pmb{w}_{y_i} - \overline{\pmb{w}}_{y_i}}{\|\pmb{w}_{y_i} - \overline{\pmb{w}}_{y_i}\|_2}$ , i.e., $\pmb{w}_i^{\mathrm{T}}\pmb{w}_j = -\frac{1}{k-1}$ according to Lemma 2.3. At this time, we have $\pmb{z}_i = \frac{\pmb{w}_{y_i} - \overline{\pmb{w}}_{y_i}}{\|\pmb{w}_{y_i} - \overline{\pmb{w}}_{y_i}\|_2} = \frac{\pmb{w}_{y_i} - (-\pmb{w}_{y_i})}{\|\pmb{w}_{y_i} - (-\pmb{w}_{y_i})\|_2} = \pmb{w}_{y_i}$ .
+
+Theorem 3.1. $\forall \varepsilon \in (0,\pi /2]$ , if the range of $\pmb{w}_1,\dots,\pmb{w}_k$ or $\pmb{z}_1,\dots,\pmb{z}_N$ is $\mathbb{R}^d$ ( $2\leq k\leq d + 1$ ), then there exists prototypes that achieve the infimum of the softmax loss and have the class margin $\varepsilon$ .
+
+Proof. With the softmax loss, the goal is to optimize the following problem
+
+$$
+\min _ {\left. \boldsymbol {w} _ {j} \right\rbrace_ {j = 1} ^ {k}, \left. \boldsymbol {z} _ {i} \right\rbrace_ {i = 1} ^ {N}} L = - \frac {1}{N} \sum_ {i = 1} ^ {N} \log \frac {\exp \left(\boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)}{\sum_ {j = 1} ^ {K} \exp \left(\boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)}.
+$$
+
+$\forall \varepsilon \in (0, \frac{\pi}{2}]$ , we can easily obtain $k \leq d + 1$ vectors $\boldsymbol{w}_1', \ldots, \boldsymbol{w}_k'$ on the unit sphere $\mathbb{S}^{d-1}$ , such that the angle between any two of them is $\varepsilon \in (0, \frac{\pi}{2})$ .
+
+(1) If the domain of $\boldsymbol{w}_1, \dots, \boldsymbol{w}_k$ is $\mathbb{R}^d$ , then let $\boldsymbol{w}_j = s\boldsymbol{w}_j'$ , and $\boldsymbol{z}_i = \boldsymbol{w}_{y_i}$ . In this way, we have $\boldsymbol{w}_{y_i}^{\mathrm{T}}\boldsymbol{z}_i > \boldsymbol{w}_j^{\mathrm{T}}\boldsymbol{z}_i, \forall j \neq y_i$ . The infimum of softmax loss can be obtained by directly increasing $s$ .
+(2) If the domain of $z_1, \ldots, z_k$ is $\mathbb{R}^d$ , then let $w_j = w_j'$ , and $z_i = s w_{y_i}$ . In this way, we have $w_{y_i}^{\mathrm{T}} z_i > w_j^{\mathrm{T}} z_i, \forall j \neq y_i$ . The infimum of softmax loss can be obtained by directly increasing $s$ .
+
+In conclusion, without both normalization for both features and prototypes, the original softmax loss may produce an arbitrary small class margin $\varepsilon$ .
+
+Theorem 3.2. For class-balanced datasets (i.e., each class has the same number of samples), $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with GM-Softmax (where $\alpha_{i1} = \alpha_1$ , $\alpha_{i2} = \alpha_2$ , $\beta_{i1} = \beta_1$ and $\beta_{i2} = \beta_2$ ) leads to maximizing both the class margin and the sample margin. More specifically, the optimal solution
+
+$$
+\left\{\boldsymbol {w} _ {j} ^ {*} \right\} _ {j = 1} ^ {k}, \left\{\boldsymbol {z} _ {i} ^ {*} \right\} _ {i = 1} ^ {N} = \underset {\boldsymbol {w} _ {j}, \boldsymbol {z} _ {i} \in \mathbb {S} ^ {d - 1}} {\arg \min } \frac {1}{N} \sum_ {i = 1} ^ {N} - \log \frac {\exp (s (\alpha_ {1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {1}))}{\exp (s (\alpha_ {2} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {2})) + \sum_ {j \neq y _ {i}} \exp (s \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i})}
+$$
+
+have the largest class margin $m_c^* = \arccos \frac{-1}{k-1}$ and the largest sample margin $\gamma_{\mathrm{min}}^* = \frac{k}{k-1}$ . The lower bound of the risk is $\log[\exp(s(\alpha_1 + \beta_1 - \alpha_2 - \beta_2)) + (k-1)\exp(-s(\frac{1}{k-1} + \alpha_1 + \beta_1))]$ , which is obtained if and only if $\forall i \neq j$ , $\boldsymbol{w}_i^{\mathrm{T}}\boldsymbol{w}_j = \frac{-1}{k-1}$ , and $\boldsymbol{z}_i = \boldsymbol{w}_{y_i}$ .
+
+Proof. Since the function $\exp$ is strictly convex, using the Jensen's inequality, we have
+
+$$
+\begin{array}{l} L = \frac {1}{N} \sum_ {i = 1} ^ {N} - \log \frac {\exp \left(s \left(\alpha_ {1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {1}\right)\right)}{\exp \left(s \left(\alpha_ {2} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {2}\right)\right) + \sum_ {j \neq i} \exp \left(s \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)} \\ \geq \frac {1}{N} \sum_ {i = 1} ^ {N} - \log \frac {\exp (s (\alpha_ {1} \pmb {w} _ {y _ {i}} ^ {\mathrm {T}} \pmb {z} _ {i} + \beta_ {1}))}{\exp (s (\alpha_ {2} \pmb {w} _ {y _ {i}} ^ {\mathrm {T}} \pmb {z} _ {i} + \beta_ {2})) + (k - 1) \exp (\frac {s}{k - 1} \sum_ {j \neq i} \pmb {w} _ {j} ^ {\mathrm {T}} \pmb {z} _ {i})} \\ \end{array}
+$$
+
+Let $\overline{\boldsymbol{w}} = \frac{1}{k}\sum_{i=1}^{k}\boldsymbol{w}_i$ , $\alpha = \alpha_2 - \alpha_1$ , $\beta = \beta_2 - \beta_1$ , $\sigma = \frac{k}{k-1}$ , and $\delta = \frac{1}{k-1} + \alpha_1$ , then we have
+
+$$
+\begin{array}{l} L \geq \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left[ \right. \exp \left( \right.s \left(\alpha \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta\right) + (k - 1) \exp \left(s \left(\sigma \overline {{\boldsymbol {w}}} - \delta \boldsymbol {w} _ {y _ {i}}\right) ^ {\mathrm {T}} \boldsymbol {z} _ {i} - s \beta_ {1}\right)\left. \right] \\ \geq \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left[ \exp (s \alpha + s \beta) + (k - 1) \exp (- s \| \sigma \overline {{\boldsymbol {w}}} - \delta \boldsymbol {w} _ {y _ {i}} \| _ {2} - s \beta_ {1}) \right] \\ = \frac {1}{k} \sum_ {i = 1} ^ {k} \log \left[ \exp (s \alpha + s \beta) + (k - 1) \exp (- s \| \sigma \overline {{\boldsymbol {w}}} - \delta \boldsymbol {w} _ {i} \| _ {2} - s \beta_ {1}) \right] \\ \end{array}
+$$
+
+where we use the facts that $\alpha \mathbf{w}_{y_i}^{\mathrm{T}}\mathbf{z}_i \geq \alpha$ when $\alpha \leq 0$ , $(\sigma \overline{\mathbf{w}} - \delta \mathbf{w}_{y_i})^{\mathrm{T}}\mathbf{z}_i \geq -\|\sigma \overline{\mathbf{w}} - \delta \mathbf{w}_i\|_2$ when $\mathbf{z}_i \in \mathbb{S}^{d-1}$ . Due the convexity of the function $\log[1 + \exp(ax + b)]$ ( $a > 0$ ), we use the Jensen's
+
+inequality and obtain that
+
+$$
+\begin{array}{l} L \geq \log \left[ \exp (s (\alpha + \beta)) + (k - 1) \exp \left(- \frac {s}{k} \sum_ {i = 1} ^ {k} \| \sigma \overline {{\boldsymbol {w}}} - \delta \boldsymbol {w} _ {i} \| _ {2} - s \beta_ {1}\right) \right] \\ \geq \log \left[ \exp (s (\alpha + \beta)) + (k - 1) \exp \left(- \frac {s}{k} \sqrt {k \sum_ {i = 1} ^ {k} \| \sigma \bar {\boldsymbol {w}} - \delta \boldsymbol {w} _ {i} \| _ {2} ^ {2}} - s \beta_ {1}\right) \right] \\ = \log \left[ \exp (s (\alpha + \beta)) + (k - 1) \exp \left(- \frac {s}{k} \sqrt {k (k \delta^ {2} - 2 k \sigma \delta \| \overline {{\boldsymbol {w}}} \| _ {2} ^ {2} + k \sigma^ {2} \| \overline {{\boldsymbol {w}}} \| _ {2} ^ {2})} - s \beta_ {1}) \right. \right], \\ \geq \log [ \exp (s (\alpha + \beta)) + (k - 1) \exp (- s (\delta + \beta_ {1})) ] \\ = \log \left[ \exp \left(s \left(\alpha_ {2} - \alpha_ {1} + \beta_ {2} - \beta_ {1}\right)\right) + (k - 1) \exp \left(- s \left(\frac {1}{k - 1} + \alpha_ {1} + \beta_ {1}\right)\right) \right] \\ \end{array}
+$$
+
+where in the second inequality we used the Cauchy-Schwarz inequality, and the third inequality is based on that $\sigma \leq 2\delta \Leftrightarrow \alpha_{1} \geq \frac{k - 2}{2k - 2}$ , which holds since $\alpha_{1} \geq \frac{1}{2}$ .
+
+According to the above derivation, the equality holds if and only if $\forall i$ , $\pmb{w}_{1}^{\mathrm{T}}\pmb{z}_{i} = \dots = \pmb{w}_{y_{i} - 1}^{\mathrm{T}}\pmb{z}_{i} = \pmb{w}_{y_{i} + 1}^{\mathrm{T}}\pmb{z}_{i} = \dots = \pmb{w}_{k}^{\mathrm{T}}\pmb{z}_{i}$ , $\pmb{w}_{y_{i}}^{\mathrm{T}}\pmb{z}_{i} = 1$ , $\pmb{z}_{i} = -\frac{\sigma\overline{\pmb{w}} - \delta\pmb{w}_{y_{i}}}{\|\sigma\overline{\pmb{w}} - \delta\pmb{w}_{y_{i}}\|_{2}}$ , $\|\sigma\overline{\pmb{w}} - \delta\pmb{w}_{1}\|_{2} = \dots = \|\sigma\overline{\pmb{w}} - \delta\pmb{w}_{k}\|_{2}$ and $\overline{\pmb{w}} = 0$ . The condition can be simplified as $\forall i \neq j$ , $\pmb{w}_{i}^{\mathrm{T}}\pmb{w}_{j} = \frac{-1}{k-1}$ , and $\pmb{z}_{i} = \pmb{w}_{y_{i}}$ when $2 \leq d$ and $2 \leq k \leq d+1$ .
+
+Proposition 3.3. For class-balanced datasets, $\mathbf{w}_1, \dots, \mathbf{w}_k, \mathbf{z}_1, \dots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with the loss functions A-Softmax (Liu et al., 2017) with feature normalization, NormFace (Wang et al., 2017), CosFace (Wang et al., 2018b) or AM-Softmax (Wang et al., 2018a), and ArcFace (Deng et al., 2019) share the same optimal solution.
+
+Proof. A unified framework for A-Softmax with feature normalization, NormFace, LMLC/AM-Softmax and ArcFace can be implemented with hyper-parameters $m_1$ , $m_2$ and $m_3$ , i.e.,
+
+$$
+L _ {i} ^ {\prime} = - \log \frac {\exp (s (\cos (m _ {1} \theta_ {i y _ {i}} + m _ {2}) - m _ {3}))}{\exp (s (\cos (m _ {1} \theta_ {i y _ {i}} + m _ {2}) - m _ {3})) + \sum_ {j \neq y _ {i}} \exp (s \cos \theta_ {i j})},
+$$
+
+where $\theta_{ij} = \angle (\pmb{w}_j, \pmb{z}_i)$ . The setting of these hyper-parameters always guarantees that $\cos(m_1\theta_{iy_i} + m_2) - m_3 \leq \cos m_2\cos\theta_{iy_i} - m_3$ , and $m_2$ is usually set to satisfy $\cos m_2 \geq \frac{1}{2}$ . Let $\alpha = \cos m_2$ and $\beta = -m_3 < 0$ , then we have
+
+$$
+L _ {i} ^ {\prime} \geq - \log \frac {\exp (s (\alpha \cos \theta_ {i y _ {i}} + \beta))}{\exp (s (\alpha \cos \theta_ {i y _ {i}} + \beta)) + \sum_ {j \neq y _ {i}} \exp (s \cos \theta_ {i j})}, \tag {A.1}
+$$
+
+where the equality holds if and only if $\theta_{iy_i} = 0$ .
+
+According to Theorem 3.2, we know that the empirical risk of the loss function in the right-hand side of (3.2) has a lower bound, then we obtain
+
+$$
+\frac {1}{N} \sum_ {i = 1} ^ {N} L _ {i} ^ {\prime} \geq - \log \frac {\exp (s (\alpha + \beta))}{\exp (s (\alpha + \beta)) + \sum_ {j \neq y _ {i}} \exp \left(- \frac {s}{k - 1}\right)} \tag {A.2}
+$$
+
+The equality holds if and only if $\forall i\neq j,\pmb{w}_i^{\mathrm{T}}\pmb {w}_j = \frac{-1}{k - 1}$ , and $\pmb {z}_i = \pmb {w}_{y_i}$ . Since $\pmb {z}_i = \pmb {w}_{y_i}$ means $\theta_{iy_i} = 0$ , indicating that the equality in (3.2) holds. Then the optimal solution is the same for A-Softmax with feature normalization, NormFace, CosFace, and ArcFace.
+
+Theorem 3.4. For class-balanced datasets, $\mathbf{w}_1, \ldots, \mathbf{w}_k, \mathbf{z}_1, \ldots, \mathbf{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ , and $2 \leq k \leq d+1$ , learning with $R_{sm} = -\mathbf{w}_y^{\mathrm{T}}\mathbf{z} + \max_{j \neq y} \mathbf{w}_j^{\mathrm{T}}\mathbf{z}$ leads to the maximization of the class margin and the sample margin.
+
+Proof. Let $L(\boldsymbol{z}, y) = -\boldsymbol{w}_y^{\mathrm{T}} \boldsymbol{z} + \max_{j \neq y} \boldsymbol{w}_j^{\mathrm{T}} \boldsymbol{z}$ , $\overline{\boldsymbol{w}} = \frac{1}{k} \sum_{i=1}^{k} \boldsymbol{w}_i$ , then we have
+
+$$
+\begin{array}{l} \frac {1}{N} \sum_ {i = 1} ^ {N} L (z _ {i}, y _ {i}) = \frac {1}{N} \sum_ {i = 1} ^ {N} \left(- \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \max _ {j \neq y _ {i}} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right) \\ \geq \frac {1}{N} \sum_ {i = 1} ^ {N} \left(- \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \frac {1}{k - 1} \sum_ {j \neq y _ {i}} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right) \\ = \frac {k}{N (k - 1)} \sum_ {i = 1} ^ {N} - \left(\boldsymbol {w} _ {y _ {i}} - \overline {{\boldsymbol {w}}}\right) ^ {\mathrm {T}} \boldsymbol {z} _ {i} \\ \geq \frac {k}{N (k - 1)} \sum_ {i = 1} ^ {N} - \| \boldsymbol {w} _ {y _ {i}} - \overline {{\boldsymbol {w}}} \| _ {2} \tag {A.3} \\ = \frac {1}{k - 1} \sum_ {i = 1} ^ {k} - \| \boldsymbol {w} _ {i} - \overline {{\boldsymbol {w}}} \| _ {2} \\ \geq \frac {1}{k - 1} - \sqrt {k \left(\sum_ {i = 1} ^ {k} \| \boldsymbol {w} _ {i} - \overline {{\boldsymbol {w}}} \| _ {2} ^ {2}\right)} \\ = \frac {1}{k - 1} - \sqrt {k (k - k \| \overline {{\boldsymbol {w}}} \| _ {2} ^ {2})} \\ \geq - \frac {k}{k - 1} \\ \end{array}
+$$
+
+where the equality holds if and only if $\forall i\neq j$ $w_{i}^{\mathrm{T}}w_{j} = \frac{-1}{k - 1}$ ,and $z_{i} = w_{y_{i}}$
+
+
+
+Theorem 3.5. For class-balanced or -imbalanced cases, $\pmb{w}_1, \dots, \pmb{w}_k, \pmb{z}_1, \dots, \pmb{z}_N \in \mathbb{S}^{d-1}$ , $d \geq 2$ and $2 \leq k \leq d+1$ , if $\sum_{i=1}^{K} \pmb{w}_i = 0$ , then learning with the GM-Softmax loss in (3.3) leads to maximizing both the class margin and the sample margin. More specifically, the optimal solution $\{\pmb{w}_j^*\}_{j=1}^{K}, \{\pmb{z}_i^*\}_{i=1}^{N}$ has the largest class margin $m(\pmb{W}^*) = \arccos \frac{-1}{K-1}$ and the largest sample margin $\gamma_{\min}^* = \frac{k}{k-1}$ . The lower bound of the risk is $\frac{1}{N} \sum_{i=1}^{N} \log[\exp(s(\alpha_{i1} + \beta_{i1} - \alpha_{i2} - \beta_{i2})) + (k-1) \exp(-s(\frac{1}{k-1} + \alpha_{i1} + \beta_{i1}))]$ , which is obtained if and only if $\forall i \neq j$ , $\pmb{w}_i^{\mathrm{T}}\pmb{w}_j = \frac{-1}{K-1}$ , and $z_i = w_{y_i}$ , i.e., the optimal solution maximizes that class margin and sample margin.
+
+Proof. For the GM-Softmax loss $L_{i} = -\log \frac{\exp(s(\alpha_{i1}\boldsymbol{w}_{y_{i}}^{\mathrm{T}}\boldsymbol{z}_{i} + \beta_{i1}))}{\exp(s(\alpha_{i2}\boldsymbol{w}_{y_{i}}^{\mathrm{T}}\boldsymbol{z}_{i} + \beta_{i2})) + \sum_{j\neq y_{i}}\exp(s\boldsymbol{w}_{j}^{\mathrm{T}}\boldsymbol{z}_{i})}$ , let $\alpha_{i} = \alpha_{i2} - \alpha_{i1} \leq 0, \beta_{i} = \beta_{i2} - \beta_{i1}$ . If $\sum_{i=1}^{K}\boldsymbol{w}_{i} = 0$ , then we have
+
+$$
+\begin{array}{l} L _ {i} = - \log \frac {\exp \left(s \left(\alpha_ {i 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 1}\right)\right)}{\exp \left(s \left(\alpha_ {i 2} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 2}\right)\right) + \sum_ {j \neq y _ {i}} \exp \left(s \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)} \\ \geq - \log \frac {\exp \left(s \left(\alpha_ {i 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 1}\right)\right)}{\exp \left(s \left(\alpha_ {i 2} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 2}\right)\right) + (k - 1) \exp \left(\frac {1}{k - 1} \sum_ {j \neq y _ {i}} s \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)} \\ = - \log \frac {\exp \left(s \left(\alpha_ {i 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 1}\right)\right)}{\exp \left(s \left(\alpha_ {i 2} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 2}\right)\right) + (k - 1) \exp \left(- \frac {s}{k - 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i}\right)} \tag {A.4} \\ = \log \left[ \exp \left(s \alpha_ {i} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + s \beta_ {i}\right) + (k - 1) \exp \left(- \frac {s}{k - 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} - s \left(\alpha_ {i 1} \boldsymbol {w} _ {y _ {i}} ^ {\mathrm {T}} \boldsymbol {z} _ {i} + \beta_ {i 1}\right)\right) \right] \\ \geq \log \left[ \exp \left(s \left(\alpha_ {i 1} + \beta_ {i 1} - \alpha_ {i 2} - \beta_ {i 2}\right)\right) + (k - 1) \exp \left(- s \left(1 / (k - 1) + \alpha_ {i 1} + \beta_ {i 1}\right)\right) \right] \\ \end{array}
+$$
+
+where in the first inequality we used the Jensen's inequality, and the last inequality comes from the facts that $\alpha_{i}\mathbf{w}_{y_{i}}^{\mathrm{T}}\mathbf{z}_{i} \geq \alpha_{i}$ and $-\frac{1}{k - 1}\mathbf{w}_{y_{i}}^{\mathrm{T}}\mathbf{z}_{i} - \alpha_{i1}\mathbf{w}_{y_{i}}^{\mathrm{T}}\mathbf{z}_{i} \geq -\frac{1}{k - 1} - \alpha_{i1}$ .
+
+Therefore, we have the lower bound of the risk $\frac{1}{N}\sum_{i=1}^{N}L_i \geq \frac{1}{N}\sum_{i=1}^{N}\log[\exp(s(\alpha_{i1} + \beta_{i1} - \alpha_{i2} - \beta_{i2})) + (k-1)\exp(-s(\frac{1}{k-1} + \alpha_{i1} + \beta_{i1}))]$ , where the equality holds if and only if $\forall i$ ,
+
+$\pmb{w}_{1}^{\mathrm{T}}\pmb{z}_{i} = \dots = \pmb{w}_{y_{i} - 1}^{\mathrm{T}}\pmb{z}_{i} = \pmb{w}_{y_{i} + 1}^{\mathrm{T}}\pmb{z}_{i} = \dots = \pmb{w}_{k}^{\mathrm{T}}\pmb{z}_{i}$ , and $\pmb{w}_{y_i}^{\mathrm{T}}\pmb{z}_i = 1$ . The condition can be simplified as $\forall i\neq j,\pmb{w}_i^{\mathrm{T}}\pmb{w}_j = \frac{-1}{k - 1}$ , and $\pmb{z}_i = \pmb{w}_{y_i}$ when $2\leq d$ and $2\leq k\leq d + 1$ .
+
+# B MORE ANALYSIS
+
+In this section, we provide more analysis about the unified framework of margin-based losses in (3.2), Sample Margin Regularization, Largest-Margin Softmax (LM-Softmax) loss.
+
+# B.1 A UNIFIED FRAMEWORK
+
+A unified framework that covers A-Softmax (Liu et al., 2017) with feature normalization, NormFace (Wang et al., 2017), CosFace/AM-Softmax (Wang et al., 2018b;a) and ArcFace (Deng et al., 2019) as special cases can be formulated with hyper-parameters $m_{1}$ , $m_{2}$ and $m_{3}$ :
+
+$$
+L _ {i} ^ {\prime} = - \log \frac {\exp \left(s \left(\cos \left(m _ {1} \theta_ {i y _ {i}} + m _ {2}\right) - m _ {3}\right)\right)}{\exp \left(s \left(\cos \left(m _ {1} \theta_ {i y _ {i}} + m _ {2}\right) - m _ {3}\right)\right) + \sum_ {j \neq y _ {i}} \exp \left(s \cos \theta_ {i j}\right)}, \tag {B.1}
+$$
+
+where $\theta_{ij} = \angle (\pmb{w}_j, \pmb{z}_i)$ . In the following, we provide the details of the derivation from (3.1) to (3.2)
+
+For the parameter $m_{1}$ , it satisfies that $\cos(m_{1}\theta) \leq \cos(\theta)$ in SphereFace Liu et al. (2017). Therefore, based on the definition of the multiplicative-angular operator, we have $\cos(m_{1}\theta_{iy_{i}} + m_{2}) \leq \cos(\theta_{iy_{i}} + m_{2})$ . To better understand the theoretical optimal solution, we make the constraint that $\theta_{iy_{i}} \in [0, \frac{\pi}{2}]$ , which is reasonable because the unique minimizer of these losses, like SphereFace, CosFace, and ArcFace, should satisfy $\theta_{iy_{i}}^{*} = 0$ , rather than belongs to $(\frac{\pi}{2}, \pi]$ .
+
+As for $m_2$ , ArcFace did not analyze its range. Instead, we can easily derive that $0 \leq m_2 \leq \frac{\pi}{2}$ . Otherwise, the minimum of ArcFace will be obtained at $\theta_{iy_i} = \pi$ , since $\cos(\theta_{iy_i} + m_2) \leq \cos(\pi + m_2)$ when $m_2 > \frac{\pi}{2}$ , which is ridiculous. Therefore, for $\theta_{iy_i}, m_2 \in [0, \frac{\pi}{2}]$ , we have $\cos(\theta_{iy_i} + m_2) = \cos \theta_{iy_i} \cos m_2 - \sin \theta_{iy_i} \sin m_2 \leq \cos m_2 \cos \theta_{iy_i}$ , which is the main derivation from (3.1) to (3.2).
+
+# B.2 ON THE SAMPLE MARGIN REGULARIZATION AND BEYOND
+
+The sample margin regularization term in (3.4) actually encourages the feature representation $z$ to be similar to the corresponding prototype $w_{y}$ , and push $z$ away from the most similar one of the other prototypes. This concept is similar to contrastive learning, where the most similar one of the other prototypes can be regarded as the hardest negative representation. And we also have
+
+$$
+R _ {\mathrm {s m}} (\boldsymbol {x}, y) \leq - \boldsymbol {w} _ {y} ^ {\mathrm {T}} \boldsymbol {z} + \frac {1}{k - 1} \sum_ {j \neq y} \boldsymbol {w} _ {j} ^ {\mathrm {T}} \boldsymbol {z}, \tag {B.2}
+$$
+
+where the right side can be regarded as pushing $z$ away from the centroid $\frac{1}{k - 1}\sum_{j\neq y}w_j$ or pushing $z$ away from other negative representations. Intuitively, we can also use the right side of Eq. B.2 as a sample margin regularization.
+
+# B.3 MORE CLARIFICATIONS
+
+As shown in the main paper, GM-Softmax loss, LM-Softmax loss, Sample Margin regularization, and Zero-centroid regularization serve different purposes. More specifically,
+
+- The GM-Softmax loss is only derived as a theoretical formulation, which is not used for practical implementation.
+- The LM-Softmax loss is tailored to obtain large margins with only one hyper-parameter. It can be used to replace popular margin-based losses, such as CosFace, and ArcFace, to obtain better discriminativeness of feature representations. Compared with NormFace Wang et al. (2017), LM-Softmax achieves much better performance on the task of person ReID, as shown in Table 3. This demonstrates that removing the term $\exp(s\boldsymbol{w}_y^{\mathrm{T}}\boldsymbol{z})$ in the denominator is helpful, which enforces LM-Softmax to have a stronger fitting ability.
+
+
+(a) NormFace $(68.50^{\circ})$
+
+
+(b) CosFace (71.86°)
+
+
+(c) ArcFace $(67.74^{\circ})$
+Figure 3: Visualization of the learned prototypes (red arrows) and features (green points) using NormFace, CosFace, ArcFace and LM-Softmax on $\mathbb{S}^2$ for eight classes. The optimal solution of Tammes problem for $N = 8$ have the class margin $74.86^{\circ}$ (Whyte, 1952), where the class margin of learning with the losses NormFace, CosFace, ArcFace and LM-Softmax are $68.50^{\circ}$ , $71.86^{\circ}$ , $67.74^{\circ}$ and $74.46^{\circ}$ , respectively. We note that this phenomenon coincides with the recent popular concept—neural collapse (Papyan et al., 2020).
+
+
+(d) LM-Softmax $(74.46^{\circ})$
+
+- The sample margin regularization $R_{\mathrm{sm}}$ serves as a general regularization term to significantly improve the ability of learning towards the largest margins by combining it with the commonly-used losses. Sample margin is not new, but to the best of our knowledge, we are the first one to use it in deep learning to obtain feature representations with inter-class separability and intra-class compactness. Although theoretically learning with $R_{\mathrm{sm}}$ can achieve the largest margins, we verify by experiments that directly maximizing sample margin cannot optimize neural networks well on complex datasets, such as CIFAR-100, as shown in Table 5. It can be found that learning with $R_{\mathrm{sm}}$ suffers from the underfitting problem on CIFAR-100, whose performance is much worse than CE. Alternatively, we turn to use $R_{\mathrm{sm}}$ as a regularization term, which can significantly improve the performance of commonly-used CE loss. These results demonstrate that using sample margin as the regularization term is more beneficial than using it as the loss. This is our new contribution to the classical sample margin.
+- The zero-centroid regularization $R_{\mathrm{w}}$ is specially tailored for class-imbalanced cases, which is only applied to prototypes at the last inner-product layer. Therefore, it can be easily embedded into the DNN-based methods to handle class imbalance.
+
+# C EXPERIMENTS
+
+In this section, we provide the experimental details, including datasets, network architectures, parameter settings, analysis, and more results. All codes are implemented by PyTorch (Paszke et al., 2019).
+
+We first recall the sample margin regularization $R_{\mathrm{sm}} = -\boldsymbol{w}_y^{\mathrm{T}}\boldsymbol{z} + \max_{j\neq y}\boldsymbol{w}_j^{\mathrm{T}}\boldsymbol{z}$ and the zero-centroid regularization $R_{\mathrm{w}} = \left\| \frac{1}{k}\sum_{i = 1}^{k}\boldsymbol{w}_{i}\right\|_{2}^{2}$ , which are used to enlarge margins for baseline methods. As for the trade-off parameter settings $\mu$ and $\lambda$ in the following experiments. We use $\mu$ and $\lambda' = 100\lambda$ denote the trade-off parameters for $R_{\mathrm{sm}}$ and $R_{\mathrm{w}}$ , i.e., $L + \mu R_{\mathrm{sm}}$ and $L + 100\lambda R_{\mathrm{w}}$ , respectively. In the following, we set $\mu = 0.5, 1.0$ for $R_{\mathrm{sm}}$ , and $\lambda = 1, 2, 5, 10, 20$ for $R_{\mathrm{w}}$ .
+
+# C.1 TOY EXPERIMENT
+
+We conduct a toy experiment to show the inter-class separability and intra-class compactness using different losses, where we randomly generate prototypes $W \in \mathbb{R}^{k \times d}$ (we set $d = 3$ and $k = 8$ ), and initialize features $Z \in \mathbb{R}^{N \times d}$ (we set $N = 10k$ ). Our goal is to optimize both $W$ and $Z$ to learn the largest class margin and sample margin with different losses. According to the Tammes problem for $N = 8$ , the optimal solution of $W$ and $Z$ satisfies that $m_c(W) = 74.86^\circ$ (Whyte, 1952). The number of training epochs is set 500,000. We use cosine learning rate annealing with $T_{\max} = 10,000$ , and SGD optimizer with momentum 0.9 and weight decay $1e - 4$ .
+
+
+
+
+
+
+
+
+Figure 4: Histogram of similarities and sample margins for CosFace with/without sample margin regularization $R_{\mathrm{sm}}$ on CIFAR-10. (a-c) denote the cosine similarities between samples and their corresponding prototypes, and (d-f) denote the sample margins.
+
+
+
+
+
+Results. We use green points and red arrows to denote the learned feature vectors and prototype vectors, respectively. As shown in Fig. 3, the learned prototypes are separated well with NormFace, CosFace, ArcFace, and LM-Softmax. Specifically, the class margin of learning with the losses NormFace, CosFace, ArcFace, and LM-Softmax are $68.50^{\circ}$ , $71.86^{\circ}$ , $67.74^{\circ}$ and $74.46^{\circ}$ , respectively. As we can seen, ArcFace has a smaller class margin $(67.74^{\circ})$ than the others, and the intraclass compactness for NormFace and CosFace is worse than LM-Softmax. The features in the blue box of Fig. 3(a) and Fig. 3(b) are not compact enough, but ArcFace and LM-Softmax do. Moreover, our proposed LM-Softmax shows better performance in class margin and sample margins, where the learned prototypes have the class margin close to the theoretical optima, and the features are perfectly optimized to be their corresponding prototypes.
+
+# C.2 VISUAL CLASSIFICATION
+
+We introduce three metrics to evaluate whether a loss function owns good inter-class separability and intra-class compactness. The first one is the top-1 test accuracy $acc$ to measure the generalization of the trained models. The second one is the class margin $m_{cls}$ defined in Eq. (2). And the last one we define as the average of sample margins with cosine similarities, i.e., $m_{samp} = \frac{1}{N}\sum_{i=1}^{N}\frac{\boldsymbol{w}_{y_i}^T\phi_\Theta(\boldsymbol{x}_i)}{\|\boldsymbol{w}_{y_i}\| \|\phi_\Theta(\boldsymbol{x}_i)\|} - \max_{j \neq y_i}\frac{\boldsymbol{w}_{y_i}^T\phi_\Theta(\boldsymbol{x}_i)}{\|\boldsymbol{w}_j\| \|\phi_\Theta(\boldsymbol{x}_i)\|}$ . Then we experiments with a 4-layer CNN, ResNet-18 and ResNet-34 (He et al., 2016) on MNIST (LeCun et al., 1998), CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009), respectively. Moreover, some commonly-used neural layers are considered, such as ReLU (Glorot et al., 2011), BatchNorm (Ioffe & Szegedy, 2015), and cosine learning rate annealing (Loshchilov & Hutter, 2016).
+
+Datasets. We empirically investigate the performance of learning towards the largest margins on benchmark datasets including MNIST (LeCun et al., 1998), CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009).
+
+Training details. We use a simple CNN which consists of $\text{Conv}(1, 32, 3) \to \text{BatchNorm}$ (Ioffe & Szegedy, 2015) $\rightarrow \text{ReLU}$ (Glorot et al., 2011) $\rightarrow \text{MaxPool}(2, 2) \rightarrow \text{Conv}(32, 64, 3) \rightarrow \text{BatchNorm} \rightarrow \text{ReLU} \rightarrow \text{MaxPool}(2, 2) \rightarrow \text{Linear}$ for MNIST, a ResNet-18 (He et al., 2016) for CIFAR-10, and a ResNet-34 (He et al., 2016) for CIFAR-100. The number of training epochs is set 100, 200 and
+
+Table 5: Test accuracies, class margins and sample margins on MNIST, CIFAR-10 and CIFAR-100 using loss functions with/without sample margin regularization $R_{\mathrm{sm}}$ , where we simply set the regularization parameter to 0.5. The results with positive gains are highlighted.
+
+| Dataset | MNIST | CIFAR-10 | CIFAR-100 |
| Metric | acc | mcls | msamp | acc | mcls | msamp | acc | mcls | msamp |
| CE | 99.11 | 87.39° | 0.5014 | 94.12 | 81.73° | 0.6203 | 74.56 | 65.38° | 0.1612 |
| Rsm | 99.07 | 95.38° | 1.036 | 94.13 | 96.28° | 0.9791 | 62.08 | 58.58° | 0.3793 |
| CE + 0.5Rsm | 99.13 | 95.41° | 1.026 | 94.45 | 96.31° | 0.9744 | 74.96 | 90.00° | 0.4955 |
| CosFace (s = 5) | 99.11 | 95.85° | 1.020 | 94.02 | 96.33° | 0.9619 | 75.37 | 84.20° | 0.5037 |
| CosFace (s = 10) | 98.98 | 95.93° | 0.9839 | 94.39 | 96.00° | 0.9168 | 74.44 | 83.31° | 0.4578 |
| CosFace (s = 20) | 99.06 | 93.24° | 0.8376 | 94.13 | 91.22° | 0.7955 | 73.26 | 79.17° | 0.3078 |
| CosFace (s = 40) | 99.18 | 90.69° | 0.7650 | 93.84 | 76.09° | 0.7617 | 73.54 | 77.48° | 0.2380 |
| CosFace (s = 64) | 99.25 | 89.50° | 0.7581 | 93.53 | 64.14° | 0.6969 | 73.87 | 72.56° | 0.2233 |
| CosFace (s = 5) + 0.5Rsm | 99.07 | 95.60° | 1.036 | 94.20 | 96.32° | 0.9740 | 75.52 | 90.41° | 0.5230 |
| CosFace (s = 10) + 0.5Rsm | 99.16 | 95.56° | 1.033 | 94.42 | 96.26° | 0.9675 | 73.76 | 90.21° | 0.5089 |
| CosFace (s = 20) + 0.5Rsm | 99.24 | 95.41° | 1.030 | 94.27 | 96.18° | 0.9490 | 74.41 | 89.02° | 0.4780 |
| CosFace (s = 40) + 0.5Rsm | 99.32 | 95.41° | 1.026 | 94.42 | 95.93° | 0.9238 | 74.58 | 86.91° | 0.4251 |
| CosFace (s = 64) + 0.5Rsm | 99.27 | 95.35° | 1.019 | 94.20 | 95.48° | 0.9075 | 74.53 | 85.31° | 0.3817 |
| CosFace (s = 5) + Rsm | 99.15 | 95.59° | 1.032 | 94.38 | 96.35° | 0.9817 | 75.18 | 90.44° | 0.5228 |
| CosFace (s = 10) + Rsm | 99.09 | 95.48° | 1.029 | 94.49 | 96.32° | 0.9770 | 73.93 | 90.36° | 0.5237 |
| CosFace (s = 20) + Rsm | 99.08 | 95.37° | 1.028 | 94.36 | 96.24° | 0.9640 | 73.79 | 89.63° | 0.4958 |
| CosFace (s = 40) + Rsm | 99.12 | 95.38° | 1.027 | 94.31 | 96.18° | 0.9510 | 74.43 | 88.83° | 0.4736 |
| CosFace (s = 64) + Rsm | 99.18 | 95.38° | 1.025 | 94.60 | 96.02° | 0.9443 | 74.05 | 87.83° | 0.4390 |
| ArcFace (s = 5) | 99.05 | 95.46° | 0.9956 | 93.90 | 96.33° | 0.9473 | 75.08 | 78.28° | 0.4884 |
| ArcFace (s = 10) | 99.05 | 94.64° | 0.8225 | 94.50 | 91.23° | 0.8501 | 73.96 | 76.91° | 0.4313 |
| ArcFace (s = 20) | 99.11 | 90.84° | 0.6091 | 94.11 | 53.98° | 0.5707 | 74.74 | 60.91° | 0.3010 |
| ArcFace (s = 40) | 99.13 | 86.13° | 0.4606 | 93.88 | 35.68° | 0.3195 | — | — | — |
| ArcFace (s = 64) | 99.21 | 82.63° | 0.4038 | — | — | — | — | — | — |
| ArcFace (s = 5) + 0.5Rsm | 99.00 | 95.59° | 1.034 | 94.17 | 96.32° | 0.9731 | 74.72 | 90.37° | 0.5081 |
| ArcFace (s = 10) + 0.5Rsm | 99.14 | 95.42° | 1.034 | 94.21 | 96.27° | 0.9651 | 74.47 | 90.13° | 0.5143 |
| ArcFace (s = 20) + 0.5Rsm | 99.19 | 91.38° | 1.030 | 94.32 | 96.15° | 0.9571 | 74.64 | 88.73° | 0.4804 |
| ArcFace (s = 40) + 0.5Rsm | 99.24 | 95.34° | 1.026 | 94.07 | 95.69° | 0.9434 | — | — | — |
| ArcFace (s = 64) + 0.5Rsm | 99.14 | 95.29° | 1.019 | — | — | — | — | — | — |
| ArcFace (s = 5) + Rsm | 99.17 | 95.53° | 1.030 | 94.40 | 96.35° | 0.9825 | 74.85 | 90.41° | 0.5156 |
| ArcFace (s = 10) + Rsm | 99.09 | 95.37° | 1.029 | 94.14 | 96.32° | 0.9713 | 73.76 | 90.30° | 0.5259 |
| ArcFace (s = 20) + Rsm | 99.11 | 95.36° | 1.028 | 94.45 | 96.25° | 0.9676 | 74.61 | 89.65° | 0.5033 |
| ArcFace (s = 40) + Rsm | 99.02 | 95.34° | 1.026 | 94.39 | 96.04° | 0.9621 | — | — | — |
| ArcFace (s = 64) + Rsm | 99.13 | 95.30° | 1.024 | — | — | — | — | — | — |
| NormFace (s = 5) | 99.03 | 95.68° | 0.9836 | 94.34 | 96.34° | 0.9452 | 75.56 | 85.37° | 0.5076 |
| NormFace (s = 10) | 99.06 | 94.34° | 0.7750 | 94.16 | 94.40° | 0.8004 | 74.23 | 79.10° | 0.4250 |
| NormFace (s = 20) | 99.09 | 89.27° | 0.5263 | 94.09 | 74.32° | 0.6001 | 73.87 | 77.47° | 0.2498 |
| NormFace (s = 40) | 99.06 | 85.44° | 0.3473 | 94.11 | 47.52° | 0.3825 | 73.73 | 66.67° | 0.1439 |
| NormFace (s = 64) | 99.00 | 82.08° | 0.2621 | 94.01 | 36.50° | 0.2633 | 73.42 | 52.37° | 0.0993 |
| NormFace (s = 5) + 0.5Rsm | 99.15 | 95.55° | 1.035 | 94.11 | 96.32° | 0.9739 | 74.82 | 90.38° | 0.5124 |
| NormFace (s = 10) + 0.5Rsm | 99.16 | 95.38° | 1.034 | 94.23 | 96.28° | 0.9650 | 74.54 | 90.10° | 0.5160 |
| NormFace (s = 20) + 0.5Rsm | 99.19 | 95.37° | 1.031 | 94.38 | 96.17° | 0.9519 | 74.75 | 88.86° | 0.4773 |
| NormFace (s = 40) + 0.5Rsm | 99.14 | 95.36° | 1.026 | 94.18 | 95.59° | 0.9495 | 74.48 | 84.78° | 0.4181 |
| NormFace (s = 64) + 0.5Rsm | 99.34 | 95.29° | 1.021 | 94.42 | 93.87° | 0.9508 | 74.33 | 76.02° | 0.3665 |
| NormFace (s = 5) + Rsm | 99.14 | 95.48° | 1.029 | 94.42 | 96.34° | 0.9798 | 74.89 | 90.45° | 0.5134 |
| NormFace (s = 10) + Rsm | 99.12 | 95.37° | 1.028 | 94.31 | 96.32° | 0.9758 | 73.16 | 90.31° | 0.5183 |
| NormFace (s = 20) + Rsm | 99.11 | 95.35° | 1.028 | 94.16 | 96.25° | 0.9656 | 74.23 | 89.72° | 0.5004 |
| NormFace (s = 40) + Rsm | 99.11 | 95.36° | 1.026 | 93.98 | 95.87° | 0.9583 | 74.22 | 88.73° | 0.4731 |
| NormFace (s = 64) + Rsm | 99.14 | 95.34° | 1.025 | 94.04 | 94.35° | 0.9570 | 74.24 | 81.57° | 0.4386 |
+
+
+(a) LM-Softmax $(s = 10)$
+
+
+(b) LM-Softmax $(s = 20)$
+
+
+(c) LM-Softmax $(s = 40)$
+
+
+(d) LM-Softmax $(s = 64)$
+
+
+(e) LM-Softmax $(s = 10)$
+
+
+(f) LM-Softmax $(s = 20)$
+
+
+Figure 5: Histogram of similarities and sample margins for LM-Softmax on CIFAR-10. (a-d) denote the cosine similarities between samples and their corresponding prototypes, and (e-h) denote the sample margins.
+
+
+(g) LM-Softmax $(s = 40)$
+(h) LM-Softmax $(s = 64)$
+
+250 for MNIST, CIFAR-10, and CIFAR-100, respectively. For all training, we use SGD optimizer with momentum 0.9 and cosine learning rate annealing (Loshchilov & Hutter, 2016) when $T_{\mathrm{max}}$ is equal to the corresponding epochs. Weight Decay is set to $1 \times 10^{-4}$ for MNIST, CIFAR-10, and CIFAR-100. The initial learning rate is set to 0.01 for MNIST and 0.1 for CIFAR-10 and CIFAR-100. Moreover, batch size is set to 256. Typical data augmentations including random width/height shift and horizontal flip are applied.
+
+Baselines and hyper-parameter settings. We consider the baseline methods, including the commonly-used loss function CE, and margin-based loss functions NormFace, CosFace, and ArcFace with normalization for both feature vectors and class centers, and our proposed LM-Softmax loss. We have tuned their hyper-parameters for the best performance, and the specific settings are: for CosFace, we set $m = 0.1$ ; for ArcFace, we set $m = 0.1$ . To learn towards the largest margins, we boost them with the sample margin regularization, and the trade-off parameter is set to 0.5 and 1. Moreover, we tune their identical hyper-parameter $s$ , and show them for a comprehensive study.
+
+Results. The test accuracy, class margin and the average of all sample margins are reported in Table 1. As we can see, the baseline methods fail in learning large margins for all $s$ , and there is no significant difference in the performance of these losses. More specifically, the class margin decreased as $s$ increases, while the losses with the sample margin regularization $R_{\mathrm{sm}}$ usually remain the large class margins, and the class margins are close to the optimal results (arccos $(-1/9) = 96.37^\circ$ for MNIST and CIFAR-10, and arccos $(-1/99) = 90.57^\circ$ for CIFAR-100). To better describe the inter-class separability and intra-class compactness, we provide the histograms of sample margins and similarities between the learned features and their corresponding prototype that they belong to. In Fig. 9, the similarities in Fig. 9(a) are mainly concentrated in 0.8 for CosFace with $s = 64$ , while the similarities in Fig. 9(b) and 9(c) are very close to 1. This indicates that the sample margin regularization significantly improves the inter-class compactness (the learned features in the same class are very similar to their corresponding prototype.) Moreover, the histograms of our proposed LM-Softmax on CIFAR-10 and CIFAR-100 are reported in Fig. 5 and 6, respectively. The similarities and sample margins keep very large with different $s$ . More visualizations are provided in the following figures.
+
+Clarification. As shown in table 5, the proposed method results in both more larger class margin and more larger sample margin than the compared methods, however, the accuracy of the proposed method is slightly better than accuracies of the compared methods. $acc$ actually evaluate the proportion of samples whose sample margin is larger than 0, i.e., $acc = \frac{1}{N}\sum_{i=1}^{N}\mathbb{I}(\gamma(x_i,y_i) > 0)$ . $acc$ is a good evaluation criterion for classification but is not good enough to measure the quality of feature representation. This is also one of the motivations of the previous works to improve the original
+
+softmax loss. In this paper, we measure the inter-class separability and intra-class compactness by class margin and sample margin, which can be used as two criteria to evaluate the quality of feature representations. Thus, $acc$ , class margin, and sample margin can be regarded as different criteria.
+
+Although the relationship of $acc$ and margins is not so straightforward, enlarging the margins can improve acc to some extent. As shown in Table 1, we can see that enlarging the margins of other losses by adding the sample margin regularization $R_{\mathrm{sm}}$ can improve the accuracy in most cases. Moreover, as shown in Table 2, the results on imbalanced learning are noteworthy, where the zero-centroid regularization for learning towards the largest margins on imbalanced classification shows obvious improvements in both class margins and accuracy in most cases, and even can improve the performance of LDAM that is tailored for imbalanced learning
+
+
+(a) LM-Softmax $(s = 10)$
+
+
+(b) LM-Softmax $(s = 20)$
+
+
+(c) LM-Softmax $(s = 40)$
+
+
+(d) LM-Softmax $(s = 64)$
+
+
+(e) LM-Softmax $(s = 10)$
+
+
+(f) LM-Softmax $(s = 20)$
+
+
+Figure 6: Histogram of similarities and sample margins for LM-Softmax on CIFAR-100. (a-d) denote the cosine similarities between samples and their corresponding prototypes, and (e-h) denote the sample margins.
+
+
+(g) LM-Softmax $(s = 40)$
+(h) LM-Softmax $(s = 64)$
+
+# C.3 IMBALANCED CLASSIFICATION
+
+Imbalanced CIFAR-10 and CIFAR-100. The original version of CIFAR-10 and CIFAR-100 contains 50,000 training images and 10,000 test images of size $32 \times 32$ with 10 and 100 classes, respectively. To create their imbalanced version, we follow the setting in (Buda et al., 2018; Cui et al., 2019; Cao et al., 2019), where we reduce the number of training examples per class, and keep the test set unchanged. To ensure that our methods apply to a variety of settings, we consider two types of imbalance: long-tailed imbalance (Cui et al., 2019) and step imbalance (Buda et al., 2018). We use the imbalance ratio $\rho$ to denote the ratio between sample sizes of the most frequent and least frequent class, i.e., $\rho = \max_{i} \{n_{i}\} / \min_{i} \{n_{i}\}$ . Long-tailed imbalance utilizes an exponential decay in sample sizes across different classes. For step imbalance setting, all minority classes have the same sample size, as do all frequent classes. This gives a clear distinction between minority classes and frequent classes, and the fraction for minority classes is defined as $\mu$ . We follow (Cao et al., 2019) and set $\mu = 0.5$ by default.
+
+We report the top-1 test accuracy $acc$ and class margin $m_{cls}$ of various baseline methods, including CE, Focal Loss, NormFace, CosFace, ArcFace, and the Label-Distribution-Aware Margin Loss (LDAM) with hyper-parameter $s = 5$ . Moreover, the proposed LM-Softmax loss actually is greatly affected by data imbalance since it will pay much attention to enlarge the margin between frequent classes and minority classes than other losses rather than any two classes. And we experiment with the LM-Softmax to verify the validity of the enlarging margin method. Moreover, we add the zero-centroid regularization to the losses whose feature and prototypes are normalized for better margins.
+
+Training details. We use ResNet-18 for imbalanced CIFAR-10, and ResNet-34 for imbalanced CIFAR-100. Following in (Cao et al., 2019), we use SGD optimizer with momentum 0.9 and weight decay $2 \times 10^{-4}$ . The number of training epochs is set 200, and batch size is 128. The initial learning
+
+
+(a) Test Accuracy
+
+
+(b) Class Margin
+
+
+(c) Test Accuracy
+Figure 7: Test accuracies and class margins using different loss functions with and without the zero-centroid regularization on imbalanced CIFAR-10 and CIFAR-100. (a) and (b) are test accuracies and class margins on imbalanced CIFAR-10, respectively. (c) and (d) are test accuracies and class margins on imbalanced CIFAR-10, respectively.
+
+
+(d) Class Margin
+
+rate is set to 0.1. Moreover, we use the cosine learning rate annealing strategy (Loshchilov & Hutter, 2016) when $T_{\mathrm{max}}$ is equal to the corresponding epochs.
+
+Baselines and their hyper-parameter settings. We consider the baseline methods, including CE, Focal loss, CosFace, NormFace, ArcFace, LM-Softmax, and the label-distribution-aware margin (LDAM) loss. We set $\gamma = 1$ for Folcal, $m = 0.35$ for CosFace, $m = 0.1$ for ArcFace with stable results, and the identical hyper-parameter $s$ is set to 5.
+
+Results. The experimental results of imbalanced CIFAR-10 and CIFAR-100 are reported in Table 6. As we can see, the class margin of the LM-Softmax loss is fairly low in the severely imbalanced cases, while the other losses with feature and weight normalization have better performance than CE and Focal. However, their class margins are still small. With the role of the zero-centroid regularization, the class margin has a very obvious improvement in all cases, where the class margins are close to the optimal one $(\arccos(-1/9) = 96.37^\circ$ for imbalanced CIFAR-10, and $\arccos(-1/99) = 90.57^\circ$ for imbalanced CIFAR-100). This conclusion holds for any choice of $\lambda$ . As for the accuracy, there are also good improvements in most cases, especially for imbalanced CIFAR-100. Moreover, compared with the performance of NormFace, it is worth noticing that the improvements of LDAM may heavily rely on the features and prototype normalization even if LDAM is designed for label-distribution-aware margin trade-off. As illustrated in Fig. 20-28, the zero-centroid regularization improves the intra-class compactness, where the cosine similarities between features and their corresponding prototypes they belong to are more concentrated around 1. The experimental results on the task of imbalanced classification. In the class imbalanced scenario, the stronger fitting ability of LM-Softmax however would make the learner care more about the majority classes but neglect the minority classes. This is the reason why LM-Softmax is less stable, which can be alleviated by applying the proposed zero-centroid regularization.
+
+More Comparisons. To better show the effectiveness of zero-centroid regularization, we also construct more comparison to other related works of imbalanced learning, including two-stage methods cRT (Kang et al., 2020) and MiSLAS (Zhong et al., 2021). cRT works in a two-stage manner: firstly learn feature representation from the original imbalanced data, and then retrain the classifier using class-balanced sampling with the first-stage representation frozen. Our proposed zero-centroid regularization $R_{\mathrm{w}}$ can not only render zero-centroid classifier but also produce feature representations with larger margins when directly learning with imbalanced datasets. Thus, our proposed zero-centroid regularization can benefit these two-stage methods. To verify this point, we conduct experiments on ImageNet-LT with backbone ResNet-50 where the experimental settings follow a recent two-stage decoupling method MiSLAS. As shown in the following table, the performance comparison of CE and $\mathrm{CE} + R_{\mathrm{w}}$ demonstrate that zero-centroid regularization can significantly improve the representation learning ability of the first stage. Moreover, our zero-centroid regularization $R_{\mathrm{w}}$ can be easily integrated into well-developed two-stage decoupling methods, such as cRT, MiSLAS. As demonstrated by the following results, adding $R_{w}$ into 1st stage (representation learning only) or both stages (representation learning and classifier learning) all can improve the performance of the original methods.
+
+Table 6: Test accuracies (acc) and class margins $(m_{cls})$ on imbalanced CIFAR-10. The results with positive gains are highlighted (where $\lambda$ denotes the regularization coefficient of the zero-centroid regularization term).
+
+| Dataset | Imbalanced CIFAR-10 | Imbalanced CIFAR-100 |
| Imbalance Type | long-tailed | step | long-tailed | step |
| Imbalance Ratio | 100 | 10 | 100 | 10 | 100 | 10 | 100 | 10 |
| Metric | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls | acc mcls |
| CE | 70.88 | 87.41° | 88.17 | 79.63° | 64.21 | 76.50° | 85.06 | 82.24° | 40.38 | 64.73° | 60.42 | 66.24° |
| Focal | 66.30 | 74.14° | 87.33 | 74.48° | 60.55 | 63.30° | 84.49 | 75.16° | 38.04 | 54.67° | 60.09 | 59.30° |
| CosFace (λ = 0) | 69.28 | 58.77° | 87.02 | 81.61° | 53.64 | 19.78° | 84.86 | 75.96° | 34.91 | 4.73° | 60.60 | 70.82° |
| CosFace (λ = 1) | 68.86 | 96.17° | 87.24 | 96.16° | 62.24 | 95.93° | 84.98 | 96.26° | 40.53 | 65.42° | 60.37 | 84.84° |
| CosFace (λ = 2) | 69.40 | 95.61° | 87.16 | 96.26° | 62.49 | 95.86° | 84.69 | 95.88° | 40.53 | 65.13° | 60.77 | 84.97° |
| CosFace (λ = 5) | 69.18 | 93.73° | 87.34 | 96.24° | 62.13 | 95.84° | 85.07 | 96.24° | 40.58 | 55.27° | 60.34 | 84.47° |
| CosFace (λ = 10) | 68.83 | 92.49° | 86.94 | 96.23° | 61.99 | 95.35° | 85.59 | 96.12° | 40.98 | 80.93° | 59.15 | 85.07° |
| CosFace (λ = 20) | 69.52 | 91.90° | 87.55 | 95.46° | 62.38 | 94.36° | 85.15 | 95.88° | 39.92 | 80.30° | 59.66 | 83.46° |
| ArcFace (λ = 0) | 72.20 | 65.86° | 89.00 | 85.23° | 62.48 | 54.29° | 86.32 | 80.51° | 42.77 | 13.22° | 63.21 | 67.73° |
| ArcFace (λ = 1) | 71.69 | 95.08° | 88.86 | 96.26° | 63.10 | 95.83° | 86.49 | 96.23° | 43.97 | 52.75° | 63.67 | 71.52° |
| ArcFace (λ = 2) | 71.91 | 93.78° | 88.78 | 96.24° | 63.05 | 94.84° | 86.18 | 96.23° | 44.19 | 55.95° | 63.54 | 72.68° |
| ArcFace (λ = 5) | 72.23 | 92.30° | 89.22 | 96.23° | 64.38 | 95.01° | 86.56 | 96.24° | 44.68 | 56.60° | 63.80 | 73.45° |
| ArcFace (λ = 10) | 71.99 | 91.92° | 88.99 | 94.68° | 63.59 | 94.97° | 86.65 | 96.23° | 43.89 | 75.58° | 63.55 | 82.11° |
| ArcFace (λ = 20) | 71.75 | 91.42° | 88.99 | 92.85° | 63.56 | 93.29° | 86.15 | 95.83° | 43.55 | 75.28° | 62.10 | 81.00° |
| NormFace (λ = 0) | 72.37 | 62.72° | 89.19 | 82.60° | 63.69 | 51.00° | 86.37 | 77.82° | 43.71 | 16.11° | 63.50 | 71.26° |
| NormFace (λ = 1) | 72.07 | 94.95° | 89.18 | 96.27° | 62.40 | 96.15° | 86.46 | 96.29° | 44.18 | 59.42° | 63.81 | 79.85° |
| NormFace (λ = 2) | 71.92 | 94.29° | 88.93 | 96.28° | 63.21 | 96.14° | 86.26 | 96.30° | 44.20 | 60.39° | 63.90 | 77.69° |
| NormFace (λ = 5) | 70.79 | 92.37° | 88.84 | 96.17° | 62.83 | 95.38° | 86.49 | 96.28° | 44.25 | 64.85° | 63.60 | 77.74° |
| NormFace (λ = 10) | 72.04 | 91.95° | 89.30 | 94.50° | 63.45 | 94.75° | 86.06 | 96.29° | 43.71 | 74.87° | 63.17 | 82.71° |
| NormFace (λ = 20) | 71.36 | 91.14° | 89.08 | 93.40° | 64.07 | 93.06° | 86.50 | 95.94° | 43.67 | 75.71° | 62.66 | 82.18° |
| LDAM (λ = 0) | 72.86 | 73.30° | 88.92 | 88.19° | 63.27 | 61.42° | 87.04 | 85.21° | 43.28 | 7.73° | 63.62 | 73.19° |
| LDAM (λ = 1) | 72.50 | 96.25° | 88.97 | 96.24° | 64.31 | 96.10° | 86.74 | 96.26° | 44.18 | 71.00° | 63.95 | 84.49° |
| LDAM (λ = 2) | 72.41 | 95.85° | 89.01 | 96.24° | 64.99 | 96.04° | 86.55 | 96.28° | 44.90 | 67.95° | 64.12 | 85.81° |
| LDAM (λ = 5) | 71.99 | 93.83° | 89.51 | 96.25° | 64.79 | 96.12° | 86.62 | 96.16° | 45.23 | 70.96° | 64.18 | 85.03° |
| LDAM (λ = 10) | 72.21 | 92.49° | 88.92 | 96.18° | 64.48 | 96.16° | 86.69 | 96.29° | 43.53 | 81.42° | 63.05 | 85.62° |
| LDAM (λ = 20) | 72.86 | 91.75° | 89.20 | 95.59° | 64.66 | 94.55° | 86.60 | 96.05° | 43.85 | 79.65° | 62.64 | 84.87° |
| LM-Softmax (λ = 0) | 65.32 | 4.42° | 88.69 | 68.91° | 50.47 | 0.45° | 86.08 | 52.20° | 41.52 | 4.50° | 63.26 | 68.31° |
| LM-Softmax (λ = 1) | 72.25 | 96.06° | 88.47 | 96.26° | 64.18 | 91.44° | 86.66 | 96.14° | 45.22 | 68.02° | 63.77 | 81.99° |
| LM-Softmax (λ = 2) | 72.57 | 95.83° | 88.69 | 96.31° | 65.58 | 93.23° | 86.70 | 96.11° | 44.90 | 67.90° | 63.39 | 82.93° |
| LM-Softmax (λ = 5) | 72.53 | 93.65° | 88.60 | 96.26° | 65.18 | 95.20° | 87.07 | 96.05° | 45.28 | 69.53° | 63.60 | 83.32° |
| LM-Softmax (λ = 10) | 73.21 | 92.57° | 88.49 | 96.25° | 65.91 | 93.84° | 86.96 | 96.09° | 44.13 | 78.90° | 62.89 | 85.39° |
| LM-Softmax (λ = 20) | 73.20 | 91.95° | 89.12 | 95.73° | 65.39 | 93.23° | 86.95 | 96.03° | 44.22 | 80.53° | 63.40 | 83.80° |
+
+Table 7: Top-1 validation accuracy on ImageNet-LT, where * denotes that the results are borrowed from MiSLAS, $\mathrm{X} + {R}_{\mathrm{w}}$ denotes adding ${R}_{\mathrm{w}}$ to the corresponding stages,and the trade-off parameter $\lambda$ is set 100 . The results with positive gains are highlighted.
+
+| Method | Many | Medium | Few | All |
| CE | 66.76 | 36.87 | 7.06 | 43.61 |
| CE+Rw | 68.42 | 39.42 | 10.69 | 45.90 |
| cRT* | 62.5 | 47.4 | 29.5 | 50.3 |
| cRT+mixup* | 63.9 | 49.1 | 30.2 | 51.7 |
| cRT+mixup | 65.72 | 48.78 | 25.89 | 51.61 |
| cRT+mixup+Rw (adding Rw for 1st stage) | 64.03 | 49.89 | 32.81 | 52.59 |
| cRT+mixup+Rw (adding Rw for 1st and 2nd stage) | 64.12 | 49.99 | 32.73 | 52.65 |
| MiSLAS* | 61.7 | 51.3 | 35.8 | 52.7 |
| MiSLAS | 63.30 | 50.06 | 33.52 | 52.50 |
| MiSLAS+ Rw (adding Rw for 1st stage) | 63.11 | 50.56 | 34.24 | 52.76 |
| MiSLAS+Rw (adding Rw for 1st and 2nd stage) | 63.20 | 50.69 | 34.21 | 52.85 |
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+Figure 8: Histogram of similarities and sample margins for LM-Softmax using the zero-centroid regularization with different $\lambda$ on long-tailed imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
+
+# C.4 PERSON RE-IDENTIFICATION
+
+We conduct experiments on the task of person re-identification. Specifically, we use the off-the-shelf baseline (Luo et al., 2019) as the main code to verify the efficiency of our proposed LM-Softmax.
+
+Training Details. We followed the default parameter settings and training strategy. More specifically, we train the ResNet50 with pre-trained parameters for 60 epochs. Two benchmark datasets Market-1501 (Zheng et al., 2015) and DukeMTMC (Ristani et al., 2016) are evaluated. Moreover, all models are trained with Triplet Loss + the compared losses, including CE, ArcFace, CosFace, NormFace, and the proposed LM-Softmax. Experiments were conducted on Market-1501 and DukeMTMC. As shown in Table 3, our proposed LM-Softmax obtains obvious improvements in mAP, Rank@1 and Rank@5, which also exhibits significant robustness for different parameters. In contrast, ArcFace, CosFace, and NormFace show worse performance than ours and are more sensitive to parameter settings.
+
+Table 8: The results on Market-1501 and DukeMTMC for person re-identification task. The best four results are highlighted.
+
+| Dataset | Market-1501 | DukeMTMC |
| Method | mAP | Rank@1 | Rank@5 | Rank@10 | mAP | Rank@1 | Rank@5 | Rank@10 |
| Softmax | 82.8 | 92.7 | 97.5 | 98.7 | 73.0 | 83.5 | 93.0 | 95.2 |
| ArcFace (s = 10) | 67.5 | 84.1 | 92.1 | 94.9 | 37.7 | 58.7 | 72.7 | 77.8 |
| ArcFace (s = 20) | 79.1 | 90.8 | 96.5 | 98.1 | 61.4 | 78.3 | 88.6 | 91.6 |
| ArcFace (s = 32) | 80.5 | 92.1 | 97.1 | 98.4 | 66.7 | 82.9 | 91.2 | 93.4 |
| ArcFace (s = 64) | 80.4 | 92.6 | 97.4 | 98.4 | 67.6 | 83.4 | 91.4 | 94.1 |
| CosFace (s = 10) | 68.0 | 84.9 | 92.7 | 95.2 | 39.3 | 60.6 | 73.1 | 78.7 |
| CosFace (s = 20) | 80.5 | 92.0 | 97.1 | 98.2 | 64.2 | 81.3 | 89.7 | 92.8 |
| CosFace (s = 32) | 81.7 | 93.4 | 97.6 | 98.3 | 69.4 | 83.5 | 92.3 | 94.4 |
| CosFace (s = 64) | 78.7 | 92.0 | 97.1 | 98.3 | 68.2 | 83.1 | 92.5 | 94.4 |
| NormFace (s = 10) | 81.2 | 91.6 | 96.3 | 98.0 | 63.7 | 79.3 | 88.5 | 91.0 |
| NormFace (s = 20) | 83.2 | 93.5 | 97.9 | 98.8 | 71.6 | 83.8 | 93.3 | 95.1 |
| NormFace (s = 32) | 77.5 | 90.0 | 96.9 | 98.3 | 66.2 | 80.2 | 90.5 | 93.8 |
| NormFace (s = 64) | 77.5 | 90.0 | 96.9 | 98.3 | 60.1 | 75.2 | 88.1 | 91.7 |
| LM-Softmax (s = 10) | 83.3 | 92.8 | 97.1 | 98.2 | 72.2 | 85.8 | 92.4 | 94.8 |
| LM-Softmax (s = 20) | 84.7 | 93.8 | 97.6 | 98.6 | 74.1 | 86.4 | 93.5 | 94.9 |
| LM-Softmax (s = 32) | 84.3 | 93.4 | 97.7 | 98.4 | 73.3 | 86.0 | 93.2 | 95.1 |
| LM-Softmax (s = 64) | 84.6 | 93.9 | 98.1 | 98.8 | 74.2 | 86.6 | 93.5 | 95.2 |
+
+
+(a) $\mu = 0$
+
+
+(b) $\mu = 0.5$
+
+
+(c) $\mu = 1$
+
+
+(d) $\mu = 0$
+
+
+(e) $\mu = 0.5$
+
+
+(f) $\mu = 1$
+
+
+(g) $\mu = 0$
+
+
+(h) $\mu = 0.5$
+
+
+(i) $\mu = 1$
+Figure 9: Histogram of similarities and sample margins for CosFace ( $s = 64$ ) with/without sample margin regularization $R_{\mathrm{sm}}$ on CIFAR-10 and CIFAR-100. (a-c) and (g-i) denote the cosine similarities on CIFAR-10 and CIFAR-100, respectively. (d-f) and (j-l) denote the sample margins on CIFAR-10 and CIFAR-100, respectively.
+
+
+(j) $\mu = 0$
+
+
+(k) $\mu = 0.5$
+
+
+(1) $\mu = 1$
+
+# C.5 FACE VERIFICATION
+
+Datasets. We also verify our method on the task of face verification whose performance highly depends on the discriminability of feature embeddings. We follow the training settings in (An et al., 2020)1. The model is trained on MS1MV3 with 5.8M images and 85K ids (Guo et al., 2016) and testing on LFW (Sengupta et al., 2016), CFP-FP [3], AgeDB-30 (Moschoglou et al., 2017) and IJBC (Maze et al., 2018). The detailed results on IJBC-C are shown in Table 9
+
+Training Details We use ResNet34 as the feature embedding model and train it on two GPUs NVIDIA Tesla v100 with batch size 512 for all compared methods. The compared method includes ArcFace, CosFace, NormFace, and our proposed LM-Softmax.
+
+Baselines and hyper-parameter settings. We use the baseline methods including CosFace, ArcFace, NormFace, and our proposed LM-Softmax. For CosFace and ArcFace, we use the hyperparameters followed their original paper, i.e., $s = 64$ and $m = 0.35$ for CosFace; $s = 64$ and $m = 0.5$ for ArcFace; For NormFace and LM-Softmax, we set $s = 64$ and $s = 32$ , respectively.
+
+Table 9: Different evaluation metrics of fave verification on IJB-C. The results with positive gains are highlighted.
+
+| Method | 1e-5 | 1e-4 | AUC |
| ArcFace | 93.21 | 95.51 | 99.4919 |
| ArcFace+Rsm | 93.26 | 95.41 | 99.5011 |
| ArcFace+Rw | 93.27 | 95.53 | 99.5133 |
| CosFace | 93.27 | 95.63 | 99.4942 |
| CosFace+Rsm | 93.28 | 95.68 | 99.5112 |
| CosFace+Rw | 93.29 | 95.69 | 99.5538 |
| LM-Softmax | 91.85 | 94.80 | 99.4721 |
| LM-Softmax+Rw | 93.17 | 95.47 | 99.5086 |
+
+
+(a) $\mu = 0$
+
+
+(b) $\mu = 0.5$
+
+
+(c) $\mu = 1$
+
+
+(d) $\mu = 0$
+
+
+(e) $\mu = 0.5$
+
+
+(f) $\mu = 1$
+
+
+(g) $\mu = 0$
+
+
+(h) $\mu = 0.5$
+
+
+(i) $\mu = 1$
+Figure 10: Histogram of similarities and sample margins for ArcFace ( $s = 20$ ) with/without sample margin regularization $R_{\mathrm{sm}}$ on CIFAR-10 and CIFAR-100. (a-c) and (g-i) denote the cosine similarities on CIFAR-10 and CIFAR-100, respectively. (d-f) and (j-l) denote the sample margins on CIFAR-10 and CIFAR-100, respectively.
+
+
+(j) $\mu = 0$
+
+
+(k) $\mu = 0.5$
+
+
+(1) $\mu = 1$
+
+
+(a) $\mu = 0$
+
+
+(b) $\mu = 0.5$
+
+
+(c) $\mu = 1$
+
+
+(d) $\mu = 0$
+
+
+(e) $\mu = 0.5$
+
+
+(f) $\mu = 1$
+
+
+(g) $\mu = 0$
+Figure 11: Histogram of similarities and sample margins for NormFace ( $s = 64$ ) with/without sample margin regularization $R_{\mathrm{sm}}$ on CIFAR-10 and CIFAR-100. (a-c) and (g-i) denote the cosine similarities on CIFAR-10 and CIFAR-100, respectively. (d-f) and (j-l) denote the sample margins on CIFAR-10 and CIFAR-100, respectively.
+
+
+(h) $\mu = 0.5$
+
+
+(i) $\mu = 1$
+
+
+(j) $\mu = 0$
+
+
+(k) $\mu = 0.5$
+
+
+(1) $\mu = 1$
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+Figure 12: Histogram of similarities and sample margins for LM-Softmax using the zero-centroid regularization with different $\lambda$ on step imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+Figure 13: Histogram of similarities and sample margins for CosFace using the zero-centroid regularization with different $\lambda$ on long-tailed imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+Figure 14: Histogram of similarities and sample margins for ArcFace using the zero-centroid regularization with different $\lambda$ on long-tailed imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+Figure 15: Histogram of similarities and sample margins for NormFace using the zero-centroid regularization with different $\lambda$ on long-tailed imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
+
+
+(a) $\lambda = 0$
+
+
+(b) $\lambda = 1$
+
+
+(c) $\lambda = 2$
+
+
+(d) $\lambda = 5$
+
+
+(e) $\lambda = 10$
+
+
+(f) $\lambda = 20$
+
+
+(g) $\lambda = 0$
+
+
+(h) $\lambda = 1$
+
+
+(i) $\lambda = 2$
+Figure 16: Histogram of similarities and sample margins for LDAM using the zero-centroid regularization with different $\lambda$ on long-tailed imbalanced CIFAR-10 with $\rho = 10$ . (a-f) denote the cosine similarities between samples and their corresponding prototypes, and (g-l) denote the sample margins.
+
+
+(j) $\lambda = 5$
+
+
+(k) $\lambda = 10$
+
+
+(1) $\lambda = 20$
\ No newline at end of file
diff --git a/learningtowardsthelargestmargins/images.zip b/learningtowardsthelargestmargins/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2dfec357f68d68533847906f251397070bbc47d6
--- /dev/null
+++ b/learningtowardsthelargestmargins/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:49fc6f943de6fc2df10a6c7cd6be651e1600cab0d947a8b7965844fdd55f7186
+size 2201039
diff --git a/learningtowardsthelargestmargins/layout.json b/learningtowardsthelargestmargins/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e76e9b622e3d0727f7acc96fda9f54ae91af463e
--- /dev/null
+++ b/learningtowardsthelargestmargins/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:50e3cfd72d36b9db70d78611a254305ab085877e043890ef62568d4365ac9dd1
+size 1539559
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_content_list.json b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..648f414108bc3f2ea65bef431a3063deb0a801d3
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44be08efad99d712c38ef3894c2675b0bde85a5f8e210d77607c36a4bc7bc96a
+size 133986
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_model.json b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..284962e3227aac1461028de5492a2690c7a44fae
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:83a5c62911241fa2ea3eeb8c77101b6d8d204746e036b5c6565f4d738c0e5abd
+size 159088
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_origin.pdf b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a3ebe9cbe7cdd17754ad29f396b3d38df2322b55
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/365c3ad4-77f2-4d55-b43f-7fa50c68de12_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:47653d965d76e6b592b4310717c1cf35fab84da92c59247b39f87cd9ac7823e5
+size 9125961
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/full.md b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b00bb1e37ccbac8b9529b9ac0bcf47fc8702a995
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/full.md
@@ -0,0 +1,500 @@
+# LEARNING TRANSFERABLE REWARD FOR QUERY OBJECT LOCALIZATION WITH POLICY ADAPTATION
+
+Tingfeng Li†§; Shaobo Han†, Martin Renqiang Min†, Dimitris N. Metaxas§
+
+$\dagger$ NEC Labs America, $\S$ Department of Computer Science, Rutgers University
+
+{tl601,dnm}@cs.rutgers.edu,{shaobo,renqiang}@nec-labs.com
+
+# ABSTRACT
+
+We propose a reinforcement learning based approach to query object localization, for which an agent is trained to localize objects of interest specified by a small exemplary set. We learn a transferable reward signal formulated using the exemplary set by ordinal metric learning. Our proposed method enables test-time policy adaptation to new environments where the reward signals are not readily available, and outperforms fine-tuning approaches that are limited to annotated images. In addition, the transferable reward allows repurposing the trained agent from one specific class to another class. Experiments on corrupted MNIST, CU-Birds, and COCO datasets demonstrate the effectiveness of our approach1.
+
+# 1 INTRODUCTION
+
+There is increasing interest in designing machine learning models that can be adapted to unseen environments or repurposed for new tasks, with only minimal human guidance (Vinyals et al., 2016; Snell et al., 2017; Finn et al., 2017; Sun et al., 2020; Hansen et al., 2021). To this end, a small set of examples can not only serve the purpose of implicitly generalizing a trained model to a new environment during training time, but also enable the learner to update its learning objectives during test time.
+
+In this paper, we focus on a reinforcement learning (RL) formulation to the problem of query object localization, in which an agent is trained to localize the target object specified by a small set of exemplary images. Instead of using fixed bounding box proposals, our vision-based agent can be viewed as a proactive information gatherer (Guo, 2003), which actively interacts with an image environment; Furthermore, it follows a class-specific localization policy, and thus is more suitable for aerial imagery (Xia et al., 2018), robotic manipulation (Kalashnikov et al., 2018), or embodied AI (Savva et al., 2019) tasks.
+
+During the test time of query object localization, the queried object class to localize may be novel, or the background environment may undergo substantial changes, hindering the applicability of class-agnostic agents with a fixed policy. In addition, in standard RL settings for object localization, the reward signal is often available, so fine-tuning methods (Julian et al., 2020) can effectively adapt agents to new environments and yield improved performance; On the contrary, in query object localization, the reward signal is not available at test time, because the bounding box annotations are to be found by the localization agent on test images.
+
+To address these problems, we propose an ordinal metric learning based framework for learning an implicitly transferable reward signal defined with a small exemplary set. An ordinal embedding network is pre-trained with data augmentation under a loss function designed to be relevant to the RL task. The reward signal allows explicit updates of the controller in the policy network with continual training during test time. Compared to fine-tuning approaches, the agent can get exposed to new environments more extensively with unlimited usage of test images. Informed by the exemplary set precisely, the agent is adapted to the changes of the localization target.
+
+Our contributions in this paper are summarized as follows: (1) We propose a novel ordinal metric learning based RL framework to learn a transferable reward signal defined with a small exemplary
+
+set for query object localization; (2) Our RL framework enables test-time policy adaptation to new environments where there is no readily available reward signal; (3) Our learned transferable reward allows repurposing a trained agent from localizing one specific class to another; (4) Extensive experiments on several datasets demonstrate the effectiveness of our proposed approach.
+
+# 2 RELATED WORK
+
+# 2.1 OBJECT LOCALIZATION
+
+Compared to bounding-box regression approaches (Redmon et al., 2016; Ren et al., 2016), deep RL based object localization approaches (Caicedo & Lazebnik, 2015; Jie et al., 2016) have the advantage of being region-proposal free, with customized search paths for each image environment. The specificity of an agent purely depends on the classes of bounding-boxes used in the reward. They can be made class-specific (Caicedo & Lazebnik, 2015), but the agent for each class would need to be trained separately.
+
+Despite the rise of crowdsourcing platforms, obtaining ample amount of bounding-box annotations remains costly and error-prone. Furthermore, the quality of annotations often varies, and precise annotations for certain object class may require special expertise from annotators. The emergence of weakly supervised object localization (WSOL) (Song et al., 2014; Oquab et al., 2015; Zhou et al., 2016) methods alleviates the situation, in which image class labels are used to derive bounding box annotations. It is known that WSOL methods have drawbacks of overly relying on inter-class discriminative features and failing to generalize to classes unseen during the training phase.
+
+We argue that intra-class similarity is a more natural objective for the problem of localizing objects belonging to a target class. "Query object localization" emphasizes more about the class-specific nature of a localization task, with the relevance defined by the similarity to query images. A similar problem is image co-localization (Tang et al., 2014; Wei et al., 2017), in which the task is to identify the common objects within a set of images. Co-localization approaches exploit the common characteristics across images to localize objects. Being unsupervised, co-localization approaches could suffer from ambiguity if there exist multiple common objects or parts, e.g., bird head and body (Jaderberg et al., 2015), which may provide unwanted common objects as output.
+
+# 2.2 POLICY ADAPTATION
+
+There seems to be a contradiction between the goals of training an agent with high task-specificity and better generalization performance to new situations at the same time. The key to reconcile these two goals lies in the usage of a small set of examples. There has been a paradigm shift from training static models defined with parameters to dynamic ones defined together with a support set (Vinyals et al., 2016; Snell et al., 2017), proved to be very effective in few-shot classification.
+
+Besides the efforts of employing meta learning to adjust models, fine-tuning on a pre-trained model (Oquab et al., 2014; Finn et al., 2017; Julian et al., 2020) has also been widely used in transferring knowledge from data-abundant to data-scarce tasks. When reward signal is not available, (Hansen
+
+
+Figure 1: RL-based query object localization: training and adaptation. Image-box pairs are only available in the training phase. Test environments include images without box annotations and an exemplary set specifying a different task objective. Thus, the trained policy needs to be adapted.
+
+et al., 2021) proposed a policy adaptation approach, in which the intermediate representation is fine-tuned via optimizing a self-supervised auxiliary loss while the controller is kept fixed. Our work shares the same motivation of test-time training (Sun et al., 2020), but we focus instead on the settings where the controller needs to be adapted or even repurposed for new tasks.
+
+# 3 LEARNING TRANSFERABLE REWARD FOR LOCALIZING QUERY OBJECTS
+
+# 3.1 RL FORMULATION FOR QUERY OBJECT LOCALIZATION
+
+Given a set of images $\mathcal{I}$ with known class labels, the task of query object localization is to find the location $b$ of the bounding box most relevant to the query object, specified in a small set of exemplary images $\mathcal{E}$ . Following the Markov Decision Process (MDP) framework for object localization (Caicedo & Lazebnik, 2015; Jie et al., 2016), this task can be formulated as a RL problem. In the training phase, a localization agent learns to take actions of moving the bounding box to maximize a reward function reflecting localization accuracy. In the test phase, the agent is informed by a small test exemplary set about a new task objective. Figure 1 shows an overview of the query object localization problem and the RL formulation, with components listed as follows.
+
+- Environment: Raw pixels of a single image $I_{i}$ , without candidate proposal boxes.
+- Action: Discrete actions facilitating a top-down search, including five scaling: scale towards top left/right, bottom left/right, center; eight translation transformations: move left/right/up/down, enlarge width/height, reduce width/height; plus one stay action.
+- State: Pooled features from the current box and an internal state within RNN that encodes information from history observations.
+- Reward: Improvements the agent made in localizing the query images (in different tasks).
+
+# 3.2 PRE-TRAINING ORDINAL REWARD SIGNAL
+
+For training an agent to localize different objects according to queries, the reward function needs to be transferable. Existing deep RL approaches for object localization (Caicedo & Lazebnik, 2015; Jie et al., 2016) use its ground-truth object bounding box $g_{i}$ as the reward signal,
+
+$$
+R = \operatorname {s i g n} \left(\operatorname {I o U} \left(b _ {t}, g _ {i}\right) - \operatorname {I o U} \left(b _ {t - 1}, g _ {i}\right)\right), \tag {1}
+$$
+
+where $\mathrm{IoU}(b_t, g_i)$ denotes the Intersection-over-Union (IoU) between the current window $b_t$ and the corresponding ground-truth box $g_i^2$ , and $\mathrm{IoU}(b, g) = \mathrm{area}(b \cap g) / \mathrm{area}(b \cup g)$ . Similar to the bounding box regression approaches which learn a mapping $\phi: I \mapsto g$ , the image and box must be paired. However, annotated image-box pairs $(I, g)$ may be scarce in both the training and testing phases. The reward signal defined in Eq. 1 is instance-wise, which is not transferable across images.
+
+To address this problem, a natural idea is to define the reward signal based on learned representations of the cropped images by current window $b_{t}$ and the ground-truth window $g$ . Given their $M$ -dimensional representations $\mathbf{b}_{\mathbf{t}}$ and $\mathbf{g}$ produced by an embedding function $f: \mathbb{R}^{D} \mapsto \mathbb{R}^{M}$ from $D$ -dimensional image feature vectors, a distance function $d: \mathbb{R}^{M} \times \mathbb{R}^{M} \mapsto [0, +\infty)$ returns the embedding distance $d(\mathbf{b}_{\mathbf{t}}, \mathbf{g})$ . However, an embedding distance based on off-the-shelf pre-trained networks is not adequate, since it may not decrease monotonically as the agent approaches to the ground-truth box $g$ . As a result, the embedding distance based reward signal may be less effective than Eq. 1 (as shown in Section 4). Therefore, an embedding function customized for the downstream RL-based localization task is needed.
+
+Ordinal metric learning. We propose to use an ordinal embedding based reward signal. For any two perturbed boxes $b_{j}, b_{k}$ from ground truth $g$ , embeddings $\mathbf{b_j}, \mathbf{b_k}, \mathbf{g}$ are learned, such that the relative preferences between any pair of boxes are preserved in the Euclidean space,
+
+$$
+\rho_ {j} > \rho_ {k} \Leftrightarrow | | \mathbf {b} _ {\mathbf {j}} - \mathbf {g} | | < | | \mathbf {b} _ {\mathbf {k}} - \mathbf {g} | |, \quad \forall j, k \in \mathcal {C}, \tag {2}
+$$
+
+where $\rho_{j}$ and $\rho_{k}$ denote the preference (derived from either IoU to ground-truth box or ordinal feedback from user), and $\mathcal{C}$ is an ordinal constraint set constructed by sampling box pairs around
+
+$g$ . This problem is originally posed as non-metric multidimensional scaling (Agarwal et al., 2007; Jamieson & Nowak, 2011). Although we apply a very simple pairwise-based approach, there exist other extensions such as the listwise-based (Cao et al., 2007), quadruplet-based (Terada & Luxburg, 2014) and landmark-based (Anderton & Aslam, 2019; Ghosh et al., 2019) approaches.
+
+Loss function. In this paper, we define preference $\rho$ as the IoU of box $b$ to the ground-truth box $g$ , i.e., $\rho = \mathrm{IoU}(b, g)$ . We choose to optimize a triplet loss (Hermans et al., 2017) for learning the desired embeddings,
+
+$$
+\mathcal {L} _ {\text {t r i p l e t}} = \sum_ {\text {a n c h o r}, \text {o r d i n a l p a i r s}} \max \left(m + d (\mathbf {a}, \mathbf {p}) - d (\mathbf {a}, \mathbf {n}), 0\right), \tag {3}
+$$
+
+where $\mathbf{a}$ is the "anchor" embedding that will be discussed in detail later, $\mathbf{p}$ , $\mathbf{n}$ are the "positive" and "negative" embeddings for boxes with larger and smaller IoUs with ground truth box $g$ , respectively, $m$ is a margin hyper-parameter. We learn an embedding space consistent with local ordinal constraints on positive and negative data obtained via data augmentation such as box perturbation.
+
+Box Perturbation Assuming the training exemplary set $\mathcal{E}_{\mathrm{train}}$ contains both image $I$ and box $g$ , we adopt a tailored data augmentation scheme - box perturbation, in which a pair of boxes are randomly sampled from $I$ with different IoUs to $g$ . We compare the efficiency of sampling schemes on generating augmented bounding box pairs, (a) Random sampling, where the pair of boxes are generated completely randomly, and (b) Group-based sampling, where dense boxes with variant scales are first generated, and then divided into $M = 10$ groups according to the IoU with ground-truth box. Each group has an IoU interval of $1 / M$ . The sampling is first done on the group level, i.e., 2 out of $M$ , then sample one box from each group. Thus, the sampled boxes are likely to cover more diverse cases comparing to random sampling. We have found that using IoU-based partition scheme is more effective than random sampling.
+
+The choice of anchor. The anchor embedding $\mathbf{a}$ in Eq. 3 is not restricted to the cropped image from the same image. For example, it could be replaced by the prototype embedding (Snell et al., 2017) of the exemplary set $\mathcal{E}$ , $\mathbf{c} = 1 / |\mathcal{E}| \sum_{i \in \mathcal{E}} \mathbf{g}_i$ , where $\mathbf{g}_i$ is the embedding of the cropped image $I_i$ by ground-truth box $g_i$ . If images from multiple classes are of interest, the prototype can be further made to be class-dependent, or clustering-based. A prototype as the anchor enables test-time policy adaptation without image-box pairs in the exemplary set $\mathcal{E}_{\mathrm{test}}$ . In comparison, supervised methods such as Faster RCNN would require image-box pairs for fine-tuning on new tasks. In some experiments (Appendix B.1), we find that using prototype-based embedding as the anchor could lead to better generalization performance than using $\mathbf{g}$ . It is also interesting to explore other treatment on the exemplary set, such as permutation-invariant architectures (Zaheer et al., 2017; Ilse et al., 2018; Lee et al., 2019).
+
+# 3.3 LOCALIZATION AGENT TRAINING
+
+As discussed in Section 3.2, we use the ordinal embedding rather than the bounding box coordinates to quantify the improvement that an agent makes, and the continuous-valued reward for the agent
+
+
+Figure 2: (a) Modules for ordinal representation learning. The RoI encoder extracts RoI feature that will be used as the state representation for localization. The projection head learns ordinal embedding $\mathbf{b}$ for computing reward. (b) Controller network. In each step, the agent takes the output from the RoI encoder as state, while it also maintains an internal hidden state $h^r$ within a RNN, which encodes information from history observations. Then it outputs the action for next step.
+
+
+
+moving from state $s'$ to $s$ takes the following form,
+
+$$
+R (s, s ^ {\prime}) = \left\| \mathbf {b} _ {t - 1} - \mathbf {c} \right\| - \left\| \mathbf {b} _ {t} - \mathbf {c} \right\|, \tag {4}
+$$
+
+where $\mathbf{c}$ is the prototype embedding, $\mathbf{b}_t$ is the embedding of the cropped region at step $t$ . We expect positive reward if the embedding distance between cropped image $\mathbf{b}_t$ and query image $\mathbf{a}$ is decreased.
+
+State representation. Note that a good representation for defining reward may not necessarily be a good state representation at the same time - it may not contain enough information guiding the agent taking the right actions. Chen et al. (2020) suggests that adding a projection head between the representation and the contrastive loss substantially improves the quality of the learned representation. We find that the use of projection head is crucial in balancing the two objectives in our task. The network architecture is shown in Figure 2(a), in which an MLP projection head is attached after an (Region of Interest) RoI encoder. The ROIAign module handles boxes of different sizes.
+
+Policy network. Starting from a whole image as input, the agent is trained to select actions to transform the current box at each step, maximizing the total discounted reward. We use policy gradient based on a recurrent neural network (RNN) (Mnih et al., 2014) with a vector of history actions and states. More detailed architecture can be found in Figure 2(b) and Appendix Figure 6. For all experiments, we apply policy gradient (REINFORCE) (Williams, 1992) with entropy loss regularization to encourage exploration. The main algorithm is outlined in Algorithm 1.
+
+Algorithm 1: Training localization agent using the proposed ordinal reward signal.
+Require:initial policy $\pi_{\theta}$ , batch size $N$ , pre-trained RoI encoder $e$ and projection head $h$ , learning rate $\alpha$ Output:policy network $\pi_{\theta}$
+for sampled minibatch $\{x_{k}\}_{k = 1}^{N}$ do
+for $k = 1,\dots N$ do Construct an exemplary set $\mathcal{E}_{\mathrm{batch}}$ $\mathbf{g_j}\gets h(e(x_k,g_j)) / /$ compute the ordinal embedding in Figure 2(a) $\mathbf{c}_k\leftarrow \frac{1}{|\mathcal{E}_{\mathrm{batch}}|}\sum_{j\in \mathcal{E}_{\mathrm{batch}}}\mathbf{g}_j / /$ compute the prototype vector $\tau_{k}\gets \{s_{1},a_{1},\ldots s_{T},a_{T}\}$ by running policy $\pi_{\theta}$ // sample trajectory $\mathbf{b_t}\gets$ take action $a_{t}$ , and compute embedding $h(e(x_k,b_t))$ for current window $b_{t}$ $R_k^t\gets \| \mathbf{b}_{t - 1} - \mathbf{c}_k\| -\| \mathbf{b}_t - \mathbf{c}_k\|$ // compute reward in equation 4
+end
+ $\theta \gets \theta +\alpha \nabla_{\theta}\sum_{k = 1}^{N}\Big[\log \pi_{\theta}\left(\sum_{t^{\prime} = t}^{T}\gamma^{t^{\prime} - t}R_k^t\right) - \lambda \cdot \pi_{\theta}\log \pi_{\theta}\Big] / /$ policy update
+end
+
+# 3.4 TEST-TIME ADAPTATION
+
+During test time, the agent has the option of further updating the policy network using the received reward from Eq. 4. To match test conditions, the training batch is split into two groups, and $\mathbf{c}$ is computed on a small subset that does not overlap with the training images to localize; During test-time adaptation, $\mathbf{c}$ becomes the prototype of the test exemplary set $\mathcal{E}_{\mathrm{test}}$ . Different from $\mathcal{E}_{\mathrm{train}}$ , only cropped images are needed in $\mathcal{E}_{\mathrm{test}}$ as shown in Figure 1.
+
+# 4 EXPERIMENTAL RESULTS
+
+In this section, we evaluate the generalization ability of the ordinal embedding as well as the performance of the trained localization agent on both source and target domains. The embedding-based reward not only improves the RL training, but also enables test-time adaptation of the learned policy. Experimental results demonstrate the effectiveness of our approach, with empirical comparisons to fine-tuning, co-localization, few-shot and Faster RCNN object detection baselines.
+
+Implementation details. To evaluate the learned ordinal embedding, we use OrdAcc defined as the percentage of images within which the preference between a pair of perturbed boxes is correctly predicted. To evaluate object localization performance, we use the Correct Localization (CorLoc) (Deselaers et al., 2012) metric, which is defined as the percentage of images correctly localized according to the criterion IoU $(b_{p},g)\geq 0.5$ , where $b_{p}$ is the predicted box and $g$ is the ground-truth
+
+box. Mean and standard deviation (displayed as subscript) are reported from 10 independent runs. We evaluate our approach on distorted versions of the MNIST handwriting, the CUB-200-2011 birds (Wah et al., 2011), and the COCO (Lin et al., 2014) dataset. For the MNIST dataset, we use three convolutional layers with ReLU activation after each layer as the image encoder. For the CUB and the COCO datasets, we adopt layers before conv5_3 of VGG-16 pre-trained on ImageNet as the encoder, unless otherwise specified. More details are presented in Appendix A.2.
+
+# 4.1 POLICY ADAPTATION DURING TEST TIME
+
+We demonstrate the performance improvement with test-time policy adaptation. Through all the experiments, we assume source domain contains abundant data annotations, and target domain annotations are only available in an exemplary set of size 5. We compare our policy adaptation scheme with a standard fine-tuning scheme on the pre-trained policy network.
+
+Results on the corrupted MNIST dataset. For the new class adaptation experiment, we use 50 "digit 4 images under random patch background noises" to train the ordinal embedding and the localization agent. The results on policy adaptation to new digits (other than 4) are shown in Table 1. Row 1 illustrates the transferability of the ordinal embedding reward, trained prototype embedding of a subgroup without the training instance, and evaluated using instance embedding from the same test image ("OrdAcc"). Rows 2 to 4 list the resulting localization accuracy after direct generalization ("before"), fine-tuning on the exemplary set ("fine-tune"), and adaptation using all test images ("adapt"), respectively. Our policy adaptation approach produces a substantial improvement over direct generalization, while fine-tuning approach experiences overfitting on the limited exemplary set. For the background adaptation experiment, we train on 50 digit-3 images under random patch noise, and test on digit-2 images under all four noises. The localization accuracy on both source and new backgrounds environment are shown in Table 2, significant improvements are achieved using our policy adaptation scheme.
+
+Table 1: OrdAcc (%) and CorLoc (%) on new digits environment.
+
+ | 0 | 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | mean |
| OrdAcc | 91.90.7 | 90.32.9 | 92.11.8 | 92.00.2 | 92.70.6 | 92.60.2 | 90.70.7 | 92.00.7 | 90.50.7 | 91.60.5 |
| before | 94.20.6 | 84.11.5 | 88.71.7 | 86.51.8 | 81.21.4 | 91.90.3 | 89.50.7 | 93.01.0 | 90.80.4 | 88.91.0 |
| fine-tune | 93.32.5 | 80.43.9 | 84.53.5 | 84.91.5 | 78.82.7 | 87.32.9 | 82.25.4 | 87.74.5 | 85.65.3 | 83.74.5 |
| adapt | 99.80.2 | 95.60.6 | 98.10.4 | 97.90.4 | 88.30.5 | 99.10.2 | 98.60.9 | 99.80.3 | 99.20.4 | 97.40.4 |
+
+Table 2: CorLoc (%) when adapted to other background on corrupted MNIST dataset.
+
+| adapt | random patch | clutter | impulse noise | gaussian noise | mean |
| ✓ | 97.60.4 | 39.60.5 | 22.10.7 | 66.22.0 | 56.4 |
| 100.00.0 | 97.40.3 | 99.90.1 | 100.00.0 | 99.3 |
+
+Results on the CUB dataset. We also evaluate the policy adaptation performance on the CUB dataset. The localization agent is trained on 15 species from the "Warbler" class, and adapted to different classes of "Warbler" (5 new species), "Wren", "Sparrow", "Oriole", "Kingfisher", "Vireo", and "Gull". Each test class contains a single bird class. We also implement deep descriptor transforming (DDT) (Wei et al., 2017), a deep learning based co-localization approach, and add it to the comparison.
+
+Table 3: CorLoc (%) when adapted to other species/classes on CUB dataset.
+
+ | adapt | warbler (new) | wren | sparrow | oriole | kingfisher | vireo | gull | mean |
| DDT | | 73.8 | 78.6 | 71.2 | 74.5 | 78.0 | 69.2 | 93.3 | 76.9 |
| Ours | ✓ | 85.51.1 | 82.92.6 | 81.33.7 | 77.90.7 | 78.90.6 | 82.24.6 | 86.33.5 | 82.1 |
| 89.71.1 | 91.01.1 | 89.31.8 | 85.00.8 | 85.94.4 | 90.00.9 | 93.90.5 | 89.3 |
+
+Results on the COCO dataset. Given a target domain that one would like to deploy models to, a natural question is whether one should collect labeled data from an abundant number of source domains or from one specific class with potential lower data collection cost. On the COCO dataset, we train on one of the five classes: cat, cow, dog, horse, zebra, then adapt to another four classes. The results are shown in Figure 3. The models perform best using ordinal embedding reward with
+
+
+Figure 3: CorLoc (\%) Comparison with IoU-based reward on COCO dataset. "ours": ordinal embedding based reward; "iou": IoU based reward, ImageNet pre-trained embedding. Dotted lines are the results of directly training on target class, using embedding based reward but from a ImageNet pre-trained model, indicating the advantage of our approach, with ordinal embedding learned from a single source class and policy adaptation.
+
+adaptation (see "ours-adapt"). It shows that, although an agent is trained in a highly specialized way on only one-source tasks, it can still be flexibly generalized to different target tasks. One interesting observation is that, it is easy to transfer from other four classes to zebra, but not vice versa. A possible explanation might be that, the embedding net is biased on textures, and texture information is less adaptable than shape information.
+
+# 4.2 COMPARISON TO FEW-SHOT OBJECT DETECTORS
+
+Few-shot object detection (Kang et al., 2019; Yan et al., 2019; Wang et al., 2019; 2020) methods are similar to our work in adapting models to a new test case with the help of limited annotations, but they have a different requirement on the number of training classes. Being different in the generalization mechanism, they usually require multiple classes in both stages of training and fine-tuning. On the COCO dataset, we compared the performance of our methods with TFA (Wang et al., 2020), and Meta-RCNN (Yan et al., 2019), on the same one-way 5-shot test setting. TFA adopts two-stage finetuning of object detector, while Meta-RCNN incorporates additional meta-learner to acquire class-level meta knowledge for generalization to novel classes. These two few-shot baselines are trained on 60 base classes and fine-tuned on all 80 classes, while our model is trained from one single class of the 5 classes randomly selected from the base classes set: elephant, sheep, giraffe, laptop and suitcase. Table 4 shows that with ordinal embedding, our agent achieves better performance even without adaptation, and the performance can be further improved after adaptation.
+
+Table 4: CorLoc (%) Adaptation comparison with other methods on COCO dataset. "TFA w/ fc": TFA with a cosine similarity based box classifier; "TFA w/ cos": TFA with a normal FC-based classifier; "FRCN+ft-full": Meta-RCNN with Faster RCNN as detector and finetuning both the feature extractor and the box predictor.
+
+| target | cat | dog | cow | horse | mean |
| FRCN+ft-full (Yan et al., 2019) | 13.1 | 3.1 | 3.7 | 7.4 | 6.8 |
| TFA w/ fc (Wang et al., 2020) | 29.1 | 13.0 | 5.0 | 10.7 | 14.4 |
| TFA w/ cos (Wang et al., 2020) | 28.0 | 10.3 | 4.5 | 8.9 | 12.9 |
| Ours-before | 23.0 | 20.6 | 24.5 | 21.2 | 22.3 |
| Ours-adapt | 40.3 | 33.5 | 43.1 | 40.2 | 39.3 |
+
+# 4.3 COMPARE WITH SUPERVISED BASELINE - FASTER RCNN
+
+We compare our framework with a strong supervised object localization baseline, Faster RCNN (Ren et al., 2016). Both methods are trained in one class (foreground vs. background as the classification labels in Faster RCNN) and adapted to a different class. We fine-tune the pre-trained VGG-16 model and test on each of the five classes: cow, cat, dog, horse, zebra. The results on source domain are
+
+shown in Table 5. It shows that Faster RCNN can also be made into a class-specific model and it still yields superior performance on source domain. On the target domain, we fine-tune Faster RCNN using only query set for each target class. The results are shown in Table 6. It can be seen that our method works better on new classes with test-time adaptation over the traditional fine-tuning of Faster RCNN. Note that fine-tuning requires image-box pairs in the target domain while our policy adaptation approach does not.
+
+Table 5: CorLoc (%) comparison with Faster RCNN on source domain.
+
+| method | cow | cat | dog | horse | zebra |
| Faster RCNN (Ren et al., 2016) | 70.37 | 89.82 | 85.81 | 92.65 | 85.71 |
| ours | 70.37 | 68.46 | 61.26 | 61.28 | 79.36 |
+
+Table 6: CorLoc (%) comparison with Faster RCNN fine-tuned on target domain.
+
+ | before fine-tune | before adapt | after fine-tune | after adapt |
| Faster RCNN | ours | Faster RCNN | ours |
| cat ->horse | 20.93 | 33.32 | 37.73 | 51.89 |
| cow ->horse | 54.79 | 48.41 | 68.04 | 46.80 |
| cog ->horse | 38.52 | 41.50 | 58.01 | 55.89 |
| zebra ->horse | 1.12 | 10.29 | 6.04 | 39.22 |
| cat ->cow | 40.52 | 50.85 | 58.55 | 58.58 |
| dog ->cow | 54.55 | 54.63 | 70.11 | 62.86 |
| horse ->cow | 72.11 | 59.52 | 75.35 | 64.83 |
| zebra ->cow | 1.23 | 8.14 | 5.86 | 35.56 |
| cow ->cat | 46.12 | 39.84 | 53.85 | 46.42 |
| dog ->cat | 67.62 | 57.97 | 77.07 | 63.12 |
| horse ->cat | 36.67 | 44.25 | 36.67 | 53.39 |
| zebra ->cat | 0.55 | 10.45 | 4.09 | 35.73 |
| cat->dog | 58.98 | 47.81 | 66.50 | 48.94 |
| cow ->dog | 45.85 | 37.28 | 51.69 | 42.33 |
| horse ->dog | 41.04 | 39.07 | 47.69 | 44.77 |
| zebra ->dog | 0.68 | 7.74 | 3.4 | 17.73 |
| cat ->zebra | 10.64 | 57.58 | 37.97 | 70.28 |
| cow ->zebra | 4.42 | 39.64 | 19.64 | 65.80 |
| dog ->zebra | 2.29 | 35.27 | 15.88 | 63.91 |
| horse ->zebra | 7.86 | 66.82 | 29.3 | 72.83 |
| mean | 30.32±25.0 | 39.51±17.9 | 41.17±25.3 | 52.04±13.9 |
+
+# 4.4 ABLATION STUDIES
+
+We analyze the effectiveness of ordinal embedding and RL component separately on COCO dataset (Appendix B.1 provides more in-depth analysis on the corrupted MNIST dataset, including policy gradient vs. deep Q-Network, continuous vs. binary reward). First, we remove RL, and substitute it with a simple linear search approach. Specifically, we adopt selective search (Uijlings et al., 2013) for candidate boxes generation. The candidate boxes are ranked according to their embedding distances to the prototype, and the one with the smallest embedding distance is returned as the final output. We consider two backbone networks as the embedding, including ImageNet pre-trained VGG-16 and Faster RCNN VGG-16 trained locally on COCO dataset. We also compare both with and without the ordinal component, making it a $2 \times 2$ ablation study. It can be seen from the blue and green bars from Figure 4 and Appendix Figure 10 that with ordinal structure, the ranking method performs much better. We find that pre-training with the proposed ordinal loss significantly improves the rank consistency of these backbone networks (Appendix B.1).
+
+In contrast, being able to learn across different images, the RL localization agent shows more tolerance to the defects of the reward function. We analyze the benefits of RL component. From both Figure 4 and Figure 10, when using ordinal embedding, the model with RL is generally better than ranking, especially after adaptation.
+
+Ordinal component is necessary for several possible reasons. First, the ordinal component makes the generic pre-trained network more specific to the downstream object localization task. Second, it
+
+
+Figure 4: CorLoc $(\%)$ comparison with ranking method using Faster RCNN pre-trained backbone.
+
+helps remove the dataset bias if the pre-trained network is non-native. Third, ordinal pre-training encourages the reward signal to reflect step-by-step improvements.
+
+Encouraged by the strong baseline performance of Faster RCNN on both source and target domain (detailed in Table 5 and Table 6), we investigate whether it is adequate to use Faster RCNN embedding in the RL reward function, with or without ordinal pre-training. Since Faster RCNN embedding is also trained for object localization on the COCO dataset, it can separate out the effects of the ordinal pre-training component better. The result are shown in Table 7. It can be seen that without ordinal pre-training, the performance degrades significantly and the CorLoc is much lower even in source domain. More results of different backbones are presented in Appendix Table 15 and Table 16, from which the test-time adaptation still brings a large margin of improvement.
+
+Table 7: CorLoc (%) RL with Faster RCNN embedding w/ and w/o ordinal pre-training on source domain.
+
+| method | cow | cat | dog | horse | zebra |
| Faster RCNN backbone | 25.93 | 13.17 | 12.16 | 16.18 | 28.57 |
| Faster RCNN backbone + Ord | 66.67 | 72.46 | 61.59 | 60.29 | 71.25 |
+
+# 5 CONCLUSION AND FUTURE WORK
+
+We propose an ordinal representation learning based reward, for training a localization agent to search queried objects of interest. In particular, we use a small exemplary set as a guidance signal for delivering learning objectives without ambiguity. Meanwhile, we use test image environments to inform the agent about the domain shifts, without requiring image-box pairs during test time.
+
+Instead of jointly training a localization and classification model, we learn box annotations from image class labels, in a similar spirit to weakly-supervised learning. Empirically, we focus extensively on the transfer learning setting from one single data abundant training task to data-scarce (one-way few-shot) test tasks (Taylor & Stone, 2009; Zhu et al., 2020). To make a trained RL agent generalizable to new unseen test cases, one can either expose the agent to as many cases as possible during training, or make the agent more specific but adaptable upon changed scenarios. Our approach belongs to the latter.
+
+The transferability of our reward signal from training to test crucially relies on the generalization ability of the learned ordinal representation. If the ordinal preference does not hold in the test domain, the proposed test-time policy adaptation scheme will not work. By adapting the representation with self-supervised objectives (Hansen et al., 2021), this issue might be remedied.
+
+Although our work focuses on the generalization ability of a single object localizer, extensions to multiple objects can possibly be done by applying it multiple times and marking the found regions, in a similar manner as (Caicedo & Lazebnik, 2015). Curriculum learning with a designed sequence of targets in the exemplary set may guide the agent toward solving challenging localization tasks. We leave those extensions for future study.
+
+# ACKNOWLEDGEMENT
+
+This research has been partially funded by the following grants ARO MURI 805491, NSF IIS-1793883, NSF CNS-1747778, NSF IIS 1763523, DOD-ARO ACC-W911NF, NSF OIA-2040638 to D. Metaxas. We would like to thank anonymous reviewers for their comments and suggestions.
+
+# REFERENCES
+
+Sameer Agarwal, Josh Wills, Lawrence Cayton, Gert Lanckriet, David Kriegman, and Serge Belongie. Generalized non-metric multidimensional scaling. In Artificial Intelligence and Statistics, pp. 11-18. PMLR, 2007.
+Jesse Anderton and Javed Aslam. Scaling up ordinal embedding: A landmark approach. In International Conference on Machine Learning, pp. 282-290. PMLR, 2019.
+Juan C Caicedo and Svetlana Lazebnik. Active object localization with deep reinforcement learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2488-2496, 2015.
+Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. Learning to rank: from pairwise approach to listwise approach. In International Conference on Machine Learning, pp. 129-136, 2007.
+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.
+Thomas Deselaers, Bogdan Alexe, and Vittorio Ferrari. Weakly supervised localization and learning with generic knowledge. International Journal of Computer Vision, 100(3):275-293, 2012.
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126-1135. PMLR, 2017.
+Nikhil Ghosh, Yuxin Chen, and Yisong Yue. Landmark ordinal embedding. In Advances in Neural Information Processing Systems, volume 32, 2019.
+AnYuan Guo. Decision-theoretic active sensing for autonomous agents. In International Joint Conference on Autonomous Agents and Multiagent Systems, pp. 1002-1003, 2003.
+Nicklas Hansen, Rishabh Jangir, Yu Sun, Guillem Alenyà, Pieter Abbeel, Alexei A Efros, Lerrel Pinto, and Xiaolong Wang. Self-supervised policy adaptation during deployment. In International Conference on Learning Representations, 2021.
+Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask R-CNN. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2961-2969, 2017.
+Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017.
+Maximilian Ilse, Jakub Tomczak, and Max Welling. Attention-based deep multiple instance learning. In International Conference on Machine Learning, pp. 2127-2136. PMLR, 2018.
+Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pp. 2017-2025, 2015.
+Kevin G Jamieson and Robert D Nowak. Low-dimensional embedding using adaptively selected ordinal data. In 2011 49th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1077-1084. IEEE, 2011.
+Zequn Jie, Xiaodan Liang, Jiashi Feng, Xiaojie Jin, Wen Lu, and Shuicheng Yan. Tree-structured reinforcement learning for sequential object localization. In Advances in Neural Information Processing Systems, pp. 127–135, 2016.
+
+Ryan Julian, Benjamin Swanson, Gaurav S Sukhatme, Sergey Levine, Chelsea Finn, and Karol Hausman. Never stop learning: The effectiveness of fine-tuning in robotic reinforcement learning. In Conference on Robot Learning, 2020.
+Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, pp. 651-673. PMLR, 2018.
+Bingyi Kang, Zhuang Liu, Xin Wang, Fisher Yu, Jiashi Feng, and Trevor Darrell. Few-shot object detection via feature reweighting. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8420-8429, 2019.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332-1338, 2015.
+Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning, pp. 3744-3753. PMLR, 2019.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In European Conference on Computer Vision, pp. 740-755, 2014.
+Volodymyr Mnihi, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. Recurrent models of visual attention. In Proceedings of the 27th International Conference on Neural Information Processing Systems-Volume 2, pp. 2204-2212, 2014.
+Maxime Oquab, Leon Bottou, Ivan Laptev, and Josef Sivic. Learning and transferring mid-level image representations using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1717-1724, 2014.
+Maxime Oquab, Léon Bottou, Ivan Laptev, and Josef Sivic. Is object localization for free? - weakly-supervised learning with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 685-694, 2015.
+Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763. PMLR, 2021.
+Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 779-788, 2016.
+Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1137-1149, 2016.
+Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9339-9347, 2019.
+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.
+Hyun Oh Song, Ross Girshick, Stefanie Jegelka, Julien Mairal, Zaid Harchaoui, and Trevor Darrell. On learning to localize objects with minimal supervision. In International Conference on Machine Learning, pp. 1611-1619. PMLR, 2014.
+
+Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In International Conference on Machine Learning, pp. 9229-9248. PMLR, 2020.
+Kevin Tang, Armand Joulin, Li-Jia Li, and Li Fei-Fei. Co-localization in real-world images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1464-1471, 2014.
+Matthew E Taylor and Peter Stone. Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10(7), 2009.
+Yoshikazu Terada and Ulrike Luxburg. Local ordinal embedding. In International Conference on Machine Learning, pp. 847-855. PMLR, 2014.
+Jasper RR Uijlings, Koen EA Van De Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. International Journal of Computer Vision, 104(2):154-171, 2013.
+Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. Advances in Neural Information Processing Systems, 29:3630-3638, 2016.
+Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-UCSD birds-200-2011 dataset, 2011.
+Xin Wang, Thomas Huang, Joseph Gonzalez, Trevor Darrell, and Fisher Yu. Frustratingly simple few-shot object detection. In International Conference on Machine Learning, pp. 9919-9928, 2020.
+Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Meta-learning to detect rare objects. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9925-9934, 2019.
+Xiu-Shen Wei, Chen-Lin Zhang, Yao Li, Chen-Wei Xie, Jianxin Wu, Chunhua Shen, and Zhi-Hua Zhou. Deep descriptor transforming for image co-localization. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pp. 3048–3054, 2017.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229-256, 1992.
+Gui-Song Xia, Xiang Bai, Jian Ding, Zhen Zhu, Serge Belongie, Jiebo Luo, Mihai Datcu, Marcello Pelillo, and Liangpei Zhang. DOTA: A large-scale dataset for object detection in aerial images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3974-3983, 2018.
+Xiaopeng Yan, Ziliang Chen, Anni Xu, Xiaoxi Wang, Xiaodan Liang, and Liang Lin. Meta R-CNN: Towards general solver for instance-level low-shot learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9577-9586, 2019.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabás Póczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, 2017.
+Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921-2929, 2016.
+Zhuangdi Zhu, Kaixiang Lin, and Jiayu Zhou. Transfer learning in deep reinforcement learning: A survey. CoRR, abs/2009.07888, 2020.
+
+# A APPENDIX: IMPLEMENTATION DETAILS
+
+# A.1 ALGORITHM PIPELINE
+
+General supervised training methods are usually class-agnostic and require exposure to a large number of training classes, box-image pairs, and foreground and background variations in order to generalize well. In contrast, we allow specialized agents to be trained, with the ability of adaptation to changes during the test time. Our approach is based on the feature similarity with query images, which departs from previous bounding-box regression and RL approaches based on objectiveness. Compared to general supervised training or fine-tuning methods, our approach is able to flexibly make use of various types of data in these phases. This is summarized in Table 8.
+
+Table 8: Breaking up the requirements on data and labels in training and adaptation
+
+ | Supervised methods | Our approach |
| Training | Fine-tuning | Ordinal embedding | Agent training | Test-time adaptation |
| Image-box pairs | ✓ | ✓ | ✓ | ✗ | ✗ |
| Unlabeled images | ✗ | ✗ | ✗ | ✓ | ✓ |
| Exemplar images | ✗ | ✗ | ✓ | ✓ | ✓ |
+
+Our agent can both take human feedback in terms of the exemplary set and perform test-time policy adaptation using unlabeled test data. It includes three stages: ordinal representation pre-training, RL agent training, and test-time adaptation. Details are as follows:
+
+Stage 1: Pre-train ordinal embedding for state representation and reward In this stage, we assume pairs of ground-truth bounding box and training image are available. We train the ordinal embedding by attaching a projection head after RoI encoder, as Figure 5 shows. RoI encoder is composed of image encoder and a RoIAlign layer (He et al., 2017). It extracts corresponding bounding box feature directly from image feature output by image encoder. After training, all the modules are fixed. The output of RoI Encoder then becomes the state for agent, and output of projection head is then used for reward computation.
+
+On Corrupted MNIST (cMNIST) dataset, we attach a decoder in order to train the encoder, but discard it during inference. The loss function is defined as
+
+$$
+\mathcal {L} = \mathcal {L} _ {\text {r e c o n s t r u c t}} + \lambda_ {1} \cdot \mathcal {L} _ {\text {t r i p l e t}}, \tag {5}
+$$
+
+where we set $\lambda_{1} = 0.1$ , and $\mathcal{L}_{\text{reconstruct}}$ is mean square error loss to measure the reconstruction ability of the autoencoder. On CUB and COCO dataset, we adopt the pre-trained ImageNet encoder, thus no additional decoder is needed. The triplet loss $\mathcal{L}_{\text{triplet}}$ is optimized, such that the embedding of positive bounding boxes are closer to the embedding of anchor than negative boxes. Different from traditional definition of triplet loss, our positive and negative boxes are not fixed. When comparing two perturbed boxes, the positive box is always the one with larger IoU. Thus, a box with IoU=0.2 could be positive box if the negative box has even smaller IoU. The anchor box is not restricted to ground truth box of the image instance. For example, we use the mean vector of ordinal embeddings in this paper, computed from ground-truth boxes of images from the exemplary set.
+
+
+Figure 5: Learning RoI Encoder and Projection Head.
+
+Table 9: Network and loss updating details for different stages of the method
+
+ | Configuration | Training | Testing of the RL agent |
| Modules | Objective | Network | Exemplary set | Ordinal pre-training | Policy training | before adaptation | after adaptation |
| ROI Encoder | NA* | VGG-16/ViT | Etrain | Frozen | Frozen | Frozen | Frozen |
| Projection Head | Ordinal loss Ltriplet | MLP | Etrain | Train | Frozen | Frozen | Frozen |
| Controller | Reward | RNN | Etest | NA | Train | Frozen | Updated |
+
+* For cMNIST dataset, ROI encoder is trained under loss Eq.5. For other datasets, we directly load the off-the-shelf pre-trained network.
+
+Stage 2: Localization agent training In this stage, we assume the ground-truth bounding box is available for each training image. All the models are trained and tested on the same datasets as stage 1. We fix all the layers in RoI encoder and projection head. The adopted RNN model is shown in Figure 6. In each step, the agent takes the RoI encoder output $e_{\mathrm{roi}}$ and the hidden state of RNN $h_{t-1}$ , concatenated as the state representation. Then it predicts the action for next step by sampling according to the logits. The loss is defined as
+
+$$
+\mathcal {L} _ {\text {a g e n t}} = \mathcal {L} _ {\text {p o l i c y}} + \lambda_ {2} \cdot \mathcal {L} _ {\text {e n t r o p y}},
+$$
+
+$$
+\mathcal {L} _ {\text {e n t r o p y}} = - \pi \log \pi , \quad \mathcal {L} _ {\text {p o l i c y}} = - (R - \bar {R}) \cdot \log \pi \tag {6}
+$$
+
+where $\mathcal{L}_{\mathrm{entropy}}$ prevents the agent from being stuck in the local minimum, $\pi$ is the policy, and $R$ is the reward defined in Eq. 4.
+
+
+Figure 6: Policy network architecture.
+
+Stage 3: Test-time adaptation To adapt to new class, we make use of a limited number of groundtruth-box cropped images in the test exemplary set. We leverage abundant unlabelled images and this exemplary set to update the agent. We fix the RoI encoder and projection head, and only update the agent. The process is almost the same as stage 2, except that c in reward (Eq. 4) is the prototype of the test exemplary set.
+
+In summary, the configuration of different model components and how they are updated is listed in Table 9. The losses for each dataset and training stage are in Table 10.
+
+Table 10: Summary of losses used on different datasets.
+
+ | dataset | loss |
| stage 1 | cMNIST | L = Lreconstruct + λ1 · Ltriplet, λ1 = 0.1 |
| CUB | L = Ltriplet |
| COCO | L = Ltriplet |
| stage 2 | cMNIST | Lagent = Lpolicy + λ2 · Entropy, λ2 = 6 |
| CUB | Lagent = Lpolicy + λ2 · Entropy, λ2 = 0.5 |
| COCO | Lagent = Lpolicy + λ2 · Entropy, λ2 = 0.5 |
| stage 3 | cMNIST | Lagent = Lpolicy + λ2 · Entropy, λ2 = 0.5 |
| CUB | Lagent = Lpolicy + λ2 · Entropy, λ2 = 0.5 |
| COCO | Lagent = Lpolicy + λ2 · Entropy, λ2 = 0.5 |
+
+# A.2 EXPERIMENTS DETAILS
+
+For MNIST, we use three convolutional layers with ReLU activation after each layer as image encoder, while the same but mirrored structure as decoder to learn an autoencoder, and then attach ROIAlign layer followed by two fully connected $(fc)$ layers as projection head for ordinal reward learning. For the CUB and the COCO datasets, we adopt layers before conv5_3 of VGG-16 pre-trained on ImageNet as encoder unless otherwise specified. The projection head uses the same structure as before but with more units for each $fc$ layer. All of our models were trained with the Adam optimizer (Kingma & Ba, 2015). We set margin $m = 60$ in all the experiments heuristically. All the models take less than one hour to finish training, implemented on PyTorch on a single NVIDIA A100 GPU.
+
+We list experiment details for the datasets used in Section 4 as follows.
+
+Corrupted MNIST Dataset. Examples of the four types of corrupted MNIST (cMNIST) images are shown in Figure 7. In stage 1 and 2, we randomly sample 50 images of one class in original MNIST training set, and add noise as our training set. During testing, the models are evaluated on all the corrupted MNIST test set. In stage 3, to adapt to a new digit, we annotate a limited number of images as exemplary set for adaptation and use all the (corrupted) MNIST training set from that digit. We then test the agent on all (corrupted) MNIST test set of the same digit. There is no overlap between the training and test set used in stage 3.
+
+
+Random patch
+
+
+Cluttered
+Figure 7: Corrupted MNIST Datasets: $28 \times 28$ digits on four kinds of $84 \times 84$ noisy background.
+
+
+Gaussian noise
+
+
+Impulse noise
+
+CUB Dataset. In stage 1 and 2, we train on 15 warbler classes with class id between 158 and 172. There are 896 images in total. Then test the models on 5 new warbler classes with class id between 178 and 182, resulting in 294 images in total. In stage 3, the number and class ids of images for each class are presented in Table 11. We also randomly select limited number of images as exemplary set and use all unlabeled data for adaptation. The CorLoc is calculated using all the images of this class.
+
+Table 11: Number of images for training and testing in stage 3 on CUB dataset.
+
+ | warbler | wren | sparrow | oriole | kingfisher | vireo | gull |
| cls id | [178, 182] | [193, 197] | [114, 119] | [95, 98] | [79, 83] | [151, 157] | [59, 64] |
| #images | 294 | 299 | 357 | 239 | 300 | 409 | 359 |
+
+COCO Dataset. For the results of Figure 3, we train on one of the five classes: cat, cow, dog, horse, zebra, then adapt to another four classes. The detailed number of each class for training and testing in stage 1 and 2 is shown in Table 12.
+
+Table 12: Number of images for training and testing in stage 1, 2 on COCO dataset.
+
+ | cat | cow | dog | horse | zebra | elephant | giraffe | laptop | sheep | suitcase |
| train | 3619 | 649 | 3701 | 1524 | 611 | 973 | 1146 | 2844 | 260 | 1402 |
| test | 167 | 27 | 148 | 68 | 21 | 32 | 40 | 163 | 18 | 61 |
+
+In stage 3, the agent is tested on new classes in target domain, within which we annotate limited number of images for adaptation. In comparison with few-shot object detection experiment, the models in stage 1 and 2 are trained using one single class of the 5 classes: elephant, sheep, giraffe, laptop and suitcase. Then being adapted to the four classes in Table 4. Note that the five classes are in the base classes, and the four classes are in the novel classes used in other methods. Thus, it's
+
+harder to transfer from one single class to another due to scarcity of training data and training class. Table 4 reports the average CorLoc from the five classes to each target class. We also provide the results of each source class in Table 13. From this table, we can see that transferring from related classes with target class usually performs better. For example, the CorLoc from laptop and suitcase are lower than other three animal classes, especially before adaptation. After adaptation, the gap becomes smaller.
+
+Table 13: CorLoc(%) Adaptation comparison with other methods on COCO dataset per class results.
+
+ | before adapt | after adapt |
| cat | dog | cow | horse | cat | dog | cow | horse |
| elephant | 41.25 | 38.45 | 59.94 | 54.27 | 48.00 | 45.66 | 65.64 | 59.19 |
| giraffe | 17.91 | 19.18 | 22.19 | 26.25 | 42.89 | 31.88 | 35.59 | 53.68 |
| laptop | 13.87 | 4.57 | 3.24 | 1.58 | 34.93 | 15.67 | 29.43 | 20.34 |
| sheep | 29.10 | 34.13 | 36.98 | 33.14 | 46.01 | 36.64 | 49.92 | 46.26 |
| suitcase | 12.99 | 6.43 | 11.71 | 4.99 | 37.99 | 37.56 | 43.14 | 25.98 |
+
+Selective localization. We investigate the agent's ability in localizing the object specified by the query set, when the set of images have two common objects. We use random patched MNIST, where each image has digit 3 and digit 4. First, the RoI encoder and projection head are trained with an additional contrastive loss to enlarge the distance between the two digits in embedding space,
+
+$$
+l o s s _ {e m b e d} = l o s s _ {r e c} + \lambda_ {t r i p} \cdot l o s s _ {t r i p} + \lambda_ {c o n t r} \cdot l o s s _ {c o n t r}, \tag {7}
+$$
+
+where $loss_{trip} = loss_{trip_3} + loss_{trip_4}$ , learning two local ordinal structure around each class center in embedding space. We set the margin for both triplet losses as 10, and the margin for contrastive loss as 320 heuristically. We found that the larger the gap between the two margins, the better the performance. Detailed results can be found in Table 17 and its related discussion. After learning the RoI encoder and projection head, we train the agent with the reward defined with Eq. 4 in Sect. 3.3, where $\mathbf{c}$ is the prototype embedding of the targeted digit exemplary set (exemplary size is 5).
+
+
+Figure 8: Selective localization vs. co-localization on two-digits data with random patch background.
+
+Figure 8 shows an illustrative example of query object localization with task adaptation. Given two common objects coexisting in the image environment, the agent is trained to pick up one from the two during training, while quickly adapt to pick another one during testing. Different from unsupervised co-localization approaches (Wei et al., 2017) relying on low-level image clues to distinguish foreground and background, our learning objectives can be specified explicitly by switching the train/test exemplary sets. With test-time adaptation, our agent can handle even partially conflicting learning objectives.
+
+# B ADDITIONAL EXPERIMENTS
+
+# B.1 ABLATION OF ORDINAL EMBEDDING AND RL
+
+Setting and main results on corrupted MNIST dataset. We analyze the effectiveness of using ordinal embedding in terms of representation and reward first on synthetic datasets of corrupted MNIST digits under cluttered, random patch, Gaussian, or impulse noises (see Figure 7 in Appendix for examples). We want to find the answers to two main questions listed below:
+
+1. Is the embedding distance based reward signal as effective as the IoU counterpart?
+2. Does the ordinal triplet loss benefit the state representation learning?
+
+Accordingly, we consider baselines in which embeddings are trained with only autoencoder or jointly with the ordinal projection head. Besides, we also compare our embedding distance based reward against the IoU based reward used in Caicedo & Lazebnik (2015). Without loss of generality, the agent is trained on images of digit 4, and tested on images from all rest classes. In particular, we are interested in evaluating the sample efficiency of different approaches. The results under different training set sizes are shown in Figure 9. To distract the localization agent, cluttered noises with random $6 \times 6$ crops of digits are added to the background. All comparisons are based on the policy gradient (PG) method. With ordinal embedding present in both the representation and reward ("AE+Ord+Embed"), our model performance is consistently better than other settings, especially when the training set size is small. The benefit of a triplet loss is demonstrated by the comparison between "AE+Ord+IoU" and "AE+IoU". Intuitively, the similarity to a queried object is also a more natural goal than objectives defined by bounding boxes IoU, which is used in both generic object detection or localization and previous RL-based approaches.
+
+
+Figure 9: Comparison under different training set sizes. "AE+IoU": autoencoder, IoU based reward; "AE+Embed": autoencoder, embedding distance based reward; "AE+Ord+IoU": autoencoder and ordinal projection head, IoU based reward; "AE+Ord+Embed": autoencoder and ordinal projection head, embedding distance based reward. (a) Test performance on the trained digits 4, (b) Average test performance on the other nine digits.
+
+
+
+Signed reward or not. Another intriguing question is that other than benefiting state representation learning, whether the embedding-based reward itself can bring any additional benefits than the IoU-based reward. From Figure 9, there is a large gap between "AE+Ord+Embed" and "AE+Ord+IoU", especially when the training set size is small. This is counter-intuitive as the ordinal reward is trained with supervision from IoU in embedding space, supposedly it shall not bring any additional information. To further analyze this phenomenon, we take the sign operation off in Eq. 1 and retrain the agent. In an experiment with 50 training images, without sign operation, the localization accuracy increases from $90.92\%$ to $94.36\%$ on test digit 4, and from $82.43\%$ to $88.64\%$ on other digit test set. Perhaps, this improvement can be attributed to more informative feedback provided by the continuous-valued, unsigned reward.
+
+On policy vs. off policy. Many deep RL approaches are in favor of using deep Q-Network (DQN) to train an agent. Different from Caicedo & Lazebnik (2015) and Jie et al. (2016), we apply Policy Gradient (PG) to optimize it. Besides, we adopt a top-down search strategy through a RNN, while they used a vector of history actions to encode memory. We evaluate these design choices with four baselines, with "AE+IoU" setting, and trained on the same 600 sampled cluttered digit 4 images. As
+
+Table 14 shows, the agent achieves the best performance with "PG+RNN". We find that empirically, with history action vectors the accuracy becomes worse when the agent is trained by DQN.
+Table 14: CorLoc(%): DQN (with/without history action vector) vs. PG (with/without RNN)
+
+| Method | DQN | DQN+History | PG | PG+RNN |
| Digit 4 | 88.801.6 | 86.544.3 | 88.982.9 | 94.680.9 |
| Other digits | 84.212.0 | 81.753.4 | 81.912.7 | 89.051.7 |
+
+
+Figure 10: CorLoc(%) comparison with ranking method using ImageNet pre-trained backbone.
+
+More results on COCO dataset. Figure 10 provides results using ImageNet pre-trained VGG-16 network as backbone with the same training strategy as Figure 4. To further demonstrate the effectiveness of ordinal embedding, we compute the Spearman's Rho rank correlation between embedding distance to the prototype and IoU to the ground-truth. The results are shown in Figure 11. Here we also add CLIP (Radford et al., 2021) pre-trained ViT as backbone for comparison. The rank correlation is smaller than $-0.7$ on all backbones with ordinal embedding, exhibiting ordinal embedding preserves the IoU order, thus is better for the ranking purpose. Although pretty effective, embedding distance is still not a perfect indicator of the ranking of IoU. Thus, directly formulate the object localization problem as a search problem leads to suboptimal localization accuracy.
+
+Table 15: CorLoc(%) compare backbones on source domain.
+
+| backbone | cow | cat | dog | horse | zebra |
| ImageNet pre-trained VGG-16 | 70.37 | 68.46 | 61.26 | 61.28 | 79.36 |
| Faster RCNN pre-trained VGG-16 | 66.67 | 72.46 | 61.59 | 60.29 | 71.25 |
| CLIP pre-trained ViT | 74.07 | 82.64 | 70.95 | 76.47 | 80.95 |
+
+# B.2 COMPARER DIFFERENT OFF-THE-SHELF NETWORKS AS THE BACKBONE
+
+It is interesting to study the choices of off-the-shelf pre-trained networks as the backbone, such as CLIP or supervised embedding provided by Faster RCNN or a classification network. Since these networks have been exposed to large-scale dataset, it is interesting to see whether policy adaptation is still needed. We compare different backbones on both source domain and target domain using our method. Table 15 reports the CorLoc of training and testing on source domain. The large-scale pre-traind ViT backbone consistently performs the best, comparing to the other two VGG-16 models. Table 16 compares the backbones on target domain with new classes. The test-time adaptation still brings a large margin of improvement. Interestingly, we also found that the Faster-RCNN embedding offers the best performance on the target domain before adaptation, while the ViT network trained on CLIP dataset provides the best performance after adaptation, indicating different generalization mechanisms. They both outperform the ImageNet backbone initially considered.
+
+
+
+
+
+
+
+
+
+
+Figure 11: Rank correlations between embedding distance and IoU: using different embedding functions such as ImageNet and Faster RCNN, with or without the ordinal pre-training, and ViT.
+
+Table 16: CorLoc(%) compare backbones on target domain.
+
+ | before adapt | after adapt |
| ImageNet VGG-16 | Faster RCNN VGG-16 | CLIP ViT | ImageNet VGG-16 | Faster RCNN VGG-16 | CLIP ViT |
| cat->horse | 33.32 | 35.50 | 18.42 | 51.89 | 47.64 | 56.41 |
| cow ->horse | 48.41 | 54.55 | 53.67 | 46.80 | 59.61 | 63.06 |
| dog ->horse | 41.50 | 46.48 | 15.70 | 55.89 | 56.83 | 58.62 |
| zebra ->horse | 10.29 | 16.86 | 6.74 | 39.22 | 34.19 | 46.39 |
| cat ->cow | 50.85 | 42.99 | 36.26 | 58.58 | 53.26 | 55.52 |
| dog ->cow | 54.63 | 58.65 | 43.50 | 62.86 | 64.15 | 58.76 |
| Horse ->cow | 59.52 | 61.32 | 52.54 | 64.83 | 65.23 | 68.16 |
| Zebra ->cow | 8.14 | 11.92 | 7.19 | 35.56 | 38.26 | 52.65 |
| cow ->cat | 39.84 | 47.39 | 38.79 | 46.42 | 51.15 | 61.67 |
| dog ->cat | 57.97 | 63.84 | 66.60 | 63.12 | 65.18 | 76.83 |
| horse ->cat | 44.25 | 47.67 | 27.80 | 53.39 | 52.96 | 63.87 |
| zebra ->cat | 10.45 | 17.67 | 2.47 | 35.73 | 31.40 | 49.12 |
| cat->dog | 47.81 | 45.61 | 49.69 | 48.94 | 49.83 | 61.75 |
| cow ->dog | 37.28 | 37.64 | 30.13 | 42.33 | 37.10 | 50.94 |
| horse ->dog | 39.07 | 40.76 | 23.89 | 44.77 | 40.69 | 55.68 |
| zebra ->dog | 7.74 | 11.83 | 2.88 | 17.73 | 30.64 | 36.48 |
| cat ->zebra | 57.58 | 15.82 | 22.59 | 70.28 | 45.83 | 69.39 |
| cow ->zebra | 39.64 | 60.55 | 37.75 | 65.80 | 64.21 | 72.18 |
| dog ->zebra | 35.27 | 18.25 | 15.33 | 63.91 | 58.16 | 67.59 |
| horse ->zebra | 66.82 | 56.63 | 61.37 | 72.83 | 68.74 | 75.01 |
+
+# B.3 THE EFFECTS OF MARGIN
+
+The margin in triplet loss is selected heuristically. It is not sensitive except in the selective localization experiment (Figure 8), where there are two different digits in each image. For this experiment, we trained two ordinal structures around each digit using triplet loss with margin $m_{1}$ , and add additional contrastive loss with margin $m_{2}$ to separate the centers of the two different digits as far as possible. And we found out that the model works best when $m_{2} \gg m_{1}$ . In our experiment, we set $m_{1} = 10$ , $m_{2} = 320$ . The results of using different set of $m_{1}$ and $m_{2}$ are presented in Table 17.
+
+Table 17: Results of different margin configuration in selective localization.
+
+| m1 | 10 | 10 | 10 | 10 | 10 |
| m2 | 60 | 70 | 80 | 160 | 320 |
| CorLoc(%) | 86.54 | 87.92 | 88.32 | 91.39 | 98.52 |
+
+# B.4 SIZE OF TRAINING SET
+
+In this experiment, we train on class giraffe in stage 1 and 2, then adapt to cat, cow, dog and horse. We set the training set size as [200, 500, 700, 1146], exemplary set size as 5. We compare our after adaptation results with TFA w/ fc (Wang et al., 2020) one-way 5-shot setting, where their model is trained on all 60 base classes, while ours is only trained on one of the base classes. Figure 12 shows the results, in which the dotted lines are the results of TFA w/ fc. Ours performs much better than their method. Except on cat class, ours is better than theirs with only 200 images for training.
+
+
+Figure 12: Results using different training set size in stage 1, 2.
+
+# B.5 SIZE OF EXEMPLARY SET
+
+We also compare the effect of different size of exemplary set during training and adaptation on CUB-warbler dataset. During training stage, we use shuffle proto training strategy, and set exemplary set size as 2, 5, 15, 25. The results without adaptation on test set are in Table 18. Both OrdAcc and CorLoc increase with exemplary set size. For adaptation stage, the range of exemplary set size is from 2 to 200. And the results are in Table 19. The test performance does not increase much with the exemplary set size. One possible explanation is that the data points in embedding space are compact, thus prototype doesn't change much when increasing exemplary set size. We will analyze the influence of multiple prototypes per class in future experiments.
+
+# B.6 PROTOTYPE SELECTION
+
+We further evaluate the choice of anchor in the triplet loss for both the pre-training of state representation and the ordinal reward for the training of agent. We study $(i)$ whether ordinal embedding can be
+
+Table 18: Effect of exemplary set size during training stage.
+
+| Size | OrdAcc(%) | CorLoc(%) |
| 2 | 94.39±1.7 | 84.18±6.5 |
| 5 | 94.83±2.0 | 88.10±0.2 |
| 15 | 95.69±1.7 | 89.22±1.9 |
| 25 | 93.82±1.0 | 89.64±2.3 |
+
+Table 19: Effect of exemplary set size during adaptation.
+
+| Size | 2 | 5 | 50 | 100 | 150 | 200 |
| CorLoc(%) | 89.12±1.9 | 89.67±1.1 | 90.15±0.8 | 90.36±0.5 | 89.63±0.2 | 90.14±0.5 |
+
+trained in reference to an anchor from a different image instances, $(ii)$ whether it is advantageous to use the prototype embedding of an exemplary set, rather than instance embeddings, and $(iii)$ whether mimicking the test condition in training yields any improvement.
+
+Table 20: Anchor choice comparison. Note that in evaluations the $OrdAcc$ is always computed using instance as anchor.
+
+| Mode | OrdAcc(%) | CorLoc(%) |
| Self | 97.2±0.7 | 61.0±2.0 |
| Proto | 95.2±1.6 | 77.9±0.4 |
| Shuffle self | 92.4±1.4 | 73.8±2.5 |
| Shuffle proto | 96.2±1.5 | 88.1±0.2 |
+
+We use the CUB-Warbler dataset with more foreground background variations than the corrupted MNIST dataset. The training and test set contains 15 and 5 disjoint fine-grained classes respectively, resulting 896 images for training (viewed as a single class) and 294 for testing. Table 20 shows the OrdAcc and CorLoc in four settings. "Self" uses the embedding from images cropped by the ground-truth box from the same instance; "Shuffle self" uses the ground-truth box cropped image embedding from a different instance; Similarly, "Proto" uses the prototype of a subgroup containing the training instance within the same batch; "Shuffle proto (SP)" uses the prototype of a subgroup from a different batch without the training instance. Results suggest that this training strategy brings compactness to the training set, constructing an ordinal structure around the cluster. For "Shuffle proto", while the OrdAcc is lower than others, its CorLoc is the best with large margin. Matching the condition between training and testing indeed improves generalization to new classes on this dataset.
+
+# B.7 ANNOTATION REFINEMENT
+
+Annotation collection plays an important role in building machine learning systems. It is one task that could benefit greatly from automation, especially in cost-sensitive applications. The human labeling efforts can be reduced, not only in terms of the number of annotate samples per class, number of annotate classes (one-class at the minimum), but also the level of accuracy required. We explore the direction of iterative refinement of annotation quality with minimal human guidance. Given an agent trained extensively with inexact human annotations, can we adapt it to refine the annotation with a few well-annotated examples? We purposefully enlarge the ground truth bounding boxes in the corrupted MNIST and CUB datasets, and adapt the trained agent using the original ground truth box in an exemplary set of size 5.
+
+For corrupted MNIST dataset, the agent, RoI encoder and projection head are first trained with 50 digit 3 images with loose $(38\times 38)$ bounding box annotation. Then the agent is adapted to digit 1 images, where the exemplary size $= 5$ , and the ground-truth boxes are $28\times 28$ . For CUB dataset, during training, the ground-truth box in each resized $224\times 224$ image is expanded 10 pixels each side. During adaptation we use the original ground-truth boxes. In adaptation from entire body to head experiment on CUB dataset, we train on original entire body ground-truth bounding box. During adaptation, 15 randomly sampled exemplar images are annotated with head bounding box. The agent
+
+is trained to adapt to localize head by minimizing the distance between embedding of predicted box and prototype of head embeddings. The results are shown in Figure 13 (left panel). Preliminary results with agent trained on the entire bird body and adapt to bird head are shown in Figure 13 (right panel), with a few successful cases on the first row and failure cases on the second row.
+
+
+Figure 13: Annotation refinement. Left: Loose to tight transfer. Right: entire body to head transfer.
+
+
+
+# B.8 FEW-SHOT LOCALIZATION ON OMNIGLOT
+
+The proposed ordinal reward signal also makes our approach amenable to few-shot training, when only a small subset of training images per class are annotated. Different from the transfer learning setting, in few-shot setting limited annotations across multiple classes are available during training. The ordinal reward can be viewed as meta information. We evaluate our method under few-shot setting on corrupted Omniglot dataset (Lake et al., 2015) and CUB-warbler dataset. For Omniglot, We put each $28 \times 28$ character in $84 \times 84$ random patch background. The train and test set contains 25 different classes respectively, thus 500 images for each set. We randomly sample 100 iterations for training and testing. For CUB-warbler dataset, as we did in Sect. 4.2 we train on the same 15 species from the "Warbler" class, and adapted to 5 new species of "Warbler", thus 896 and 294 images respectively. We randomly sample 100 and 50 iterations for training and testing. We use 5-shot 5-way, set exemplary set size as 5, and use proto training strategy for both dataset. The results are shown in Table 21. As an implicit meta learning method, our approach achieves $99.94\%$ and $90.52\%$ CorLoc on the two datasets. We can also leverage explicit meta learning method, such as MAML (Finn et al., 2017) to further improve the results. We will leave this part as future work. Although initial results are promising, more efforts are needed to validate whether the proposed RL approach can achieve state-of-the-art performance, but it is beyond the scope of this work.
+
+Table 21: Evaluation under few-shot localization setting.
+
+| Dataset | OrdAcc(%) | CorLoc(%) |
| Omniglot | 95.11±0.6 | 99.94±0.1 |
| CUB-warbler | 91.28±0.9 | 90.52±0.7 |
+
+# C INTERMEDIATE RESULTS
+
+The agent tends to predict expected actions to transform the box so that it can finally get to the target location. It can also be observed from Figure 14 that the embedding distance between predicted boxes and ground-truth boxes is in agreement with the corresponding IoU. This further demonstrates the effectiveness of the localization agent.
+
+
+Figure 14: Starting from the whole image, the agent is able to localize digit 4 within 10 steps. Each row shows localizing one image, and each column is a time step. Green box means ground-truth bounding box.
+
+
+
+
+Figure 15: The IoU relation between ground-truth and predicted box is accurately represented in embedding space. Left: the embedding distance between ground-truth and predicted box in each step. Right: the IoU between ground-truth and predicted box in each step.
\ No newline at end of file
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/images.zip b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d56de42bcf316cd612f9867773de8fd2686f491b
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:890319b159ec804542990dd40424e69cec0631f688e674175cedf2120767b94f
+size 1255818
diff --git a/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/layout.json b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..aa1a3899f590281f3f6dc8764029f06722e72f93
--- /dev/null
+++ b/learningtransferablerewardforqueryobjectlocalizationwithpolicyadaptation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:efd6aa900e2497be6114a591b3d84ea65457ace9557933accb5e550f890a8769
+size 638810
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_content_list.json b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1df6acd935d6627a2fd5c680ce3538f16ac53c5c
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9a7b567d188085adf346a4a914ba8d02d6b824471868f1dcdd10a527c9aa5cad
+size 143852
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_model.json b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a92d6eb4299b3cf74d25d94de2c4b861b8080d58
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4bff304cb27a8d7f03d536f36535d8a16ba8fd11447d6380bb96612886ef94df
+size 168466
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_origin.pdf b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..44be84bef952caeca1d0a1f235b7a76ed9d33294
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/78d7575a-9859-46a1-8fef-d1bb7c4d7b33_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:81aec665163c1c908251fc52b043d4d8b96a8773baeccc81b8d4b23fc0d65424
+size 2933574
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/full.md b/learningvaluefunctionsfromundirectedstateonlyexperience/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7ffe088d15003fbc674589e58fb1f243a9519c2b
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/full.md
@@ -0,0 +1,559 @@
+# LEARNING VALUE FUNCTIONS FROM UNDIRECTED STATE-ONLY EXPERIENCE
+
+Matthew Chang* Arjun Gupta* Saurabh Gupta
+
+University of Illinois at Urbana-Champaign
+
+{mc48, arjung2, saurabhg}@illinois.edu
+
+# ABSTRACT
+
+This paper tackles the problem of learning value functions from undirected state-only experience (state transitions without action labels i.e. $(s, s', r)$ tuples). We first theoretically characterize the applicability of Q-learning in this setting. We show that tabular Q-learning in discrete Markov decision processes (MDPs) learns the same value function under any arbitrary refinement of the action space. This theoretical result motivates the design of Latent Action Q-learning or LAQ, an offline RL method that can learn effective value functions from state-only experience. Latent Action Q-learning (LAQ) learns value functions using Q-learning on discrete latent actions obtained through a latent-variable future prediction model. We show that LAQ can recover value functions that have high correlation with value functions learned using ground truth actions. Value functions learned using LAQ lead to sample efficient acquisition of goal-directed behavior, can be used with domain-specific low-level controllers, and facilitate transfer across embodiments. Our experiments in 5 environments ranging from 2D grid world to 3D visual navigation in realistic environments demonstrate the benefits of LAQ over simpler alternatives, imitation learning oracles, and competing methods.
+
+# 1 INTRODUCTION
+
+Offline or batch reinforcement learning focuses on learning goal-directed behavior from prerecorded data of undirected experience in the form of $(s_t, a_t, s_{t+1}, r_t)$ quadruples. However, in many realistic applications, action information is not naturally available (e.g. when learning from video demonstrations), or worse still, isn't even well-defined (e.g. when learning from the experience of an agent with a different embodiment). Motivated by such use cases, this paper studies if and how, intelligent behavior can be derived from undirected streams of observations: $(s_t, s_{t+1}, r_t)$ .1
+
+At the face of it, it might seem that observation-only data would be useless towards learning goal-directed policies. After all, to learn such a policy, we need to know what actions to execute. Our key conceptual insight is that while an observation-only dataset doesn't tell us the precise action to execute, i.e. the policy $\pi(a|s)$ ; it may still tell us which states are more likely to lead us to the goal than not, i.e. the value function $V(s)$ . For example, simply by looking at someone working in the kitchen, we can infer that approaching the microwave handle is more useful (i.e. has higher value) for opening the microwave than to approach the buttons. Thus, we can still make use of observation-only data, if we focused on learning value functions as opposed to directly learning goal-directed policies. Once we have learned a good value function, it can be used to quickly acquire or infer behavior. Using learned value functions as dense rewards can lead to quick policy learning through some small amount of interaction in the environment. Alternatively, they could be used to directly guide the behavior of low-level controllers that may already be available for the agent (as is often the case in robotics) without any further training. Furthermore, decoupling the learning of value functions from policy learning enables deriving behavior for agents with a different embodiment as long as the overall solution strategy remains similar. Thus, the central technical question is how to learn a good value function from undirected observation streams. Is it even possible? If so, under what conditions? This paper tackles these questions from a theoretical and practical perspective.
+
+We start out by characterizing the behavior of tabular Q-learning from Watkins (1989) under missing action labels. We note that Q-learning with naively imputed action labels is equivalent to the TD(0) policy evaluation, which serves as a simple baseline method for deriving a value function. However, depending on the policy that generated the data, the learned values (without any action grounding) can differ from the optimal values. Furthermore, it is possible to construct simple environments where the behavior implied by the learned value function is also sub-optimal.
+
+Next, we present a more optimistic result. There are settings in which Q-learning can recover the optimal value function even in the absence of the knowledge of underlying actions. Concretely, we prove that if we are able to obtain an action space which is a strict refinement of the original action space, then Q-learning in this refined action space recovers the optimal value function.
+
+This motivates a practical algorithm for learning value functions from the given undirected observation-only experience. We design a latent-variable future prediction model that seeks to obtain a refined action space. It operates by predicting $s_{t+1}$ from $s_t$ and a discrete latent variable $\hat{a}$ from a set of actions $\hat{\mathbf{A}}$ (Section 4.1). Training this latent variable model assigns a discrete action $\hat{a}_t$ to each $(s_t, s_{t+1})$ tuple. This allows us to employ Q-learning to learn good value functions (Section 4.2). The learned value function is used to derive behavior (Section 4.3) either through some online interaction with the environment, or through the use of domain specific low-level controllers.
+
+The use of a latent action space for Q-learning allows us to exceed the performance of methods based on policy evaluation (Edwards & Isbell, 2019), which will learn the value of the demonstration policy, not the optimal value function. Additionally, it side-steps the problem of reconstructing high-dimensional images faced by other state-only value learning methods (Edwards et al., 2020). Other approaches for learning from state-only data rely on imitating the demonstration data, which renders them unable to improve on sub-optimal demonstration data. See Section 7 for more discussion.
+
+Our experiments in five environments (2D grid world, 2D continuous control, Atari game Freeway, robotic manipulation, and visual navigation in realistic 3D environments) test our proposed ideas. Our method approximates a refinement of the latent space better than clustering alternatives, and in turn, learns value functions highly correlated with ground truth. Good value functions in-turn lead to sample efficient acquisition of behavior, leading to significant improvement over learning with only environment rewards. Our method compares well against existing methods that learn from undirected observation-only data, while being also applicable to the case of high-dimensional observation spaces in the form of RGB images. We are also able to outperform imitation learning methods, even when these imitation learning methods have access to privileged ground-truth action information. Furthermore, our method is able to use observation-only experience from one agent to speed up learning for another agent with a different embodiment.
+
+# 2 PRELIMINARIES
+
+Following the notation from Sutton & Barto (2018), our Markov decision process (MDP) is specified by $(\mathbf{S},\mathbf{A},p,\gamma)$ , where $\mathbf{S}$ is a state space, $\mathbf{A}$ is an action space, $\gamma$ is the discount factor, and $p(s',r|s,a)$ is the state/reward joint dynamics function. It specifies the probability distribution that the agent ends up in state $s'$ , receives a reward of $r$ on executing action $a$ from state $s$ .
+
+Offline or batch RL (Lange et al., 2012; Levine et al., 2020) studies the problem of deriving high reward behavior when only given a dataset of experience in an MDP, in the form of a collection of quadruples $(s, a, s', r)$ . In this paper, we tackle a harder version of this problem where instead we are only given a collection of triplets $(s, s', r)$ , i.e. experience without information about intervening actions. In general, this dataset could contain any quality of behavior. In contrast to some methods (see Section 7), we will not assume that demonstrations in the dataset are of high quality, and design our method to be robust to sub-optimal data. Using such a dataset, our goal is to learn good value functions. A value function under a policy $\pi$ is a function of states that estimates the expected return when starting in $s$ and following $\pi$ thereafter.
+
+In this paper, we will focus on methods based on Q-learning (Watkins, 1989) for tackling this problem. Q-learning has the advantage of being off-policy, i.e., experience from another policy (or task) can be used to learn or improve a different policy for a different task. Q-learning seeks to learn the optimal Q-function $Q^{*}(s,a)$ by iteratively updating $Q(s_{t},a_{t})$ to the Bellman equation. This process converges to the $Q^{*}$ under mild conditions in many settings (Watkins, 1989).
+
+
+
+
+
+
+
+
+Figure 1: We visualize the learned value function when using different action labels for Q-learning: ground truth actions, one single action, a $4 \times$ refined action space, and obfuscated actions. We also report the mean squared error from the optimal value function. Arrows show the behavior induced by the value function (picking neighboring state with highest value). We note that a) ignoring the intervening actions works poorly both in terms of value function estimates and the induced behavior, b) refined actions don't cause any degradation in performance, c) noisy actions that don't adhere the refinement constraint cause degradation in performance. See Section 3.2 for more details.
+
+# 3 CHARACTERIZING Q-LEARNING WITHOUT TRUE ACTION LABELS
+
+We characterize the outcome of Q-learning in settings where we don't have ground truth intervening actions in the offline dataset being used for Q-learning. Without action labels, one could simply assign all transitions the same label. In this case, Q-Learning becomes TD(0) policy evaluation. The induced value function isn't the optimal value function for the MDP, but rather the value according to the policy that generated the dataset. Depending on the dataset, this could be sub-optimal.
+
+Next, we study if labeling $(s,s^{\prime},r)$ samples with actions from a different action space $\hat{\mathbf{A}}$ to construct a new MDP could aid learning. More specifically, can the optimal Q-function for this new MDP, as obtained through Q-learning on samples $(s,s^{\prime},r)$ labeled with actions from $\hat{\mathbf{A}}$ , be useful in the original MDP? We show that under the right conditions the value function learned under the altered action space $\hat{\mathbf{A}}$ is identical to the value function learned for the original MDP.
+
+# 3.1 OPTIMALITY OF ACTION REFINEMENT
+
+Assume we have a Markov Decision Process (MDP) $M$ specified by $(\mathbf{S},\mathbf{A},p,\gamma)$ . Let the action space $\mathbf{A}$ be composed of actions $a_1,a_2,a_3,\ldots ,a_n\in \mathbf{A}$ . We are interested in the value learned under a modified MDP, $\hat{M}$ composed of $(\mathbf{S},\hat{\mathbf{A}},\hat{p},\gamma)$ . We will show that if the actions and transitions $\hat{\mathbf{A}}$ and $\hat{p}$ are a refinement of $\mathbf{A}$ and $p$ , then the value function learned on $\hat{M}$ , $V_{\hat{M}}$ is identical to the value function learned on $M$ , $V_{M}$ . We define actions and transitions in $\hat{M}$ to be a refinement of those in $M$ when, a) in each state, for every action in $\hat{\mathbf{A}}$ , there is at least one action in $\mathbf{A}$ which is functionally identical in the same state, and b) in each state, for each action in $\mathbf{A}$ is represented by at least one action in $\hat{\mathbf{A}}$ in that state.
+
+Definition 3.1 Given a discrete finite MDP, $M$ specified by $(\mathbf{S},\mathbf{A},p)$ and MDP, $\hat{M}$ specified by $(\mathbf{S},\hat{\mathbf{A}},\hat{p})$ , $\hat{M}$ is a refinement of $M$ when
+
+$$
+\underset {\hat {a} \in \hat {\mathbf {A}}, s \in \mathbf {S}} {\forall} \underset {a \in \mathbf {A}} {\exists} \underset {s ^ {\prime}, r} {\forall} \hat {p} (s ^ {\prime}, r | s, \hat {a}) = p (s ^ {\prime}, r | s, a), \text {a n d} \underset {a \in \mathbf {A}, s \in \mathbf {S}} {\forall} \underset {\hat {a} \in \hat {\mathbf {A}}} {\exists} \underset {s ^ {\prime}, r} {\forall} \hat {p} (s ^ {\prime}, r | s, \hat {a}) = p (s ^ {\prime}, r | s, a),
+$$
+
+Note that this definition of refinement requires a state conditioned correspondence between action behavior. Actions do not need to have to correspond across states.
+
+Theorem 3.1. Given a discrete finite MDP, $\hat{M}$ which is a refinement of $\hat{M}$ (Definition 3.1) then both MDPs induce the same optimal value function, i.e. $\forall_{s}V_{\hat{M}}^{*}(s) = V_{M}^{*}(s)$ .
+
+We prove this by showing that optimal policies under both MDPs induce the same value function.
+
+Lemma 3.2. For any policy $\pi_M$ on $M$ , there exists a policy $\pi_{\hat{M}}$ on $\hat{M}$ such that $V_{\hat{M}}^{\pi_{\hat{M}}}(s) = V_{M}^{\pi_{M}}(s)$ , $\forall s$ , and for any policy $\pi_{\hat{M}}$ on $\hat{M}$ there exists a policy $\pi_M$ on $M$ such that $V_{\hat{M}}^{\pi_{\hat{M}}}(s) = V_{M}^{\pi_{M}}(s) \forall s$ .
+
+
+Figure 2: Approach Overview. Our proposed approach Latent Action Q-Learning (LAQ) starts with a dataset of $(s, s', r)$ triples. Using the latent action learning process, each sample is assigned a latent action $\hat{a}$ . Q-learning on the dataset of quadruples produces a value function, $V(s)$ . Behaviors are derived from the value function through densified RL, or by guiding low-level controllers.
+
+For this lemma we introduce the notion of fundamental actions, which are actions which correspond to sets of actions which have the same state and reward transition distributions in a given state. We utilize the equivalence of fundamental actions between MDPs to construct a policy in the new MDP which induces the same value function as a given policy in the original MDP. We provide proofs for Theorem 3.1 and Lemma 3.2 in Section A.2.
+
+# 3.2 GRIDWORLD CASE STUDY
+
+We validate these results in a tabular grid world setting. In particular, we measure the error in learned value functions and the induced behavior, when conducting Q-learning with datasets with different qualities of intervening actions. The agent needs to navigate from the top left of a $6 \times 6$ grid to the bottom right with sparse reward. We generate data from a fixed, sub-optimal policy to evaluate all methods in an offline fashion (additional details in Section A.7). We generate 20K episodes with this policy, and obtain value functions using Q-learning under the following 4 choices for the intervening actions: (1) Ground truth actions ( $V_{\mathrm{gt}}$ ), (2) One action ( $V_{\mathrm{one - act}}$ , ammounts to TD(0) policy evaluation), (3) $4 \times$ refinement of original action space ( $V_{4 \times \mathrm{gt}}$ ). We modify the data so that each sample for a particular action in the original action space is randomly mapped to one of 4 actions in the augmented space. (4) Obfuscated actions ( $V_{\mathrm{impure - act}}$ ). Original action with probability 0.5, and a random action with probability 0.5.
+
+Figure 1 shows the learned value functions under these different action labels, and reports the MSE from the true value function, along with induced behavior. In line with our expectations, $V_{4 \times \mathrm{gt}}$ which uses a refinement of the actions is able to recover the optimal value function. $V_{\mathrm{one - act}}$ fails to recover the optimal value function, and recovers the value corresponding to the policy that generated the data. $V_{\mathrm{impure - act}}$ , under noise in action labels (non-refinement) also fails to recover the optimal value function. Furthermore, the behavior implied by $V_{\mathrm{impure - act}}$ and $V_{\mathrm{one - act}}$ is sub-optimal. We also analyze the effect of the action impurity on learned values and implied behavior. Behavior becomes increasingly inaccurate as action impurity increases. More details in Section A.4.
+
+# 4 LATENT ACTION Q-LEARNING
+
+Our analysis in Section 3 motivates the design of our approach for learning behaviors from state-only experience. Our proposed approach decouples learning into three steps: mining latent actions from state-only trajectories, using these latent actions for Q-learning to obtain value functions, and learning a policy to act according to the learned value function. As per our analysis, if learned latent actions are a state-conditioned refinement of the original actions, Q-learning will result in good value functions, that will lead to good behaviors. Refer to Algorithm 1 for details.
+
+# 4.1 LATENT ACTIONS FROM FUTURE PREDICTION
+
+Given a dataset $\mathbf{D}$ of observations streams $\dots, o_t, o_{t+1}, \dots$ , the goal in this step is to learn latent actions that are a refinement of the actual actions that the agent executed. We learn these latent actions through future prediction. We train a future prediction model $f_\theta$ , that maps the observation $o_t$ at time $t$ , and a latent action $\hat{a}$ (from a set $\hat{\mathbf{A}}$ of discrete latent actions) to the observation $o_{t+1}$ at time $t+1$ , i.e. $f_\theta(o_t, \hat{a})$ . $f$ is trained to minimize a loss $l$ between the prediction $f_\theta(o_t, \hat{a})$ and the ground truth observation $o_{t+1}$ . $\hat{a}$ is treated as a latent variable during learning. Consequently, $f_\theta$ is trained using a form of expectation maximization (Bishop, 2006). Each training sample $(o_t, o_{t+1})$
+
+is assigned to the action that leads to the lowest loss under the current forward model. The function $f_{\theta}$ is optimized to minimize the loss under the current latent action assignment. More formally, the loss for each sample $(o_t, o_{t+1})$ is: $L(o_t, o_{t+1}) := \min_{\hat{a} \in \hat{\mathbf{A}}} l(f_{\theta}(o_t, \hat{a}), o_{t+1})$ . We minimize $\sum_{(o_t, o_{t+1}) \in \mathbf{D}} L(o_t, o_{t+1})$ over the dataset to learn $f_{\theta}$ .
+
+Latent action $\hat{a}_t$ for observation pairs $(o_t, o_{t+1})$ are obtained from the learned function $f_\theta$ as: $\arg \min_{\hat{a} \in \hat{\mathbf{A}}} l(f_\theta(o_t, \hat{a}), o_{t+1})$ . Choice of the function $f_\theta$ and loss $l$ vary depending on the problem. We use L2 loss in the observation space (low-dimensional states, or images).
+
+# 4.2 Q-LEARNING WITH LATENT ACTIONS
+
+Latent actions mined from Section 4.1 allow us to complete the given $(o_{t}, o_{t+1}, r_{t})$ tuples into $(o_{t}, \hat{a}_{t}, o_{t+1}, r_{t})$ quadruples for use in Q-learning Watkins (1989). As our actions are discrete we can easily adopt any of the existing Q-learning methods for discrete action spaces (e.g. Mnih et al. (2013)). Though, we note that this Q-learning still needs to be done in an offline manner from prerecorded state-only experience. While we adopt the most basic Q-learning in our experiments, more sophisticated versions that are designed for offline Q-learning (e.g. Kumar et al. (2020); Fujimoto et al. (2019)) can be directly adopted, and should improve performance further. Value functions are obtained from the Q-functions as $V(s) = \max_{\hat{a} \in \hat{\mathbf{A}}} \hat{Q}(s, \hat{a})$ .
+
+# 4.3 BEHAVIORS FROM VALUE FUNCTIONS
+
+Given a value function, our next goal is to derive behaviors from the learned value function. In general, this requires access to the transition function of the underlying MDP. Depending on what assumptions we make, this will be done in the following two ways.
+
+Densified Reinforcement Learning. Learning a value function from state-only experience can be extremely valuable when a dense reward function for the underlying task is not readily available. In this case, using the learned value function can densify sparse reward functions, making previously intractable RL problems solvable. Specifically, we use the value function to create a potential-based shaping function $F(s,s^{\prime}) = V(s^{\prime}) - V(s)$ , based on Ng et al. (1999), and construct an augmented reward function $r^{\prime}(s,a,s^{\prime}) = r(s,a,s^{\prime}) + F(s,s^{\prime})$ . Our experiments show that using this densified reward function speeds up behavior acquisition.
+
+Domain Specific Low-level Controllers. In more specific scenarios, it may be possible to employ hand designed low-level controllers in conjunction with a model that can predict the next state $s'$ on executing any of low-level controllers. In such a situation, behavior can directly be obtained by picking the low-level controller that conveys the agent to the state $s'$ that has the highest value under the learned $V(s)$ . Such a technique was used by Chang et al. (2020). We show results in their setup.
+
+# 5 EXPERIMENTS
+
+We design experiments to assess the quality of value functions learned by LAQ from undirected state-only experience. We do this in two ways. First, we measure the extent to which value functions learned with LAQ without ground truth information agree with value functions learned with Q-learning with ground truth action information. This provides a direct quality measure and allows us to compare different ways of arriving at the value function: other methods in the literature (D3G (Edwards et al., 2020)), and simpler alternatives of arriving at latent actions. Our second evaluation measures the effectiveness of LAQ-learned value functions for deriving effective behavior in different settings: when using it as a dense reward, when using it to guide low-level controllers, and when transferring behavior across embodiments. Where possible, we compare to behavior cloning (BC) with privileged ground truth actions. BC with ground truth actions serves as an upper bound on the performance of state-only imitation learning methods (BCO from Torabi et al. (2018a), ILPO from Edwards et al. (2019), etc.) and allows us to indirectly compare with these methods.
+
+Test Environments. Our experiments are conducted in five varied environments: the grid world environment from Section 3, the Atari game Freeway from Bellemare et al. (2013), 3D visual navigation in realistic environments from Chang et al. (2020); Savva et al. (2019), and two continuous control tasks from Fu et al. (2020)'s D4RL: Maze2D (2D continuous control navigation), and
+
+
+2D Grid World
+Figure 3: We experiment with five environments: 2D Grid World, Freeway (Atari), 3D Visual Navigation, Maze2D (2D Continuous Control), and FrankaKitchen. Top right corner of Maze2D and FrankaKitchen, shows the embodiments for cross-embodiment transfer (ant and hook, respectively).
+
+
+Freeway
+
+
+3D Visual Nav.
+
+
+2D Maze
+
+
+Kitchen
+
+Table 1: We report Spearman's correlation coefficients for value functions learned using various methods with DQN, against a value function learned offline using ground-truth actions (DQN for discrete action environments, and DDPG for continuous action environments). The Ground Truth Actions column shows Spearman's correlation coefficients between two different runs of offline learning with ground-truth actions. See Section 5.1. Details on model selection in Section A.11.
+
+| Environment | D3G | Single Action | Clustering | Clustering (Diff) | Latent Actions | Ground Truth Actions |
| 2D Grid World | 0.959 | 0.093 | 0.430 | 1.000 | 0.985 | 1.000 |
| Freeway | - (image input) | 0.886 | 0.945 | 0.902 | 0.961 | 0.970 |
| 3D Visual Navigation | - (image input) | 0.641 | 0.722 | 0.827 | 0.927 | 0.991 |
| 2D Continuous Control | 0.673 | 0.673 | 0.613 | 0.490 | 0.844 | 0.851 |
| Kitchen Manipulation | 0.854 | 0.858 | 0.818 | 0.815 | 0.905 | 0.901 |
+
+FrankaKitchen (dexterous manipulation in a kitchen). For Maze2D and FrankaKitchen environments, we also consider *embodiment transfer*, where we seek to learn policies for an ant and a hook respectively from the observation-only experience of a point mass and the Franka arm. Together, these environments test our approach on different factors that make policy learning hard: continuous control, high-dimensional observations and control, complex real world appearance, 3D geometric reasoning, and learning across embodiments. Environments are visualized in Figure 3, more details about the environments are provided in Section A.6.
+
+Experimental Setup For each setting, we work with a pre-collected dataset of experience in the form of state, next state and reward triplets, $(o_{t}, o_{t+1}, r_{t})$ . We use our latent-variable forward model (Section 4.1) and label triplets with latent actions to obtain quadruples $(o_{t}, \hat{a}_{t}, o_{t+1}, r)$ . We perform Q-learning on these quadruples to obtain value functions $V(s)$ , which are used to acquire behaviors either through densified RL by interacting with the environment, or through use of domains-specific low-level controllers. We use the ACME codebase (Hoffman et al., 2020) for experiments.
+
+Latent Action Quality. In line with the theory developed in Section 3, we want to establish how well our method learns a refinement of the underlying action space. To assess this, we study the state-conditioned purity of the partition induced by the learned latent actions (see definition in Section A.9). Overall, our method is effective at finding refinement of the original action space. It achieves higher state-conditioned purity than a single action and clustering. In high-dimensional image observation settings, it surpasses baselines by a wide margin. More details in Section A.9.
+
+# 5.1 QUALITY OF LEARNED VALUE FUNCTIONS
+
+We evaluate the quality of the value functions learned through LAQ. We use as reference the value function $V_{\mathrm{gt - act}}$ , obtained through offline Q-learning (DDPG for continuous action cases) with true ground truth actions i.e. $(o_t, a_t, o_{t + 1}, r_t)$ . For downstream decision making, we only care about the relative ordering of state values. Thus, we measure the Spearman's rank correlation coefficient between the different value functions. Table 1 reports the Spearman's coefficients of value functions
+
+
+
+
+
+
+
+
+Figure 4: We show learning curves for acquiring behavior using learned value functions. We compare densified RL (Section 4.3) with sparse RL and BC/BC+RL. See Section 5.2 for more details. Results are averaged over 5 seeds and show $\pm$ standard error.
+
+obtained using different action labels: single action, clustering, latent actions (ours), and ground truth actions. We also report Spearman's correlations of value functions produced using D3G (Edwards et al., 2020). In all settings we do Q-learning over the top 8 dominant actions, except for Freeway, where using the top three actions stabilized training. Our method out performs all baselines in settings with high-dimensional image observations (3D Visual Navigation, Freeway). In state based settings, where clustering state differences is a helpful inductive bias, method is still on-par with, or superior to clustering state differences and even D3G, which predicts state differences.
+
+# 5.2 USING VALUE FUNCTIONS FOR DOWNSSTREAM TASKS
+
+Our next experiments test the utility of LAQ-learned value functions for acquiring goal-driven behavior. We first describe the 3 settings that we use to assess this, and then summarize our takeaways.
+
+- Using value functions as dense reward functions. We combine sparse task reward with the learned value function as a potential function (Section 4.3). We scale up the sparse task rewards by a factor of 5 so that behavior is dominated by the task reward once policy starts solving the task. Figure 4 measures the learning sample efficiency. We compare to only using the sparse reward, behavior cloning (BC) with ground truth actions, and BC followed by spare reward RL.
+- Using value functions to learn behavior of an agent with a different embodiment. Decoupling the learning of value function and the policy has the advantage that learned value functions can be used to improve learning across embodiment. We demonstrate this, we keep the same task, but change the embodiment of the agent in Maze2D and FrankaKitchen environments. Note that we do not assume access to ground truth actions in these experiments either. For Maze2D, the point-mass is replaced with a 8-DOF quadrupedal ant. For FrankaKitchen, the Franka arm is replaced with a position-controlled hook. We may need to define how we query the value function when the embodiment (and the underlying state space) changes. For the ant in Maze2D, the location (with 0 velocity) of the ant body is used to query the value function learned with the point-mass. For the hook in FrankaKitchen, the value function is able to transfer directly as both settings observe end-effector position and environment state. We report results in Figure 5.
+- Using value functions to guide low-level controllers. Learned value functions also have the advantage that they can be used directly at test time to guide the behavior of low-level controllers. We do this experiment in context of 3D visual navigation in a scan of a real building and use the branching environment from Chang et al. (2020). We follow their setup and replace their value functions with ones learned using LAQ in their hierarchical policy, and compare the efficiency of behavior encoded by the different value functions.
+
+LAQ value functions speed up downstream learning. Learning plots in Figure 4 show that LAQ-learned value functions speed up learning in the different settings over learning simply with sparse rewards (orange line vs. blue line). In all settings except Freeway, our method not only learns more quickly than sparse reward, but converges to a higher mean performance.
+
+LAQ discovers stronger behavior than imitation learning when faced with undirected experience. An advantage of LAQ over other imitation-learning based methods such as BCO (Torabi et al., 2018a) and ILPO (Edwards et al., 2019) is LAQ's ability to learn from sub-optimal or undirected experience. To showcase this, we compare the performance of LAQ with behavior cloning (BC)
+
+Table 2: We report Spearman's correlation coefficients for value functions learned using either DQN or BCQ, against a value function learned offline using BCQ with ground-truth actions. The Ground Truth Actions column shows Spearman's correlation coefficients between two different runs of offline learning with ground-truth actions. See Section 5.1.
+
+| Environment | Single Action | Clustering | Clustering (Diff) | Latent Actions | Ground Truth Actions |
| 2D Continuous Control (DQN) | 0.664 | 0.431 | 0.312 | 0.807 | 0.765 |
| 2D Continuous Control (BCQ) | 0.710 | 0.876 | 0.719 | 0.927 | 0.990 |
+
+
+Figure 5: Behavior acquisition across embodiments. Results averaged over 50 seeds and show $\pm$ standard error.
+
+
+Figure 6: Visualization of trajectories and SPL numbers in the 3D visual navigation environment.
+
+
+
+with ground truth actions. Since BCO and ILPO recover ground truth actions to perform behavior cloning (BC), BC with ground truth actions serves as an upper bound on the performance of all methods in this class. Learning plots in Figure 4 shows the effectiveness of LAQ over BC and BC followed by fine-tuning with sparse rewards for environments where the experience is undirected (Maze2D, and GridWorld). For Freeway, the experience is fairly goal-directed, thus BC already works well. A similar trend can be seen in the higher Spearman's coefficient for LAQ vs. $V_{\mathrm{one - act}}$ in Table 1. LAQ discovers stronger behavior than imitation learning when faced with undirected data.
+
+LAQ is compatible with other advances in batch RL. Although LAQ uses the most basic Q-Learning as our offline value learning method, it is compatible with recent more advanced offline RL value-learning methods (such as CQL (Kumar et al., 2020) and BCQ (Fujimoto et al., 2019)). We validate by simply swapping to using (discrete) BCQ with our latent actions. Figures. 4 and 5 show that LAQ with BCQ is the strongest method, outperforming ours with DQN, and D3G, on Maze2D and embodiment transfer environments. Analysis of Spearman's correlations in Table 2 shows the same trend as before with latent actions: better than single actions, and clustering variants. Note also that use of BCQ leads to value functions with better Spearman's correlations than DQN.
+
+LAQ value functions allow transfer across embodiments. Figure 5 shows learning plots of agents trained with cross-embodiment value functions. LAQ-densified rewards functions, speed-up learning and consistently guide to higher reward solutions than sparse task rewards, or D3G.
+
+LAQ compares favorably to D3G. We compare LAQ and D3G (a competing state-only method) in different ways. D3G relies on generating potential future states. This is particularly challenging for image observations, and D3G doesn't show results with image observations. In contrast, LAQ maps state transitions to discrete actions, and hence works with image observations as our experiments show. Even in scenarios with low-dimensional state inputs, LAQ learns better value functions than D3G, as evidences by Spearman's correlations in Table 1, and learning plots in Figure 4 and Figure 5.
+
+LAQ value functions can guide low-level controllers for zero-shot control: We report the SPL for 3D navigation using value functions combined with low-level controllers in Figure 6. We report the efficiency of behavior induced by LAQ learned value functions as measured by the SPL metric from Anderson et al. (2018) (higher is better). The branching environment has two goal states, one optimal and one sub-optimal. The demonstrations there-in were specifically designed to emphasize the utility of knowing the intervening actions. Simple policy evaluation leads sub-optimal behavior (SPL of 0.53) and past work relied on using an inverse model to label actions (Chang et al., 2020) to derive better behavior. This inverse model itself required $40K$ interactions with the environment
+
+for training, and boosted the SPL to 0.95. LAQ is able to navigate to the optimal goal (w/ SPL 0.82) but without the $40K$ online interaction samples necessary to acquire the inverse model. It also performs better than clustering transitions, doing which achieves an SPL of 0.57. The improvement is borne out in visualizations in Figure 6. LAQ correctly learns to go to the nearer goal, even when the underlying experience came from a policy that preferred the further away goal.
+
+# 6 DISCUSSION
+
+Our theoretical characterization and experiments in five representative environments showcase the possibility and potential of deriving goal-directed signal from undirected state-only experience. Here we discuss some scenarios which are fundamentally hard, and some avenues for future research.
+
+Non-deterministic MDPs. Our theoretical result relies on a refinement where state-action transition probabilities are matched. However, the latent action mining procedure in LAQ results in deterministic actions. Thus, for non-deterministic MDPs, LAQ will be unable to achieve a strict refinement, leading to sub-optimal value functions. However, note that this limitation isn't specific to our method, but applies to any deterministic algorithm that seeks to learn from observation only data. We formalize this concept and provide a proof in Section A.3.
+
+Constraining evaluation of $V(s)$ to within its domain. LAQ learns a value function $V(s)$ over the set of states that were available in the experience dataset, and as such its estimates are only accurate within this set. In situations where the experience dataset doesn't span the entire state space, states encountered at test time may fall out of the distribution used to train $V(s)$ , leading to degenerate solutions. In Section A.12 we discuss a density model based solution we used for this problem, along with an alternate parameterization of value networks which helps avoid degenerate solutions.
+
+Offline RL Validation. Validation (e.g. when to stop training) is a known issue in offline RL (Gulcehre et al., 2020). Like other offline RL methods, LAQ suffers from it too. LAQ's use of Q-learning makes it compatible to recent advances (Kumar et al., 2021) that tackle this validation problem.
+
+# 7 RELATED WORK
+
+Our work focuses on batch (or offline) RL with state-only data using a latent-variable future prediction model. We survey works on batch RL, state-only learning, and future prediction.
+
+Batch Reinforcement Learning. As the field of reinforcement learning has matured, batch RL (Lange et al., 2012; Levine et al., 2020) has gained attention as a component of practical systems. A large body of work examines solutions the problem of extrapolation error in batch RL settings. Advances in these works are complementary to our approach, as substantiated by our experiments with BCQ. A more detailed discussion of batch RL methods can be found in Section A.1.
+
+State-only Learning. Past works have explored approaches for dealing with the lack of actions in offline RL when given goal-directed or undirected state-only experience. Works in the former category rely on high quality behavior in the data, and suffer on sub-optimal data. Past work on state-only learning from undirected experience relies on either domain knowledge or state reconstruction and only show results with low dimensional states. See Section A.1 for continued discussion.
+
+Future Prediction Models. Past work from Oh et al. (2015); Agrawal et al. (2016); Finn et al. (2016) (among many others) has focused on building action conditioned forward models in pixel and latent spaces. Yet other work in computer vision studies video prediction problems (Xue et al., 2016; Castrejon et al., 2019). Given the uncertainty in future prediction, these past works have pursued variational (or latent variable) approaches to make better predictions. Our latent variable future model is inspired from these works, but we explore its applications in a novel context.
+
+Latent MDP Learning One way to interpret our method is that of learning an approximate MDP homomorphism (Taylor et al., 2008; Ravindran & Barto, 2004). Other works have explored learning latent homorphic MDPs. These methods tend to focus on learning equivalent latent state spaces (Li et al., 2006; Givan et al., 2003). Most similarly to our work (van der Pol et al., 2020) also learns a latent action space, but relies on ground truth action data to do so.
+
+Acknowledgement: This paper is based on work supported by NSF under Grant #IIS-2007035.
+
+# REFERENCES
+
+Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, pp. 104-114. PMLR, 2020. 19, 20
+Pulkit Agrawal, Ashvin V Nair, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Learning to poke by poking: Experiential learning of intuitive physics. In NeurIPS, 2016. 9
+Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, and Amir Zamir. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018. 8
+Arthur Argenson and Gabriel Dulac-Arnold. Model-based offline planning, 2021. 13
+M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253-279, jun 2013. 5
+Christopher M Bishop. Pattern recognition and machine learning. Springer, 2006. 4
+Lluis Castrejon, Nicolas Ballas, and Aaron Courville. Improved conditional vrnns for video prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7608-7617, 2019. 9
+Matthew Chang, Arjun Gupta, and Saurabh Gupta. Semantic visual navigation by watching youtube videos. In NeurIPS, 2020. 5, 7, 8, 13, 19, 20, 24
+Ashley D. Edwards and Charles L. Isbell. Perceptual values from observation. CoRR, abs/1905.07861, 2019. 2, 13
+Ashley D Edwards, Himanshu Sahni, Yannick Schroecker, and Charles L Isbell. Imitating latent policies from observation. In ICML, 2019. 5, 7, 13
+Ashley D. Edwards, Himanshu Sahni, Rosanne Liu, Jane Hung, Ankit Jain, Rui Wang, Adrien Ecoffet, Thomas Miconi, Charles Isbell, and Jason Yosinski. Estimating $q(s,s')$ with deep deterministic dynamics gradients. In ICML, 2020. 2, 5, 7, 13
+Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. arXiv preprint arXiv:1605.07157, 2016. 9
+Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4RL: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020. 5, 13, 19
+Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In ICML, 2019. 5, 8, 13
+Robert Givan, Thomas Dean, and Matthew Greig. Equivalence notions and model minimization in markov decision processes. Artificial Intelligence, 147(1-2):163-223, 2003. 9
+Caglar Gulcehre, Ziyu Wang, Alexander Novikov, Tom Le Paine, Sergio Gomez Colmenarejo, Konrad Zolna, Rishabh Agarwal, Josh Merel, Daniel Mankowitz, Cosmin Paduraru, Gabriel Dulac-Arnold, Jerry Li, Mohammad Norouzi, Matt Hoffman, Ofir Nachum, George Tucker, Nicolas Heess, and Nando deFreitas. Rl unplugged: Benchmarks for offline reinforcement learning, 2020. 9, 13
+Matt Hoffman, Bobak Shahriari, John Aslanides, Gabriel Barth-Maron, Feryal Behbahani, Tamara Norman, Abbas Abdelmaleki, Albin Cassirer, Fan Yang, Kate Baumli, et al. Acme: A research framework for distributed reinforcement learning. arXiv preprint arXiv:2006.00979, 2020. 6
+Ashish Kumar, Saurabh Gupta, and Jitendra Malik. Learning navigation subroutines by watching videos. In CoRL, 2019a. 13
+Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In NeurIPS, 2019b. 13
+
+Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. In NeurIPS, 2020. 5, 8, 13
+Aviral Kumar, Anikait Singh, Stephen Tian, Chelsea Finn, and Sergey Levine. A workflow for offline model-free robotic reinforcement learning. In CoRL, 2021. 9
+Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pp. 45-73. Springer, 2012. 2, 9
+Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020. 2, 9
+Lihong Li, Thomas J Walsh, and Michael L Littman. Towards a unified theory of state abstraction for mdps. ISAIM, 4:5, 2006. 9
+Ajay Mandlekar, Fabio Ramos, Byron Boots, Silvio Savarese, Fei-Fei Li, Animesh Garg, and Dieter Fox. IRIS: implicit reinforcement without interaction at scale for learning control from offline robot manipulation data. In ICRA, 2020. 13
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. 5
+Andrew Y. Ng, Daishi Harada, and Stuart J. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, pp. 278-287. Morgan Kaufmann, 1999. 5
+Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. arXiv preprint arXiv:1507.08750, 2015. 9
+Ilija Radosavovic, Xiaolong Wang, Lerrel Pinto, and Jitendra Malik. State-only imitation learning for dexterous manipulation. CoRR, abs/2004.04650, 2020. 13
+Rafael Rafailov, Tianhe Yu, Aravind Rajeswaran, and Chelsea Finn. Offline reinforcement learning from images with latent space models. CoRR, abs/2012.11547, 2020. 13
+Aravind Rajeswaran, Chelsea Finn, Sham Kakade, and Sergey Levine. Meta-learning with implicit gradients. arXiv preprint arXiv:1909.04630, 2019. 13
+Balaraman Ravindran and Andrew G Barto. Approximate homomorphisms: A framework for nonexact minimization in markov decision processes. 2004. 9
+Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, Devi Parikh, and Dhruv Batra. Habitat: A platform for embodied AI research. In ICCV, 2019. 5, 19, 20
+Pierre Sermanet, Kelvin Xu, and Sergey Levine. Unsupervised perceptual rewards for imitation learning. In RSS, 2017. 13
+Lin Shao, Toki Migimatsu, Qiang Zhang, Karen Yang, and Jeannette Bohg. Concept2robot: Learning manipulation concepts from instructions and human demonstrations. In RSS, 2020. 13
+Avi Singh, Larry Yang, Chelsea Finn, and Sergey Levine. End-to-end robotic reinforcement learning without reward engineering. In RSS, 2019. 13
+Shuran Song, Andy Zeng, Johnny Lee, and Thomas Funkhouser. Grasping in the wild: Learning 6 dof closed-loop grasping from low-cost demonstrations. Robotics and Automation Letters, 2020. 13
+Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018. ISBN 0262039249. 2, 14
+Jonathan Taylor, Doina Precup, and Prakash Panagaden. Bounding performance loss in approximate mdp homomorphisms. Advances in Neural Information Processing Systems, 2008. 9
+
+Faraz Torabi, Garrett Warnell, and Peter Stone. Behavioral cloning from observation. In *IJCAI*, 2018a. 5, 7, 13
+Faraz Torabi, Garrett Warnell, and Peter Stone. Generative adversarial imitation from observation. CoRR, abs/1807.06158, 2018b. 13
+Faraz Torabi, Garrett Warnell, and Peter Stone. Adversarial imitation learning from state-only demonstrations. In AAMAS, pp. 2229-2231. International Foundation for Autonomous Agents and Multiagent Systems, 2019a. 13
+Faraz Torabi, Garrett Warnell, and Peter Stone. Imitation learning from video by leveraging proprioception. arXiv preprint arXiv:1905.09335, 2019b. 13
+Elise van der Pol, Thomas Kipf, Frans A. Oliehoek, and Max Welling. Plannable approximations to MDP homomorphisms: Equivariance under actions. In International Conference on Autonomous Agents and Multiagent Systems, AAMAS, 2020. 9
+Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. 1989. 2, 5, 15
+Annie Xie, Avi Singh, Sergey Levine, and Chelsea Finn. Few-shot goal inference for visuomotor learning and planning. In Conference on Robot Learning, pp. 40-52. PMLR, 2018. 13
+Tianfan Xue, Jiajun Wu, Katherine L Bouman, and William T Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. arXiv preprint arXiv:1607.02586, 2016.9
+
+# A APPENDIX
+
+# A.1 RELATED WORK CONTINUED
+
+Discussion continued from Section 7:
+
+Batch Reinforcement Learning. In recent times, Gulcehre et al. (2020) and Fu et al. (2020) propose datasets and experimental setups for studying offline RL problems. A large body of work examines solutions to the batch RL problem. Researchers have identified that extrapolation error, the phenomenon in which batch RL algorithms incorrectly estimate the value of states/actions not present in the training batch, is a major challenge, and have proposed methods to tackle it, e.g. BCQ (Fujimoto et al., 2019), BEAR (Kumar et al., 2019b), IRIS from (Mandlekar et al., 2020), and CQL (Kumar et al., 2020) among many others. In contrast to these model-free methods, Argenson & Dulac-Arnold (2021); Rajeswaran et al. (2019); Rafailov et al. (2020) learn a forward predictive model from the batch data and use it for model predictive control. These methods all approach the traditional batch RL problem, while we consider a different and harder setting in which the action labels are unavailable. Aforementioned advances in offline RL are complementary to our work. Offline value learning approaches (such as CQL and BCQ) can serve as a drop-in replacement for Q-learning in our pipeline and improve our results. In fact, our experiments with BCQ substantiate this.
+
+State-only Learning. In line of work which studies learning form goal-directed state-only experience, researchers use imitation learning-based techniques (Radosavovic et al., 2020; Torabi et al., 2018a; Edwards et al., 2019; Kumar et al., 2019a), learn policies that match the distribution of visited states (Torabi et al., 2018b; 2019a;b), or use demonstrations to construct dense reward functions (Shao et al., 2020; Sermanet et al., 2017; Singh et al., 2019; Xie et al., 2018; Edwards & Isbell, 2019). These methods make strong assumptions about the quality and goal-directed nature of the experience data, and suffer in performance when faced with low-quality or undirected experience.
+
+Instead of goal-directed experience our work tackles the problem of learning from undirected experience. Past work in this area employs Q-learning to learn optimal behavior from sub-optimal data (Chang et al., 2020; Song et al., 2020; Edwards et al., 2020). Chang et al. (2020) and Song et al. (2020) use domain specific insights. Edwards et al. (2020) rely on being able to generate the next state and only demonstrate results in environments with low-dimensional states. Instead, our work maps transition tuples to discrete latent actions and can thus easily work with high-dimensional observations such as RGB images.
+
+# A.2 PROOFS
+
+Proof. Proof for Lemma 3.2. We will start by showing that for any policy $\pi_{\hat{M}}$ on $\hat{M}$ , there exists a policy $\pi_M$ on $M$ such that $V_{\hat{M}}^{\pi_{\hat{M}}} (s) = V_{M}^{\pi_M} (s)$ , for all $s$ .
+
+To do this we need to introduce the idea of fundamental actions, which are classes of actions which have the same state and reward transition distributions in a given state. If we have a fundamental action $b$ , corresponding to some state and reward distributions, let $\alpha(b, s) \subseteq \mathbf{A}$ give the set of actions in $\mathbf{A}$ that have the matching state and reward transition distributions,
+
+$$
+\underset {a \in \alpha (b, s)} {\forall} p (s ^ {\prime}, r | s, a) = p (s ^ {\prime}, r | s, \alpha (b, s) _ {1}).
+$$
+
+Similarly, let $\hat{\alpha}(b,s) \subseteq \hat{\mathbf{A}}$ give the set of actions in $\hat{\mathbf{A}}$ belonging to $b$ in state $s$ . In any given state, there are at most $\min(|\mathbf{A}|, |\hat{\mathbf{A}}|)$ fundamental actions for $M$ and the union of all actions belonging to all fundamental actions gives the set of actions that make up the original action space. For our MDP let's denote $B(s)$ as the set of fundamental actions in the state $s$ for $M$ , and $\hat{B}(s)$ as the set of fundamental actions in the state $s$ for $\hat{M}$ . Let $\beta(s,a)$ , and $\hat{\beta}(s,a)$ be functions which return the set of actions which correspond to the same fundamental action containing as $a$ in state $s$ for $M$ , and $\hat{M}$ respectively. This means,
+
+$$
+\bigcup_ {b \in B (s)} \alpha (b, s) = A, \quad \forall_ {b \in B (s)} \forall_ {b ^ {\prime} \neq b} \alpha (b, s) \cap \alpha (b ^ {\prime}, s) = \emptyset , \text {a n d} \forall_ {a \in A, s} \exists_ {b \in B (s)} | a \in \alpha (b, s). \tag {1}
+$$
+
+With this notation out of the way we can construct a policy $\pi_{\hat{M}}$ from $\pi_M$ , which achieves the same value in $\hat{M}$ as $\pi_M$ does in $M$ . We do this by constructing $\pi_{\hat{M}}$ such that the probability distributions over each fundamental action is equivalent. We define this policy as
+
+$$
+\pi_ {M} (a | s) = \frac {1}{| \beta (s , a) |} \sum_ {\hat {a} \in \hat {\beta} (s, a)} \pi_ {\hat {M}} (\hat {a} | s).
+$$
+
+Following Sutton & Barto (2018) we can define the value function for a given policy as
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \mathbb {E} _ {\pi_ {M}} [ G _ {t} | S _ {t} = s ],
+$$
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \sum_ {a \in \mathbf {A}} \pi_ {M} (a | s) \sum_ {s ^ {\prime}, r} p \left(s ^ {\prime}, r | s, a\right) \left[ r + \gamma V _ {M} ^ {\pi_ {M}} \left(s ^ {\prime}\right) \right].
+$$
+
+From the properties in Eq. 1, we know a sum over fundamental actions will count each action exactly once, so we can write this sum as
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \sum_ {b \in B (s)} \sum_ {a \in \alpha (b, s)} \pi_ {M} (a | s) \sum_ {s ^ {\prime}, r} p \left(s ^ {\prime}, r | s, a\right) \left[ r + \gamma V _ {M} ^ {\pi_ {M}} \left(s ^ {\prime}\right) \right]. \tag {2}
+$$
+
+substituting in the constructed policy we have
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \sum_ {b \in B (s)} \sum_ {a \in \alpha (b, s)} \left[ \frac {1}{| \beta (s , a) |} \sum_ {\hat {a} \in \hat {\beta} (s, a)} \pi_ {\hat {M}} (\hat {a} | s) \right] \sum_ {s ^ {\prime}, r} p (s ^ {\prime}, r | s, a) \big [ r + \gamma V _ {M} ^ {\pi_ {M}} (s ^ {\prime}) \big ].
+$$
+
+since the third sum is over $\hat{\beta}(s, a)$ with $a \in \alpha(b, s)$ , we can rewrite this sum as over $\hat{a} \in \hat{\alpha}(b, s)$ , giving
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \sum_ {b \in B (s)} \sum_ {a \in \alpha (b, s)} \left[ \frac {1}{| \beta (s , a) |} \sum_ {\hat {a} \in \hat {\alpha} (b, s)} \pi_ {\hat {M}} (\hat {a} | s) \right] \sum_ {s ^ {\prime}, r} p (s ^ {\prime}, r | s, a) \big [ r + \gamma V _ {M} ^ {\pi_ {M}} (s ^ {\prime}) \big ].
+$$
+
+For the final sum, from the definition of fundamental actions, we know $p(s', r|s, a) = p(s', r|s, \alpha(b, s)_1) = \hat{p}(s', r|s, \hat{\alpha}(b, s)_1)$ , so we can rewrite that term as
+
+$$
+\sum_ {s ^ {\prime}, r} \hat {p} (s ^ {\prime}, r | s, \hat {\alpha} (b, s) _ {1}) \left[ r + \gamma V _ {M} ^ {\pi_ {M}} (s ^ {\prime}) \right].
+$$
+
+Crucially, in the second sum (over $a \in \alpha(b, s)$ ), $\beta(s, a)$ is the same for all $a \in \alpha(b, s)$ , so the term in brackets can be treated as a constant. Similarly, since $|\beta(s, a)| = |\alpha(b, s)|$ we can simplify the second sum leaving
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = \sum_ {b \in B (s)} \sum_ {\hat {a} \in \hat {\alpha} (b, s)} \pi_ {\hat {M}} (\hat {a} | s) \sum_ {s ^ {\prime}, r} \hat {p} (s ^ {\prime}, r | s, \hat {\alpha} (b, s) _ {1}) \big [ r + \gamma V _ {M} ^ {\pi_ {M}} (s ^ {\prime}) \big ].
+$$
+
+This gives the definition of $V_{\hat{M}}^{\pi_{\hat{M}}}(s)$ using the same decomposition as equation Eq. 2, meaning
+
+$$
+V _ {M} ^ {\pi_ {M}} (s) = V _ {\hat {M}} ^ {\pi_ {\hat {M}}} (s).
+$$
+
+One can show the opposite direction, that a policy there exists a policy $\pi_{M'}$ for any policy $\pi_M$ such $V_M^{\pi_M}(s) = V_{\hat{M}}^{\pi_{\hat{M}}} (s)$ , with a symmetric construction.
+
+
+
+Note that Lemma 3.2 holds true regardless of the stochasticity of the policy, as the constructed policy matches probability of the original policy for taking each fundamental action.
+
+Proof for Theorem 3.1. Under the new MDP $\hat{M}$ , Q-learning will learn the same optimal value function value function as learned under MDP $M$ , i.e. $\forall_{s}V_{\hat{M}}^{*}(s) = V_{M}^{*}(s)$ .
+
+Proof. This follows from Lemma 3.2 by contradiction. Assume there is a state $s'$ where $V_{\hat{M}}^{*}(s) \neq V_{M}^{*}(s)$ . Two cases must be considered. In the first case, $V_{\hat{M}}^{*}(s) > V_{M}^{*}(s)$ . We will notate the optimal policy in $\hat{M}$ as $\tilde{\pi}_{\hat{M}}^{*}$ (i.e. $V_{\hat{M}}^{*} = V_{\hat{M}}^{\tilde{\pi}_{\hat{M}}^{*}}$ ) and the optimal policy in $M$ as $\pi_{M}^{*}$ . We know there must exist a policy $\tilde{\pi}_{M}^{*}$ such that $V_{M}^{\tilde{\pi}_{M}^{*}}(s) = V_{\hat{M}}^{\tilde{\pi}_{\hat{M}}^{*}}(s)$ from Lemma 3.2. We arrive at a contradiction because $V_{M}^{\tilde{\pi}_{M}^{*}}(s) > V_{M}^{\pi_{M}^{*}}(s)$ , so $\pi_{M}^{*}$ could not have been the optimal policy on $M$ . The other direction follows a symmetric argument. If $V_{\hat{M}}^{\tilde{\pi}_{\hat{M}}^{*}}(s) < V_{M}^{\pi_{M}^{*}}(s)$ , we know there must be a policy $\pi_{\hat{M}}^{*}$ in $\hat{M}$ such that $V_{M}^{\pi_{M}^{*}}(s) = V_{\hat{M}}^{\pi_{\hat{M}}^{*}}(s)$ . This implies $V_{\hat{M}}^{\pi_{\hat{M}}^{*}}(s) > V_{\hat{M}}^{\tilde{\pi}_{\hat{M}}^{*}}(s)$ , meaning that $\tilde{\pi}_{\hat{M}}^{*}$ could not have been the optimal policy. Since Q-learning is known to converge to the optimal value function Watkins (1989), Q-learning on $\hat{M}$ will converge to the original value function $V_{M}^{*}$ .
+
+# A.3 STATE ONLY LEARNING FROM STOCHASTIC MDPS
+
+Here we will briefly prove that problem of deducing the optimal value function of an MDP $M$ , from some state-only experience dataset $D$ , cannot be solved in general for non-deterministic MDPs. We denote $\mathbb{D}$ as the space of all complete state-only datasets, and $\mathbb{V}$ as the space of all value functions. By complete state-only dataset, we mean datasets in which all possible transition triples $(s,s',r)$ appear. Note that exactly one complete dataset exists for each MDP. We denote $D_M$ as the complete dataset corresponding to an MDM $M$ .
+
+In short, the idea is to construct a single state-only dataset which ambiguously could have been produced from two different MDPs which have different optimal value functions. Since no function deterministic function can model two outputs from the same input, no such function can exist.
+
+Theorem A.1. For any function $f: \mathbb{D} \to \mathbb{V}$ which maps from the set of state-only datasets, $\mathbb{D}$ , to a set of value functions. There exists some MDP $M$ , with corresponding dataset $D_M$ such that $f(D) \neq V_M^*$ .
+
+$$
+\nexists f \mid \forall_ {M} f (D _ {M}) = V _ {M} ^ {*}.
+$$
+
+Proof. We proceed by contradiction, assume any $f:\mathbb{D}\to \mathbb{V}$ such that
+
+$$
+\forall_ {M} f (D _ {M}) = V _ {M} ^ {*}.
+$$
+
+If we can construct $M_1$ and $M_2$ such that $V_{M_1}^* \neq V_2^*$ , and $D$ such that $D = D_{M_1} = D_{M_2}$ , then $f$ cannot produce the correct value function for $f(D)$ in all cases, from the definition of a function. We will now show a very simple construction which exhibits this property. Consider an MDP $M_1$ , with 3 states, $s_1, s_2, s_t$ , and 2 actions $a_1, a_2$ . $s_t$ is terminal, and gives reward 1, other states give reward 0. The transition dynamics of the two actions are given below.
+
+Table: ${a}_{1}$ transitions for ${M}_{1}$
+
+
+
+Table: ${a}_{2}$ transitions for ${M}_{1}$
+
+
+
+For simplicity, assume $M_1$ has a discount factor of 0.9. This means $V^{*}(s_{1}) = V^{*}(s_{2}) = 1$ .
+
+We define $M_2$ as identical to $M_1$ , only with stochastic transitions.
+
+Table: ${a}_{1}$ transitions for ${M}_{2}$
+
+
+
+Table: ${a}_{2}$ transitions for ${M}_{2}$
+
+
+
+In this MDP, with a discount factor of 0.9, $V^{*}(s_{2}) = 1$ , but $V^{*}(s_{1}) = 0.1 + 0.9 * 0.9 = 0.91$ .
+
+Since both $M_{1}$ and $M_{2}$ share the same states, actions, and possible transitions, $D_{M_1} = D_{M_2}$ . So we have satisfied our condition that $D = D_{M_1} = D_{M_2}$ , and $V_{M_1}^* \neq V^* M_2$ . Thus, no $f$ can model the value functions for both MDPs in general.
+
+# A.4 GRID WORLD BEHAVIOR vs. PURITY
+
+
+Figure S7: We plot correctness of value function estimate and behavior as a function of state-based purity of the intervening actions used for Q-learning. Left plot shows the mean squared error (lower is better) between the obtained value function and the optimal value function. Right plot shows fraction of states in which the learned value function induces the optimal action (higher is better). Both value function and behaviors become worse as state-based purity decreases.
+
+
+Figure S7 plots the MSE in value function and the proportion of states with correct implied actions as a function of the noise in the action labels.
+
+# A.5 LAQ IN STOCHASTIC MDPS
+
+We have conducted experiments on stochastic MDPs in the gridworld environment. Specifically, we do this by adding sticky actions, such that with a certain probability (called the stickiness parameter), the environment executes the previous action as opposed to the given action. We run LAQ with data from this stochastic environment and examine a) purity of latent actions, b) quality of learned value functions, and c) correctness of implied behavior.
+
+
+
+
+
+
+Figure S8: As a function of stochasticity in environment, we plot: state-based purity of the latent actions (top left), Spearman's rank correlation between LAQ learned value function and ground truth value function (top right), correctness of implied behavior by the LAQ learned value function (bottom right), and average state-value of LAQ learend value function, and the ground truth value function (bottom left).
+
+
+
+As expected, Figure S8 (left) shows that the state-based purity of the learned latent actions falls off as the stochasticity (stickiness) increases. However, these impure latent actions have little effect on the Spearman's rank correlation (top right). The Spearman's rank correlation does decrease but remains reasonably high even when the stickiness parameter is set to $95\%$ . While the ordering of the values of the different states doesn't change by much, we note increasing amount of over-estimation in the values (bottom right). This is expected as with increasing stochasticity, there is an increasingly large gap between what LAQ thinks it can control, and what it can actually control. However, the behavior implied by LAQ is still always correct (bottom left), as the over-estimation is uniform over all states. Thus, it is possible to get good performance from LAQ in some stochastic environments. However, it is possible to also construct simple scenarios where LAQ, and for that matter any deterministic algorithm, will suffer as we describe in Section A.3.
+
+# A.6 ENVIRONMENT DETAILS
+
+2D Grid World. We use the environment and data from Section 3.2. We use the $(x,y)$ coordinates as our state for this environment. We use a multi-layer perceptron for $f_{\theta}$ and L2 loss for $l$ .
+
+2D Continuous Control Navigation. We use the Maze2D data from D4RL Fu et al. (2020). Observation space here is $(x,y,v_x,v_y)$ i.e. location and velocity of the agent, and action space is force along $x$ and $y$ directions. We use a frame skip of 3. We use a multi-layer perceptron for $f_{\theta}$ and L2 loss for $l$ . In the embodiment transfer variant, we swap the agent for a 4-legged ant, also from D4RL. The ant embodiment is far more challenging to control, with an 8-d action space and 29-d observation space.
+
+Atari Game. We work with Freeway. We generated our own data using the protocol described in Agarwal et al. (2020). We turned off sticky actions and store frames both at the default resolution $(84\times 84)$ and full resolution $(224\times 224)$ . Other settings are same as is typical: stack last 4 frames to represent the observations, and use frame-skip of 4. We use a convolutional encoder-decoder model for $f_{\theta}$ and predict raw future observations. We use L2 distance in the pixel space as our loss function $l$ .
+
+3D Visual Navigation. We work with the branching environment from Chang et al. (2020) in the AI Habitat Simulator Savva et al. (2019), and use the provided dataset of first-person trajectories as our pre-recorded experience dataset. Following Chang et al. (2020), we employ low-level controllers for deriving behaviors from the learned value functions. We use a convolutional encoder-decoder for $f_{\theta}$ , and L2 loss in pixel space as $l$ .
+
+Kitchen Manipulation. In this task a 9-DOF Franka arm can interact with several different objects physically simulated kitchen. The observations are 24-d, containing the end-effector position and state of various objects in the environment (microwave door angle, kettle position, etc.). The action space represents the 9-d joint velocity. In cross-embodiment experiments we replace the Franka arm with a hook. The observation space remains the same while the action space becomes 3-d position control.
+
+For experiments in kitchen manipulation, we utilize the GMM based solution described in Section A.12. For all environments, we throw out the provided action labels when learning our models.
+
+# A.7 DATA COLLECTION
+
+2D Grid World. The setting for this experiment is a $6 \times 6$ grid with 8 actions, corresponding to moving in the 4 cardinal directions and 4 diagonal directions. The agent starts in the top left $(0,0)$ , and gets reward 0 everywhere, except for in the bottom right, $(5,5)$ . Reaching the bottom right gives the agent reward 1 and terminates the episode. In the starting square $(0,0)$ , the agent has probability 0.5 of moving right, and probability 0.5 of moving down. When the agent is on the top or bottom edge of the maze (row = 0 or row = 5) it moves right with probability 0.9, and takes a random action with probability 0.1. When it is on the left or right edge of the grid (column = 0 or column = 5), it moves down with probability 0.9 and takes a random action with probability 0.1. Otherwise, it is in the interior of the grid, where it takes an action away from the goal (randomly chosen from: up, left, or up-left) with probability 0.9, and one of the remaining actions otherwise (randomly chosen from: down, right, down-right, up-right, down-left). This policy is rolled out for 20,000 policies to generate the data for methods described in main paper Section 3.2 and Figure 1.
+
+Atari Game. Data for the Freeway environment had to be additionally collected, as native high resolution resolution images of the episodes from Agarwal et al. (2020) are not readily available. For this, we re-generated the data using the protocal described in Agarwal et al. (2020), without sticky actions. Then, the high resolution data was collected by taking the action sequences from the re-generated dataset and executing them in an emulator, while storing the native resolution images. Because we re-generated the data without sticky actions, the high resolution episodes are perfect recreations of the low resolution episodes.
+
+Visual Navigation. The data used for the visual navigation experiment was generated using the same protocol as Chang et al. (2020). Agents are tasked to reach one of two goals ( $G_{\mathrm{near}}$ and $G_{\mathrm{far}}$ ) in a visually realistic simulator Savva et al. (2019). Navigating to $G_{\mathrm{near}}$ is the optimal path as it is nearer to the agent's starting location.
+
+The dataset contains 3 types of trajectories, $T_{1}$ , $T_{2}$ , and $T_{3}$ , representing $50\%$ , $49.5\%$ , and $0.5\%$ of the trajectories in the dataset respectively. $T_{1}$ takes a sub-optimal path to $G_{\mathrm{near}}$ , $T_{3}$ takes the optimal path to $G_{\mathrm{near}}$ , and $T_{2}$ navigates to $G_{\mathrm{far}}$ .
+
+2D Continuous Control (Maze2D) We use the Maze2D dataset from D4RL as is.
+
+Kitchen Manipulation. The data used for the Kitchen Manipulation environment comes from the partial version of the D4RL FrankaKitchen dataset. To facilitate cross-embodiment transfer we convert the state representation to contain end-effector location instead of joint angles.
+
+# A.8 ALGORITHM
+
+# Algorithm 1 LAQ
+
+```txt
+1: Given dataset $D$ of $(o_t, o_{t+1}, r)$ triples
+2: for each epoch do ▷ Latent Action Mining
+3: for sampled batch $(o_t, o_{t+1}, r) \sim D$ do
+4: $L(o_t, o_{t+1}) \leftarrow \min_{\hat{a} \in \hat{A}} l(f_\theta(s, \hat{a}), s')$
+5: $\theta \leftarrow \theta - \alpha \nabla_\theta L(o_t, o_{t+1})$ ▷ Section 4.1
+6: end for
+7: end for
+8: let $\hat{g}(o_t, o_{t+1}) = \arg \min_{\hat{a} \in \hat{A}} l(f_\theta(o_t, \hat{a}), o_{t+1})$
+9: $\hat{D} = \{(o_t, o_{t+1}, r, \hat{g}(o_t, o_{t+1})) \mid (o_t, o_{t+1}, r) \in D\}$ ▷ Latent Action Labeling
+10: for each epoch do
+11: for sampled batch $(o_t, o_{t+1}, r, \hat{a}) \sim \hat{D}$ do ▷ Q-learning with Latent Actions
+12: Q-learning update to learn $Q(s, \hat{a})$
+13: end for
+14: end for
+15: $V(s) = \max_{\hat{a} \in \hat{A}} Q(s, \hat{a})$
+```
+
+# A.9 LATENT ACTION QUALITY
+
+We first measure the effectiveness of our latent action mining process by judging the extent to which the induced latent actions are a refinement of the original actions. We measure this using the state-conditioned purity of the partition induced by the learned latent actions.
+
+In a given state, for any latent action $\hat{a}$ , there must be some ground truth action which most frequently mapped to $\hat{a}$ . We define the purity of $\hat{a}$ as the proportion of the most frequent action among all actions mapped to $\hat{a}$ . For example, in a given state $s$ if a set of actions $[0, 0, 0, 1, 2]$ , were mapped to latent action $\hat{a}$ , then $0$ is the most frequent action mapped to $\hat{a}$ and thus the purity of $\hat{a}$ would be 0.6. For a given state, the purity of an entire set of latent actions is the weighted mean of purity of individual latent actions. Overall purity is the average of all state wise purities weighted by how often the states appear in the dataset.
+
+We extend this definition of state-conditioned purity to continuous or high-dimensional states by measuring the validation accuracy of a function $g$ that is trained to map the high-dimensional state (or observation) $s$ , and the associated latent action $\hat{a}$ to the actual ground truth action $a$ . Training such a function induces an implicit partition of the state space. Learning to predict the ground truth action from the latent action $\hat{a}$ within this induced partition estimates the most frequent ground truth action, and accuracy measures its proportion, i.e. purity. This exact procedure reduces to the above definition for discrete state spaces, but also handles continuous and high-dimensional states well. For continuous action spaces, we measure the mean squared error in action prediction instead of classification accuracy.
+
+Table S3 reports the purity (and MSE for continuous action environment) obtained by our proposed future prediction method. For reference, we also report the purity obtained when using single action that maps all samples into a single cluster, and 2 clustering methods that cluster either concatenation of the two observations i.e. $[o_{t + 1};o_t]$ , or the difference between the two observations i.e. $[o_{t + 1} - o_t]$ . We use 8 latent actions for all environments except the FrankaKitchen environment for which we use 64 because of its richer underlying action space.
+
+In general, our forward models are effective at generating a latent action space that is a state-conditioned refinement of the original action space. This is indicated by the improvement in state-conditioned purity values over using a single action or naive clustering. For the 2D Grid World and 2D Continuous Navigation, clustering in the correct space (state difference vs. state concatenation) works well as expected. But our future prediction model, which directly predicts $s_{t+1}$ and doesn't use any domain specific choices, is able to outperform the corresponding clustering method. We also observe large improvements over all baselines for the challenging case of environments with high-dimensional state representations: Freeway and 3D Visual Navigation.
+
+Table S3: We report the state-conditioned action purity (higher is better, MSE for continuous action case where lower is better), of latent actions for different approaches: single action, clustering concatenated observations, clustering difference in observations, and the proposed future prediction models from Section 4.1. We note the utility of the future prediction model for the challenging case of Freeway and 3D Visual Navigation environments. See Section A.9 for a full discussion.
+
+| Environment | Observation Space | Action Space | Purity Metric | Single Action | Clustering [ot, ot+1] | Clustering [ot+1 - ot] | Future Prediction |
| 2D Grid World | xy location | Discrete, 8 | Purity (↑) | 0.827 | 0.851 | 1.000 | 0.998 |
| Freeway | 210 × 160 image | Discrete, 3 | Purity (↑) | 0.753 | 0.778 | 0.773 | 0.907 |
| 3D Visual Navigation (Branching) | 224 × 224 image | Discrete, 3 | Purity (↑) | 0.783 | 0.839 | 0.859 | 0.928 |
| 2D Continuous Control | xy loc. & vel | Continuous, 2 | MSE (↓) | 2.207 | 2.188 | 0.325 | 0.905 |
| Kitchen Manipulation | 24-d State | Continuous, 8 | MSE (↓) | 0.015 | 0.015 | 0.015 | 0.014 |
+
+# A.10 ANALYSIS OF LEARNED LATENT ACTIONS
+
+We analyze the latent actions learned for the Freeway environment.
+
+We visualize our future prediction model's predictions for the Freeway environment in Figure S9. In line with our expectations, the one action future prediction model and the latent action future prediction model are both able to reconstruct the background and the vehicles perfectly. At the same time, the one action future prediction model fails to reconstruct the agent accurately, whereas the latent action future prediction model is able to reconstruct the agent almost perfectly. This provides evidence for the effectiveness of our proposed latent action mining approach at discovering pure action groundings.
+
+
+Figure S9: We visualize the Freeway future prediction models' reconstructions for $o_{t+1}$ . From left to right, the ground truth $o_t$ , the ground truth $o_{t+1}$ , the reconstruction for $o_{t+1}$ by the future prediction model with one action, the reconstruction for $o_{t+1}$ by the future prediction model with latent actions. The agent is circled in each image.
+
+
+
+
+
+
+
+Furthermore, we visualize the learned latent actions for Freeway in Figure S10. In Freeway, the agent can only move along the y-axis, and consequently, the environment action space only has three actions: move up, move down, and no-op. This means that the agent's y-displacement between the current frame and the previous frame directly corresponds to the ground truth action taken. In this visualization, we visualize the chosen latent action (by color: blue, orange, or green) as a function of the agent's y-position in the current frame (x-axis) and the y-displacement relative to the previous frame (y-axis). Note that as mentioned in the paper, we learn the value functions over the top three most dominant actions to stabilize training; for this reason, the visualization only consists of three latent actions.
+
+
+Figure S10: Visualization of the latent actions learned in Freeway. X-axis is the agent's y-position, y-axis is the displacement of the agent (which is indicative of ground truth action).
+
+Within each vertical region marked by the red bars, we see that the latent actions are split into distinct clusters based on the agent's y-displacement. Because the agent's y-displacement directly corresponds to the ground truth action taken, this indicates that given the agent's y-position, the learned latent actions encode information about the ground truth action. Hence, we qualitatively confirm that the state-based purity of the latent actions is high.
+
+# A.11 VALUE FUNCTION DETAILS
+
+Value Function Model Selection The numbers reported in Table 1 are the $95^{\text{th}}$ percentile Spearman's correlation coefficients over the course of training. If training is stable and converges, this corresponds to taking the final value, and in the case that training is not stable and diverges, this acts as a form of early stopping. We take the $95^{\text{th}}$ percentile as opposed to the maximum to eliminate outliers.
+
+Below we present visualizations of value functions learned from LAQ.
+
+Freeway. We visualize the value functions learned using our latent actions for Freeway. Figure S11 plots the values over the course of an episode. In Freeway, the agent has to move vertically up and down the screen to cross a busy freeway, receiving reward when it successfully gets to the other side. In a single episode, the agent can cross the freeway multiple times; each time the agent makes it to the other side, the agent's location is reset to the original starting location, allowing the agent to attempt to cross the freeway once again. For this reason, we see the value increase as the agent gets closer to the other side of the road, and then drop as soon as its position resets to the starting location. As evident, the peaks of the learned value function correspond highly to the environment reward.
+
+
+Figure S11: We visualize the value predicted by our learned value function over the course of one episode of Freeway. The red points correspond to when the agent receives a reward from the environment.
+
+3D Visual Navigation. Figure S12 visualizes the learned value map in the 3D Visual Navigation branching environment from Chang et al. (2020). As depicted in Figure 6, there are two goals: $G_{near}$ and $G_{far}$ . The figure on the right illustrates that the value function learned by utilizing our latent actions correctly assigns high value to the regions surrounding the two goal locations, and low value elsewhere. Additionally, we learn the value functions with DQN using a dataset obtained by using a sub-optimal policy which prefers to go to the goal further away rather than the goal close by. Despite this sub-optimality, the learned value function correctly assigns a higher value to the nearby goal than the goal which is further away.
+
+
+Figure S12: Visualization of the learned value function for 3D Visual Navigation.
+
+2D Continuous Control. Figure S13 shows a visualization of the value function learned using latent actions for the 2D Continuous Control environment. While the observation space of this environment is $(x,y,v_x,v_y)$ i.e. location and velocity of the agent, we produce this visualization over just the location of the agent. Based on just the location of the agent, the optimal value function would be a monotonically decreasing function as the distance from the goal location increases. In this particular environment, the goal of the agent is to get to the top-right corner of the maze. The visualization shows that the learned value function produces high values around this goal region at the top-right corner of the maze, and gradually lower values the farther away you go. This figure visually is in line with our quantitative results in
+
+Table 1 which show that the value function learned using latent actions in the 2D Continuous Control environment highly correlates to that learned using ground truth actions.
+
+Kitchen Manipulation. We visualize the values as a function of both the angle that the microwave door makes with respect to its starting state as well as the distance between the end-effector and the microwave door handle in Figure S14. The task here is to open the microwave door: the agent receives a binary reward when the angle that the microwave door makes with respect to its starting state (i.e. closed microwave door) is above a threshold (approx. 0.7 radians), and zero otherwise. As expected, we see that the predicted value of a state increases as the angle of the microwave door increases. The end-effector position does not start out at the microwave door handle, but rather is initialized a fixed distance away from the handle. As a result, the agent must first move the end-effector to the microwave door handle, before interacting with the door handle to open it. In addition to this, we hypothesize that as the distance between the end-effector and the microwave door handle decreases, the predicted
+
+value should increase. While not as obvious as the relation between the microwave door angle and the value, we see some indication that as the distance between the end-effector and the microwave door handle decreases, the value increases.
+
+
+Figure S13: Visualization of the learned value function for 2D Continuous Control.
+
+
+Figure S14: Visualization of the learned value function in Kitchen Manipulation. The x-axis is the microwave angle in radians, the y-axis is the distance between the end-effector and the microwave door handle, with the colors corresponding to the magnitude of the values.
+
+# A.12 DEALING WITH EXTRAPOLATION ERROR
+
+Given the reward structure utilized in densified reinforcement learning (see Section 4.3), if there exist states which produce spuriously high values of $V(s)$ , the optimal policy in the new MDP may erroneously seek these states. Here we present two ways to combat this phenomenon:
+
+1) Fit a density model to constrain high reward regions to the distribution used to train $V(s)$
+2) Re-parameterize the value function such that out of distribution states are likely to have low value.
+
+Density Model: We add an additional component to the reward computation to incentivize behavior to remain within the region of the state space covered by the demonstrations (where the learned value function is in-distribution). For the kitchen manipulation environment we build a density model over the end effector position using a 2 component Gaussian mixture model. If a state $s$ has a less than $1\%$ probability according to the GMM density model, then we assign $V(s) = 0$ , for the update described in Section 5.2. We apply this shaping to all methods in Figure 4 for the kitchen environment. We give sparse reward the same benefit of this shaping by giving reward $-1$ outside of the GMM distribution, and 0 inside. Sparse task reward remains the same.
+
+Value function re-parameterization For sparse reward tasks, we can parameterize the final value prediction as $1 - \|\phi(s)\|_2$ . Where $\phi$ is a neural network based featurization of the state. This ensures high values are only predicted when the featurization of the state is close to the zero vector. States which are out of distribution may induce random features, but these will result in lower predicted values.
+
+Results on the kitchen manipulation environment are presented in Figure S15. We can see that all methods solve the task poorly in this environment when value functions are unconstrained. Using a density based model (GMM) or the "1-norm" parameterization of the value function allow the task to be solved consistently.
+
+
+Figure S15: We show learning curves for acquiring behavior using different methods for dealing with out of distribution samples in the kitchen manipulation environment: unconstrained (left), density model based reward shaping (center), and "1-norm" parameterization of the value function (right). Results are averaged over 5 seeds and show $95\%$ confidence intervals. See Section A.12 for details.
+
+
+
+
+
+| Sparse Reward | Densified Reward (Ours + BCQ) | Densified Reward (TD(0)) |
| Densified Reward (Ours) | Densified Reward (D3G) | |
\ No newline at end of file
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/images.zip b/learningvaluefunctionsfromundirectedstateonlyexperience/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ba81bd5e3f471603d974b64d7e674c596cc1f631
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41d409de90c352ac34faf4e7b378e215e3688802b81f1390c838c66db1a2fbff
+size 766233
diff --git a/learningvaluefunctionsfromundirectedstateonlyexperience/layout.json b/learningvaluefunctionsfromundirectedstateonlyexperience/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7b762b57c6b11ff11c9b4eae4f54edb870703cba
--- /dev/null
+++ b/learningvaluefunctionsfromundirectedstateonlyexperience/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91af3c437886e652739b1b8675d8f9094bf99a1f3194ff439fc99bcc8f1aeb0b
+size 836122
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_content_list.json b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..75477ed2527ba26480fc735fba03132c7d7c9bbb
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c686559aab2a4820f0071c5309129e9e4f1f54c7c90a9b7fd0a6289ef7de6d08
+size 85657
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_model.json b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0bae488b05b9a737144abdcb462e3c2983bf2f03
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1b50a5358151ceb00f8be4c39573f5e3ac3ad43c349677aea094475cfdaae5d2
+size 103794
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_origin.pdf b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..029e1b55be0a959ca023f51b0fd8214fe672608b
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/fc550069-54c5-4bcb-873c-09ab3c76238e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ec5620d196a0b4f73765dae8d272258e649280e4a3f94675f37876022d3afd1d
+size 1002555
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/full.md b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..773ad5015cf8aeb09bda309d74b0076c07b7e583
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/full.md
@@ -0,0 +1,314 @@
+# LEARN LOCALLY, CORRECT GLOBALLY: A DISTRIBUTED ALGORITHM FOR TRAINING GRAPH NEURAL NETWORKS
+
+Morteza Ramezani*, Weilin Cong*, Mehrdad Mahdavi
+Mahmut T. Kandemir, Anand Sivasubramaniam
+
+Pennsylvania State University, University Park, PA 16802, USA
+morteza@cse.psu.edu, wxc272@psu.edu, mzm616@psu.edu
+anand@cse.psu.edu, kandemir@cse.psu.edu
+
+# ABSTRACT
+
+Despite the recent success of Graph Neural Networks (GNNs), training GNNs on large graphs remains challenging. The limited resource capacities of the existing servers, the dependency between nodes in a graph, and the privacy concern due to the centralized storage and model learning have spurred the need to design an effective distributed algorithm for GNN training. However, existing distributed GNN training methods impose either excessive communication costs or large memory overheads that hinders their scalability. To overcome these issues, we propose a communication-efficient distributed GNN training technique named Learn Locally, Correct Globally (LLCG). To reduce the communication and memory overhead, each local machine in LLCG first trains a GNN on its local data by ignoring the dependency between nodes among different machines, then sends the locally trained model to the server for periodic model averaging. However, ignoring node dependency could result in significant performance degradation. To solve the performance degradation, we propose to apply Global Server Corrections on the server to refine the locally learned models. We rigorously analyze the convergence of distributed methods with periodic model averaging for training GNNs and show that naively applying periodic model averaging but ignoring the dependency between nodes will suffer from an irreducible residual error. However, this residual error can be eliminated by utilizing the proposed global corrections to entail fast convergence rate. Extensive experiments on real-world datasets show that LLCG can significantly improve the efficiency without hurting the performance.
+
+# 1 INTRODUCTION
+
+In recent years, Graph Neural Networks (GNNs) have achieved impressive results across numerous graph-based applications, including social networks (Hamilton et al., 2017; Deng et al., 2019),
+
+recommendation systems (Ying et al., 2018; Wang et al., 2018), and drug discovery (Fout et al., 2017; Do et al., 2019; Ghorbani et al., 2022; Faez et al., 2021). Despite their recent success, effective training of GNNs on large-scale real-world graphs, such as Facebook social network (Boldi & Vigna, 2004), remains challenging. Although several attempts have been made to scale GNN training by sampling techniques (Hamilton et al., 2017; Zou et al., 2019; Zeng et al., 2020; Chiang et al., 2019; Chen et al., 2018; Zhang et al., 2021; Ramezani et al., 2020), they are still inefficient for training on extremely large graphs, due to the unique structure of GNNs and the limited memory capacity/bandwidth of current servers. One potential solution to tackle these limitations is employing distributed training with data parallelism, which have become almost a de facto standard for fast and accurate training for natural language processi
+
+
+Figure 1: Comparison of the speedup and the memory consumption of distributed multimachine training and centralized single machine training on the Reddit dataset.
+
+2018) and computer vision (Bonawitz et al., 2019; Konečný et al., 2018). For example, as shown in Figure 1, moving from single machine to multiple machines reduces the training time and alleviates the memory burden on each machine. Besides, scaling the training of GNNs with sampling techniques can result in privacy concerns: existing sampling-based methods require centralized data storage and model learning, which could result in privacy concerns in real-world scenarios (Shin et al., 2018; Wu et al., 2021). Fortunately, the privacy in distributed learning can be preserved by avoiding mutual access to data between different local machines, and using only a trusted third party server to access the entire data.
+
+Nonetheless, generalizing the existing data parallelism techniques of classical distributed training to the graph domain is non-trivial, which is mainly due to the dependency between nodes in a graph. For example, unlike solving image classification problems where images are mutually independent, such that we can divide the image dataset into several partitions without worrying about the dependency between images; GNNs are heavily relying on the information inherent to a node and its neighboring nodes. As a result, partitioning the graph leads to subgraphs with edges spanning subgraphs (cut-edges), which will cause information loss and hinder the performance of the model (Angerd et al., 2020). To cope with this problem, (Md et al., 2021; Jiang & Rumi, 2021; Angerd et al., 2020) propose to transfer node features and (Zheng et al., 2020; Tripathy et al., 2020; Scardapane et al., 2020) propose to transfer both the node feature and its hidden embeddings between local machines, both of which can cause significant storage/communication overhead and privacy concerns (Shin et al., 2018; Wu et al., 2021).
+
+To better understand the challenge of distributed GNN training, we compare the validation F1-score in Figure 2 (a) and the average data communicated per round in Figure 2 (b) for two different distributed GNN training methods on the Reddit dataset. On the one hand, we can observe that when ignoring the cut-edges, Parallel SGD with Periodic Averaging (PSGD-PA (Dean et al., 2012; Li et al., 2020b)) suffers from significant accuracy drop and cannot achieve the same accuracy as the single machine training, even by increasing the number of communication. However, Global Graph Sampling (GGS) can successfully reach the baseline by considering the cut-edges and allowing feature transfer, at the cost of significant communication overhead, and potential violation of privacy.
+
+
+(a)
+
+
+(b)
+Figure 2: Comparison of (a) the validation F1-score and (b) the average data communicated per round (in bytes and log-scale) for two different distributed GNN training settings, including Parallel SGD with Periodic Averaging (PSGDPA) where the cut-edges are ignored and only the model parameters are transferred and Global Graph Sampling (GGS), where the cut-edges are considered and the node features of the cut-edges are transferred to the corresponding local machine, on the Reddit dataset using 8 machines.
+
+In this paper, we propose a communication-efficient distributed GNN training method, called Learn Locally, Correct Globally (LLCG). To reduce the communication overhead, inspired by the recent success of the distributed optimization with periodic averaging (Stich, 2019; Yu et al., 2019), we propose Local Training with Periodic Averaging: where each local machine first locally trains a GNN model by ignoring the cut-edges, then sends the trained model to the server for periodic model averaging, and receive the averaged model from server to continue the training. By doing so we eliminate the features exchange phase between server and local machines, but it can result in a significant performance degradation due to the lack of the global graph structure and the dependency between nodes among different machines. To compensate for this error, we propose a Global Server Correction scheme to take advantage of the available global graph structure on the server and refine the averaged locally learned models before sending it back to each local machine. Notice that without Global Server Correction, LLCG is similar to PSGD-PA as introduced in Figure 2.
+
+To get a deeper understanding on the necessity of Global Server Correction, we provide the first theoretical analysis on the convergence of distributed training for GNNs with periodic averaging. In particular, we show that solely averaging the local machine models and ignoring the global graph structure will suffer from an irreducible residual error, which provides sufficient explanation on why Parallel SGD with Periodic Averaging can never achieve the same performance as the model trained on a single machine in Figure 2 (a). Then, we theoretically analyze the convergence of our proposal LLCG. We show that by carefully choosing the number of global correction steps,
+
+LLCG can overcome the aforementioned residual error and enjoys $\mathcal{O}\big(1 / \sqrt{PT}\big)$ convergence rate with $P$ local machines and $T$ iterations of gradient updates, which matches the rate of (Yu et al., 2019) on a general (not specific for GNN training) non-convex optimization setting. Finally, we conduct comprehensive evaluations on real-world graph datasets with ablation study to validate the effectiveness of LLCG and its improvements over the existing distributed methods.
+
+Related works. Recently, several attempts have been made on distributed GNN training. According to how they deal with the input/hidden feature of nodes that are associated with the cut-edges (i.e., the edges spanning subgraphs of each local machine), existing methods can be classified into two main categories: (1) Input feature only communication-based methods: In these methods, each local machine receives the input features of all nodes required for the gradient computation from other machines, and trains individually. However, since the number of required nodes grows exponentially with the number of layers, these methods suffer from a significant communication and storage overhead. To alleviate these issues, (Md et al., 2021) proposes to split the original graph using a min-cut graph partition algorithm that can minimize the number of cut-edges. (Jiang & Rumi, 2021) proposes to use importance sampling to assign nodes on the local machine with a higher probability. (Angerd et al., 2020) proposes to sample and save a small subgraph from other local machines as an approximation of the original graph structure. Nonetheless, these methods are limited to a very shallow GNN structure and suffer from significant performance degradation when the original graph is dense. (2) Input and hidden feature communication-based methods: These methods propose to communicate hidden features in addition to the input node features. Although these methods reduce the number of transferred bytes during each communication round (due to the smaller size of hidden embedding and less required nodes features), the number of communication rounds grows linearly as the number of layers, and are prone to more communication delay. To address these issues, in addition to optimal partitioning of the graph, (Zheng et al., 2020) proposes to use sparse embedding to reduce the number of bytes to communicate and (Tripathy et al., 2020) proposes several graph partitioning techniques to diminish the communication overhead.
+
+# 2 BACKGROUND AND PROBLEM FORMULATION
+
+In this section, we start by describing Graph Convolutional Network (GCN) and its training algorithm on a single machine, then formulate the problem of distributed GCN training. Note that we use GCN with mean aggregation for simplicity, however, our discussion is also applicable to other GNN architectures, such as SAGE (Hamilton et al., 2017), GAT (Velickovic et al., 2018), ResGCN (Li et al., 2019) and APPNP (Klicpera et al., 2019).
+
+Training GCN on a single machine. Here, we consider the semi-supervised node classification in an undirected graph $\mathcal{G}(\mathcal{V},\mathcal{E})$ with $N = |\mathcal{V}|$ nodes and $|\mathcal{E}|$ edges. Each node $v_{i}\in \mathcal{V}$ is associated with a pair $(\mathbf{x}_i,\mathbf{y}_i)$ , where $\mathbf{x}_i\in \mathbb{R}^d$ is the input feature vector, $\mathbf{y}_i\in \mathbb{R}^{|\mathcal{C}|}$ is the ground truth label, and $\mathcal{C}$ is the candidate labels in the multi-class classifications. Besides, let $\mathbf{X} = [\mathbf{x}_1,\dots ,\mathbf{x}_N]\in \mathbb{R}^{N\times d}$ denote the input node feature matrix. Our goal is to find a set of parameters $\pmb {\theta} = \{\mathbf{W}^{(\ell)}\}_{\ell = 1}^{L}$ by minimizing the empirical loss $\mathcal{L}(\pmb {\theta})$ over all nodes in the training set, i.e.,
+
+$$
+\mathcal {L} (\boldsymbol {\theta}) = \frac {1}{N} \sum_ {i \in \mathcal {V}} \phi \left(\mathbf {h} _ {i} ^ {(L)}, \mathbf {y} _ {i}\right), \quad \mathbf {h} _ {i} ^ {(\ell)} = \sigma \left(\frac {1}{| \mathcal {N} (v _ {i}) |} \sum_ {j \in \mathcal {N} (v _ {i})} \mathbf {h} _ {j} ^ {(\ell - 1)} \mathbf {W} ^ {(\ell)}\right), \tag {1}
+$$
+
+where $\phi (\cdot ,\cdot)$ is the loss function (e.g., cross entropy loss), $\sigma (\cdot)$ is the activation function (e.g., ReLU), and $\mathcal{N}(v_i)$ is the neighborhood of node $v_{i}$ . In practice, we can update the model parameters by the stochastic gradient computed on a sampled mini-batch (using full-neighbors) by
+
+$$
+\tilde {\nabla} \mathcal {L} (\boldsymbol {\theta}, \xi) = \frac {1}{B} \sum_ {i \in \xi} \nabla \phi \left(\mathbf {h} _ {i} ^ {(L)}, \mathbf {y} _ {i}\right), \tag {2}
+$$
+
+where $\xi$ denotes an i.i.d. sampled mini-batch of size $B$ and we have $\mathbb{E}[\tilde{\nabla}\mathcal{L}(\pmb {\theta},\xi)] = \nabla \mathcal{L}(\pmb {\theta})$
+
+Distributed GCN training with periodic averaging. In this paper, we consider the distributed learning setting with $P$ local machines and a single parameter server. The original input graph $\mathcal{G}$ is partitioned into $P$ subgraphs, where $\mathcal{G}_p(\mathcal{V}_p,\mathcal{E}_p)$ denotes the subgraph on the $p$ -th local machine with $N_{p} = |\mathcal{V}_{p}|$ nodes, and $\mathbf{X}_p\in \mathbb{R}^{N_p\times d}$ as the input feature of all nodes in $\nu_{p}$ located on the $p$ -th machine. Then, the full-batch local gradient $\nabla \mathcal{L}_p^{\mathrm{local}}(\boldsymbol {\theta}_p)$ is computed as
+
+$$
+\nabla \mathcal {L} _ {p} ^ {\text {l o c a l}} (\boldsymbol {\theta} _ {p}) = \frac {1}{N _ {p}} \sum_ {i \in \mathcal {V} _ {p}} \nabla \phi \left(\mathbf {h} _ {i} ^ {(L)}, \mathbf {y} _ {i}\right), \quad \mathbf {h} _ {i} ^ {(\ell)} = \sigma \left(\frac {1}{\left| \mathcal {N} _ {p} \left(v _ {i}\right) \right|} \sum_ {j \in \mathcal {N} _ {p} \left(v _ {i}\right)} \mathbf {h} _ {j} ^ {(\ell - 1)} \mathbf {W} _ {p} ^ {(\ell)}\right), \tag {3}
+$$
+
+Algorithm 1 Distributed GCN training with "Parallel SGD with Periodic Averaging"
+Input: Global parameters $\bar{\theta}^0$ , local parameters $\theta_p^0 = \bar{\theta}^0$ , time-step $t = 0$ , learning rate $\eta$ .
+1: for $r \gets 1$ to $R$ do
+2: for $p \gets 1$ to $P$ do in parallel ▷ Parallel training on local machines
+3: Local machine $p$ receives the global parameters $\theta_p^t \gets \bar{\theta}^t$ . ▷ Communication
+4: for $k \gets 1$ to $K$ do
+5: $t \gets t + 1$ .
+6: Local machine $p$ constructs the mini-batch $\xi_p^t$ with neighbor sampling.
+7: Local machine $p$ computes the stochastic gradients $\tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\theta_p^t, \xi_p^t)$ .
+8: Local machine $p$ updates the local parameter by $\theta_p^{t+1} = \theta_p^t - \eta \tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\theta_p^t, \xi_p^t)$ .
+9: end for
+10: Local machine $p$ sends the local parameters $\theta_p^{t+1}$ to the server. ▷ Communication
+11: end for
+12: Server updates the global parameters by parameter averaging $\bar{\theta}^{t+1} = \frac{1}{P}\sum_{p=1}^{P}\theta_p^{t+1}$ .
+13: end for
+Output: Server returns trained GCN model with $\min_t\mathbb{E}[\|\nabla\mathcal{L}(\bar{\theta}^t)\|^2]$ .
+
+where $\pmb{\theta}_{p} = \{\mathbf{W}_{p}^{(\ell)}\}_{\ell = 1}^{L}$ is the model parameters on the $p$ -th local machine, $\mathcal{N}_p(v_i) = \{v_j|(v_i,v_j)\in \mathcal{E}_p\}$ is the local neighbors of node $v_{i}$ on the $p$ -th local machine. When the graph is large, the computational complexity of forward and backward propagation could be very high. One practical solution is to compute the stochastic gradient on a sampled mini-batch with neighbor sampling, i.e.,
+
+$$
+\tilde {\nabla} \mathcal {L} _ {p} ^ {\text {l o c a l}} (\boldsymbol {\theta} _ {p}, \xi_ {p}) = \frac {1}{B _ {p}} \sum_ {i \in \xi_ {p}} \nabla \phi \left(\tilde {\mathbf {h}} _ {i} ^ {(L)}, \mathbf {y} _ {i}\right), \quad \tilde {\mathbf {h}} _ {i} ^ {(\ell)} = \sigma \left(\frac {1}{| \tilde {\mathcal {N}} _ {p} (v _ {i}) |} \sum_ {j \in \tilde {\mathcal {N}} _ {p} (v _ {i})} \tilde {\mathbf {h}} _ {j} ^ {(\ell - 1)} \mathbf {W} _ {p} ^ {(\ell)}\right), \tag {4}
+$$
+
+where $\xi_p$ is an i.i.d. sampled mini-batch of $B_p$ nodes, $\tilde{\mathcal{N}}_p(v_i) \subset \mathcal{N}(v_i)$ is the sampled neighbors.
+
+An illustration of distributed GCN training with Parallel SGD with Periodic Averaging (PSGD-PA) is summarized in Algorithm 1. Before training, the server maintains a global model $\bar{\theta}^0$ and each local machine keeps a local copy of the same model $\pmb{\theta}_p^0$ . During training, the local machine first updates the local model $\pmb{\theta}_p^t$ using the stochastic gradient $\nabla \mathcal{L}_p^{\mathrm{local}}(\pmb{\theta}_p^t,\xi_p^t)$ computed by Eq. 4 for $K$ iterations (line 8), then sends the local model $\pmb{\theta}_p^t$ to the server (line 10). At each communication step, the server collects and averages the model parameters from the local machines (line 12) and send the averaged model $\pmb{\theta}_p^{t + 1}$ back to each local machine.
+
+Limitations. Although PSGD-PA can significantly reduce the communication overhead by transferring the locally trained models instead of node feature/embeddings (refer to Figure 2 (b)), it suffers from performance degeneration due to ignorance of the cut-edges (refer to Figure 2 (a)). In the next section, we introduce a communication-efficient algorithm LLCG that does not suffer from this issue, and can achieve almost the same performance as training the model on a single machine.
+
+# 3 PROPOSED ALGORITHM: LEARN LOCALLY CORRECT GLOBALLY
+
+In this section, we describe Learn Locally, Correct Globally (LLCG) for distributed GNN training. LLCG includes two main phases, local training with periodic model averaging and global server correction, to help reduce both the number of required communications and size of transferred data, without compromising the predictive accuracy. We summarize the details of LLCG in Algorithm 2.
+
+# 3.1 LOCAL TRAINING WITH PERIODIC MODEL AVERAGING
+
+At the beginning of a local epoch, each local machine receives the latest global model parameters from the server (line 3). Next, each local machine runs $K\rho^{r}$ iterations to update the local model (line 4 to 9), where $K$ and $\rho$ are the hyper-parameters that control the local epoch size. Note that instead of using a fixed local epoch size as Algorithm 1, we choose to use exponentially increasing local epoch size in LLCG with $\rho > 1$ . The reasons are as follows.
+
+At the beginning of the training phase, all local models $\pmb{\theta}_p^t$ are far from the optimal solution and will receive a gradient $\bar{\nabla}\mathcal{L}_p^{\mathrm{local}}(\pmb{\theta}_p^t,\xi_p^t)$ computed by Eq. 4. Using a smaller local update step at the early stage guarantees each local model does not diverge too much from each other before the model averaging step at the server side (line 12). However, towards the end of the training, all local
+
+Algorithm 2 Distributed GCN training by "Learn Locally, Correct Globally"
+Input: Global parameters $\bar{\theta}^0$ , local parameters $\theta_p^0$ , time-step $t = 0$ , local step size hyper-parameters $K, \rho$ , and learning rate $\gamma, \eta$
+1: for $r \gets 1$ to $R$ do
+2: for $p \gets 1$ to $P$ do in parallel ▷ Parallel training on local machine
+3: Local machine $p$ receives the global parameters $\theta_p^t \gets \bar{\theta}^t$ ▷ Communication
+4: for $k \gets 1$ to $K\rho^r$ do
+5: $t \gets t + 1$
+6: Local machine $p$ constructs the mini-batch $\xi_p^t$ with neighbor sampling
+7: Local machine $p$ computes stochastic gradients $\tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\theta_p^t, \xi_p^t)$
+8: Local machine $p$ updates model parameter by $\theta_p^{t+1} = \theta_p^t - \eta \tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\theta_p^t, \xi_p^t)$
+9: end for
+10: Local machine $p$ sends the local parameters $\theta_p^{t+1}$ to the server ▷ Communication
+11: end for
+12: Server updates the global parameters using parameter averaging $\bar{\theta}^{t+1} = \frac{1}{P}\sum_{p=1}^{P}\theta_p^{t+1}$
+13: for $s \gets 1$ to $S$ do ▷ Server Correction
+14: $t \gets t + 1$
+15: Server constructs a mini-batch $\xi^t$ with full-neighbors
+16: Server computes the stochastic gradient $\tilde{\nabla}\mathcal{L}(\bar{\theta}^t, \xi^t)$
+17: Server updates the global parameters by $\bar{\theta}^{t+1} = \bar{\theta}^t - \gamma \tilde{\nabla}\mathcal{L}(\bar{\theta}^t, \xi^t)$
+18: end for
+19: end for
+Output: Server return GCN model with trained min_t $\mathbb{E}[||\nabla\mathcal{L}(\bar{\theta}^t)||^2]$
+
+models $\theta_p^t$ will receive relatively smaller gradient $\tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\theta_p^t,\xi_p^t)$ , such that we can choose a larger local epoch size to reduce the number of communications, without worrying about the divergence of local models. By doing so, after total number of $T = \sum_{r = 1}^{R}K\rho^{r}$ iterations, LLCG only requires $R = \log_{\rho}\frac{T}{K}$ rounds of communications. Therefore, compared to the fully-synchronous method, we can significantly reduce the total number of communications from $\mathcal{O}(T)$ to $\mathcal{O}(\log_{\rho}\frac{T}{K})$ .
+
+# 3.2 GLOBAL SERVER CORRECTION
+
+The design of the global server correction is to ensure that the trained model not only learns from the data on each local machine, but also learns the global structure of the graph, thus reducing the information loss caused by graph partitioning and avoiding cut-edges. Before the correction, the server receives the locally trained models from all local machines (line 10) and applies model parameter averaging (line 12). Next, $S$ server correction steps are applied on top of the averaged model (line 13 to 18). During the correction, the server first constructs a mini-batch $\xi^t$ using full-neighbors1 (line 15), compute the stochastic gradient $\tilde{\nabla} \mathcal{L}(\bar{\theta}^t, \xi^t)$ on the constructed mini-batch by Eq. 2 (line 16) and update the averaged model $\bar{\theta}^t$ for $S$ iterations (line 17). The number of correction steps $S^2$ depends on the heterogeneity among the subgraphs on each local machine: the more heterogeneous the subgraphs are, the more correction steps are required to better refine the averaged model and reduce the divergence across the local models. Note that, the heterogeneity is minimized when employing GGS (Figure 2) with the local machines having access to the full graph, as a result. However, GGS requires sampling from the global graph and communication at every iteration, which results in additional overhead and lower efficiency. Instead, in LLCG we are trading computation on the server for the costly feature communication, and only requires periodic communication.
+
+# 4 THEORETICAL ANALYSIS
+
+In this section, we provide the convergence analysis on the distributed training of GCN under two different settings, i.e., with and without server correction. We first introduce the notations and assumptions for the analysis (Section 4.1). Then, we show that periodic averaging of local machine models alone and ignoring the global graph structure will suffer from an irreducible residual error (Section 4.2). Finally, we show that this residual error can be eliminated by running server correction steps after each periodic averaging step on the server (Section 4.3).
+
+
+(a) With cross-device communication Without neighbor sampling
+
+
+(b) Without cross-device communication Without neighbor sampling
+
+
+(c) Without cross-device communication With neighbor sampling
+Figure 3: Comparison of notations $\nabla \mathcal{L}_p^{\mathrm{local}}(\pmb {\theta})$ , $\tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\pmb {\theta},\xi_p)$ , and $\nabla \mathcal{L}_p^{\mathrm{full}}(\pmb {\theta})$ on two local machines, where the blue node and green circles represent nodes on different local machines.
+
+# 4.1 NOTATIONS AND ASSUMPTIONS
+
+Let us first recall the notations defined in Section 2, where $\mathcal{L}(\theta)$ denotes the global objective function computed using the all node features $\mathbf{X}$ and the original graph $\mathcal{G}$ , $\mathcal{L}_p(\theta)$ denotes the local objective function computed using the local node features $\mathbf{X}_p$ and local graph $\mathcal{G}_p$ , $\boldsymbol{\theta}_p^t$ denotes the model parameters on the $p$ -th local machine at the $t$ -th step, and $\bar{\boldsymbol{\theta}}^t = \frac{1}{P}\sum_{p=1}^{P}\boldsymbol{\theta}_p^t$ denotes the virtual averaged model at the $t$ -th step. In the non-convex optimization, our goal is to show the expected gradient of the global objective on the virtual averaged model parameters $\mathbb{E}[\|\nabla\mathcal{L}(\bar{\boldsymbol{\theta}}^t)\|^2]$ decreases as the number of local machines $P$ and the number of training steps $T$ increase. Besides, we introduce $\nabla\mathcal{L}_p^{\mathrm{full}}(\boldsymbol{\theta})$ as the gradient computed on the $p$ -th local machine but have access the full node features $\mathbf{X}$ and the original graph structure $\mathcal{G}$ as
+
+$$
+\nabla \mathcal {L} _ {p} ^ {\text {f u l l}} (\boldsymbol {\theta}) = \frac {1}{| \mathcal {V} _ {p} |} \sum_ {i \in \mathcal {V} _ {p}} \nabla \phi \left(\mathbf {h} _ {i} ^ {(L)}, y _ {i}\right), \quad \mathbf {h} _ {i} ^ {(\ell)} = \sigma \left(\frac {1}{| \mathcal {N} (v _ {i}) |} \sum_ {j \in \mathcal {N} (v _ {i})} \mathbf {h} _ {j} ^ {(\ell - 1)} \mathbf {W} _ {p} ^ {(\ell)}\right). \tag {5}
+$$
+
+Please refer to Figure 3 for an illustration of different gradient computations. Besides, we introduce local-global gradient discrepancy as $\kappa^2 = \kappa_{\mathbf{A}}^2 + \kappa_{\mathbf{X}}^2$ , where $\kappa_{\mathbf{A}}^2 = \max_{p \in [P]} \{\|\nabla \mathcal{L}_p^{\mathrm{local}}(\boldsymbol{\theta}) - \nabla \mathcal{L}_p^{\mathrm{full}}(\boldsymbol{\theta})\|^2\}$ is the maximum difference between the gradient computed on the local machine with and without having access to the global graph structure, which is mainly due to fact that the local machines are oblivious to the full graph information; and $\kappa_{\mathbf{X}}^2 = \max_{p \in [P]} \{\|\nabla \mathcal{L}_p^{\mathrm{full}}(\boldsymbol{\theta}) - \nabla \mathcal{L}(\boldsymbol{\theta})\|^2\}$ is the maximum difference between the gradient computed using the local node and all nodes, which is mainly due to the heterogeneity of the node features on each local machine, and we have $\kappa_{\mathbf{X}}^2 = 0$ if the nodes are i.i.d. sampled to each local machine. Notice that local-global gradient discrepancy $\kappa^2$ plays an important role in our theoretical results.
+
+For the convergence analysis, we make the following standard assumptions.
+
+Assumption 1 The stochastic gradient on the $p$ -th local machine (with neighbor sampling) has stochastic gradient variance bounded by $\sigma_{var}^2$ and stochastic gradient bias bounded by $\sigma_{bias}^2$ , i.e., $\mathbb{E}[\|\tilde{\nabla}\mathcal{L}_p^{local}(\boldsymbol{\theta};\xi) - \mathbb{E}[\tilde{\nabla}\mathcal{L}_p^{local}(\boldsymbol{\theta};\xi)]\|^2] \leq \sigma_{var}^2$ , $\mathbb{E}[\|\mathbb{E}[\tilde{\nabla}\mathcal{L}_p^{local}(\boldsymbol{\theta};\xi)] - \nabla\mathcal{L}_p^{local}(\boldsymbol{\theta})\|^2] \leq \sigma_{bias}^2$ .
+
+Assumption 2 The stochastic gradient for global server correction (with full neighbors) has stochastic gradient variance bounded by $\sigma_{global}^2$ , i.e., $\mathbb{E}[\|\tilde{\nabla}\mathcal{L}_p^{full}(\boldsymbol{\theta};\xi) - \nabla\mathcal{L}_p^{full}(\boldsymbol{\theta})\|^2] \leq \sigma_{global}^2$ .
+
+The existence of stochastic gradient bias and variance in sampling-based GNN training have been studied in (Cong et al., 2020; 2021), where (Cong et al., 2021) further quantify the stochastic gradient bias and variance as a function of the number of GCN layers. In particular, they show that the existence of $\sigma_{\mathrm{bias}}^2$ is due to neighbor sampling and non-linear activation, and we have $\sigma_{\mathrm{bias}}^2 = 0$ if all neighbors are used or the non-linear activation is removed. The existence of $\sigma_{\mathrm{var}}^2$ is because we are sampling mini-batches to compute the stochastic gradient on each local machine during training. As the mini-batch size increases, $\sigma_{\mathrm{var}}^2$ will be decreasing, and we have $\sigma_{\mathrm{var}}^2 = 0$ when using full-batch.
+
+# 4.2 DISTRIBUTED GNN VIA PARAMETER AVERAGING
+
+In the following, we provide the first convergence analysis on distributed training of GCN. We show that solely periodic averaging of the local machine models and ignoring the global graph structure suffers from an upper bound that is irreducible with the number of training steps. Comparing to the traditional distributed training (e.g., distributed training Convolutional Neural Network for image classification (Dean et al., 2012; Li et al., 2020b)), the key challenges in the distributed GCN training is the two different types of gradient bias: (1) The expectation of the local full-batch gradient is
+
+a biased estimation of the global full-batch gradient, i.e., $\frac{1}{P}\sum_{p = 1}^{P}\nabla \mathcal{L}_p^{\mathrm{local}}(\boldsymbol {\theta})\neq \nabla \mathcal{L}(\boldsymbol {\theta})$ . This is because each local machine does not have access to the original input graph and full node feature matrix. Note that the aforementioned equivalence is important for the classical distributed training analysis Dean et al. (2012); Yu et al. (2019). (2) The expectation of the local stochastic gradient is a biased estimation of the local full-batch gradient i.e., $\mathbb{E}[\tilde{\nabla}\mathcal{L}_p^{\mathrm{local}}(\boldsymbol {\theta},\xi_p)]\neq \nabla \mathcal{L}_p^{\mathrm{local}}(\boldsymbol {\theta})$ . This is because the stochastic gradient on each local machine is computed by using neighbor sampling, which has been studied in (Cong et al., 2021).
+
+Theorem 1 (Distributed GCN via Parameter Averaging) Consider applying model averaging for GNN training under Assumption 1 and 2. If we choose learning rate $\eta = \frac{\sqrt{P}}{\sqrt{T}}$ and the local step size $K \leq \frac{\sqrt{2}T^{1/4}}{8L.P^{3/4}}$ , then for any $T \geq L^2P$ steps of gradient updates we have
+
+$$
+\frac {1}{T} \sum_ {t = 0} ^ {T - 1} \mathbb {E} [ \| \nabla \mathcal {L} (\bar {\boldsymbol {\theta}} ^ {t}) \| ^ {2} ] = \mathcal {O} \left(\frac {1}{\sqrt {P T}}\right) + \mathcal {O} (\kappa^ {2} + \sigma_ {b i a s} ^ {2}).
+$$
+
+Theorem 1 implies that, by carefully choosing the learning rate $\eta$ and the local step size $K$ , the gradient norm computed on the virtual averaged model is bounded by $\mathcal{O}(1 / \sqrt{PT})$ after $R = T / K = \mathcal{O}\left(\frac{P^{3/4}}{T^{3/4}}\right)$ communication rounds, but suffers from an irreducible residual error upper bound $\mathcal{O}(\kappa^2 + \sigma_{\mathrm{bias}}^2)$ . In the next section, we show that this residual error can be eliminated by applying server correction.
+
+# 4.3 DISTRIBUTED GCN VIA SERVER CORRECTION
+
+Before proceeding to our result, in order to simplify the presentation, let us first define the notation $G_{\mathrm{global}}^{r} = \min_{t\in \mathcal{T}_{\mathrm{global}}(r)}\mathbb{E}[\| \nabla \mathcal{L}(\bar{\boldsymbol{\theta}}^{t})\|^{2}]$ and $G_{\mathrm{local}}^{r} = \min_{t\in \mathcal{T}_{\mathrm{local}}(r)}\mathbb{E}\left[\left\| \frac{1}{P}\sum_{p = 1}^{P}\nabla \mathcal{L}_{p}^{\mathrm{local}}(\boldsymbol{\theta}_{p}^{t})\right\|^{2}\right]$ as the minimum gradient computed at the $r$ -th round global and local step, where $\mathcal{T}_{\mathrm{global}}(r)$ and $\mathcal{T}_{\mathrm{local}}(r)$ are the number of iteration run after the $r$ -th communication round on server and local machine, respectively. Please refer to Eq. 42 in Appendix C.2 for a formal definition.
+
+Theorem 2 Consider applying model averaging for GCN training under Assumption 1 and 2. If we choose learning rate $\gamma = \eta = \frac{\sqrt{P}}{\sqrt{T}}$ , the local step size $K, \rho$ such that $\sum_{r=1}^{R} K^2 \rho^{2r} \leq \frac{RT^{1/2}}{32L^2 P^{3/2}}$ , and server correction step size $S = \max_{r \in [R]} \left( \frac{\kappa^2 + 2 \sigma_{bias}^2}{1 - L(\sqrt{P / T})} - G_{local}^r \right) \frac{K \rho^r}{G_{local}^r}$ , then for any $T \geq L^2 P$ steps of gradient updates we have: $\frac{1}{T} \sum_{t=1}^{T} \mathbb{E}[\| \nabla \mathcal{L}(\bar{\boldsymbol{\theta}}^t) \|^2] = \mathcal{O}\left( \frac{1}{\sqrt{PT}} \right)$ .
+
+Theorem 2 implies that, by carefully choosing the learning rates $\gamma$ and $\eta$ , the local step size hyperparameters $K, \rho$ , and the number of global correction steps $S$ , after $T$ steps ( $R$ rounds of communication), employing parameter averaging with Global Server Correction, we have the norm of gradient bounded by $\mathcal{O}(1 / \sqrt{PT})$ , without suffering the residual error that exists in the naive parameter averaging (in Theorem 1). Besides, the server correction step size is proportional to the scale of $\kappa^2$ and local stochastic gradient bias $\sigma_{\mathrm{bias}}^2$ . The larger $\kappa^2$ and $\sigma_{\mathrm{bias}}^2$ , the more corrections are required to eliminate the residual error. However, in practice, we observe that a very small number of correction steps (e.g., $S = 1$ ) performs well, which minimizes the computation overhead on the server.
+
+# 5 EXPERIMENTS
+
+Real-world simulation. In a real-world distributed setting, the server and local machines are located on different machines, connected through the network (Li et al., 2020a). However, for our experiments, we only have access to a single machine with multiple GPUs. As a result, we simulate a real-world distributed learning scenario, such that each GPU is responsible for the computation of two local machines (8 in total) and the CPU acts as the server. For these reasons, in our evaluations, we opted to report the communication size and number of communication rounds, instead of the wall-clock time, which can show the benefit of distributed training. We argue that these are acceptable measures in real-world scenarios as well since the two main factors in distributed training are initializing connection overhead and bandwidth (Tripathy et al., 2020).
+
+Baselines. To illustrate the effectiveness of LLCG, we setup two general synchronized distributed training techniques as the our baseline methods, namely "Parallel SGD with Parameter Averaging" (PSGD-PA) and "Global Graph Sampling" (GGS), as introduced in Figure 2, where the cut-edges in PSGD-PA are ignored and only the model parameters are transferred, but the cut-edges in GGS are considered and the node features of the cut-edges are transferred to the corresponding machine.
+
+
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(a)
+(e)
+Figure 4: Comparing LLCG against PSGD-PA and GGS on real-world datasets. We show the global validation score in terms of the number of communications in $(a,b,c,d)$ , the training loss per round of communications in $(e,f)$ , and the global validation score per bytes of exchanged data in $(g,h)$ .
+
+
+(f)
+
+
+(g)
+
+
+(h)
+
+Table 1: Comparison of performance and the average Megabytes of node representation/feature communicated per round on various datasets.
+
+ | Method | No. Comm. | GCN / SAGE | GAT | APPNP |
| Performance | Avg. MB | Performance | Avg. MB | Performance | Avg. MB |
| Flickr(F1-score) | PSGD-PA | 50 | 49.08±0.27 | 12.57 | 51.56±0.28 | 4.24 | 50.81±0.48 | 8.40 |
| GGS | 51.22±0.13 | 1849.32 | 52.41±0.29 | 1895.61 | 51.33±0.33 | 1897.82 |
| LLCG | 50.38±0.20 | 12.57 | 52.01±0.33 | 4.24 | 51.15±0.25 | 8.40 |
| OGB-Proteins(ROC-AUC) | PSGD-PA | 100 | 72.85±0.70 | 6.20 | 64.95±1.01 | 3.14 | 71.10±0.79 | 7.31 |
| GGS | 74.78±0.36 | 922.42 | 68.11±0.60 | 912.79 | 71.29±0.31 | 917.20 |
| LLCG | 73.92±0.45 | 6.20 | 67.62±0.58 | 3.14 | 71.18±0.43 | 7.31 |
| OGB-Arxiv(F1-score) | PSGD-PA | 100 | 69.43±0.21 | 3.55 | 69.88±0.18 | 3.59 | 68.48±0.17 | 7.71 |
| GGS | 70.51±0.26 | 3391.03 | 70.82±0.23 | 3396.79 | 69.01±0.10 | 3394.33 |
| LLCG | 70.21±0.13 | 3.55 | 70.58±0.37 | 3.59 | 68.73±0.29 | 7.71 |
| Reddit(F1-score) | PSGD-PA | 75 | 71.17±1.06 | 14.83 | 70.57±1.24 | 7.48 | 83.48±0.81 | 11.63 |
| GGS | 94.77±0.20 | 3798.81 | 95.03±0.48 | 3805.28 | 95.23±0.22 | 3770.46 |
| LLCG | 94.67±0.15 | 14.83 | 94.73±0.23 | 7.48 | 94.64±0.17 | 11.63 |
+
+Note that we choose GGS as a reasonable representation for most existing proposals (Md et al., 2021; Zheng et al., 2020; Tripathy et al., 2020) for distributed GNN training, since these methods have very close communication cost and also require a large cluster of machines to truly show their performance improvement. We also use PSGD-PA as a lower bound for communication size, which is widely used in traditional distributed training and similar to the one used in (Angerd et al., 2020; Jiang & Rumi, 2021). However, we did not specifically include these methods in our results since we could not reproduce their results in our settings. Please refer to Appendix A for a detailed description of implementation, hardware specification and link to our source code.
+
+Datasets and evaluation metric. We compare LLCG and other baselines on real-world semi-supervised node classification datasets, details of which are summarized in Table 2 in the Appendix. The input graphs are split into multiple subgraphs using METIS before training, then the same set of subgraphs are used for all baselines. For training, we use neighborhood sampling (Hamilton et al., 2017) with 10 neighbors sampled per node and $\rho = 1.1$ for LLCG. For a fair comparison, we chose the base local update step $K$ such that LLCG has the same number of local update steps as PSGD-PA. During evaluation, we use full-batch without sampling, and report the performance on the full graph using AUC ROC and F1 Micro as the evaluation metric. Unless otherwise stated, we conduct each experiment five times and report the mean and standard deviation.
+
+# 5.1 PRIMARY RESULTS
+
+In this section, we compare our proposed LLCG algorithm with baselines on four datasets. Due to space limitations we defer the detailed discussion on additional datasets to the Appendix A.4.
+
+LLCG requires same number of communications. Figure 4 (a) through 4 (d) illustrate the validation accuracy per communication rounds on four different datasets. We run a fixed number of communication rounds and plot the global validation score (the validation score computed using the full-graph on the server) at the end of each communication step. For PSGD-PA and GGS, the score is calculated on the averaged model, whereas for LLCG the validation is calculated after the correction
+
+
+Figure 5: Effect of local epoch size $(K)$
+
+
+Figure 6: Effect of sampling on local machine and number of correction steps on the server
+
+
+
+step. It can be seen that PSGD-PA suffers from performance drop compared to other two methods, due to the residual error we discussed in Section 4, while both GGS and LLCG perform well and can achieve the expected accuracy. Note that the performance drop of PSGD-PA can vary across different datasets; in some cases such as Reddit, PSGD-PA can significantly hurt the accuracy, while on other datasets the gap is smaller. Nevertheless, LLCG can always close the gap between PSGD-PA and GGS with minimal overhead.
+
+LLCG convergences as fast as GGS. To represent the effect of communication on the real-time convergence, in Figure 4 (e) and 4 (f), we plot the global training loss (training loss computed on the full-graph on the server) after each communication round. Similar to the accuracy score, the training loss is also computed on the server averaged (and corrected, in case of LLCG) global model. These results clearly indicate that LLCG can improve the convergence over PSGD-PA, while it shows a similar convergence speed to GGS.
+
+LLCG exchanges data as little as PSGD-PA. Figure 4 (g) and 4 (h) show the relation between global validation accuracy with the average size (volume) of communication in bytes. As expected, this figure clearly shows the effectiveness of LLCG. On the one hand, LLCG has a similar amount of communication volume as PSGD-PA but can achieve a higher accuracy. On the other hand, LLCG requires significantly less amount of communication volume than GGS to achieve the same accuracy, which leads to slower training time in real world settings.
+
+LLCG works with various GNN models and aggregations. We evaluate four popular GNN models, used in recent graph learning literature: GCN Kipf & Welling (2017), SAGE Hamilton et al. (2017), GAT Velickovic et al. (2018) and APPNP Klicpera et al. (2019). In Table 1, we summarize the test score and average communication size (in MB) on different datasets for a fixed number of communication rounds. Note that we only include the results for the aggregation methods (GCN or SAGE) that have higher accuracy for the specific datasets, details of which can be found in Appendix A.2. As shown here, LLCG can consistently improve the test accuracy for all different models compared to PSGD-PA, while the communication size is significantly lower than GGS, since LLCG only needs to exchange the model parameters.
+
+Effect of local epoch size. Figure 5 compares the effect of various values of local epoch size $K \in \{1,4,16,64,128\}$ for fixed $\rho$ and $S$ on the OGB-Arxiv dataset. When using fully synchronous with $K = 1$ , the model suffers from very slow convergence and needs more communications. Further increasing the $K$ to larger values can speed up the training; however, we found a diminishing return point for $K > 128$ in this dataset and extremely large $K$ in general.
+
+Effect of sampling in local machines. In Figure 6, we report the validation scores per round of communication to compare the effect of neighborhood sampling at local machines. We can observe that when the neighborhood sampling size is reasonably large (i.e., $20\%$ ), the performance is very similar to full neighborhood training. However, reducing the neighbor sampling ratio to $5\%$ could result in a larger local stochastic gradient bias $\sigma_{\mathrm{bias}}^2$ , which requires using more correction steps $(S)$ .
+
+# 6 CONCLUDING REMARKS
+
+In this paper, we propose a novel distributed algorithm for training Graph Neural Networks (GNNs). We theoretically analyze various GNN models and discover that, unlike the traditional deep neural networks, due to inherent data samples dependency in GNNs, naively applying periodic parameter averaging leads to a residual error and current solutions to this issue impose huge communication overheads. Instead, our proposal tackles these problems by applying correction on top of locally learned models, to infuse the global structure of the graph back into the network and avoid any costly communication. In addition, through extensive empirical analysis, we support our theoretical findings and demonstrate that LLCG can achieve high accuracy without additional communication costs.
+
+# ACKNOWLEDGEMENTS
+
+This work was supported in part by CRISP, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA and NSF grants 1909004, 1714389, 1912495, 1629915, 1629129, 1763681, 2008398.
+
+# REPRODUCIBILITY STATEMENT
+
+We provide a GitHub repository in Appendix A including all code and scripts used in our experimental studies. This repository includes a README.md file, explaining how to install and prepare the code and required packages. Detailed instruction on how to use the partitioning scripts is provided for various datasets. In addition, we provide several configuration files (under scripts/configs) folder for different hyper-parameters on each individual dataset, and a general script (scripts/run-config.py) to run and reproduce the results with these configurations. Details of various models and parameters used in our evaluation studies can also be found in Appendix A.
+
+# REFERENCES
+
+Alexandra Angerd, Keshav Balasubramanian, and Murali Annavaram. Distributed training of graph convolutional networks using subgraph approximation. arXiv preprint arXiv:2012.04930, 2020.
+Paolo Boldi and Sebastiano Vigna. The webgraph framework I: compression techniques. In Proceedings of the 13th international conference on World Wide Web, WWW 2004, New York, NY, USA, May 17-20, 2004, pp. 595-602. ACM, 2004. doi: 10.1145/988672.988752.
+Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Konecný, Stefano Mazzocchi, Brendan McMahan, Timon Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. Towards federated learning at scale: System design. In Proceedings of Machine Learning and Systems 2019, MLSys 2019, Stanford, CA, USA, March 31 - April 2, 2019. mlsys.org, 2019.
+Jianfei Chen, Jun Zhu, and Le Song. Stochastic training of graph convolutional networks with variance reduction. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 941-949. PMLR, 2018.
+Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-gen: An efficient algorithm for training deep and large graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 257-266. ACM, 2019. doi: 10.1145/3292500.3330925.
+Weilin Cong, Rana Forsati, Mahmut T. Kandemir, and Mehrdad Mahdavi. Minimal variance sampling with provable guarantees for fast training of graph neural networks. In KDD '20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, pp. 1393-1403. ACM, 2020.
+Weilin Cong, Morteza Ramezani, and Mehrdad Mahdavi. On the importance of sampling in learning graph convolutional networks. arXiv preprint arXiv:2103.02696, 2021.
+Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc V. Le, Mark Z. Mao, Marc'Aurelio Ranzato, Andrew W. Senior, Paul A. Tucker, Ke Yang, and Andrew Y. Ng. Large scale distributed deep networks. In Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States, pp. 1232-1240, 2012.
+Songgaojun Deng, Huzefa Rangwala, and Yue Ning. Learning dynamic context graphs for predicting social events. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 1007-1016. ACM, 2019. doi: 10.1145/3292500.3330919.
+
+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. ACM, 2019. doi: 10.1145/3292500.3330958.
+Faezeh Faez, Yassaman Ommi, Mahdieh Soleymani Baghshah, and Hamid R Rabiee. Deep graph generators: A survey. IEEE Access, 9:106675-106702, 2021.
+Alex Fout, Jonathon Byrd, Basir Shariat, and Asa Ben-Hur. Protein interface prediction using graph convolutional networks. 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. 6530-6539, 2017.
+Mahsa Ghorbani, Anees Kazi, Mahdieh Soleymani Baghshah, Hamid R Rabiee, and Nassir Navab. Ra-gcn: Graph convolutional network for disease prediction problems with imbalanced data. Medical Image Analysis, 75:102272, 2022.
+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.
+Andrew Hard, Kanishka Rao, Rajiv Mathews, Swaroop Ramaswamy, Françoise Beaufays, Sean Augenstein, Hubert Eichner, Chloe Kiddon, and Daniel Ramage. Federated learning for mobile keyboard prediction. arXiv preprint arXiv:1811.03604, 2018.
+Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
+Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. Ogb-lsc: A large-scale challenge for machine learning on graphs. arXiv preprint arXiv:2103.09430, 2021.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp. 448-456. JMLR.org, 2015.
+Peng Jiang and Masuma Akter Rumi. Communication-efficient sampling for distributed training of graph convolutional networks. arXiv preprint arXiv:2101.07706, 2021.
+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. OpenReview.net, 2017.
+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. OpenReview.net, 2019.
+Jakub Konečný, H. Brendan McMahan, X. Yu Felix, Ananda Theertha Suresh, Dave Bacon, and Peter Richtárik. Federated learning: Strategies for improving communication efficiency. 2018.
+Guohao Li, Matthias Müller, Ali K. Thabet, and Bernard Ghanem. Deep GCNs: Can GCNs go as deep as cnns? In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 9266-9275. IEEE, 2019. doi: 10.1109/ICCV.2019.00936.
+Shen Li, Yanli Zhao, Rohan Varma, Omkar Salpekar, Pieter Noordhuis, Teng Li, Adam Paszke, Jeff Smith, Brian Vaughan, Pritam Damania, et al. Pytorch distributed: Experiences on accelerating data parallel training. arXiv preprint arXiv:2006.15704, 2020a.
+
+Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of fedavg on non-iid data. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020b.
+Bill Yuchen Lin, Chaoyang He, Zihang Zeng, Hulin Wang, Yufen Huang, Mahdi Soltanolkotabi, Xiang Ren, and Salman Avestimehr. Fednlp: A research platform for federated learning in natural language processing. arXiv preprint arXiv:2104.08815, 2021.
+Vasimuddin Md, Sanchit Misra, Guixiang Ma, Ramanarayan Mohanty, Evangelos Georganas, Alexander Heinecke, Dhiraj Kalamkar, Nesreen K Ahmed, and Sasikanth Avancha. Distgnn: Scalable distributed training for large-scale graph neural networks. arXiv preprint arXiv:2104.06700, 2021.
+Morteza Ramezani, Weilin Cong, Mehrdad Mahdavi, Anand Sivasubramaniam, and Mahmut Kandemir. Gcn meets gpu: Decoupling "when to sample" from "how to sample". Advances in Neural Information Processing Systems, 33, 2020.
+Simone Scardapane, Indro Spinelli, and Paolo Di Lorenzo. Distributed graph convolutional networks. arXiv preprint arXiv:2007.06281, 2020.
+Hyejin Shin, Sungwook Kim, Junbum Shin, and Xiaokui Xiao. Privacy enhanced matrix factorization for recommendation with local differential privacy. IEEE Transactions on Knowledge and Data Engineering, 30(9):1770-1782, 2018.
+Sebastian U. Stich. Local SGD converges fast and communicates little. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
+Chuxiong Sun and Guoshi Wu. Adaptive graph diffusion networks with hop-wise attention. arXiv preprint arXiv:2012.15024, 2020.
+Chuxiong Sun and Guoshi Wu. Scalable and adaptive graph neural networks with self-label-enhanced training. arXiv preprint arXiv:2104.09376, 2021.
+Alok Tripathy, Katherine Yelick, and Aydin Buluc. Reducing communication in graph neural network training. arXiv preprint arXiv:2005.03300, 2020.
+Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
+Jizhe Wang, Pipei Huang, Huan Zhao, Zhibo Zhang, Binqiang Zhao, and Dik Lun Lee. Billion-scale commodity embedding for e-commerce recommendation in alibaba. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2018, London, UK, August 19-23, 2018, pp. 839-848. ACM, 2018. doi: 10.1145/3219819.3219869.
+Chuhan Wu, Fangzhao Wu, Yang Cao, Yongfeng Huang, and Xing Xie. Fedgnn: Federated graph neural network for privacy-preserving recommendation. arXiv preprint arXiv:2102.04925, 2021.
+Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L. Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2018, London, UK, August 19-23, 2018, pp. 974-983. ACM, 2018. doi: 10.1145/3219819.3219890.
+Hao Yu, Sen Yang, and Shenghuo Zhu. Parallel restarted sgd with faster convergence and less communication: Demystifying why model averaging works for deep learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5693-5700, 2019.
+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. OpenReview.net, 2020.
+
+Qingru Zhang, David Wipf, Quan Gan, and Le Song. A biased graph neural network sampler with near-optimal regret. arXiv preprint arXiv:2103.01089, 2021.
+Da Zheng, Chao Ma, Minjie Wang, Jinjing Zhou, Qidong Su, Xiang Song, Quan Gan, Zheng Zhang, and George Karypis. Distdgl: Distributed graph neural network training for billion-scale graphs. arXiv preprint arXiv:2010.05337, 2020.
+Difan Zou, Ziniu Hu, Yewen Wang, Song Jiang, Yizhou Sun, and Quanquan Gu. Layer-dependent importance sampling for training deep and large graph convolutional networks. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 11247-11256, 2019.
\ No newline at end of file
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/images.zip b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cdd3780c88e3de4f190721a04a1027e4a9d41d04
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:45f92bfe09ce22eefd96ffe77ba74a66dcea9359dcba977fe8eb954c29256751
+size 304648
diff --git a/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/layout.json b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f4d229a49cb2f55ddddfc87158e95781c378ea39
--- /dev/null
+++ b/learnlocallycorrectgloballyadistributedalgorithmfortraininggraphneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3efbbbc6cbfb15b930789dde74807480b520328c952a18ac064ef905ba05ae2f
+size 501516
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_content_list.json b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6f690db992c3eb25f53a5a5f1f66f3dd15ff90d4
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f27c2c80c8080aeb567639f326bc28171d1ccc38548321b1f9926074aa8ee79
+size 96095
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_model.json b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..6526a345619a2a4864020efb2541fe801a828ebf
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0f5f0c051958256b1a5913ed72615f66c86c7479d4545d60da74bd7bf5e51f9
+size 118308
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_origin.pdf b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..b1e30ad1e7f6126a53c2a606b962e9f004d35780
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/be7dde6d-edb9-409c-a113-47b12d8b7765_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f7f8c928a44c0e46124468641872ec7b897fba999309a6f7db5cf96f31b62f64
+size 717764
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/full.md b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1b705ed7830ea2bf06af0cee02c2edcd850f41de
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/full.md
@@ -0,0 +1,362 @@
+# LFPT5: A UNIFIED FRAMEWORK FOR LIFELONG FEW-SHOT LANGUAGE LEARNING BASED ON PROMPT TUNING OF T5
+
+Chengwei Qin\* and Shafiq Joty\*
+
+\* Nanyang Technological University
+$\spadesuit$ Salesforce Research
+
+{chengwei003@e.ntu, srjoty@ntu}.edu.sg
+
+# ABSTRACT
+
+Existing approaches to lifelong language learning rely on plenty of labeled data for learning a new task, which is hard to obtain in most real scenarios. Considering that humans can continually learn new tasks from a handful of examples, we expect the models also to be able to generalize well on new few-shot tasks without forgetting the previous ones. In this work, we define this more challenging yet practical problem as Lifelong Few-shot Language Learning (LFLL) and propose a unified framework for it based on prompt tuning (PT) of T5. Our framework called LFPT5 takes full advantage of PT's strong few-shot learning ability, and simultaneously trains the model as a task solver and a data generator. Before learning a new domain of the same task type, LFPT5 generates pseudo (labeled) samples of previously learned domains, and later gets trained on those samples to alleviate forgetting of previous knowledge as it learns the new domain. In addition, a KL divergence loss is minimized to achieve label consistency between the previous and the current model. While adapting to a new task type, LFPT5 includes and tunes additional prompt embeddings for the new task. With extensive experiments, we demonstrate that LFPT5 can be applied to various different types of tasks and significantly outperform previous methods in different LFLL settings.
+
+# 1 INTRODUCTION
+
+A hallmark of human intelligence is that they can learn new tasks quickly by leveraging previously acquired knowledge from other related tasks, and they do so without forgetting prior knowledge. However, despite the monumental success of deep learning in recent years, models face challenges to retain and accumulate knowledge when learning new tasks due to the shift of data distribution – they run into the overfitting issue when the data for the new task is small and they forget prior knowledge, a phenomenon known as catastrophic forgetting (McCloskey & Cohen, 1989).
+
+Researchers in Lifelong Learning (Thrun & Mitchell, 1995) have proposed a number of methods to alleviate the above issues with machine learning. When it comes to language, earlier approaches to Lifelong Language Learning (LLL) merely focus on a single type of NLP tasks (Wang et al., 2019; d'Autume et al., 2019); see (Biesialska et al., 2020) for a survey. In contrast, humans can easily handle tasks that vary with respect to not only domain but also task type (Figure 1). More recent methods attempt to learn from different types of tasks. These include LAMOL (Sun et al., 2019) and its improvements (Chuang et al., 2020; Sun et al., 2020; Kanwatchara et al., 2021). Despite the effectiveness of these methods in LLL, there are several limitations. First, they all assume plenty of training data for every task which is hard to acquire in most real scenarios as getting large labeled datasets is often expensive and time-consuming. Second, they mainly consider tasks from the decaNLP challenge (McCann et al., 2018) that can be easily framed as question answering (Kumar et al., 2016), paying little attention to sequence labeling tasks such as Name Entity Recognition (NER). Finally, they fine-tune the entire model for all tasks ignoring the possibility of negative transfer (Lopez-Paz & Ranzato, 2017) between different types of tasks.
+
+Our work in this paper aims to address these limitations of LLL. We focus on a more challenging yet more practical problem where the model needs to generalize well on new few-shot tasks without forgetting the previous ones. We regard this as Lifelong Few-shot Language Learning (LFLL) and investigate three different kinds of tasks: sequence labeling tasks, text classification tasks and text generation tasks.
+
+Based on the strong few-shot learning ability of prompt tuning (Lester et al., 2021) of T5 (Raffel et al., 2019), we propose a unified framework for LFLL, named LFPT5 (Lifelong Few-shot Language Learning with Prompt Tuning of T5). Specifically, we reframe all types of tasks into a text-to-text format (Figure 2). To continually learn new domains of a task, we simultaneously train the prompt embeddings designed for this task type as a task solver and a data generator keeping the backbone T5 frozen. When LFPT5 goes about learning a new domain, it first generates pseudo labeled samples of previously learned domains, which are then combined with the new domain training data to alleviate catastrophic forgetting. To achieve label consistency between the previous and the current model, LFPT5 also minimizes a KL divergence loss. For the adaptation from one task
+
+
+Figure 1: Two different dimensions of lifelong language learning. The horizontal axis (Domain) indicates tasks of the same type (e.g., NER), whereas the vertical axis (Task) indicates different kinds of tasks.
+
+type to another, LFPT5 includes additional prompt embeddings for the new task, and tunes them similarly. In this way the learning of new tasks minimally affects previously acquired knowledge, mitigating the catastrophic forgetting problem. In the whole learning process, the pre-trained T5 acts as a meta-learned model (Brown et al., 2020) that is kept frozen, while the tunable soft prompt acts as a task or domain adaptation model. In summary, our main contributions are:
+
+- To the best of our knowledge, we are the first to consider LFLL, a challenging yet practical problem. We propose LFPT5, a unified framework for LFLL based on prompt tuning of T5. LFPT5 can generalize well on various new few-shot tasks without severe forgetting of previously acquired knowledge, which can be seen as an important step towards general language intelligence.
+- With extensive experiments and analysis, we demonstrate that LFPT5 outperforms previous baselines by a large margin. We have open-sourced our code base at https://github.com/qcwhtu/Lifelong-Fewshot-Language-Learning.
+
+# 2 RELATED WORK
+
+# 2.1 LIFE LONG LEARNING
+
+In lifelong learning (LL), the model is expected to learn sequentially from a stream of tasks with different data distributions. The main problem in LL is catastrophic forgetting (McCloskey & Cohen, 1989) – the model forgets previously acquired knowledge after learning a new task. Prior approaches to LL can be divided into three categories. First, architecture-based methods dynamically adjust the model architecture to learn new knowledge while preventing the forgetting of previously learned tasks (Chen et al., 2015; Rusu et al., 2016; Mallya et al., 2018). Second, regularization-based methods constrain the update of parameters that are important to the learned tasks to retain previous knowledge (Li & Hoiem, 2017; Kirkpatrick et al., 2017; Aljundi et al., 2018). Third, memory-based methods keep a number of key samples from previous tasks in memory to alleviate forgetting (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2018; d'Autume et al., 2019). These methods for LL mostly focus on tasks of the same type (referred as domains in this work). Recently, Sun et al. (2019) proposes LAMOL, a general framework designed for lifelong language learning (LLL), where the model needs to continually learn from different domains as well as different types of NLP tasks.
+
+# 2.2 FEW-SHOT LEARNING
+
+Few-shot learning (FL) aims to learn tasks with a few labeled examples. Due to the scarcity of labeled training data, FL faces the problem of over-fitting. Existing methods to overcome over
+
+fitting include: (i) model-based methods that explore how to reduce the hypothesis space of the few-shot task (Triantafillou et al., 2017; Hu et al., 2018), (ii) data-based methods that try to augment additional data to the few-shot set (Benaim & Wolf, 2018; Gao et al., 2020b), and (iii) algorithm-based solutions that aim to improve strategies for searching for the best hypothesis. Recently, a new paradigm introducing prompts achieves promising results for few-shot language learning as shown by GPT-3 (Brown et al., 2020), PET (Schick & Schütze, 2020) and LM-BFF (Gao et al., 2020a).
+
+# 2.3 PROMPT-BASED LEARNING
+
+Brown et al. (2020) first show that a GPT-3 frozen model can achieve impressive few-shot results through manually designed prompts that provide a natural language description of the task. Since then many efforts have been made on prompt-based learning (PL). In general, PL modifies the original input, often adding a task-specific template or prompt, which usually contains some unfilled slots to let a pre-trained language model probabilistically generate a textual response, from which the final model output can be derived (Liu et al., 2021b). The ongoing research on PL has explored (i) methods of prompt designing, including discrete prompts (Schick & Schütze, 2020; Shin et al., 2020; Tam et al., 2021) and continuous or soft prompts (Li & Liang, 2021; Liu et al., 2021c; Lester et al., 2021), (ii) applications of PL (Han et al., 2021; Ben-David et al., 2021; Ding et al., 2021), and analysis of prompt-based learning (Liu et al., 2021a; Le Scao & Rush, 2021; Zhong et al., 2021).
+
+Summary. Existing work in lifelong language learning aims to learn from a stream of NLP tasks with plenty of training data, while the research in few-shot learning explores how to generalize well on few-shot tasks. In contrast, we focus on a more challenging yet more practical problem lifelong few-shot language learning (LFLL), where the model is expected to continually learn from a stream of few-shot tasks while avoiding overfitting on the new task and forgetting of previously acquired knowledge. We regard LFLL as an important step towards general language intelligence and propose LFPT5 which takes full advantage of the strong few-shot learning ability of prompt tuning.
+
+# 3 METHODOLOGY
+
+In this section, we first formally define the LFLL problem with the two different adaption dimensions of domains and tasks, and then illustrate how we reframe all types of tasks considered in this work into a text-to-text format in T5. Finally, we present the details of our framework LFPT5.
+
+# 3.1 PROBLEM FORMULATION
+
+As shown in Figure 1, we identify two different dimensions of LFLL: learning of new tasks that are of the same type but potentially of different domains (STDD), and learning of new tasks that are of different types (DT). Specifically, STDD involves learning from a stream of domains $\mathbb{D} = (\mathcal{D}^1,\dots ,\mathcal{D}^n)$ that belong to the same type of few-shot task $\mathcal{T}$ , such as NER learning from CoNLL03 (Sang & De Meulder, 2003) and subsequently from OntoNotes (Hovy et al., 2006). Each task domain $\mathcal{D}^k$ has its own training set $S_{\mathrm{train}}^k$ , validation set $S_{\mathrm{valid}}^k$ , and test set $S_{\mathrm{test}}^k$ . After the training on $S_{\mathrm{train}}^k$ , the model is expected to perform well on all the $k$ domains that it has learned so far and will be evaluated with the same evaluation metric(s) on the combined test set $\hat{S}_{\mathrm{test}}^k = \bigcup_{i = 1}^k S_{\mathrm{test}}^i$ .
+
+Different from STDD, in the DT dimension, the model is expected to continually learn from a sequence of different types of few-shot tasks $\mathbb{T} = (\mathcal{T}^1,\dots ,\mathcal{T}^m)$ , such as learning of NER (sequence labeling), then text classification, and subsequently text summarization (generation). After learning of $\mathcal{T}^k$ , the model will be evaluated on the test set $S_{\mathrm{test}}^{i}$ of every learned task $\mathcal{T}^i$ separately for $1\leq i\leq k$ as the evaluation metrics for different kinds of tasks might be different.
+
+In both dimensions of LFLL, we assume that the validation set $S_{\mathrm{valid}}^k$ has the same size as the few-shot training set $S_{\mathrm{train}}^k$ , that is, $|S_{\mathrm{valid}}^k| = |S_{\mathrm{train}}^k|$ . The set up of using a few-shot validation set is aligned with the overall goal of generalizing well on new tasks with limited labeled data.
+
+# 3.2 LIFE LONG FEW-SHOT LANGUAGE LEARNING WITH PROMPT TUNING OF T5 (LFPT5)
+
+Without loss of generality, let $\mathcal{D}_{\mathrm{task}}$ denote the training dataset for any new few-shot task and $\mathcal{D}_{\mathrm{pre}}$ denote a large-scale pre-training dataset. Our goal is to learn a model $\phi$ for the task. Formally,
+
+$$
+\begin{array}{l} \arg \max \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \mathcal {D} _ {\text {p r e}}) \approx \arg \max \left[ \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \theta) + \log p (\theta | \mathcal {D} _ {\text {p r e}}) \right] \tag {1} \\ \phi \quad \phi \\ \end{array}
+$$
+
+
+Figure 2: Task formulation for Named Entity Recognition (NER), classification and summarization.
+
+where $\theta$ is a prior pre-trained model, more specifically, a point estimate of the pre-trained model (see A.1). The adaptation task for LFLL thus boils down to solving: $\arg \max_{\phi} \log p(\phi | \mathcal{D}_{\text{task}}, \theta)$ . Traditionally, this has been done through fine-tuning $\theta$ . However, fine-tuning the entire model effectively on small few-shot tasks could be challenging and may lead to overfitting (Howard & Ruder, 2018).
+
+Brown et al. (2020) show that a large-scale pre-trained model (a frozen GPT-3) can act as a black-box meta-learner (Chen et al., 2017) and yield impressive few-shot performance via manually designed prompts constructed with task descriptions and some canonical examples. As model size continues to increase (often in billions), it is indeed more appealing to have a single generalist model to perform multiple different tasks simultaneously rather than having a separate copy for each task. However, as Lester et al. (2021) pointed out manual prompt engineering may have several key limitations including the human labor involved in the design process which can also be subjective and error-prone, and its rigidity with respect to the maximum sequence length supported by the model. Furthermore, the manual design assumes knowing the task in advance, which limits its applicability to lifelong learning where the next task to learn may not be known in advance.
+
+In our work for LLFL, we adopt the idea of prompt tuning proposed by Lester et al. (2021). We freeze the pre-trained model $\theta$ and prepend a series of tunable tokens $P$ , parameterized by $\phi$ (namely, prompt embeddings), to the input sequence and optimize $\log p(\phi | \mathcal{D}_{\text{task}}, \theta)$ through gradient descent. We use T5 (Raffel et al., 2019) as the pre-trained meta model, and the prompt embeddings are initialized with the embeddings drawn from the vocabulary of T5.
+
+Prompt tuning is a simple yet effective approach for learning many tasks as it only requires learning a small number of prompt embeddings for each task. In addition, as the prompt embeddings can condense the signal from the training data and exploit the huge amount of meta knowledge contained in the frozen T5 model, prompt tuning also shows impressive results in few-shot learning. These two advantages naturally make prompt tuning a good choice for LFLL.
+
+# 3.2.1 TASK FORMULATION & ADAPTATION
+
+We consider three typical task types in NLP: sequence labeling (e.g., NER), text classification and text generation (e.g., summarization). Inspired by (Raffel et al., 2019; Lester et al., 2021), we reframe all tasks into a text-to-text format as shown in Figure 2. We denote the input text as $X$ and the output text as $Y$ . The training objective for a task with dataset $\mathcal{D}_{\mathrm{task}} = \{(X_1, Y_1), \ldots, (X_n, Y_n)\}$ :
+
+$$
+\mathcal {L} _ {\phi} ^ {\text {t a s k}} = - \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \theta) = - \sum_ {i = 1} ^ {n} \log p \left(Y _ {i} \mid [ P, X _ {i} ], \phi , \theta\right) \tag {2}
+$$
+
+Where $P$ are the prompt tokens pre-pended to the input and $\phi$ denote their embeddings. Wang et al. (2019) show that memory-based methods where the model preserves some key samples from previous tasks in memory to overcome forgetting, are more effective for lifelong learning in NLP than the other two kinds, architecture and regularization based methods (§2.1). Instead of using an external memory module, we tune our task prompts such that the model simultaneously acts as a task solver and a generator. The generation capability allows the model to generate pseudo samples of previously learned tasks that the current model can use to "refresh" its prior task knowledge.
+
+When training as a task solver, the model learns to decode the output text $(Y)$ after reading the original input text $(X)$ . We call this input-output format TASK format. For sequence labeling, the output text is split into segment-label pairs by a special token ‘;’, and the text segment and its label in a pair are separated by another special token ‘!’. For classification, we convert the original label into a natural language description as the output text, e.g., converting the review score 5 into ‘wonderful’ for sentiment analysis. For text generation, we simply use the target text as the output text.
+
+
+Figure 3: Illustration of the learning process of LFPT5 for different task domains and task types. For learning new domains, LFPT5 simultaneously trains the prompt embeddings as a task solver and a data generator. When a new domain comes, it first generates pseudo samples of previous domains which will be combined with new data for training to mitigate the forgetting of learned knowledge. A KL divergence loss is also optimized to achieve label consistency between the previous and current model. To learn a new task type, LFPT5 includes and tunes additional prompt embeddings for the new task while keeping the previous embeddings frozen.
+
+When training as a data generator, the model learns to generate $X$ as well as $Y$ given a task-specific generation token as input; we call this GEN format. We use different generation tokens for different types of tasks and different domains to guide the model to generate pseudo samples for a specific task, such as 'GEN_ner1' for CoNLL NER, 'GEN_ner2' for OntoNotes NER and 'GEN_class1' for AGNews classification. In addition, we insert one special token '__split__' between $X$ and $Y$ . During inference, the generated pseudo samples which do not contain this special token are discarded. The data generation or language modeling (LM) loss can be expressed as:
+
+$$
+\mathcal {L} _ {\phi} ^ {\mathrm {l m}} = - \sum_ {i = 1} ^ {n} \log p ([ X _ {i}, Y _ {i} ] | [ G, P ], \phi , \theta) \tag {3}
+$$
+
+Where $G$ is a task-specific generation token added to the prompt $P$ . The training objective with the TASK and LM losses becomes: $\mathcal{L}_{\phi} = \mathcal{L}_{\phi}^{\mathrm{task}} + \lambda_{\mathrm{lm}}\mathcal{L}_{\phi}^{\mathrm{lm}}$ , where $\lambda_{\mathrm{lm}}$ is the weight of the LM loss. Figure 3 illustrates the complete learning process of LFPT5 for new domains and task types.
+
+Adapting to New Domains Before learning on a new domain $\mathcal{D}^k$ , LFPT5 first generates pseudo samples $(\tilde{X},\tilde{Y})$ of previous domains $\mathcal{D}^1,\ldots ,\mathcal{D}^{k - 1}$ using the corresponding generation token in the input prompt, which will be replayed later to alleviate forgetting of learned knowledge. To achieve label consistency on the pseudo samples, we also minimize a KL divergence loss between the previous and current models for the output tokens. More formally,
+
+$$
+\mathcal {L} _ {\phi} ^ {\mathrm {K L}} = \sum_ {i = 1} ^ {m} \sum_ {j = 1} ^ {t} D _ {\mathrm {K L}} \left(p _ {j} \left(\mathcal {V} \right| [ P, \tilde {X} _ {i} ], \phi^ {\prime}, \theta) \mid \mid p _ {j} \left(\mathcal {V} \right| [ P, \tilde {X} _ {i} ], \phi , \theta)\right) \tag {4}
+$$
+
+where $m$ is the number of pseudo samples, $t$ is the number of tokens in $\tilde{Y}_i$ , $\mathcal{V}$ is the T5 vocabulary and $\phi'$ is the prompt embeddings of the previous model.
+
+The overall loss that LFPT5 optimizes for adapting to new domains is: $\mathcal{L}_{\phi} = \mathcal{L}_{\phi}^{\mathrm{task}} + \lambda_{\mathrm{lm}}\mathcal{L}_{\phi}^{\mathrm{lm}} + \lambda_{\mathrm{kl}}\mathcal{L}_{\phi}^{\mathrm{KL}}$ where $\lambda_{\mathrm{kl}}$ is the weight of KL divergence loss.
+
+Adapting to New Task Types In order to learn a new task type $\mathcal{T}_k$ while not forgetting the acquired knowledge of previous tasks $\mathcal{T}_1, \ldots, \mathcal{T}_{k-1}$ , we include an additional set of prompt tokens for the new task and fine-tune their embeddings while keeping the old ones frozen. This is indeed an instance of dynamically expandable network (Yoon et al., 2017), where each task type has its own dedicated prompt. The embedding of the new prompt tokens can be initialized with the learned embeddings from a previous task to avoid forgetting and to have a better task prior. We define 300 tunable tokens per task prompt, meaning that we only add about $0.04\%$ of the parameters of the pretrained T5 when learning a new task type. Compared with previous lifelong learning frameworks which fine-tune the entire model for all tasks ignoring the negative transfer between different types of tasks, LFPT5 shows significant superiority, and it can also achieve better results than multitask learning (§4.4).
+
+# 4 EXPERIMENTS
+
+# 4.1 EXPERIMENT SETUP
+
+Tasks, Datasets and Metrics Three different types of tasks are investigated in our work: NER as an instance of sequence labeling, text classification, and summarization as an instance of text generation. For NER, we use CoNLL03 (Sang & De Meulder, 2003) and OntoNotes (Hovy et al., 2006) as different domains. For classification, we conduct experiments on four different datasets/domains: AGNews for news classification (Zhang et al., 2015), Amazon Review for sentiment analysis (McAuley et al., 2015), DBPedia for Wikipedia article classification into topics (Lehmann et al., 2015), and Yahoo for QA categorization (Zhang et al., 2015). The datasets for summarization include CNNDM containing CNN/DM news (Nallapati et al., 2016), WikiHow containing how-to instructions (Koupaee & Wang, 2018) and Xsum containing BBC news (Narayan et al., 2018).
+
+We conduct 16-shot learning for NER and classification based on Gao et al. (2020a), i.e., there are 16 samples per class in the training and validation sets. For summarization, we sample 64 examples for training and validation per domain (see A.9 for details). For pseudo data, LFPT5 generates 2 samples per learned class for NER and classification, and 4 samples per learned domain for summarization. The evaluation metrics of NER, classification and summarization are F1, accuracy and ROUGE scores, respectively. As the task order and few-shot data might influence the performance, we run every experiment 3 times with different random seeds and report the mean results.
+
+Methods Compared We use T5-Large as the backbone model and compare our LFPT5 with the following methods in the experiments for learning new domains of a task:
+
+- Fine-tuning (FT) tunes the whole T5 model during the LFLL process. We include this method as fine-tuning is still the dominant paradigm in NLP.
+- Prompt tuning (PT) continually tunes the prompt embeddings while learning on different domains. PT does not include LM and KL objectives and does not generate pseudo samples.
+- EWC (Kirkpatrick et al., 2017) and MAS (Aljundi et al., 2018) are two regularization-based lifelong learning methods requiring no extra memory. They constrain the update of parameters that are important to the learned tasks to retain previous knowledge. We apply these two methods to both PT and FT, and get four distinct methods: EWC-PT, MAS-PT, EWC-FT and MAS-FT.
+- Prompt tuning with real data (PT-R) selects the same number of randomly selected real samples from the learned domains as the generated pseudo samples in LFPT5. These samples are used as memory data which is replayed during the learning of the new domain. PT-R resembles a 'real' memory-based LFLL model with prompt tuning and its performance can be used to compare the quality of the pseudo samples generated by LFPT5.
+- Multitask prompt tuning (MT-PT) simultaneously trains on all the domains together with the combined data. It serves as an upper bound for LFPT5 which can use only the new domain data.
+
+In addition, we report experiments with a different backbone model (T5-Base), different numbers of few-shot data and different number of pseudo samples in Appendix A.4, A.5 and A.6, respectively.
+
+For adapting to new task types, we compare LFPT5 with multitask fine-tuning (MT-FT), MT-PT and AdapterFusion (Pfeiffer et al., 2021) which learns a task-specific composition of adapters from previous tasks.
+
+# 4.2 SINGLE TASK RESULTS
+
+To assess the learning ability of prompt tuning, we first compare single task few-shot results for T5 fine-tuning (T5-FT), T5 prompt tuning (T5-PT) and BERT-Large fine-tuning on NER and classifica
+
+| Method | NER | Text classification |
| CoNLL03 | OntoNotes | AGNews | Amazon | DBPedia | Yahoo |
| SoTA (full-shot) | 94.6 | 92.07 | 95.55 | 65.83 | 99.38 | 77.62 |
| BERT-Large | 62.67±1.34 | 63.55±1.68 | 82.33±1.66 | 40.47±1.39 | 97.29±0.61 | 59.97±2.25 |
| T5-FT | 53.74±1.20 | 55.15±0.70 | 83.17±2.60 | 48.80±2.05 | 98.19±0.19 | 50.07±21.84 |
| T5-PT | 68.40±1.24 | 61.23±2.14 | 85.33±1.05 | 43.73±0.41 | 97.36±0.52 | 65.67±2.03 |
+
+Table 1: Results on single few-shot tasks on NER (F1 score) and text classification (accuracy).
+
+tion in Table 1, while Figure 4 shows the comparison between T5-FT and T5-PT on summarization. We also report the state-of-the-art (SoTA) results for the original full-shot training for each task.
+
+We can see that the performance of T5-PT is quite good compared with BERT-Large and T5-FT. T5-FT overfits on several few-shot tasks (CoNLL03, OntoNotes and Yahoo) and achieves poor results. PT significantly improves these results as it requires to tune only the prompt embeddings. In particular, T5-PT achieves better results than fine-tuned BERT-Large in all cases except OntoNotes NER. Similarly, on summarization, T5-PT achieves better performance than T5-FT in all measures across the datasets except ROUGE-1 on WikiHow. These results suggest that PT has the potential for LFLL if we can solve the catastrophic forgetting problem well.
+
+
+Figure 4: Results for T5 prompt tuning (PT) and T5 fine-tuning (FT) on summarization (ROUGE scores).
+
+# 4.3 RESULTS FOR LEARNING NEW DOMAINS
+
+NER The LFLL results on the NER domains are shown in Table 2. We report the final F1 score on the whole test set after learning all domains. We observe that EWC and MAS achieve slightly better results than simply fine-tuning the parameters, meaning the catastrophic forgetting problem is still severe. LFPT5 outperforms these two regularization-based lifelong learning methods by a large margin, which demonstrates the superiority of our method.
+
+| Method | Fine-tuning | EWC-Fine-tuning | MAS-Fine-tuning | Prompt tuning-Real | MT-Prompt tuning |
| F1 | 43.07±1.48 | 43.53±1.7 | 43.63±1.9 | 48.72±0.9 | 54.32±0.88 |
| Method | | Prompt tuning | EWC-Prompt tuning | MAS-Prompt tuning | LFPT5 |
| F1 | | 44.34±0.46 | 44.68±1.4 | 45.091±.45 | 47.59±2.16 |
+
+Comparing the results of PT- and FT-based methods, we can find that PT-based methods show better performance, which can be interpreted by two factors: (i) PT has stronger ability than FT for few-shot learning of new domains. (ii) The knowledge of the two domains is not so difficult to transfer from one to the other as there are some overlaps between the label spaces. So even if PT needs to continually learn knowledge from different domains with much fewer tunable parameters than FT, it can successfully do so and outperform FT. PT-R performs better than LFPT5, which means that the quality of generated pseudo samples could be further improved. In addition, there is a performance gap between LFPT5 and MT-PT, indicating there still remains room for improvement.
+
+Table 2: F1 score on the whole test set after learning all NER domains (CoNLL03, OntoNotes).
+
+| Method | Fine-tuning | EWC- Fine-tuning | MAS-Fine-tuning | Prompt tuning-Real | MT-Prompt tuning |
| Accuracy | 40.11±7.76 | 40.60±3.02 | 40.79±6.09 | 67.23±1.36 | 76.08±0.77 |
| Method | | Prompt tuning | EWC-Prompt tuning | MAS-Prompt tuning | LFPT5 |
| Accuracy | | 28.47±9.65 | 29.09±8.92 | 29.46±8.97 | 52.71±4.19 |
+
+Table 3: Accuracy on the whole test set after learning all domains (AGNews, Amazon, DBPedia, Yahoo).
+
+Text Classification Table 3 shows the classification results on the whole test set after learning the four domains. We can see that LFPT5 achieves significant improvements compared with previous lifelong learning methods. For text classification, a significant difference from NER is that FT-based methods show much better performance than PT-based methods. We analyse the reasons as follows. The label space of the four domains is quite different, which makes it hard to transfer knowledge across different domains. So retaining and accumulating knowledge during the learning of different domains is pretty challenging for the PT-based methods as they have only a few tunable parameters. Acquiring of new information can easily cause forgetting of previously learned knowledge. Compared with PT, there are much more tunable parameters in FT, improving its ability to accommodate knowledge from different domains. Even though LFPT5 is based on PT, it can overcome such limitations by learning to remember consistently from its own generated pseudo samples.
+
+In Appendix A.3, we additionally evaluate how LFPT5 performs compared to the baselines for a large number of different tasks (domains) by considering 5 NLI tasks and combine them with the
+
+original 4 classification tasks to form a longer sequence of 9 classification tasks. These results verify that LFPT5 performs much better than previous baselines when learning from many tasks.
+
+| Method | Fine-tuning | EWC- Fine-tuning | MAS-Fine-tuning | Prompt tuning-Real | MT-Prompt tuning |
| A-RG | 15.71±1.35 | 15.91±1.46 | 15.76±1.71 | 17.48±0.25 | 19.78±0.70 |
| Method | | Prompt tuning | EWC-Prompt tuning | MAS-Prompt tuning | LFPT5 |
| A-RG | | 15.67±0.24 | 15.85±0.15 | 15.79±0.09 | 17.05±0.92 |
+
+Summarization For summarization, we find that the generated pseudo summaries (that follow the generated pseudo source documents) are often ambiguous. This could be because summarization has a large search space and is often an underconstrained task for the model as showed by Kryscinski et al. (2019). As the leading three sentences (a.k.a. Lead-3) already construct a strong baseline for summarization (especially for news articles), we use the leading three sentences of the generated document as its summary to form the pseudo data. From the results in Table 4, we can see that PT-based methods achieve similar performance to FT-based methods. This is different from NER and text classification, showing that the difficulty of transferring knowledge across different domains in summarization might be between that of NER and classification. Here also LFPT5 outperforms previous lifelong learning methods by a large margin.
+
+Summary LFPT5 achieves much better performance than previous lifelong learning methods on three different types of tasks, which verifies its effectiveness and strong generalization ability.
+
+# 4.4 RESULTS FOR LEARNING NEW TASK TYPES
+
+To investigate LFPT5's performance on learning new task types, we consider two different variants: (i) LFPT5 with FKT initializes the prompt embeddings of one task using the prompt embeddings of the previously learned task, which we regard as forward knowledge transfer (FKT), and (ii) LFPT5 w.o. FKT initializes the prompt embeddings of every task with the embeddings drawn from the vocabulary of T5. For these experiments, we use CoNLL03 for NER, AGNews for text classification and CNNDM for summarization. From the results in Table 5, we can observe the following:
+
+- Both variants of LFPT5 can achieve better performance than MT-FT and MT-PT. Multitask learning simultaneously trains all tasks together. The learning of one task might cause negative effect on the learning of others. In contrast, LFPT5 variants include and tune additional prompt embeddings for new types of tasks which avoids the negative cross-task knowledge transfer.
+- LFPT5 performs better than AdapterFusion (Pfeiffer et al., 2021) which demonstrates its superiority. Moreover, LFPT5 is much more parameter-efficient than AdapterFusion. In the course of learning these three different task types, AdapterFusion introduces about $21.72\%$ of the parameters of the pretrained T5, while LFPT5 only adds about $0.12\%$ .
+- Comparing the two variants of LFPT5, the effect of forward knowledge transfer can be positive or negative, depending on the tasks. The forward knowledge transfer between classification and summarization is positive. However, they have negative effect on NER; transferring knowledge from them to NER or from NER to them negatively affect the learning of the new task.
+
+Table 4: Average of ROUGE-1, ROUGE-2 and ROUGE-L scores (A-RG) on the whole test set after learning all domains (CNNDM, WikiHow, XSum).
+
+| Method | Task Order |
| (i)
+Summ-Class-NER | (ii)
+Class-NER-Summ | (iii)
+NER-Summ-Class |
| Multitask fine-tuning | 23.24, 78.25, 57.81 | 81.50, 58.28, 21.28 | 50.21, 22.49, 82.25 |
| Multitask prompt tuning | 24.16, 85.50, 50.80 | 82.75, 65.31, 23.36 | 62.83, 11.51, 83.25 |
| AdapterFusion | 22.26, 83.25, 55.62 | 81.25, 63.19, 22.37 | 62.99, 21.20, 82.50 |
| LFPT5 w.o. FKT | 25.48, 84.75, 63.28 | 83.25, 67.66, 23.68 | 66.65, 22.97, 84.50 |
| LFPT5 with FKT | 25.48, 86.00, 62.44 | 83.25, 65.01, 24.92 | 66.65, 22.80, 84.25 |
+
+Table 5: Results for learning three different task types: NER (CoNLL), Classification (AGNews) and Summarization (CNNDM). The tasks are presented in three different orders with different few-shot samples (results are shown in the same order). The metrics reported are F1 for NER, accuracy for Classification and Average-ROUGE for Summarization.
+
+| Method | Domain Order | Average |
| (i)DB-Amazon-Yahoo-AG (Avg.) | (ii)DB-Amazon-AG-Yahoo (Avg.) | (iii)Yahoo-Amazon-AG-DB (Avg.) | |
| Prompt tuning | 00.00, 00.00, 07.29, 81.71 (18.88) | 00.00, 00.00, 52.57, 64.57 (24.85) | 00.71, 00.00, 00.00, 97.86 (41.67) | 28.47±9.65 | |
| EWC-Prompt tuning | 00.00, 00.00, 10.86, 82.43 (19.79) | 00.00, 00.00, 56.14, 68.14 (26.36) | 00.00, 00.00, 00.00, 96.93 (41.12) | 29.09±8.92 | |
| MAS-Prompt tuning | 00.00, 00.00, 12.57, 83.86 (20.45) | 00.00, 00.00, 58.00, 65.71 (26.24) | 00.29, 00.00, 00.00, 97.86 (41.70) | 29.46±8.97 | |
| Fine-tuning | 26.71, 06.40, 09.43, 85.71 (32.48) | 21.36, 05.40, 57.00, 71.29 (37.09) | 04.43, 17.80, 25.86, 98.14 (50.76) | 40.11±7.76 | |
| EWC-Fine-tuning | 38.21, 00.20, 21.00, 86.29 (39.00) | 24.07, 04.00, 59.86, 68.14 (37.97) | 00.14, 12.80, 05.86, 98.07 (44.82) | 40.60±3.02 | |
| MAS-Fine-tuning | 37.29, 00.60, 15.71, 83.29 (36.91) | 20.79, 00.40, 61.14, 67.00 (36.06) | 01.00, 11.40, 27.57, 98.07 (49.39) | 40.79±6.09 | |
| Prompt tuning-Real | 85.79, 31.20, 43.14, 82.00 (67.67) | 82.57, 37.40, 67.29, 64.43 (68.64) | 43.71, 24.20, 58.71, 94.29 (65.39) | 67.23±1.36 | |
| LFPT5 | 48.57, 23.20, 32.43, 78.43 (47.64) | 54.93, 12.20, 61.86, 67.43 (52.58) | 10.57, 09.20, 59.86, 98.00 (57.91) | 52.71±4.19 | |
| MT-Prompt tuning | 95.00, 47.40, 62.29, 75.57 (76.73) | 93.57, 47.80, 73.86, 65.57 (76.52) | 61.71, 43.00, 74.71, 93.21 (75.00) | 76.08±0.77 | |
+
+# 5 ANALYSIS
+
+Influence of Domain Order To evaluate the influence of domain orders when LFPT5 is learning different task domains, we show the results of three runs with different domain order on the classification task in Table 6. We can see that the order of domains influences the performance of all methods a lot. For example, PT can achieve 41.67 accuracy on the third run while the accuracy of the first run is only 18.88. This phenomenon indicates that the difficulty of transferring knowledge from one domain to another might be quite different from that of the opposite transfer direction. Though the performance is affected by the order, LFPT5 outperforms previous regularization-based lifelong learning methods by a large margin for all different orders (see Appendix A.8 for more analysis).
+
+Table 6: Text classification accuracy on the whole test set for three runs with different domain order.
+
+| λkl | 0 | 0.02 | 0.04 | 0.10 | 0.20 | 0.40 |
| A-RG | 16.27±0.50 | 16.41±0.27 | 17.05±0.92 | 17.11±0.59 | 16.97±0.88 | 16.26±0.32 |
+
+Table 7: Average Rouge (A-RG) score of LFPT5 with different ${\lambda }_{kl}$ on summarization.
+
+Influence of KL Loss To investigate the influence of the label consistency loss $\mathcal{L}^{\mathrm{KL}}$ (Eq. 4), we conduct experiments with different $\lambda_{kl}$ on summarization. From the results in Table 7, we observe that the model achieves the best A-RG score of 17.11 with $\lambda_{kl} = 0.10$ and score of 16.26 with $\lambda_{kl} = 0.40$ . The performance of the variant without $\mathcal{L}^{\mathrm{KL}}$ (i.e., $\lambda_{kl} = 0$ ) is worse than the performance of all other variants except the variant with $\lambda_{kl} = 0.40$ (too large), which demonstrates the effectiveness of $\mathcal{L}^{\mathrm{KL}}$ .
+
+Quality of Pseudo Samples We show a few pseudo samples generated by LFPT5 in Figure 5. We can observe that LFPT5 can generate high-quality pseudo samples which are useful for remembering previous knowledge. However, as shown in the right part of the figure, the label of generated data could also be incorrect, which explains the performance gap between LFPT5 and PT-R. In addition, there are several obvious errors, e.g., the pseudo data might not have the '__split__' token or belong to the re
+
+
+Figure 5: Examples of generated pseudo samples for text classification (top) and NER (bottom).
+
+quired domain. We can automatically discard these samples. We believe that exploring methods to generate more reliable pseudo data should be a quite promising research direction in LFLL.
+
+Abbreviation Variations When learning NER, LFPT5 as a task solver needs to generate the entities in the original input (Figure 2). We observe an entity error related to abbreviation during the generation, such as generating 'the United States' while the original entity is 'U.S.' . This kind of error unfairly penalizes LFPT5's F1 score, but it also indicates that T5 does not just copy words from the original input but thinks about the relevant knowledge and expresses it in its own way.
+
+# 6 CONCLUSION
+
+In this work, we introduce LFPT5, a unified framework for lifelong few-shot language learning (LFLL) where the model needs to generalize well on various new few-shot tasks without forgetting previous acquired knowledge. Extensive experimental results and analysis show that LFPT5 can easily adapt to new types of tasks or new domains while retaining the knowledge of learned tasks, which we regard as an important step towards general language intelligence. In the future, we would like to investigate ways to improve the quality of generated pseudo samples.
+
+# REFERENCES
+
+Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139-154, 2018.
+Eyal Ben-David, Nadav Oved, and Roi Reichart. Pada: A prompt-based autoregressive approach for adaptation to unseen domains. arXiv preprint arXiv:2102.12206, 2021.
+Sagie Benaim and Lior Wolf. One-shot unsupervised cross domain translation. arXiv preprint arXiv:1806.06029, 2018.
+Magdalena Biesialska, Katarzyna Biesialska, and Marta R Costa-jussà. Continual lifelong learning in natural language processing: A survey. arXiv preprint arXiv:2012.09823, 2020.
+Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
+Arslan Chaudhry, Marc'Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018.
+Tianqi Chen, Ian Goodfellow, and Jonathon Shlens. Net2net: Accelerating learning via knowledge transfer. arXiv preprint arXiv:1511.05641, 2015.
+Yutian Chen, Matthew W. Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Timothy P. Lillicrap, Matt Botvinick, and Nando de Freitas. Learning to learn without gradient descent by gradient descent. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 748-756. PMLR, 06-11 Aug 2017. URL https://proceedings.mlr.press/v70/chen17e.html.
+Yung-Sung Chuang, Shang-Yu Su, and Yun-Nung Chen. Lifelong language knowledge distillation. arXiv preprint arXiv:2010.02123, 2020.
+Cyprien de Masson d'Autume, Sebastian Ruder, Lingpeng Kong, and Dani Yogatama. Episodic memory in lifelong language learning. arXiv preprint arXiv:1906.01076, 2019.
+Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. The commitmentbank: Investigating projection in naturally occurring discourse. In proceedings of Sinn und Bedeutung, volume 23, pp. 107-124, 2019.
+Ning Ding, Yulin Chen, Xu Han, Guangwei Xu, Pengjun Xie, Hai-Tao Zheng, Zhiyuan Liu, Juanzi Li, and Hong-Gee Kim. Prompt-learning for fine-grained entity typing. arXiv preprint arXiv:2108.10604, 2021.
+Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723, 2020a.
+Tianyu Gao, Xu Han, Ruobing Xie, Zhiyuan Liu, Fen Lin, Leyu Lin, and Maosong Sun. Neural snowball for few-shot relation learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 7772-7779, 2020b.
+Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. *Ptr: Prompt tuning with rules for text classification*. arXiv preprint arXiv:2105.11259, 2021.
+Eduard Hovy, Mitch Marcus, Martha Palmer, Lance Ramshaw, and Ralph Weischedel. Ontonotes: the $90\%$ solution. In Proceedings of the human language technology conference of the NAACL, Companion Volume: Short Papers, pp. 57-60, 2006.
+Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 328-339, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1031. URL https://aclanthology.org/P18-1031.
+
+Zikun Hu, Xiang Li, Cunchao Tu, Zhiyuan Liu, and Maosong Sun. Few-shot charge prediction with discriminative legal attributes. In Proceedings of the 27th International Conference on Computational Linguistics, pp. 487-498, 2018.
+Kasidis Kanwatchara, Thanapapas Horsuwan, Piyawat Lertvittayakumjorn, Boonserm Kijsjirikul, and Peerapon Vateekul. Rational lamol: A rationale-based lifelong learning framework. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 2942-2953, 2021.
+Tushar Khot, Ashish Sabharwal, and Peter Clark. Scitail: A textual entailment dataset from science question answering. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+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.
+Mahnaz Koupae and William Yang Wang. Wikihow: A large scale text summarization dataset. arXiv preprint arXiv:1810.09305, 2018.
+Wojciech Kryscinski, Nitish Shirish Keskar, Bryan McCann, Caiming Xiong, and Richard Socher. Neural text summarization: A critical evaluation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 540-551, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1051. URL https://aclanthology.org/D19-1051.
+Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In International conference on machine learning, pp. 1378-1387. PMLR, 2016.
+Tven Le Scao and Alexander M Rush. How many data points is a prompt worth? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2627-2636, 2021.
+Jens Lehmann, Robert Isele, Max Jakob, Anja Jentzsch, Dimitris Kontokostas, Pablo N Mendes, Sebastian Hellmann, Mohamed Morsey, Patrick Van Kleef, Soren Auer, et al. Dbpedia-a large-scale, multilingual knowledge base extracted from wikipedia. Semantic web, 6(2):167-195, 2015.
+Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021.
+Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021.
+Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935-2947, 2017.
+Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804, 2021a.
+Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021b.
+Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021c.
+David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. Advances in neural information processing systems, 30:6467-6476, 2017.
+
+Arun Mallya, Dillon Davis, and Svetlana Lazebnik. Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 67-82, 2018.
+Marco Marelli, Stefano Menini, Marco Baroni, Luisa Bentivogli, Raffaella Bernardi, Roberto Zamparelli, et al. A sick cure for the evaluation of compositional distributional semantic models. In Lrec, pp. 216-223. Reykjavik, 2014.
+Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. Image-based recommendations on styles and substitutes. In Proceedings of the 38th international ACM SIGIR conference on research and development in information retrieval, pp. 43-52, 2015.
+Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018.
+Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In *Psychology of learning and motivation*, volume 24, pp. 109-165. Elsevier, 1989.
+Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. Abstractive text summarization using sequence-to-sequence rnns and beyond. arXiv preprint arXiv:1602.06023, 2016.
+Shashi Narayan, Shay B Cohen, and Mirella Lapata. Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. arXiv preprint arXiv:1808.08745, 2018.
+Jonas Pfeiffer, Aishwarya Kamath, Andreas Rücklé, Kyunghyun Cho, and Iryna Gurevych. Adapter-Fusion: Non-destructive task composition for transfer learning. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pp. 487-503, Online, April 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.eacl-main.39. URL https://aclanthology.org/2021.eacl-main.39.
+Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
+Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
+Erik F Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language-independent named entity recognition. arXiv preprint cs/0306050, 2003.
+Timo Schick and Hinrich Schütze. Exploiting cloze questions for few shot text classification and natural language inference. arXiv preprint arXiv:2001.07676, 2020.
+Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. In International Conference on Machine Learning, pp. 4596-4604. PMLR, 2018.
+Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980, 2020.
+Fan-Keng Sun, Cheng-Hao Ho, and Hung-Yi Lee. Lamol: Language modeling for lifelong language learning. arXiv preprint arXiv:1909.03329, 2019.
+Jingyuan Sun, Shaonan Wang, Jiajun Zhang, and Chengqing Zong. Distill and replay for continual language learning. In Proceedings of the 28th International Conference on Computational Linguistics, pp. 3569-3579, 2020.
+Derek Tam, Rakesh R Menon, Mohit Bansal, Shashank Srivastava, and Colin Raffel. Improving and simplifying pattern exploiting training. arXiv preprint arXiv:2103.11955, 2021.
+
+Sebastian Thrun and Tom M. Mitchell. Lifelong robot learning. Robotics and Autonomous Systems, 15(1):25-46, 1995. ISSN 0921-8890. doi: https://doi.org/10.1016/0921-8890(95)00004-Y. URL https://www.sciencedirect.com/science/article/pii/092188909500004Y. The Biology and Technology of Intelligent Autonomous Agents.
+Eleni Triantafillou, Richard Zemel, and Raquel Urtasun. Few-shot learning through an information retrieval lens, 2017.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
+Hong Wang, Wenhan Xiong, Mo Yu, Xiaoxiao Guo, Shiyu Chang, and William Yang Wang. Sentence embedding alignment for lifelong relation extraction. arXiv preprint arXiv:1903.02588, 2019.
+Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017.
+Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017.
+Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28:649-657, 2015.
+Ruiqi Zhong, Kristy Lee, Zheng Zhang, and Dan Klein. Meta-tuning language models to answer prompts better. arXiv preprint arXiv:2104.04670, 2021.
+
+# A APPENDIX
+
+# A.1 DERIVATION OF EQUATION 1
+
+Assuming $\phi \perp \mathcal{D}_{\mathrm{pre}}|\theta$ , we can write:
+
+$$
+\begin{array}{l} \underset {\phi} {\arg \max } \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \mathcal {D} _ {\text {p r e}}) = \underset {\phi} {\arg \max } \int_ {\theta} [ \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \theta) + \log p (\theta | \mathcal {D} _ {\text {p r e}}) ] d \theta \\ \approx \underset {\phi} {\arg \max } \left[ \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \hat {\theta}) + \log p (\hat {\theta} | \mathcal {D} _ {\text {p r e}}) \right] \Rightarrow \text {w i t h p o i n t e s t i m a t e o f} \theta . \\ \end{array}
+$$
+
+# A.2 DERIVATION OF EQUATION 2
+
+$$
+\begin{array}{l} \mathcal {L} _ {\phi} = - \log p (\phi | \mathcal {D} _ {\text {t a s k}}, \theta) = - \log [ p (\mathcal {D} _ {\text {t a s k}} | \phi , \theta) p (\phi) ] \\ = - \sum_ {i = 1} ^ {n} \log p (Y _ {i} | [ P, X _ {i} ], \phi , \theta) \quad \Rightarrow \text {a s s u m i n g u n i f o r m} p (\phi). \\ \end{array}
+$$
+
+# A.3 LEARNING FROM A LARGE NUMBER OF DIFFERENT DOMAINS
+
+To evaluate whether our method can perform better than the baselines when learning from a large number of different domains, we consider 5 NLI tasks (GLUE-MNLI (Williams et al., 2017), Scitail (Khot et al., 2018), SICK (Marelli et al., 2014), SuperGLUE-CB (De Marneffte et al., 2019) and GLUE-RTE (Wang et al., 2018)) as classification and combine them with the original 4 classification tasks to form a long sequence of 9 classification tasks. We evaluate LFPT5, MAS-Prompt tuning and MAS-Fine-tuning on this long sequence. The accuracy after learning all tasks is shown in Table 8. From the results, we can observe that LFPT5 still performs much better than previous baselines when learning from a large number of tasks.
+
+| Method | LFPT5 | MAS-Prompt tuning | MAS-Fine-tuning |
| Accuracy (%) | 43.98±2.68 | 9.37±3.17 | 34.37±6.21 |
+
+# A.4 DIFFERENT BACKBONE MODEL
+
+To investigate how the model scale affects the LFLL capability, we compare the performance of LFPT5, EWC-Prompt tuning and EWC-Fine-tuning on summarization using T5-Base backbone. From the results in Table 9, we can observe that LFPT5 performs much better than EWC-Prompt tuning. However, it is slightly worse than EWC-Fine-tuning. This is consistent with the finding in Lester et al. (2021) that prompt tuning performs better when applied to larger pretrained language models.
+
+Table 8: Accuracy (%) of different methods after learning all 9 domains.
+
+| Method | LFPT5 | EWC-Prompt tuning | EWC-Fine-tuning |
| A-RG | 14.93±0.82 | 13.05±1.23 | 15.15±1.38 |
+
+# A.5 DIFFERENT NUMBERS OF FEW-SHOT DATA
+
+We conduct experiments to compare the performance of LFPT5, EWC-Prompt tuning and EWC-Fine tuning with different numbers (16, 32) of few-shot data on summarization. The A-RG score is shown in Table 10. From the results, we can see that LFPT5 consistently outperforms previous baselines with different numbers of few-shot samples.
+
+Table 9: A-RG score of different methods with T5-Base backbone on summarization.
+
+| Few-shot Number | LFPT5 | EWC-Prompt tuning | EWC-Fine-tuning |
| 16 | 15.11±0.44 | 14.16±0.42 | 13.75±2.35 |
| 32 | 15.58±0.27 | 14.30±0.48 | 14.78±1.49 |
+
+Table 10: A-RG score of different methods with different numbers (16, 32) of few-shot data on summarization.
+
+# A.6 INFLUENCE OF THE NUMBER OF PSEUDO SAMPLES
+
+As generating pseudo samples is feasible and cheaper, we can use any number of pseudo samples. We conduct experiments on summarization to analyze the influence of different numbers of pseudo samples. From the results in Table 11, we can find that increasing the number of pseudo samples will not always improve the performance. The model achieves the best A-RG score 17.05 with 4 pseudo samples.
+
+# A.7 MULTIPLE PROMPTS IN MULTITASK PROMPT TUNING
+
+We use a single prompt for multitask prompt tuning in Table 5, which is different from LFPT5 in model capacity. To better support our claim, we conduct multitask prompt tuning experiments using the same number of tunable tokens as LFPT5 (multiple prompts). The tunable tokens are shared among all three tasks. From the results in Table 12, we can see that LFPT5 performs better than both multitask prompt tuning methods.
+
+# A.8 ANALYSIS ON PT-BASED EWC AND MAS
+
+From the results in Table 6, we can observe that the performance on previous tasks for PT-based EWC and MAS is almost 0. There could be two reasons:
+
+- There are only a few tunable parameters in prompt tuning, which is difficult for retaining and accumulating knowledge. So the learning of new knowledge from different domains is more
+
+| Number | 2 | 4 | 8 | 16 | 32 |
| A-RG | 16.28±0.95 | 17.05±0.92 | 16.80±0.52 | 16.74±0.45 | 16.79±0.64 |
+
+Table 11: A-RG score of LFPT5 with different numbers of pseudo samples on summarization.
+
+| Method | Task Order |
| (i)
+Summ-Class-NER | (ii)
+Class-NER-Summ | (iii)
+NER-Summ-Class |
| Multitask prompt tuning (single prompt) | 24.16, 85.50, 50.80 | 82.75, 65.31, 23.36 | 62.83, 11.51, 83.25 |
| Multitask prompt tuning (multiple prompts) | 21.01, 82.25, 58.59 | 83.00, 64.83, 22.73 | 63.23, 21.41, 84.00 |
| LFPT5 w.o. FKT | 25.48, 84.75, 63.28 | 83.25, 67.66, 23.68 | 66.65, 22.97, 84.50 |
| LFPT5 with FKT | 25.48, 86.00, 62.44 | 83.25, 65.01, 24.92 | 66.65, 22.80, 84.25 |
+
+Table 12: Comparison results of single prompt multitask prompt tuning, multiple prompts multitask prompt tuning and LFPT5.
+
+likely to cause the forgetting of previously learned knowledge. LFPT5 utilizes pseudo samples to alleviate this problem.
+
+- Few-shot language learning is more challenging. The model training is already sub-optimal even without lifelong learning. So the performance is relatively low.
+
+# A.9 DATASETS DETAILS
+
+There are 4 and 18 classes in CoNLL03 and OntoNotes, respectively. And the number of classes in AGNews, Amazon, DBPedia and Yahoo is 4, 5, 14 and 10, respectively. We sample 16 examples per class, which means that there are at least 64 samples in the training and validation sets. Therefore, we sample 64 examples for the training and validation set per domain (dataset) for summarization.
+
+# A.10 PARAMETER SETTINGS
+
+We use the Adafactor (Shazeer & Stern, 2018) optimizer with a learning rate of 0.5. For NER, we set $\lambda_{\mathrm{lm}}$ and $\lambda_{\mathrm{kl}}$ to 0.10 and 0.03, respectively. For text classification, we adopt 0.25 and 0.01 for the loss weights $\lambda_{\mathrm{lm}}$ and $\lambda_{\mathrm{kl}}$ , respectively. We set 0.10 for $\lambda_{\mathrm{lm}}$ and 0.04 for $\lambda_{\mathrm{kl}}$ when learning summarization. Hyperparameter search is done on the validation sets when comparing the single task few-shot results in Section 4.2.
+
+For EWC and MAS based methods, we conduct hyper-parameter search and report the optimal results. For AdapterFusion (Pfeiffer et al., 2021), we adopt the implementation from AdapterHub and use the default adapter settings for T5. The default bottleneck reduction factor is 16, i.e., the bottleneck size is 64. We adopt a learning rate of 1e-4 with AdamW and a linear learning rate decay following the original AdapterFusion paper. All other hyper-parameter settings (such as batch size and evaluation interval) are the same as LFPT5.
\ No newline at end of file
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/images.zip b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..84d2f7a0007a59ec42f6c5fbb82146cab61a0f4e
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a02bdf9acf4a4d5d01e9a3efc6eee254f7c637dff3f06f1e059109bd3ac0e1cf
+size 578900
diff --git a/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/layout.json b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9ff47c83023bba30333e08e6d45785f2bedf7a20
--- /dev/null
+++ b/lfpt5aunifiedframeworkforlifelongfewshotlanguagelearningbasedonprompttuningoft5/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c2956e29ab20af00e67a9e5deed883968d3bdc15da141afbb82f60dd40a3367
+size 435685
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_content_list.json b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9edf9d20e31c787925c969dd781badd3162eaffb
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d8778c61259464e43b1c99cb664a3f30c15a7e99877dd6c29d9d340c50c7f7b4
+size 83134
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_model.json b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e70acc498a09cb904ef752477440f2a32e6efe04
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f886c26746eec631a48bd2a831a259426083fc7bf00677ee7d4e16ac8363dfeb
+size 104896
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_origin.pdf b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..2dfa2d4e2af503daa5300884885db26befcb0a22
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/4b24769e-e6d3-42b9-9c17-cbacbfe21b1a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:712de47c250b6036aeb811bf2f526c666b048f4753ccf82141f70c236240b2e1
+size 1834685
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/full.md b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..6b3dd327458edc3d559472d82a7b07d70b52f7bf
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/full.md
@@ -0,0 +1,289 @@
+# LIGS: LEARNABLE INTRINSIC-REWARD GENERATION SELECTION FOR MULTI-AGENT LEARNING
+
+David Mguni $^{1,*}$ , Taher Jafferjee $^{1}$ , Jianhong Wang $^{2}$ , Oliver Slumbers $^{1,5}$ , Nicolas Perez-Nieves $^{2}$ , Feifei Tong $^{1}$ , Li Yang $^{3}$ , Jiangcheng Zhu $^{1}$ , Yaodong Yang $^{4}$ , Jun Wang $^{5}$
+
+1Huawei Technologies, 2Imperial College London, 3Shanghaiitech University,
+
+$^{4}$ Institute for AI, Peking University & BIGAI, $^{5}$ University College London
+
+# ABSTRACT
+
+Efficient exploration is important for reinforcement learners to achieve high rewards. In multi-agent systems, coordinated exploration and behaviour is critical for agents to jointly achieve optimal outcomes. In this paper, we introduce a new general framework for improving coordination and performance of multi-agent reinforcement learners (MARL). Our framework, named Learnable Intrinsic-Reward Generation Selection algorithm (LIGS) introduces an adaptive learner, Generator that observes the agents and learns to construct intrinsic rewards online that coordinate the agents' joint exploration and joint behaviour. Using a novel combination of MARL and switching controls, LIGS determines the best states to learn to add intrinsic rewards which leads to a highly efficient learning process. LIGS can subdivide complex tasks making them easier to solve and enables systems of MARL agents to quickly solve environments with sparse rewards. LIGS can seamlessly adopt existing MARL algorithms and, our theory shows that it ensures convergence to policies that deliver higher system performance. We demonstrate its superior performance in challenging tasks in Foraging and StarCraft II.
+
+# 1 INTRODUCTION
+
+Cooperative multi-agent reinforcement learning (MARL) has emerged as a powerful tool to enable autonomous agents to solve various tasks such as autonomous driving (Zhou et al., 2020b), ride-sharing (Li et al., 2019), gaming AIs (Peng et al., 2017a), power networks (Wang et al., 2021a; Qiu et al., 2021) and swarm intelligence (Mguni et al., 2018; Yang et al., 2017). In multi-agent systems (MAS), maximising system performance often requires agents to coordinate during exploration and learn coordinated joint actions. However, in many MAS, the reward signal provided by the environment is not sufficient to guide the agents towards coordinated behaviour (Matignon et al., 2012). Consequently, relying on solely the individual rewards received by the agents may not lead to optimal outcomes (Mguni et al., 2019). This problem is exacerbated by the fact that MAS can have many stable points some of which lead to arbitrarily bad outcomes (Roughgarden & Tardos, 2007).
+
+As in single agent RL, in MARL inefficient exploration can dramatically decrease sample efficiency. In MAS, a major challenge is how to overcome sample inefficiency from poorly coordinated exploration. Unlike single agent RL, in MARL, the collective of agents is typically required to coordinate its exploration to find their optimal joint policies1. A second issue is that in many MAS settings of interest, such as video games and physical tasks, rich informative signals of the agents' joint performance are not readily available (Hosu & Rebedea, 2016). For example, in StarCraft Micromanagement (Samvelyan et al., 2019), the sparse reward alone (win, lose) gives insufficient information to guide agents toward their optimal joint policy. Consequently, MARL requires large numbers of samples producing a great need for MARL methods that can solve such problems efficiently.
+
+To aid coordinated learning, algorithms such as QMIX (Rashid et al., 2018), MF-Q (Yang et al., 2018), Q-DPP (Yang et al., 2020), COMA (Foerster et al., 2018) and SQDDPG (Wang et al., 2020c), so-called centralised critic and decentralised execution (CT-DE) methods use a centralised critic whose
+
+role is to estimate the agents' expected returns. The critic makes use of all available information generated by the system, specifically the global state and the joint action (Peng et al., 2017b). To enable effective CT-DE, it is critical that the joint greedy action should be equivalent to the collection of individual greedy actions of agents, which is called the IGM (Individual-Global-Max) principle (Son et al., 2019). CT-DE methods are however, prone to convergence to suboptimal joint policies (Wang et al., 2020a) and suffer from variance issues for gradient estimation (Kuba et al., 2021). Existing value factorisations, e.g. QMIX and VDN (Sunehag et al., 2017) cannot ensure an exact guarantee of IGM consistency (Wang et al., 2020b). Moreover, CT-DE methods such as QMIX require a monotonicity condition which is violated in scenarios where multiple agents must coordinate but are penalised if only a subset of them do so (see Exp. 2, Sec. 6.1).
+
+To tackle these issues, in this paper we introduce a new MARL framework, LIGS that constructs intrinsic rewards online which guide MARL learners towards their optimal joint policy. LIGS involves an adaptive intrinsic reward agent, the Generator that selects intrinsic rewards to add according to the history of visited states and the agents' joint actions. The Generator adaptively guides the agents' exploration and behaviour towards coordination and maximal joint performance. A pivotal feature of LIGS is the novel combination of RL and switching controls (Mguni, 2018) which enables it to determine the best set of states to learn to add intrinsic rewards while disregarding less useful states. This enables the Generator to quickly learn how to set intrinsic rewards that guide the agents during their learning process. Moreover, the intrinsic rewards added by the Generator can significantly deviate from the environment rewards. This enables LIGS to both promote complex joint exploration patterns and decompose difficult tasks. Despite this flexibility, special features within LIGS ensure the underlying optimal policies are preserved so that the agents learn to solve the task at hand.
+
+Overall, LIGS has several advantages:
+
+- LIGS has the freedom to introduce rewards that vastly deviate from the environment rewards. With this, LIGS promotes coordinated exploration (i.e. visiting unplayed state-joint actions) among the agents enabling them to find joint policies that maximise the system rewards and generates intrinsic rewards to aid solving sparse reward MAS (see Experiment 1 in Sec. 6.1).
+- LIGS selects which best states to add intrinsic rewards adaptively in response to the agents' behaviour while the agents learn leading to an efficient learning process (see Investigations in Sec. 6.1).
+- LIGS's intrinsic rewards preserve the agents' optimal joint policy and ensure that the total environment return is (weakly) increased (see Sec. 5).
+
+To enable the framework to perform successfully, we overcome several challenges: i) Firstly, constructing an intrinsic reward can change the underlying problem leading to the agents solving irrelevant tasks (Mannion et al., 2017). We resolve this by endowing the intrinsic reward function with special form which both allows a rich spread of intrinsic rewards while preserving the optimal policy. ii) Secondly, introducing intrinsic reward functions can worsen the agents' performance (Devlin & Kudenko, 2011) and doing so while training can lead to convergence issues. We prove LIGS leads to better performing policies and that LIGS's learning process converges and preserves the MARL learners' convergence properties. iii) Lastly, adding an agent Generator with its own goal leads to a Markov game (MG) with $N + 1$ agents (Fudenberg & Tirole, 1991). Tractable methods for solving MGs are extremely rare with convergence only in special cases (Yang & Wang, 2020). Nevertheless, using a special set of features in LIGS's design, we prove LIGS converges to a solution in which it learns an intrinsic reward function that improves the agents' performance.
+
+# 2 RELATED WORK
+
+Reward shaping (Harutyunyan et al., 2015; Mguni et al., 2021) is a technique which aims to alleviate the problem of sparse and uninformative rewards by supplementing the agent's reward with a prefixed term $F$ . In Ng et al. (1999) it was established that adding a shaping reward function of the form $F(s_{t + 1},s_t) = \gamma \phi (s_{t + 1}) - \phi (s_t)$ preserves the optimal policy and in some cases can aid learning. RS has been extended to MAS (Devlin et al., 2011; Mannion et al., 2018; Devlin & Kudenko, 2011; 2012; 2016; Sadeghlou et al., 2014) in which it is used to promote convergence to efficient social welfare outcomes. Poor choices of $F$ in a MAS can slow the learning process and can induce convergence to poor system performance (Devlin & Kudenko, 2011). In MARL, the question of which shaping function to use remains unaddressed. Typically, RS algorithms rely on hand-crafted shaping reward functions that are constructed using domain knowledge, contrary to the goal of
+
+autonomous learning (Devlin & Kudenko, 2011). As we later describe LIGS, which successfully learns an intrinsic reward function $F$ , uses a similar form as PBRS however, $F$ is now augmented to include the actions of another RL agent to learn the intrinsic rewards online. In Du et al. (2019) an approach towards learning intrinsic rewards is proposed in which a parameterised intrinsic reward is learned using a bilevel approach through a centralised critic. In Wang et al. (2021b), a parameterised intrinsic reward is learned by a corpus, then the trained intrinsic reward is frozen on parameters and used to assist the training of a single-agent policy for generating the dialogues. Loosely related are single-agent methods (Zheng et al., 2018; Dilokthanakul et al., 2019; Kulkarni et al., 2016; Pathak et al., 2017) which, in general, introduce heuristic terms to generate intrinsic rewards.
+
+Multi-agent exploration methods seek to promote coordinated exploration among MARL learners. Mahajan et al. (2019) proposed a hybridisation of value and policy-based methods that uses mutual information to learn a diverse set of behaviours between agents. Though this approach promotes coordinated exploration, it does not encourage exploration of novel states. Other approaches to promote exploration in MARL while assuming aspects of the environment are known in advance and agents can perform perfect communication between themselves (Viseras et al., 2016). Similarly, to promote coordinated exploration in partially observable settings, Pesce & Montana (2020) proposed end-to-end learning of a communication protocol through a memory device. In general, exploration-based methods provide no performance guarantees nor do they ensure the optimal policy. Moreover, many employ heuristics that naively reward exploration to unvisited states without consideration of the environment reward. This can lead to spurious objectives being maximised.
+
+Within these categories, closest to our work is the intrinsic reward approach in Du et al. (2019). There, the agents' policies and intrinsic rewards are learned with a bilevel approach. In contrast, LIGS performs these operations concurrently leading to a fast and efficient procedure. A crucial point of distinction is that in LIGS, the intrinsic rewards are constructed by an RL agent (Generator) with its own reward function. Consequently, LIGS can generate complex patterns of intrinsic rewards, encourage joint exploration. Additionally, LIGS learns intrinsic rewards only at relevant states, this confers high computational efficiency. Lastly, unlike exploration-based methods e.g., Mahajan et al. (2019), LIGS ensures preservation of the agents' joint optimal policy for the task.
+
+# 3 PRELIMINARIES
+
+A fully cooperative MAS is modelled by a decentralised-Markov decision process (Dec-MDP) (Deng et al., 2021). A Dec-MDP is an augmented MDP involving a set of $N \geq 2$ agents denoted by $\mathcal{N}$ that independently decide actions to take which they do so simultaneously over many rounds. Formally, a dec-MDP is a tuple $\mathfrak{M} = \langle \mathcal{N}, \mathcal{S}, (\mathcal{A}_i)_{i \in \mathcal{N}}, P, R, \gamma \rangle$ where $\mathcal{S}$ is the finite set of states, $\mathcal{A}_i$ is an action set for agent $i \in \mathcal{N}$ and $R: \mathcal{S} \times \mathcal{A} \to \mathcal{P}(D)$ is the reward function that all agents jointly seek to maximise where $D$ is a compact subset of $\mathbb{R}$ and lastly, $P: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \to [0,1]$ is the probability function describing the system dynamics where $\mathcal{A} := \times_{i=1}^{N} \mathcal{A}_i$ . Each agent $i \in \mathcal{N}$ uses a Markov policy $\pi_i: \mathcal{S} \times \mathcal{A}_i \to [0,1]$ to select its actions. At each time $t \in [0,1,\dots]$ , the system is in state $s_t \in \mathcal{S}$ and each agent $i \in \mathcal{N}$ takes an action $a_t^i \in \mathcal{A}_i$ . The joint action $\boldsymbol{a}_t = (a_t^1, \dots, a_t^N) \in \mathcal{A}$ produces an immediate reward $r_i \sim R(s_t, \boldsymbol{a}_t)$ for agent $i \in \mathcal{N}$ and influences the next-state transition which is chosen according to $P$ . The goal of each agent $i$ is to maximise its expected returns measured by its value function $v^{\pi^i, \pi^{-i}}(s) = \mathbb{E}_{\pi^i, \pi^{-i}}[\sum_{t=0}^{\infty} \gamma^t R(s_t, \boldsymbol{a}_t)]$ , where $\Pi_i$ is a compact Markov policy space and $-i$ denotes the tuple of agents excluding agent $i$ .
+
+Intrinsic rewards can strongly induce more efficient learning (and can promote convergence to higher performing policies) (Devlin & Kudenko, 2011). We tackle the problem of how to learn intrinsic rewards produced by a function $F$ that leads to the agents learning policies that jointly maximise the system performance (through coordinated learning). Determining this function is a significant challenge since poor choices can hinder learning and the concurrency of multiple learning processes presents potential convergence issues in a system already populated by multiple learners (Zinkevich et al., 2006). Additionally, we require that the method preserves the optimal joint policy.
+
+# 4 THE LIGS FRAMEWORK
+
+To tackle the challenges described above, we introduce Generator an adaptive agent with its own objective that determines the best intrinsic rewards to give to the agents at each state. Using
+
+observations of the joint actions played by the $N$ agents, the goal of the Generator is to construct intrinsic rewards to coordinate exploration and guide the agents towards learning joint policies that maximise their shared rewards. To do this, the Generator learns how to choose the values of an intrinsic reward function $F^{\theta}$ at each state. Simultaneously, the $N$ agents perform actions to maximise their rewards using their individual policies. The objective for each agent $i \in \{1, \dots, N\}$ is given by:
+
+$$
+v ^ {\pi^ {i}, \pi^ {- i}, g} (s) = \mathbb {E} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} \left(R + F ^ {\pmb {\theta}}\right) \left| s _ {0} = s \right. \right],
+$$
+
+where $\theta$ is determined by the Generator using the policy $g: S \times \Theta \to [0,1]$ and $\Theta \subset \mathbb{R}^p$ is the Generator's action set. The intrinsic reward function is given by $F^\theta(\cdot) \equiv \theta_t^c - \gamma^{-1}\theta_{t-1}^c$ where $\theta_t^c \sim g$ is the action chosen by the Generator and $\theta_t^c \equiv 0, \forall t < 0$ . $\Theta$ can be a set of integers $\{1, \dots, K\}$ . Therefore, the Generator determines the output of $F^\theta$ (which it does through its choice of $\theta^c$ ). With this, the Generator constructs intrinsic rewards that are tailored for the specific setting.
+
+LIGS freely adopts any MARL algorithm for the $N$ agents (see Sec. 10 in the Supp. Material). The transition probability $P: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \to [0,1]$ takes the state and only the actions of the $N$ agents as inputs. Note that unlike reward-shaping methods e.g. (Ng et al., 1999), the function $F$ now contains action terms $\theta^c$ which are chosen by the Generator which enables the intrinsic reward function to be learned online. The presence of the action $\theta^c$ term may spoil the policy invariance result in Ng et al. (1999). We however prove a policy invariance result (Prop. 1) analogous to that in Ng et al. (1999) which shows LIGS preserves the optimal policy of $\mathfrak{M}$ . The Generator is an RL agent whose objective takes into account the history of states and $N$ agents' joint actions. The Generator's objective is:
+
+$$
+v _ {c} ^ {\boldsymbol {\pi}, g} (s) = \mathbb {E} _ {\boldsymbol {\pi}, g} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} \left(R ^ {\boldsymbol {\theta}} \left(s _ {t}, \boldsymbol {a} _ {t}\right) + L \left(s _ {t}, \boldsymbol {a} _ {t}\right)\right) \mid s _ {0} = s \right], \quad \forall s \in \mathcal {S}. \tag {1}
+$$
+
+where $R^{\theta}(s, \boldsymbol{a}) \coloneqq R(s, \boldsymbol{a}) + F^{\theta}$ . The objective encodes Generator's agenda, namely to maximise the agents' expected return. Therefore, using its intrinsic rewards, the Generator seeks to guide the set of agents toward optimal joint trajectories (potentially away from suboptimal trajectories, c.f. Experiment 2) and enables the agents to learn faster (c.f. StarCraft experiments in Sec. 6). Lastly, $L: S \times \mathcal{A} \to \mathbb{R}$ rewards Generator when the agents jointly visit novel state-joint-action tuples and tends to 0 as the tuples are revisited. We later prove that with this objective, the Generator's optimal policy (for constructing the intrinsic rewards) maximises the expected (extrinsic) return (Prop. 1).
+
+Since the Generator has its own (distinct) objective, the resulting setup is an MG, $\mathcal{G} = \langle \mathcal{N}\times$ $\{c\} ,S,(A_i)_{i\in \mathcal{N}},\Theta ,P,R^\theta ,R_c,\gamma \rangle$ where the new elements are $\{c\}$ , the Generator agent, $R^{\theta}\coloneqq$ $R + F^{\theta}$ , the new team reward function which contains the intrinsic reward $F^{\theta},R_{c}:S\times \mathcal{A}\times \Theta \to \mathbb{R}$ the one-step reward for the Generator (we give the details of this later).
+
+# Switching Control Mechanism
+
+So far the Generator's problem involves learning to construct intrinsic rewards at every state which can be computationally expensive. We now introduce an important feature which allows LIGS to learn the best intrinsic reward only in a subset of states in which intrinsic rewards are most useful. This is in contrast to the problem tackled by the $N$ agents who must compute their optimal actions at all states. To achieve this, we now replace the Generator's policy space with a form of policies known as switching controls. These policies enable Generator to decide at which states to learn the value of intrinsic rewards. This enables the Generator to learn quickly both where to add intrinsic rewards and the magnitudes that improve performance since the Generator's magnitude optimisations are performed only at a subset of states. Crucially, with this the Generator can learn its policy rapidly enabling it to guide the agents toward coordination and higher performing policies while they train.
+
+At each state, the Generator first makes a binary decision to decide to switch on its $F$ for agent $i \in \mathcal{N}$ using a switch $I_{t}$ which takes values in $\{0,1\}$ . Crucially, now the Generator is tasked with learning how to construct the $N$ agents' intrinsic rewards only at states that are important for guiding the agents to their joint optimal policy. Both the decision to activate the function $F$ and its magnitudes is determined by the Generator. With this, the agent $i \in \mathcal{N}$ objective becomes:
+
+$$
+v ^ {\pi , g} \left(s _ {0}, I _ {0}\right) = \mathbb {E} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} \left\{R + F ^ {\theta} \cdot I _ {t} \right\} \right], \forall \left(s _ {0}, I _ {0}\right) \in \mathcal {S} \times \{0, 1 \}, \tag {2}
+$$
+
+where $I_{\tau_{k + 1}} = 1 - I_{\tau_k}$ , which is the switch for $F$ which is 0 or 1 and $\{\tau_k\}_{k > 0}$ are times that a switch takes place2 so for example if the switch is first turned on at the state $s_5$ then turned off at $s_7$ , then $\tau_1 = 5$ and $\tau_2 = 7$ (we will shortly describe these in more detail). At any state, the decision to turn on $I$ is decided by a (categorical) policy $\mathfrak{g}_c: S \to \{0, 1\}$ which acts according to Generator's objective. In particular, first, the Generator makes an observation of the state $s_k \in S$ and the joint action $\pmb{a}_k$ and using $\mathfrak{g}_c$ , the Generator decides whether or not to activate the policy $g$ to provide an intrinsic reward whose value is determined by $\theta_k^c \sim g$ . With this it can be seen the sequence of times $\{\tau_k\}$ is $\tau_k = \inf \{t > \tau_{k - 1}|s_t \in S, \mathfrak{g}_c(s_t) = 1\}$ so the switching times. $\{\tau_k\}$ are rules that depend on the state. Therefore, by learning an optimal $\mathfrak{g}_c$ , the Generator learns the useful states to switch on $F$ .
+
+To induce the Generator to selectively choose when to switch on the additional rewards, each switch activation incurs a fixed cost for the Generator. In this case, the objective for the Generator is:
+
+$$
+v _ {c} ^ {\pi , g} \left(s _ {0}, I _ {0}\right) = \mathbb {E} _ {\boldsymbol {\pi}, g} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} \left(R ^ {\boldsymbol {\theta}} \left(s _ {t}, \boldsymbol {a} _ {t}\right) - \sum_ {k \geq 1} \delta_ {\tau_ {2 k - 1}} ^ {t} + L \left(s _ {t}, \boldsymbol {a} _ {t}\right)\right) \right], \tag {3}
+$$
+
+where the Kronecker-delta function $\delta_{\tau_{2k-1}}^t$ which is 1 whenever $t = \tau_{2k-1}$ and 0 otherwise imposes a cost for each switch activation. The cost has two effects: first, it reduces the computational complexity of the Generator's problem since the Generator now determines subregions of $\mathcal{S}$ it should learn the values of $F$ . Second, it ensures the information-gain from encouraging the agents to explore state-action tuples is sufficiently high to merit activating a stream of intrinsic rewards. We set $\tau_0 \equiv 0$ , $\theta_{\tau_k} \equiv 0$ , $\forall k \in \mathbb{N}$ ( $\theta_{\tau_k+1}, \ldots, \theta_{\tau_{k+1}-1}$ remain non-zero), $\theta_k^c \equiv 0$ $\forall k \leq 0$ and denote by $I(t) \equiv I_t$ .
+
+# Discussion on Computational Aspect
+
+The switching controls mechanism results in a framework in which the problem facing the Generator has a markedly reduced decision space in comparison to the agent's problem (though the agents share the same experiences). Crucially, the Generator must compute optimal intrinsic rewards at only a subset of states which are chosen by $\mathfrak{g}_c$ . Moreover, the decision space for the switching policy $\mathfrak{g}_c$ is $S \times \{0,1\}$ i.e at each state it makes a binary decision. Consequently, the learning process for $\mathfrak{g}_c$ is much quicker than the agents' policies which must optimise over the decision space $|\mathcal{S}||\mathcal{A}|$ (choosing an action at every state). This results in the Generator rapidly learning its optimal policies (relative to the agent) in turn, enabling the Generator to guide the agents towards its optimal
+
+
+Figure 1: Schematic of the LIGS framework.
+
+policy during its learning phase. Also, in our experiments, we chose the size of the action set for the Generator, $\Theta$ to be a singleton resulting in a decision space of size $|S|\times \{0,1\}$ for the entire problem facing the Generator. We later show that this choice leads to improved performance while removing the free parameter of the dimensionality of the Generator's action set.
+
+# Summary of Events
+
+At a time $t\in 0,1,\ldots$
+
+1. | The $N$ agents makes an observation of the state $s_t \in S$ .
+2. The $N$ agents perform a joint action $\pmb{a}_t = (a_t^1, \dots, a_t^N)$ sampled from $\pmb{\pi} = (\pi^1, \dots, \pi^N)$ .
+
+3. The Generator makes an observation of $s_t$ and $a_t$ and draws samples from its polices $(\mathfrak{g}_c, g)$ .
+4. If $\mathfrak{g}_c(s_t) = 0$ :
+
+- Each agent $i \in \mathcal{N}$ receives a reward $r_i \sim R(s_t, \boldsymbol{a}_t)$ and the system transitions to the next state $s_{t+1}$ and steps 1 - 3 are repeated.
+
+5. If $\mathfrak{g}_c(s_t) = 1$ :
+
+$\circ F^{\theta}$ is computed using $s_t$ and the Generator action $\theta^c \sim g$ .
+Each agent $i \in \mathcal{N}$ receives a reward $r_i + F^\theta$ and the system transitions to $s_{t+1}$ .
+
+6. At time $t + 1$ if the intrinsic reward terminates then steps 1 - 3 are repeated or if the intrinsic reward has not terminated then step 5 is repeated.
+
+# 4.1 THE LEARNING PROCEDURE
+
+In Sec. 5, we provide the convergence properties of the algorithm, and give the full code of the algorithm in Sec. 9 of the Appendix. The algorithm consists of the following procedures: the Generator updates its policy that determines the values $\theta$ at each state and the states to perform a switch while the agents $\{1,\dots ,N\}$ learn their individual policies $\{\pi_1,\ldots ,\pi_N\}$ . In our implementation, we used proximal policy optimization (PPO) (Schulman et al., 2017) as the learning algorithm for both the Generator's intervention policy $\mathfrak{g}_c$ and Generator's policy $g$ . For the $N$ agents we used MAPPO (Yu et al., 2021). for the Generator $L$ term we use $^3 L(s_t,a_t)\coloneqq \| \hat{h} -h\| _2^2$ where $\hat{h}$ is a random initialised network which is the target network which is fixed and $h$ is the prediction function that is consecutively updated during training. We constructed $F^{\theta}$ using a fixed neural network $f:\mathbb{R}^d\mapsto \mathbb{R}^m$ and a one-hot encoding of the action of the Generator. Specifically, $i(\theta_{t}^{c})$ is a one-hot encoding of the action $\theta_t^c$ picked by the Generator. Thus, $F^{(\theta_t^c,\theta_{t - 1}^c)} = i(\theta_t^c) - \gamma^{-1}i(\theta_{t - 1}^c)$ . The action set of the Generator is $\Theta \equiv \{1\}$ where $g$ is an MLP $g:\mathbb{R}^d\mapsto \mathbb{R}^m$ . Extra details are in Sec. 9.
+
+# 5 CONVERGENCE AND OPTIMALITY OF LIGS
+
+We now show that LIGS converges and that the solution ensures a higher performing agent policies. The addition of the Generator's RL process which modifies $N$ agents' rewards during learning can produce convergence issues (Zinkevich et al., 2006). Also to ensure the framework is useful, we must verify that the solution of $\mathcal{G}$ corresponds to solving the MDP, $\mathfrak{M}$ . To resolve these issues, we first study the stable point solutions of $\mathcal{G}$ . Unlike MDPs, the existence of a solution in Markov policies is not guaranteed for MGs (Blackwell & Ferguson, 1968) and is rarely computable (except for special cases such as team and zero-sum MGs (Shoham & Leyton-Brown, 2008)). MGs also often have multiple stable points that can be inefficient (Mguni et al., 2019); in $\mathcal{G}$ such stable points would lead to a poor performing agent joint policy. We resolve these challenges with the following scheme:
+
+[I] LIGS preserves the optimal solution of $\mathfrak{M}$
+[II] The MG induced by LIGS has a stable point which is the convergence point of MARL.
+[III] LIGS yields a team payoff that is (weakly) greater than that from solving $\mathfrak{M}$ directly.
+[IV] LIGS converges to the solution with a linear function approximators.
+
+In what follows, we denote by $\Pi \coloneqq \times_{i\in \mathcal{N}}\Pi_i$ . The results are built under Assumptions 1 - 7 (Sec. 15 of the Appendix) which are standard in RL and stochastic approximation theory. We now prove the result [I] which shows the solution to $\mathfrak{M}$ is preserved under the influence of LIGS:
+
+Proposition 1 The following statements hold:
+
+i) $\max_{\pmb{\pi} \in \pmb{\Pi}} v^{\pi, g}(s, \cdot) = \max_{\pmb{\pi} \in \pmb{\Pi}} v^{\pi}(s), \forall s \in \mathcal{S}, \forall i \in \mathcal{N}, \forall g$ where $v^{\pi}(s) = \mathbb{E}_{\pi}[\sum_{t=0}^{\infty} \gamma^{t} R]$ .
+
+ii) The Generator's optimal policy maximises $v^{\pi}(s) = \mathbb{E}\left[\sum_{t=0}^{\infty} \gamma^{t} R(s_{t}, \boldsymbol{a}_{t})\right]$ for any $s \in S$ .
+
+Result (i) says that the agents' problem is preserved under the Generator's influence. Moreover the agents' (expected) total return is that from the environment (extrinsic rewards). Result (ii) establishes that the Generator's optimal policy induces it to maximise the agents' joint (extrinsic) total return. The result is proven by a careful adaptation of the policy invariance result in Ng et al. (1999) to our MARL switching control setting where the intrinsic-reward is not added at all states. Building on Prop. 1, we deduce the following result:
+
+Corollary 1 LIGS preserves the dec-MDP played by the agents. In particular, let $(\hat{\pi},\hat{g})$ be a stable point policy profile of the MG induced by LIGS, $\mathcal{G}$ then $\hat{\pi}$ is a solution to the dec-MDP, $\mathfrak{M}$ .
+
+Therefore, the introduction of the Generator does not alter the fundamentals of the problem. Our next task is to prove the existence of a stable point of the MG induced by LIGS and show it is a limit point of a sequence of Bellman operations. To do this we prove that a stable solution of $\mathcal{G}$ exists and that $\mathcal{G}$ has a special property that permits its stable point to be found using dynamic programming. The following result establishes that the solution of the MG $\mathcal{G}$ , can be computed using RL methods:
+
+Theorem 1 Given a function $V: \mathcal{S} \times \mathcal{A} \to \mathbb{R}$ , $\mathcal{G}$ has a stable point given by $\lim_{k \to \infty} T^k V^{\pi, g} = \sup_{\hat{\pi} \in \Pi} V^{\pi, \hat{g}} = V^{\pi^*, g^*}$ where $(\pi^*, g)$ is a stable solution of $\mathcal{G}$ and $T$ is the Bellman operator (c.f. (5)).
+
+Theorem 1 proves that the MG $\mathcal{G}$ (which is the game that is induced when Generator plays with the $N$ agents) has a stable point which is the limit of a dynamic programming method. In particular, it proves that the stable point of $\mathcal{G}$ is the limit point of the sequence $T^{1}V,T^{2}V,\ldots$ . Crucially, (by Corollary 1) the limit point corresponds to the solution of the dec-MDP $\mathcal{M}$ . Theorem 1 is proven by firstly proving that $\mathcal{G}$ has a dual representation as an MDP whose solution corresponds to the stable point of the MG. Theorem 1 enables us to tackle the problem of finding the solution to $\mathcal{G}$ using distributed learning methods i.e. MARL to solve $\mathcal{G}$ . Moreover, Prop. 1 indicates by computing the stable point of $\mathcal{G}$ leads to a solution of $\mathfrak{M}$ . These results combined prove [II]. Our next result characterises the Generator policy $\mathfrak{g}_c$ and the optimal times to activate $F$ . The result yields a key aspect of our algorithm for executing the Generator activations of intrinsic rewards:
+
+Proposition 2 The policy $\mathfrak{g}_c$ is given by: $\mathfrak{g}_c(s_t,I_t) = H(\mathcal{M}^{\pi ,g}V^{\pi ,g} - V^{\pi ,g})(s_t,I_t),\forall (s_t,I_t)\in S\times \{0,1\}$ , where $V^{\pi ,g}$ is the solution in Theorem 1, $\mathcal{M}$ is the Generator's intervention operator (c.f. (4)) and $H$ is the Heaviside function, moreover $\tau_{k} = \inf \bigl \{\tau >\tau_{k - 1}|\mathcal{M}^{\pi ,g}V^{\pi ,g} = V^{\pi ,g}\bigr \}$ .
+
+In general, introducing intrinsic rewards or shaping rewards may undermine learning and worsen overall performance. We now prove that the LIGS framework introduces an intrinsic reward which yields better performance for the $N$ agents as compared to solving $\mathfrak{M}$ directly ([III]).
+
+Theorem 2 Each agent's expected return $v^{\pi, g}$ whilst playing $\mathcal{G}$ is (weakly) higher than the expected return for $\mathfrak{M}$ (without the Generator) i.e. $v^{\pi, g}(s, \cdot) \geq v^{\pi}(s), \forall s \in S, \forall i \in \mathcal{N}$ .
+
+Theorem 2 shows that the Generator's influence leads to an improvement in the system performance. Note that by Prop. 1, Theorem 2 compares the environment (extrinsic) rewards accrued by the agents so that the presence of the Generator increases the total expected environment rewards. We complete our analysis by extending Theorem 1 to capture (linear) function approximators which proves [IV]. We first define a projection $\Pi$ by: $\Pi \Lambda \coloneqq \arg \min_{\mathbf{A}}\| \bar{\Lambda} -\Lambda \|$ for any function $\Lambda$ .
+
+$$
+\bar {\Lambda} \in \{\Phi r | r \in \mathbb {R} ^ {p} \}
+$$
+
+Theorem 3 LIGS converges to the stable point of $\mathcal{G}$ , moreover, given a set of linearly independent basis functions $\Phi = \{\phi_1,\dots ,\phi_p\}$ with $\phi_{k}\in L_{2},\forall k$ . LIGS converges to a limit point $r^{\star}\in \mathbb{R}^{p}$ which is the unique solution to $\Pi \mathfrak{F}(\Phi r^{\star}) = \Phi r^{\star}$ where $\mathfrak{F}\Lambda \coloneqq \hat{R} +\gamma P\max \{\mathcal{M}\Lambda ,\Lambda \}$ . Moreover, $r^{\star}$ satisfies: $\| \Phi r^{\star} - Q^{\star}\| \leq (1 - \gamma^{2})^{-1 / 2}\| \Pi Q^{\star} - Q^{\star}\|$ .
+
+The theorem establishes the convergence of LIGS to a stable point (of $\mathcal{G}$ ) with the use of linear function approximators. The second statement bounds the proximity of the convergence point by the smallest approximation error that can be achieved given the choice of basis functions.
+
+# 6 EXPERIMENTS
+
+We performed a series of experiments on the Level-based Foraging environment (Papoudakis et al., 2020) to test if LIGS: 1. Efficiently promotes joint exploration 2. Optimises convergence points by inducing coordination. 3. Handles sparse reward environments. In all tasks, we compared the performance of LIGS against MAPPO (Yu et al., 2021), QMIX (Rashid et al., 2018); intrinsic reward MARL algorithms LIIR (Du et al., 2019), LICA (Zhou et al., 2020a), and a leading MARL exploration algorithm MAVEN (Mahajan et al., 2019). We then compared LIGS against these baselines in StarCraft Micromanagement II (SMAC) (Samvelyan et al., 2019). Lastly, we ran a detailed suite of ablation studies (see Appendix) in which we demonstrated LIGS' flexibility to accommodate i) different MARL learners, ii) different $L$ bonus terms for the Generator objective. We also demonstrated the necessity of the switching control component in LIGS and LIGS' improved use of exploration bonuses.
+
+# 6.1 COOPERATIVE FORAGING TASKS
+
+Experiment 1: Coordinated exploration. We tested our first claim that LIGS promotes coordinated exploration among agents. To investigate this, we used a version of the level-based foraging environment (Papoudakis et al., 2020) as follows: there are $n$ agents each with level $a_{i}$ . Moreover, there are 3 apples with level $K$ such that $\sum_{i=1}^{N} a_{i} = K$ . The only way to collect the reward is if all agents collectively enact the collect action when they are beside an apple. This is a challenging joint-exploration problem since to obtain the reward, the agents must collectively explore joint actions across the state space (rapidly) to discover that simultaneously executing collect near an apple produces rewards. To increase the difficulty, we added a penalty for the agents failing to coordinate in collecting the apples. For example, if only one agent uses the collect action near an apple, it gets a negative reward. This results in a non-monotonic reward structure. The performance curves are given in Fig. 2 which shows LIGS demonstrates superior performance over the baselines.
+
+Experiment 2: Optimal joint policies. We next tested our second claim that LIGS can promote convergence to joint policies that achieve higher system rewards. To do this, we constructed a challenging experiment in which the agents must avoid converging to suboptimal policies that deliver positive but low rewards. In this experiment, the grid is divided horizontally in three sections; top, middle and bottom. All grid locations in the top section give a small reward $r / n$ to the agent visiting them where $n$ is the number of tiles in the each section. The middle section does not give any rewards. The bottom section rewards the agents depending on their relative positions. If one agent is at the top and the other at the bottom, the agent at the bottom receives a reward $-r / n$ each time the other agent receives a reward. If both agents are at the bottom, then one of the tiles in this section will give a reward $R, r / 2 < R < r$ to both agents. The bottom section gives no reward otherwise. The agents start in the middle section and as soon as they cross to one section they cannot return to the middle. As is shown in Fig. 2, LIGS learns to acquire rewards rapidly in comparison to the baselines with MAPPO requiring around 400k episodes to match the rewards produced by LIGS.
+
+Experiment 3: Sparse rewards. We tested our claim that LIGS can promote learning in MAS with sparse rewards. We simulate a sparse reward setting using a competitive game between two teams of agents. One team is controlled by LIGS while the other actions of the agents belonging to the other team are determined by a fixed policy. The goal is to collect the apple faster than the opposing team. Collecting the apple results in a reward of 1, and rewards are 0 otherwise. This is a challenging sparse reward since informative reward signals occur only apple when the apple is collected. As is shown in Fig. 1 both LIGS and MAPPO perform well on the sparse rewards environment, whilst the other baselines are all unable to learn any behaviour on this environment.
+
+Investigations. We investigated the workings of the LIGS framework. We studied the locations where the Generator added intrinsic rewards in Experiments 1 and 2. As shown in the heatmap visualisation in Fig. 3, for Experiment 2, we observe that the Generator learns to add intrinsic rewards that guide the agents towards the optimal reward (bottom right) and away from the suboptimal rewards at the top (where some other baselines converge). This supports our claim that LIGS learns to guide the agents towards jointly optimal policies. Also, as Fig. 3 shows, LIGS's switching mechanism
+
+
+
+
+
+
+
+
+Figure 2: Left. Coordinated Exploration. Centre. Optimal joint policies. Right. Sparse rewards.
+
+
+
+
+
+
+Figure 3: Left. Heatmap of Exp. 1 showing where Generator adds rewards. Centre. Plot of distance to other agent when Generator activates rewards in Exp 1. Right. Corresponding heatmap for Exp. 2.
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 4: Median win rate over the course of learning on SMAC. LIGS outperforms the baselines on all maps. LIIR, LICA, and MAVEN are generally not visible as their win rate is negligible.
+
+
+
+means that the Generator only adds intrinsic rewards at the most useful locations for guiding the agents towards their target. For Experiment 1, Fig. 3 shows that the Generator learns to guide the agents towards the apple which delivers the high rewards. Fig. 3 (Right) demonstrates a striking behaviour of the LIGS framework - it only activates the intrinsic rewards around the apple when both agents are at most 2 cells away from the apple. Since the agents receive positive rewards only when they arrive at the apple simultaneously, this ensures the agents are encouraged to coordinate their arrival and receive the maximal rewards and avoids encouraging arrivals that lead to penalties.
+
+# 6.2 LEARNING PERFORMANCE IN STARCRAFT MULTI-AGENT CHALLENGE
+
+To ascertain if LIGS is effective even in complex environments, we ran it on the following SMAC maps $5m$ vs. $6m$ (hard), $6h$ vs. $8z$ , Corridor, $3s5z$ vs $3s6z$ and MMM2 (super hard). These maps vary in a range of MARL attributes such as number of units to control, environment reward density, unit action sets, and (partial)-observability. In Fig. 4, we report our results showing 'Win Rate' vs 'Steps'. These curves are generated by computing the median win rate (vs the opponent) of the agent at regular intervals during learning. We ran 3 seeds of each algorithm (further setup details are in the Supp. material Sec 14). LIGS outperforms the baselines in all maps. In $5m$ vs. $6m$ and $6h$ vs. $8z$ , the baselines do not approach the performance of LIGS. In Corridor MAPPO requires over an extra million steps to match LIGS. In $3s5z$ vs. $3s6z$ and MMM2, LIGS still outperforms the baselines. In summary, LIGS shows performance gains over all baselines in SMAC maps which encompass diverse MAS attributes.
+
+# 7 CONCLUSION
+
+We introduced LIGS, a novel framework for generating intrinsic rewards which significantly boosts performance of MARL algorithms. Central to LIGS is a powerful adaptive learning mechanism that generates intrinsic rewards according to the task and the MARL learners' joint behaviour. Our experiments show LIGS induces superior performance in MARL algorithms in a range of tasks.
+
+# 8 ACKNOWLEDGEMENTS
+
+We would like to thank Matthew Taylor and Aivar Sootla for their helpful comments.
+
+# REFERENCES
+
+Albert Benveniste, Michel Métivier, and Pierre Priouret. Adaptive algorithms and stochastic approximations, volume 22. Springer Science & Business Media, 2012.
+David Blackwell and Tom S Ferguson. The big match. The Annals of Mathematical Statistics, 39(1): 159-163, 1968.
+Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
+Xiaotie Deng, Yuhao Li, David Henry Mguni, Jun Wang, and Yaodong Yang. On the complexity of computing markov perfect equilibrium in general-sum stochastic games. arXiv preprint arXiv:2109.01795, 2021.
+Sam Devlin and Daniel Kudenko. Theoretical considerations of potential-based reward shaping for multi-agent systems. In *The 10th International Conference on Autonomous Agents and Multiagent Systems*, pp. 225-232. ACM, 2011.
+Sam Devlin and Daniel Kudenko. Plan-based reward shaping for multi-agent reinforcement learning. The Knowledge Engineering Review, 31(1):44-58, 2016.
+Sam Devlin, Daniel Kudenko, and Marek Grzes. An empirical study of potential-based reward shaping and advice in complex, multi-agent systems. Advances in Complex Systems, 14(02): 251-278, 2011.
+Sam Michael Devlin and Daniel Kudenko. Dynamic potential-based reward shaping. In Proceedings of the 11th International Conference on Autonomous Agents and Multiagent Systems, pp. 433-440. IFAAMAS, 2012.
+Nat Dilokthanakul, Christos Kaplanis, Nick Pawlowski, and Murray Shanahan. Feature control as intrinsic motivation for hierarchical reinforcement learning. IEEE transactions on neural networks and learning systems, 30(11):3409-3418, 2019.
+Yali Du, Lei Han, Meng Fang, Ji Liu, Tianhong Dai, and Dacheng Tao. Liir: Learning individual intrinsic reward in multi-agent reinforcement learning. 32, 2019.
+Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Thirty-second AAAI conference on artificial intelligence, 2018.
+Drew Fudenberg and Jean Tirole. Tirole: Game theory. MIT Press, 726:764, 1991.
+Anna Harutyunyan, Sam Devlin, Peter Vrancx, and Ann Nowé. Expressing arbitrary reward functions as potential-based advice. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29, 2015.
+Ionel-Alexandru Hosu and Traian Rebedea. Playing atari games with deep reinforcement learning and human checkpoint replay. arXiv preprint arXiv:1607.05077, 2016.
+Tommi Jaakkola, Michael I Jordan, and Satinder P Singh. Convergence of stochastic iterative dynamic programming algorithms. In Advances in neural information processing systems, pp. 703-710, 1994.
+Jakub Grudzien Kuba, Muning Wen, Yaodong Yang, Linghui Meng, Shangding Gu, Haifeng Zhang, David Henry Mguni, and Jun Wang. Settling the variance of multi-agent policy gradients. arXiv preprint arXiv:2108.08612, 2021.
+
+Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. Advances in neural information processing systems, 29:3675-3683, 2016.
+Minne Li, Zhiwei Qin, Yan Jiao, Yaodong Yang, Jun Wang, Chenxi Wang, Guobin Wu, and Jieping Ye. Efficient ridesharing order dispatching with mean field multi-agent reinforcement learning. In The World Wide Web Conference, pp. 983-994, 2019.
+Sergio Valcarcel Macua, Javier Zazo, and Santiago Zazo. Learning parametric closed-loop policies for markov potential games. arXiv preprint arXiv:1802.00899, 2018.
+Anuj Mahajan, Tabish Rashid, Mikayel Samvelyan, and Shimon Whiteson. Maven: Multi-agent variational exploration. arXiv preprint arXiv:1910.07483, 2019.
+Patrick Mannion, Sam Devlin, Karl Mason, Jim Duggan, and Enda Howley. Policy invariance under reward transformations for multi-objective reinforcement learning. Neurocomputing, 263:60-73, 2017.
+Patrick Mannion, Sam Devlin, Jim Duggan, and Enda Howley. Reward shaping for knowledge-based multi-objective multi-agent reinforcement learning. The Knowledge Engineering Review, 33, 2018.
+Laetitia Matignon, Guillaume J Laurent, and Nadine Le Fort-Piat. Independent reinforcement learners in cooperative markov games: a survey regarding coordination problems. The Knowledge Engineering Review, 27(1):1-31, 2012.
+David Mguni. A viscosity approach to stochastic differential games of control and stopping involving impulsive control. arXiv preprint arXiv:1803.11432, 2018.
+David Mguni. Cutting your losses: Learning fault-tolerant control and optimal stopping under adverse risk. arXiv preprint arXiv:1902.05045, 2019.
+David Mguni, Joel Jennings, and Enrique Munoz de Cote. Decentralised learning in systems with many, many strategic agents. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+David Mguni, Joel Jennings, Sergio Valcarcel Macua, Emilio Sison, Sofia Ceppi, and Enrique Munoz de Cote. Coordinating the crowd: Inducing desirable equilibria in non-cooperative systems. arXiv preprint arXiv:1901.10923, 2019.
+David Mguni, Yutong Wu, Yali Du, Yaodong Yang, Ziyi Wang, Minne Li, Ying Wen, Joel Jennings, and Jun Wang. Learning in nonzero-sum stochastic games with potentials. arXiv preprint arXiv:2103.09284, 2021.
+Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, volume 99, pp. 278-287, 1999.
+Bernt Øksendal. Stochastic differential equations. In Stochastic differential equations, pp. 65-84. Springer, 2003.
+Georgios Papoudakis, Filippos Christianos, Lukas Schäfer, and Stefano V Albrecht. Comparative evaluation of multi-agent deep reinforcement learning algorithms. arXiv preprint arXiv:2006.07869, 2020.
+Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), pp. 2778-2787, 2017.
+P Peng, Q Yuan, Y Wen, Y Yang, Z Tang, H Long, and J Wang. Multiagent bidirectionally-coordinated nets for learning to play starcraft combat games. arxiv 2017. arXiv preprint arXiv:1703.10069, 2017a.
+Peng Peng, Ying Wen, Yaodong Yang, Quan Yuan, Zhenkun Tang, Haitao Long, and Jun Wang. Multiagent bidirectionally-coordinated nets: Emergence of human-level coordination in learning to play starcraft combat games. arXiv preprint arXiv:1703.10069, 2017b.
+
+Emanuele Pesce and Giovanni Montana. Improving coordination in small-scale multi-agent deep reinforcement learning through memory-driven communication. Machine Learning, pp. 1-21, 2020.
+Dawei Qiu, Jianhong Wang, Junkai Wang, and Goran Strbac. Multi-agent reinforcement learning for automated peer-to-peer energy trading in double-side auction market. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI, pp. 2913-2920, 2021.
+Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 4295-4304. PMLR, 2018.
+Tim Roughgarden and Eva Tardos. Introduction to the inefficiency of equilibria. Algorithmic Game Theory, 17:443-459, 2007.
+Maryam Sadeghlou, Mohammad Reza Akbarzadeh-T, and Mohammad Bagher Naghibi-S. Dynamic agent-based reward shaping for multi-agent systems. In 2014 Iranian Conference on Intelligent Systems (ICIS), pp. 1-6. IEEE, 2014.
+Mikayel Samvelyan, Tabish Rashid, Christian Schroeder De Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. arXiv preprint arXiv:1902.04043, 2019.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017.
+Yoav Shoham and Kevin Leyton-Brown. Multiagent systems: Algorithmic, game-theoretic, and logical foundations. Cambridge University Press, 2008.
+Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 5887-5896. PMLR, 2019.
+Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning. arXiv preprint arXiv:1706.05296, 2017.
+John N Tsitsiklis and Benjamin Van Roy. Optimal stopping of markov processes: Hilbert space theory, approximation algorithms, and an application to pricing high-dimensional financial derivatives. IEEE Transactions on Automatic Control, 44(10):1840-1851, 1999.
+Alberto Viseras, Thomas Wiedemann, Christoph Manss, Lukas Magel, Joachim Mueller, Dmitriy Shutin, and Luis Merino. Decentralized multi-agent exploration with online-learning of gaussian processes. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 4222-4229. IEEE, 2016.
+Jianhao Wang, Zhizhou Ren, Beining Han, Jianing Ye, and Chongjie Zhang. Towards understanding linear value decomposition in cooperative multi-agent q-learning. arXiv preprint arXiv:2006.00587, 2020a.
+Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. Qplex: Duplex dueling multi-agent q-learning. arXiv preprint arXiv:2008.01062, 2020b.
+Jianhong Wang, Yuan Zhang, Tae-Kyun Kim, and Yunjie Gu. Shapley q-value: A local reward approach to solve global reward games. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 7285-7292, 2020c.
+Jianhong Wang, Wangkun Xu, Yunjie Gu, Wenbin Song, and Tim Green. Multi-agent reinforcement learning for active voltage control on power distribution networks. Advances in Neural Information Processing Systems, 34, 2021a.
+Jianhong Wang, Yuan Zhang, Tae-Kyun Kim, and Yunjie Gu. Modelling hierarchical structure between dialogue policy and natural language generator with option framework for task-oriented dialogue system. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021b.
+
+Yaodong Yang and Jun Wang. An overview of multi-agent reinforcement learning from game theoretical perspective. arXiv preprint arXiv:2011.00583, 2020.
+Yaodong Yang, Lantao Yu, Yiwei Bai, Jun Wang, Weinan Zhang, Ying Wen, and Yong Yu. A study of ai population dynamics with million-agent reinforcement learning. arXiv preprint arXiv:1709.04511, 2017.
+Yaodong Yang, Rui Luo, Minne Li, Ming Zhou, Weinan Zhang, and Jun Wang. Mean field multiagent reinforcement learning. In International Conference on Machine Learning, pp. 5571-5580. PMLR, 2018.
+Yaodong Yang, Ying Wen, Jun Wang, Liheng Chen, Kun Shao, David Mguni, and Weinan Zhang. Multi-agent determinantal q-learning. In International Conference on Machine Learning, pp. 10757-10766. PMLR, 2020.
+Chao Yu, Akash Velu, Eugene Vinitsky, Yu Wang, Alexandre Bayen, and Yi Wu. The surprising effectiveness of mappo in cooperative, multi-agent games. arXiv preprint arXiv:2103.01955, 2021.
+Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
+Meng Zhou, Ziyu Liu, Pengwei Sui, Yixuan Li, and Yuk Ying Chung. Learning implicit credit assignment for multi-agent actor-critic. arXiv e-prints, pp. arXiv-2007, 2020a.
+Ming Zhou, Jun Luo, Julian Villella, Yaodong Yang, David Rusu, Jiayu Miao, Weinan Zhang, Montgomery Alban, Iman Fadakar, Zheng Chen, et al. Smarts: Scalable multi-agent reinforcement learning training school for autonomous driving. arXiv preprint arXiv:2010.09776, 2020b.
+Martin Zinkevich, Amy Greenwald, and Michael Littman. Cyclic equilibria in markov games. Advances in Neural Information Processing Systems, 18:1641, 2006.
\ No newline at end of file
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/images.zip b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..390a0f0acd83851d44964c103cb79ae265cf9c8a
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:937d1fff195ad0faebfe46933991c9af5922b99d524bf2525b7e837f11366283
+size 197915
diff --git a/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/layout.json b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..abe8e6cbeb1cca1d1948b7b6a27b11be1089a040
--- /dev/null
+++ b/ligslearnableintrinsicrewardgenerationselectionformultiagentlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:55c7aabd051a470a7e7f0dc9de29e5e9857013ea25ad0cf5ff113c0ba21c33da
+size 537576
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_content_list.json b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..85ffeb858eb57d848047ab4f5be4cb572e3d8e43
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:785fdd8f240e20bdac048428a465c0eef5af53a4608a7ac85320cef1bfb041e4
+size 171287
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_model.json b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f61824b71220a80767adfe75f5c67e29c478943c
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:32c5ad31159758cc4edd252283cee1fd8e8663e5374de92a5a50a493a9af5391
+size 194001
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_origin.pdf b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3bd3a6aa03802a7c180b463aa9d2c593af667914
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/a9058408-0cfa-49f7-91b0-badd5e8005f2_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e098566b49d74083fd3b57982ebf58cd6e1cf9478e6af843ae85552c1d5f0961
+size 1682251
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/full.md b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..911c77860267b2edcad9659f378d505c95fd54c7
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/full.md
@@ -0,0 +1,502 @@
+# LORD: LOWER-DIMENSIONAL EMBEDDING OF LOG-SIGNATURE IN NEURAL ROUGH DIFFERENTIAL EQUATIONS
+
+Jaehoon Lee, Jinsung Jeon, Sheoyon Jhin, Jihyeon Hyeong, Jayoung Kim, Minju Jo, Seungji Kook, and Noseong Park
+Yonsei University
+Seoul, South Korea
+{jaehoonlee, jjsjjs0902, sheoyonj, jiji.hyeong, jayoung.k alflsowl12, 2021321393, noseong}@yonsei.ac.kr
+
+# ABSTRACT
+
+The problem of processing very long time-series data (e.g., a length of more than 10,000) is a long-standing research problem in machine learning. Recently, one breakthrough, called neural rough differential equations (NRDEs), has been proposed and has shown that it is able to process such data. Their main concept is to use the log-signature transform, which is known to be more efficient than the Fourier transform for irregular long time-series, to convert a very long time-series sample into a relatively shorter series of feature vectors. However, the log-signature transform causes non-trivial spatial overheads. To this end, we present the method of LObweR-Dimensional embedding of log-signature (LORD), where we define an NRDE-based autoencoder to implant the higher-depth log-signature knowledge into the lower-depth log-signature. We show that the encoder successfully combines the higher-depth and the lower-depth log-signature knowledge, which greatly stabilizes the training process and increases the model accuracy. In our experiments with benchmark datasets, the improvement ratio by our method is up to $75\%$ in terms of various classification and forecasting evaluation metrics.
+
+# 1 INTRODUCTION
+
+Time-series data occurs frequently in real-world applications, e.g., stock price forecasting (Ariyo et al., 2014; Siami-Namini et al., 2018; Jhin et al., 2021), traffic forecasting (Reinsel, 2003; Fu, 2011; Bai et al., 2020; Fang et al., 2021), weather forecasting (Shi et al., 2015; Seo et al., 2018; Brouwer et al., 2019; Ren et al., 2021), and so on. However, it is known that very long time-series data (e.g., a time-series length of more than 10,000) is not straightforward to process with deep learning despite various techniques ranging from recurrent neural networks (RNNs) to neural ordinary/controlled differential equations (NODEs and NCDEs). RNNs are known to be unstable when training with such very long sequences and the maximum length that can be processed by NODEs and NCDEs is more or less the same as that by RNNs (Morrill et al., 2021; Aicher et al., 2020; Trinh et al., 2018; Stoller et al., 2019; Bai et al., 2018). However, one breakthrough has been recently proposed, namely neural rough differential equations (NRDEs).
+
+NRDEs are based on the rough path theory which was established to make sense of the controlled differential equation:
+
+$$
+d \mathbf {z} (t) = f (\mathbf {z} (t)) d X (t), \tag {1}
+$$
+
+where $X$ is a continuous control path, and $\mathbf{z}(t)$ is a hidden vector at time $t$ . A prevalent example of $X$ is a (semimartingale) Wiener process, in which case the equation reduces to a stochastic differential equation. In this sense, the rough path theory extends stochastic differential equations beyond the semimartingale environments (Lyons et al., 2004).
+
+One key concept in the rough path theory is the log-signature of a path. It had been proved that the log-signature of a path with bounded variations is unique under mild conditions (Lyons & Xu,
+
+
+(a) Directly reducing the dimensionality
+
+
+(b) Combining both log-signature information (our method)
+Figure 1: Two possible approaches to reduce the dimensionality of the higher-depth log-signature. The dark gray means a processing in a higher-dimensional space and the light gray means that in a lower-dimensional space. Our embedding method in (b) is better than the baseline in (a) in that i) the higher-dimensional processing is deferred to the decoder which will be discarded after pre-training the autoencoder, and ii) our method does not involve any higher-dimensional processing during the main training and inference processes. We pre-train the autoencoder and in the main training step, we discard the decoder, fix the encoder, and train only the main NRDE for a downstream task (cf. Table 1). In this way, we can exclude the higher-dimensional processing as early as possible.
+
+2018; Geng, 2017) and most time-series data that happens in the field of deep learning has bounded variations. Therefore, one can interpret that the log-signature is a unique feature of the path.
+
+Given a $N$ -length time-series sample $\{\mathbf{x}_i\}_{i=0}^N$ annotated with its observation time-points $\{t_i\}_{i=0}^N$ , where $t_0 = 0$ , $t_N = T$ , and $t_i < t_{i+1}$ , NRDEs construct a continuous path $X(t)$ , where $t \in [0, T]$ , with an interpolation algorithm, where $X(t_i) = (\mathbf{x}_i, t_i)$ for $t_i \in \{t_i\}_{i=0}^N$ . In other words, the path has the same value as the observation $(\mathbf{x}_i, t_i)$ , when $t_i$ is one of the observation timepoints and otherwise, interpolated values. As shown in Fig. 1, a log-signature (each dotted yellow box in the figure) is calculated every $P$ -length sub-path, and another time-series of log-signatures, denoted $\{LogSig_{r_i, r_{i+1}}^D(X)\}_{i=0}^{\lfloor \frac{T}{P} \rfloor - 1}$ , is created. The log-signature calculation has one important hyperparameter $D$ called depth — the higher the depth is, the more accurately represented each sub-path is (cf. Eq. 4). For instance, the best accuracy score is 0.81 for $D = 3$ vs. 0.78 for $D = 2$ in EigenWorms. The sub-path length $P$ and the depth $D$ decides the number and the dimensionality of log-signatures, respectively.
+
+However, one downside is $\dim (LogSig_{r_i,r_{i + 1}}^D (X)) > \dim (X)$ , where $\dim (X)$ means the dimensionality (or the number of channels) of $X$ . As a matter of fact, $\dim (LogSig_{r_i,r_{i + 1}}^D (X))$ grows rapidly w.r.t. $\dim (X)$ (Morrill et al., 2021). Since the dimensionality of the input data is, given a dataset, fixed, we need to decrease $D$ to reduce overheads. In general, NRDEs require more parameters to process higher-dimensional log-signatures (as shown in Table 4 where the original NRDE design always requires more parameters for $D = 3$ in comparison with $D = 2$ .
+
+
+Figure 2: The loss curve of LORD is stable. Other figures are in Appendix F.
+
+To this end, we propose to embed the higher-depth signatures onto a lower-dimensional space to i) decrease the complexity of the main NRDE (the solid blue box in Fig. 1), and ii) increase the easiness of training (cf. Fig. 2) and as a result, its model accuracy as well. Fig. 1 shows two possible approaches where we directly reduce the dimensionality of the higher-depth log-signature in Fig. 1 (a) or we adopt the autoencoder architecture to combine both the higher-depth and the lower-depth signatures in Fig. 1 (b) — the first approach in Fig. 1 (a) is a baseline model, and our proposed model is the second approach in Fig. 1 (b). Autoencoders are frequently used for (unsupervised) dimensionality reduction although there also exist other approaches. Since the higher-depth log-signature should be reconstructed from the embedded vector, one can consider that
+
+the higher-depth log-signature is indirectly embedded into the vector. Moreover, the decoder is discarded after its pre-training so our method does not involve any high-cost computation with the higher-depth log-signature in the main training and inference steps as clarified in Table 1.
+
+Table 1: Two phase training in our method
+
+ | Pre-training | Main training |
| Decoder | Training | Discarded |
| Encoder | Training | Fixed |
| Main NRDE | Not Applicable | Training |
+
+Our proposed method, LoweR-Dimensional embedding of log-signature (LORD), adopts an NRDE-based autoencoder to combine the higher-depth and the lower-depth log-signature knowledge, and utilizes the embedded knowledge by the encoder for a downstream machine learning task as shown in Fig. 1 (b). The encoder embeds the lower-depth log-signature from the continuous
+
+path $X$ , and the decoder reconstructs the higher-depth log-signature. This specific design is where our key idea lies in. The encoded lower-depth log-signature will contain both the lower-depth and the higher-depth log-signature knowledge because i) it is an encoding of the lower-depth log-signature and ii) the decoder should recover the higher-depth log-signature from it. After pre-training the autoencoder, we discard the decoder to exclude the higher-dimensional processing as early as possible from our framework. After that, we fix the encoder and train only the main NRDE.
+
+We conduct experiments with six very long time-series benchmark datasets and five baselines including NODE, NCDE, and NRDE-based models. RNN-based models cannot process the very long time-series datasets and we exclude them. Our proposed method significantly outperforms all existing baselines. Our contributions can be summarized as follows:
+
+1. We design an NRDE-based continuous autoencoder to combine the higher-depth and the lower-depth log-signature information. Since the decoder is discarded after being trained, we adopt the asymmetric architecture that the encoder is lightweight and the decoder is heavyweight in terms of the number of parameters.
+2. Our proposed method outperforms all baselines by large margins (up to $75\%$ for various evaluation metrics, e.g., $R^2$ ) in standard benchmark datasets with much smaller model sizes in comparison with the original NRDE design.
+
+Our code is available in https://github.com/leejaehoon2016/LORD.
+
+# 2 RELATED WORK AND PRELIMINARIES
+
+NODEs NODEs (Chen et al., 2018) use the following equation:
+
+$$
+\mathbf {z} (T) = \mathbf {z} (0) + \int_ {0} ^ {T} f (\mathbf {z} (t), t; \theta_ {f}) d t, \tag {2}
+$$
+
+which means $\mathbf{z}(T)$ is solely defined by the initial value $\mathbf{z}(0)$ — the entire evolving path from $\mathbf{z}(0)$ to $\mathbf{z}(T)$ is defined by the initial value in ODEs. NODEs are not considered as a continuous analogue to RNNs but to residual networks (Chen et al., 2018).
+
+NCDEs Let $\{\mathbf{x}_i\}_{i=0}^N$ be an $N$ -length time-series sample and $\{t_i\}_{i=0}^N$ be its observation timepoints. NCDEs are different from NODEs in that they use the following equation:
+
+$$
+\mathbf {z} (T) = \mathbf {z} (0) + \int_ {0} ^ {T} f (\mathbf {z} (t); \theta_ {f}) d X (t) = \mathbf {z} (0) + \int_ {0} ^ {T} f (\mathbf {z} (t); \theta_ {f}) \frac {d X (t)}{d t} d t, \tag {3}
+$$
+
+where $X(t)$ is a continuous interpolated path from $\{(\mathbf{x}_i, t_i)\}_{i=0}^N$ , where $t_N = T$ . In this regards, NCDEs can also be considered as a continuous analogue to RNNs. The adjoint sensitivity method can be used to decrease the space complexity of gradient calculation instead of backpropagation (Kidger et al., 2020).
+
+However, NCDEs has an inherent disadvantage that they are weak at processing very long time-series samples, because NCDEs directly process the very long time-series samples.
+
+Signature Transform Let $[r_i, r_{i+1}]$ be a time duration, where $r_i < r_{i+1}$ . The signature of the time-series sample is defined as follows:
+
+$$
+\begin{array}{l} S^{i_{1},\ldots ,i_{k}}_{r_{i},r_{i + 1}}(X) = \int \dots \int \prod_{\substack{r_{i} < t_{1} < \ldots < t_{k} < r_{i + 1}}}^{k}\frac{dX^{i_{j}}}{dt} (t_{j})dt_{j}, \\ \operatorname {S i g} _ {r _ {i}, r _ {i + 1}} ^ {D} (X) = \left(\left\{S _ {r _ {i}, r _ {i + 1}} ^ {i} (X) \right\} _ {i = 1} ^ {\dim (X)}, \left\{S _ {r _ {i}, r _ {i + 1}} ^ {i, j} (X) \right\} _ {i, j = 1} ^ {\dim (X)}, \dots , \left\{S _ {r _ {i}, r _ {i + 1}} ^ {i _ {1}, \dots , i _ {D}} (X) \right\} _ {i _ {1}, \dots , i _ {D} = 1} ^ {\dim (X)}\right), \tag {4} \\ \end{array}
+$$
+
+However, the signature has redundancy, e.g., $S_{a,b}^{1,2}(X) + S_{a,b}^{2,1}(X) = S_{a,b}^{1}(X)S_{a,b}^{2}(X)$ where we can know a value if knowing three others. The log-signature $\operatorname{LogSig}_{r_i,r_{i+1}}^D(X)$ is then created after dropping the redundancy from the signature. In this work, we use this log-signature definition in default to design our method. By creating a log-signature for every $P$ -length sub-path, the entire sequence length can be reduced — moreover, the log-signature is a unique feature of the subpath (Lyons & Xu, 2018; Geng, 2017). For complexity reasons, we typically use the log-signature of depth $D \leq 3$ (Morrill et al., 2021).
+
+NRDEs Owing to the log-signature transform of time-series, NRDEs (Morrill et al., 2021) are defined as follows:
+
+$$
+g (X, t) = \frac {\operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D} (X)}{r _ {i + 1} - r _ {i}} \text {f o r} t \in [ r _ {i}, r _ {i + 1}), \tag {5}
+$$
+
+$$
+\mathbf {z} (T) = \mathbf {z} (0) + \int_ {0} ^ {T} f (\mathbf {z} (t); \theta_ {f}) g (X, t) d t,
+$$
+
+where $\operatorname{LogSig}_{r_i, r_{i+1}}^D(X)$ means the log-signature created from the path $X$ within the interval $[r_i, r_{i+1})$ . $\frac{\operatorname{LogSig}_{r_i, r_{i+1}}^D(X)}{r_{i+1} - r_i}$ is a piecewise approximation of the time-derivative of the log-signature in the short interval $[r_i, r_{i+1})$ . $D$ means the depth of the log-signature. Once we define the subpath length $P$ , the intervals $\{(r_i, r_{i+1})\}_{i=0}^{\lfloor \frac{T}{P} \rfloor - 1}$ are decided, i.e., $P = r_{i+1} - r_i$ for all $i$ . Then, the time-series of $\operatorname{LogSig}_{r_i, r_{i+1}}^D(X)$ constitutes $\{\operatorname{LogSig}_{r_i, r_{i+1}}^D(X)\}_{i=0}^{\lfloor \frac{T}{P} \rfloor - 1}$ in our notation.
+
+NRDEs use Eq. 5 to derive $\mathbf{z}(T)$ from $\mathbf{z}(0)$ , which can be considered as a continuous analogue to RNNs since it continuously reads the time-derivative of the log-signature. Therefore, $\mathbf{z}(T)$ is defined by the initial value $\mathbf{z}(0)$ and the sequence of the time-derivative of the log-signature. We can also use the adjoint sensitivity method to train NRDEs.
+
+Long Sequence Time-series Input (LSTI) The problem of processing very long time-series data is a long standing research problem. There are three ways to solve the LSTI problem. First, it reduces the sequence through truncating/summarizing/sampling from a very long input sequence. However, this method may lose information affecting the prediction accuracy. The second is to give the gradient transformation. As the sequence becomes longer, the gradient vanishing problem occurs. Therefore, in (Aicher et al., 2020), the model is trained using only the gradient of the last step. It also solves the problem using auxiliary losses (Trinh et al., 2018). Finally, CNNs (Stoller et al., 2019; Bai et al., 2018) were used to solve the LSTI problem. The convolutional filter captures long term dependencies, but the receptive fields increase exponentially, breaking the sequence.
+
+# 3 PROPOSED METHOD
+
+We describe our proposed method, LORD-NRDE. We first clarify the motivation of our work and then describe our proposed model design.
+
+Motivation It is known that NRDEs are a generalization of NCDEs (Morrill et al., 2021, Section 3.2). However, one problem in utilizing NRDEs in real-world environments is that $\dim( \operatorname{LogSig}_{r_i, r_{i+1}}^D(X)$ ) is a rapidly growing function of $\dim(X)$ (Morrill et al., 2021, Section A).
+
+
+Figure 3: The proposed NRDE-based autoencoder
+
+# Algorithm 1: How to train LORD-NRDE
+
+Input: Training data $D_{train}$ , Validating data $D_{val}$ , Maximum iteration numbers max_iterAE and max_iterTASK
+
+1 Initialize the parameters of the encoder (i.e., $\theta_{f},\theta_{\phi_{\mathbf{e}}}$ ), the decoder (i.e., $\theta_{o},\theta_{\phi_{\mathbf{s}}}$ ), and the main NRDE (i.e., $\theta_{g},\theta_{\phi_{\mathbf{z}}},$ $\theta_{\phi_{\mathrm{output}}})$
+/\*Pre-training of the autoencoder \*/
+2 for max_iterAE iterations do
+3 Train the encoder and the decoder using $L_{AE}$
+/\*Main-trainingofLORD-NRDE
+4 for max_iterTASK iterations do
+5 Train the main NRDE using $L_{TASK}$
+6 | Validate the best main NRDE parameters with $D_{val}$ ;
+7 return the encoder and the main NRDE parameters;
+
+This rapid blow-up of dimensionality causes two problems: i) it hinders us from applying NRDEs to high-dimensional time-series data, and ii) it makes the training process complicated since the hidden representation of the large input should be made for a downstream task. Therefore, we propose to embed the log-signature onto a lower dimensional space so that the training process becomes more tractable and enhance the applicability of NRDEs to high-dimensional data. After the embedding, in other words, the dimensionality of embedded vector is typically smaller than that of the log-signature with depth $D_{2}$ in our setting but it has knowledge of the log-signature with depth $D_{2} > D_{1}$ .
+
+Overall Architecture We describe our proposed method, LORD-NRDE, which consists of three NRDEs: i) an encoder NRDE, ii) a decoder NRDE and iii) a main NRDE to derive $\mathbf{z}(T)$ from $\mathbf{z}(0)$ . The role of each NRDE is as follows:
+
+1. The encoder NRDE continuously embeds the log-signature with depth $D_{1}$ onto another space. We use $\mathbf{e}(t)$ to denote the vector embedded from the log-signature at time $t$ .
+2. The decoder NRDE reconstructs the log-signature with depth $D_{2} > D_{1}$ from $\mathbf{e}(t)$ .
+3. The main NRDE reads $\mathbf{e}(t)$ to evolve $\mathbf{z}(t)$ and derive $\mathbf{z}(T)$ . There is an output layer which reads $\mathbf{z}(T)$ and makes inference.
+
+We note that $\dim (LogSig_{r_i,r_{i + 1}}^{D_2}(X)) > \dim (\mathbf{e}(t))$ , where $t\in [0,T]$ . We require that the encoder produces embedding vectors that contain both the log-signature knowledge with $D_{1}$ and $D_{2}$ depth.
+
+LORD-NRDE To this end, we propose the following method:
+
+$$
+\mathbf {z} (T) = \mathbf {z} (0) + \int_ {0} ^ {T} g (\mathbf {z} (t); \theta_ {g}) \frac {d \mathbf {e} (t)}{d t} d t, \tag {6}
+$$
+
+$$
+\mathbf {e} (T) = \mathbf {e} (0) + \int_ {0} ^ {T} f (\mathbf {e} (t); \theta_ {f}) \frac {\operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D _ {1}} (X)}{r _ {i + 1} - r _ {i}} d t, \text {f o r} t \in [ r _ {i}, r _ {i + 1}), \tag {7}
+$$
+
+$$
+\mathbf {s} (T) = \mathbf {s} (0) + \int_ {0} ^ {T} o (\mathbf {s} (t); \theta_ {o}) \frac {d \mathbf {e} (t)}{d t} d t, \tag {8}
+$$
+
+where $\dim (\mathbf{e}(t)) < \dim (\mathbf{s}(t)) = \dim (LogSig_{r_i,r_{i + 1}}^{D_2}(X))$ , where $t\in [r_i,r_{i + 1})$ , with $D_{2} > D_{1}$ .
+
+The term $d\mathbf{e}(t)$ can be considered as an embedding of the log-signature with depth $D_{1}$ at time $t$ , and $\mathbf{e}(t)$ as an embedding of $X(t)$ constructed by the log-signature with depth $D_{1}$ . Similarly, $ds(t)$ is a reconstructed log-signature with depth $D_{2}$ from the embedding, and $\mathbf{s}(t)$ as $X(t)$ reconstructed by the log-signature with depth $D_{2}$ . Since $\mathbf{e}(0)$ and $\mathbf{s}(0)$ mean the initial values, we set $\phi_{\mathbf{e}}(X(0);\theta_{\phi_{\mathbf{e}}})$ , $\phi_{\mathbf{s}}(\mathbf{e}(0);\theta_{\phi_{\mathbf{s}}})$ , where $\phi$ means a transformation function.
+
+Therefore, $\mathbf{e}(t)$ and $\mathbf{s}(t)$ constitute an autoencoder based on NDREs as shown in Fig. 3. In our design, we use the asymmetrical setting for them, where the encoder RDE is lightweight and the decoder RDE is heavyweight in terms of the number of parameters, considering the applicability of
+
+our design to real-world environments. Since the decoder NRDE is discarded after its pre-training, the heavyweight setting causes no problems afterwards — our method requires more resources for the pre-training process though.
+
+There are three functions $g$ , $f$ , and $o$ in Eqs. 6 to 8 and their definitions are as follows:
+
+$$
+g (\mathbf {z} (t); \theta_ {g}) = \mathrm {F C} _ {\text {o u t} _ {g}, N _ {g} + 1} \left(\psi \left(\mathrm {F C} _ {h _ {g}, N _ {g}} \left(\dots \eta \left(\mathrm {F C} _ {h _ {g}, 1} (\mathbf {z} (t)) \dots\right)\right)\right), \right. \tag {9}
+$$
+
+$$
+f (\mathbf {e} (t); \theta_ {f}) = \mathbb {F C} _ {\text {o u t} _ {f}, N _ {f} + 1} \left(\psi \left(\mathbb {F C} _ {h _ {f}, N _ {f}} \left(\dots \eta \left(\mathbb {F C} _ {h _ {f}, 1} (\mathbf {e} (t)) \dots\right)\right)\right), \right. \tag {10}
+$$
+
+$$
+o (\mathbf {s} (t); \theta_ {o}) = \mathrm {F C} _ {\text {o u t} _ {o}, N _ {o} + 1} \left(\psi \left(\mathrm {F C} _ {h _ {o}, N _ {o}} \left(\dots \eta \left(\mathrm {F C} _ {h _ {o}, 1} (\mathbf {s} (t)) \dots\right)\right)\right), \right. \tag {11}
+$$
+
+where $\mathsf{FC}_h$ is a fully-connected (FC) layer whose output size is $h$ . $N_{g}, N_{f}, N_{o}$ means the number of FC layers. $\psi$ and $\eta$ are the hyperbolic tangent and rectified linear unit activations, respectively.
+
+Training Method To train the NRDE-based autoencoder, we use the following loss:
+
+$$
+L _ {r e c o n} = \frac {\sum_ {i = 0} ^ {M} \left\| \left(\mathbf {s} \left(r _ {i + 1}\right) - \mathbf {s} \left(r _ {i}\right)\right) - \operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D _ {2}} (X) \right\| _ {2} ^ {2}}{M}, \tag {12}
+$$
+
+$$
+L _ {A E} = L _ {r e c o n} + c _ {A E} \left(\| \theta_ {f} \| _ {2} ^ {2} + \| \theta_ {o} \| _ {2} ^ {2} + \| \theta_ {\phi_ {\mathbf {e}}} \| _ {2} ^ {2} + \| \theta_ {\phi_ {\mathbf {s}}} \| _ {2} ^ {2}\right) + c _ {\mathbf {e}} \| \mathbf {e} \| _ {2} ^ {2}, \tag {13}
+$$
+
+where $M = \left\lfloor \frac{T}{P} \right\rfloor - 1$ , and $c_{AE}$ is a coefficient of the $L_{2}$ regularization terms. $c_{\mathrm{e}}$ also regularizes the scale of the learned embedding. In addition to $L_{AE}$ , we also have a task loss $LT_{ASK}$ which is the standard cross-entropy (CE) loss or the mean squared loss (MSE) loss. From $\mathbf{z}(T)$ , we have an output layer, which is typically a fully-connected layer with an appropriate final activation function such as softmax, to produce a prediction $\hat{y}$ . $\theta_{\phi_{\mathrm{output}}}$ denotes the parameters of the output layer. Using the ground-truth information $y$ , we define the task loss $LT_{ASK}$ . Therefore, the final loss can be written as follows:
+
+$$
+L _ {T A S K} = C E (y, \hat {y}) + c _ {T A S K} \left(\| \theta_ {g} \| _ {2} ^ {2} + \| \theta_ {\phi_ {\mathbf {z}}} \| _ {2} ^ {2} + \| \theta_ {\phi_ {\text {o u t p u t}}} \| _ {2} ^ {2}\right), \tag {14}
+$$
+
+where $c_{TASK}$ is a coefficient of the $L_{2}$ regularization terms, and $CE(y,\hat{y})$ means a cross-entropy loss — we assume classification but it can be accordingly changed for other tasks.
+
+To implement, we define the following augmented ODE:
+
+$$
+\frac {d}{d t} \left[ \begin{array}{c} \mathbf {z} (t) \\ \mathbf {e} (t) \\ \mathbf {s} (t) \end{array} \right] = \left[ \begin{array}{c} g (\mathbf {z} (t); \theta_ {g}) f (\mathbf {e} (t); \theta_ {f}) \frac {\operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D _ {1}} (X)}{r _ {i + 1} - r _ {i}} \\ f (\mathbf {e} (t); \theta_ {f}) \frac {\operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D _ {1}} (X)}{r _ {i + 1} - r _ {i}} \\ o (\mathbf {s} (t); \theta_ {o}) f (\mathbf {e} (t); \theta_ {f}) \frac {\operatorname {L o g S i g} _ {r _ {i} , r _ {i + 1}} ^ {D _ {1}} (X)}{r _ {i + 1} - r _ {i}} \end{array} \right], \text {f o r} t \in [ r _ {i}, r _ {i + 1}), \tag {15}
+$$
+
+where we replace $\frac{d\mathbf{e}(t)}{dt}$ with $f(\mathbf{e}(t);\theta_f)\frac{\operatorname{LogSig}_{r_i,r_{i + 1}}^{D_1}(X)}{r_{i + 1} - r_i}$ (as defined in Eq. 7), and the initial values are defined as follows:
+
+$$
+\left[ \begin{array}{l} \mathbf {z} (0) \\ \mathbf {e} (0) \\ \mathbf {s} (0) \end{array} \right] = \left[ \begin{array}{l} \phi_ {\mathbf {z}} (X (0)); \theta_ {\phi_ {\mathbf {z}}} \\ \phi_ {\mathbf {e}} (X (0)); \theta_ {\phi_ {\mathbf {e}}} \\ \phi_ {\mathbf {s}} (\mathbf {e} (0); \theta_ {\phi_ {\mathbf {s}}}) \end{array} \right], \tag {16}
+$$
+
+where $\phi_{\mathbf{z}}$ and $\phi_{\mathbf{e}}$ are transformation functions to produce the initial values from the initial observation $X(0)$ , and $\phi_{\mathbf{s}}$ is a transformation function to produce the initial reconstructed value from the initial embedded vector $\mathbf{e}(0)$ . We use a fully-connected layer for each of them.
+
+Alg. 1 shows the training algorithm. In Line 3, we pre-train the autoencoder for max_iter_AE iterations. After discarding the decoder and fixing the encoder, we then train the main NRDE in Line 5 for max_iter_TASK iterations. Using $D_{val}$ , we validate and choose the best parameters.
+
+# 4 EXPERIMENTAL EVALUATIONS
+
+We describe our experimental environments and results. The mean and variance of 5 different seeds are reported for model evaluation. We refer to Appendix A for reproducibility.
+
+# 4.1 EXPERIMENTAL ENVIRONMENTS
+
+Datasets We use six real-word dataset which all contain very long time-series samples. There are 3 classification datasets in the University of East Anglia (UEA) repository (Tan & Webb): EigenWorms, CounterMovementJump, and SelfRegulationSCP2, and 3 forecasting datasets in Beth Israel Deaconess Medical Centre (BIDMC) which come from the TSR archive (Tan & Webb): BIDMCHR, BIDMCRR, BIDMCSp02. We refer to Appendix B for detail of datasets.
+
+Baselines There are three types of baselines in our Experiments, ranging from NODE to NCDE and NRDE-based baseline models. ODE-RNN is one of the state-of-the-art NODE models in processing time-series. Following the suggestion in (Morrill et al., 2021), we merge $P$ observations into one merged observation and feed it into ODE-RNN, in which case ODE-RNN is able to process much longer time-series. The dimensionality of the merged observation is $P$ times larger than that of the original observation or equivalently, the length of the merged time-series is $P$ times shorter than that of the original one. NCDE is the original NCDE design in (Kidger et al., 2020). Attentive NCDE (ANCDE) is an extension of NCDE by adding an attention mechanism into it, which significantly outperforms NCDE (Jhin et al., 2021). For the NRDE-type baselines, we consider i) the original NRDE design (Morrill et al., 2021), and ii) the one in Fig. 1 (a) which directly embeds the higher-depth log-signature into a lower-dimensional space, each of which is called NRDE and DE-NRDE, respectively. For those NRDE-based models, we clarify its one important hyperparameter, depth, as part of its name, e.g., $\mathrm{NRDE}_2$ means NRDE with $D = 2$ . One important point is that NRDE is a generalization of NCDE. Therefore, $\mathrm{NRDE}_1$ is theoretically identical to NCDE, if using the linear interpolation method, and for this reason, we set $D > 1$ for NRDE.
+
+Hyperparameters When using NRDEs, there is one crucial hyperparameter, the log-signature depth $\bar{D}$ . We use two depth settings which were used in (Morrill et al., 2021). For our LORD-NRDE, there are two depths, $D_{1}$ and $D_{2}$ , where $D_{1} < D_{2}$ . $\mathrm{LORD}_{D_1\to D_2}$ means that LORD-NRDE's decoder recovers the $D_{2}$ -depth log-signature from the $D_{1}$ -depth log-signature. The number of layers in the encoder, decoder and main NRDE, $N_{g}, N_{f}$ , and $N_{o}$ of Eqs. 9 to 11, are in $\{2,3\}$ . The hidden sizes, $h_g, h_f$ , and $h_o$ of Eqs. 9 to 11, are in $\{32,64,128,192\}$ . The coefficients of the $L_{2}$ regularizers in Eqs. 13 and 14 are in $\{1\times 10^{-5},1\times 10^{-6}\}$ . The coefficient of the embedding regularizer, $c_{\mathbf{e}}$ in Eq. 13 is in $\{0,1,10\}$ . The max_iteration numbers, max_iterAE and max_iterTASK in Alg. 1, are in $\{400,500,1000,1500,2000\}$ . The learning rate of the pre-training and main-training is $1\times 10^{-3}$ . We also set $\dim(\mathbf{e}(t)) = \dim(\operatorname{LogSig}_{r_i,r_{i+1}}^{D_1}(X))$ , where $t \in [r_i,r_{i+1})$ .
+
+We also conduct experiments by setting the sub-path length $P$ to 4, 8, 32, 64, 128, 256, or 512 observations. In other words, we create one log-signature for every $P$ input observation for NCDE and NRDE-based models. For ODE-RNN, as described earlier, we simply concatenate $P$ observations into one observation. The final time $T$ is large in our experiments, e.g., $T > 10,000$ , and the number of log-signatures is $\lfloor \frac{T}{P} \rfloor$ . We test both the adjoint sensitivity method and the backpropagation through the solver.
+
+Evaluation Methods We reuse the very long time-series classification and forecasting evaluation methods of (Morrill et al., 2021) and extend the methods by adding more datasets and more evaluation metrics. We use accuracy, macro F1, and ROCAUC for binary classification; accuracy, macro/weighted F1, and ROCAUC for multi-class classification; and $R^2$ , explained variance, mean squared error (MSE), and mean absolute error (MAE) for forecasting — we list the complete results in Appendix D after introducing key results in the main manuscript. We also show the number of parameters for each model — for our LORD, we exclude the parameter numbers of the decoder since it is discarded after the pre-training. We train and test each model 5 times with different seeds. If the mean of score is the same, the smaller standard deviation is better.
+
+# 4.2 EXPERIMENTAL RESULTS
+
+Summary of Experimental Results Since our main result tables have many items, we quickly summarize their highlights in Tables 2 and 3. To calculate the improvement in evaluation metrics, we use the ratio of improvement over $\mathrm{NRDE}_2$ for each metric averaged over all the sub-path lengths and all datasets, e.g., we calculate $\frac{\text{LORD's ROCAUC} - \text{NRDE}_2\text{s ROCAUC}}{\text{NRDE}_2\text{s ROCAUC}}$ and $\frac{\text{NRDE}_2\text{s MSE} - \text{LORD's MSE}}{\text{NRDE}_2\text{s MSE}}$ for all classification cases and average them. The ratio of the number of parameters is calculated similarly.
+
+Table 2: Highlights in Classification
+
+| Method | Acc. | Mac.F1 | ROCAUC | #Params |
| ODE-RNN | -9% | -19% | -11% | -20% |
| NCDE | -4% | -8% | -5% | -64% |
| ANCDE | 0% | 0% | 0% | 15% |
| NRDE2 | 0% | 0% | 0% | 0% |
| NRDE3 | 2% | 4% | 2% | 537% |
| DE-NRDE2 | -4% | -7% | -3% | -48% |
| DE-NRDE3 | -2% | -2% | 0% | 177% |
| LORD1→2 | 16% | 23% | 11% | -55% |
| LORD1→3 | 15% | 20% | 10% | -46% |
| LORD2→3 | 8% | 9% | 4% | 17% |
+
+Table 3: Highlights in Forecasting
+
+| Method | R2 | MSE | #Params |
| ODE-RNN | 44% | 41% | -36% |
| NCDE | -45% | -55% | -30% |
| ANCDE | -34% | -45% | -52% |
| NRDE2 | 0% | 0% | 0% |
| NRDE3 | 0% | -5% | 82% |
| DE-NRDE2 | 39% | 35% | -20% |
| DE-NRDE3 | 62% | 59% | 31% |
| LORD1→2 | 53% | 47% | -65% |
| LORD1→3 | 51% | 46% | -59% |
| LORD2→3 | 75% | 72% | -39% |
+
+Overall, LORD outperforms other baselines with smaller numbers of parameters. $\mathsf{LORD}_{D_1\to D_2}$ has a larger model size, excluding its decoder, than $\mathsf{NRDE}_{D_1}$ whereas it has a much smaller model size than $\mathsf{NRDE}_{D_2}$ . However, the performance of $\mathsf{LORD}_{D_1\to D_2}$ is similar to or better than that of $\mathsf{NRDE}_{D_2}$ , which proves the efficacy of our method. Using the encoder-decoder structure, the high complexity of processing log-signatures can be reduced and it makes our model smaller and more amenable to train.
+
+In many cases for LORD, the adjoint method and the backpropagation method are comparable in terms of model accuracy. Interestingly, we found that the backpropagation through the Euler method is fast enough with a negligible sacrifice of accuracy for several cases.
+
+Detailed Experimental Results Table 4 show detailed results for some selected evaluation metrics — full tables with all metrics are in Appendix D. One point is that many best outcomes are made with moderate $P$ settings. For EigenWorms, ODE-RNN can't achieve good scores for all $P$ settings. Our proposed model, LORD, achieves the best scores. In particular, $\mathrm{LORD}_{1\rightarrow 3}$ with $P = 32$ has a much smaller number of parameters, compared with other baselines that have similar performance. $\mathrm{LORD}_{2\rightarrow 3}$ also significantly outperforms $\mathrm{NRDE}_3$ for both accuracy and mode size. For CounterMovementJump and SelfRegulationSCP2, ODE-RNN is better than other NRDE and NCDE-based baselines. However, LORD marks the best scores in all cases.
+
+In all BIDMC experiments, LORD shows outstanding performance. $\mathrm{LORD}_{2\rightarrow 3}$ shows the best performance in almost all cases. Compared with NCDE and NRDE, DE-NRDE has $40\sim 60\%$ improvements and LORD has $50\sim 70\%$ improvements. However, LORD's model size is reduced by $60\%$ whereas DE-NRDE's model size is reduced by $20\%$ . Therefore, our proposed method is a better embedding method for log-signatures. Unlike EigenWorms, the time-series length in this dataset is rather short. For that reason, ODE-RNN performs better. Overall, DE-NRDE3 with $P = 128$ has the best performance, among the baseline models. This means that the training difficulty by the large log-signature size can be alleviated by the direct embedding. However, LORD outperforms DE-NRDE.
+
+
+Figure 4: PCA-based visualization of log-signatures
+
+Additional Results and Visualization Fig. 4 visually compares the three log-signatures and we note that the embedded signature of $d\mathbf{e}(t)$ has the characteristics of both $D_{1} = 1$ and $D_{2} = 3$ . We refer to our supplementary material for other visualization, detailed results, sensitivity analyses, and reproducibility information.
+
+# 5 LIMITATIONS AND CONCLUSIONS
+
+The log-signature transform of NRDEs is suitable to irregular and long time-series. However, the log-signature transform requires larger memory footprints and to this end, we presented
+
+an autoencoder-based method to embed their higher-dimensional log-signature into a lower-dimensional space, called LORD. Our method is carefully devised to eradicate the higher-dimensional computation as early as right after the pre-training of the autoencoder. In the standard benchmark experiments of very long time-series, our proposed method significantly outperforms existing methods and shows relatively smaller model sizes in terms of the number of parameters. Nonetheless, it is still in its early phase to enhance NRDEs and there exist a couple of items to be studied further, e.g., processing long time-series with many channels.
+
+Table 4: Detailed experimental results. The best results for each $P$ is in boldface and for all $P$ settings additionally with asterisk. Moderate configurations of $P$ are needed to see the best results in many cases.
+
+ | | Accuracy | Macro F1 | #Params |
| P=4 | 32 | 128 | 4 | 32 | 128 | 4 | 32 | 128 |
| EigenWorms | ODE-RNN | 0.35±0.01 | 0.35±0.03 | 0.40±0.04 | 0.11±0.00 | 0.15±0.07 | 0.25±0.11 | 2.9×10^4 | 5.4×10^4 | 1.4×10^5 |
| NCDE | 0.68±0.10 | 0.76±0.05 | 0.46±0.05 | 0.61±0.12 | 0.69±0.07 | 0.41±0.07 | 2.1×10^4 | 2.1×10^4 | 2.1×10^4 |
| ANCDE | 0.81±0.05 | 0.77±0.03 | 0.50±0.06 | 0.77±0.07 | 0.73±0.06 | 0.46±0.07 | 9.3×10^4 | 9.3×10^4 | 2.3×10^4 |
| NRDE2 | 0.74±0.04 | 0.78±0.03 | 0.73±0.09 | 0.66±0.08 | 0.71±0.04 | 0.66±0.11 | 6.5×10^4 | 6.5×10^4 | 6.5×10^4 |
| NRDE3 | 0.72±0.08 | 0.81±0.04 | 0.61±0.12 | 0.62±0.13 | 0.79±0.05 | 0.54±0.14 | 3.0×10^5 | 3.0×10^5 | 3.0×10^5 |
| DE-NRDE2 | 0.44±0.05 | 0.73±0.07 | 0.77±0.07 | 0.23±0.07 | 0.63±0.14 | 0.72±0.08 | 4.1×10^4 | 4.1×10^4 | 4.9×10^4 |
| DE-NRDE3 | 0.42±0.07 | 0.63±0.05 | 0.84±0.04 | 0.21±0.10 | 0.53±0.04 | 0.81±0.03 | 1.8×10^5 | 1.8×10^5 | 2.4×10^5 |
| LORD1→2 | 0.80±0.05 | 0.84±0.05 | 0.76±0.06 | 0.74±0.05 | 0.84±0.06 | 0.75±0.08 | 3.9×10^4 | 3.9×10^4 | 3.5×10^4 |
| LORD1→3 | 0.77±0.09 | 0.86±0.05* | 0.74±0.08 | 0.73±0.12 | 0.85±0.06* | 0.72±0.09 | 3.5×10^4 | 3.5×10^4 | 3.9×10^4 |
| LORD2→3 | 0.82±0.05 | 0.84±0.02 | 0.84±0.04 | 0.78±0.06 | 0.79±0.05 | 0.82±0.06 | 1.3×10^5 | 1.3×10^5 | 1.3×10^5 |
| | P=64 | 128 | 512 | 64 | 128 | 512 | 64 | 128 | 512 |
| CounterMovement Jump | ODE-RNN | 0.47±0.02 | 0.47±0.09 | 0.45±0.03 | 0.45±0.03 | 0.46±0.09 | 0.44±0.04 | 2.5×10^4 | 2.1×10^5 | 1.4×10^5 |
| NCDE | 0.35±0.06 | 0.40±0.06 | 0.41±0.05 | 0.32±0.09 | 0.35±0.05 | 0.38±0.06 | 5.8×10^4 | 2.5×10^4 | 4.7×10^4 |
| ANCDE | 0.35±0.04 | 0.47±0.06 | 0.46±0.07 | 0.34±0.03 | 0.46±0.07 | 0.43±0.10 | 1.4×10^5 | 2.5×10^5 | 2.9×10^5 |
| NRDE2 | 0.40±0.12 | 0.40±0.08 | 0.40±0.09 | 0.39±0.12 | 0.38±0.08 | 0.39±0.09 | 1.1×10^5 | 1.9×10^5 | 5.0×10^4 |
| NRDE3 | 0.47±0.09 | 0.41±0.08 | 0.47±0.06 | 0.46±0.09 | 0.40±0.08 | 0.45±0.05 | 5.3×10^5 | 5.2×10^5 | 2.1×10^6 |
| DE-NRDE2 | 0.40±0.07 | 0.38±0.06 | 0.38±0.05 | 0.39±0.08 | 0.33±0.07 | 0.36±0.06 | 5.2×10^4 | 9.1×10^4 | 3.9×10^4 |
| DE-NRDE3 | 0.41±0.07 | 0.47±0.04 | 0.42±0.07 | 0.37±0.07 | 0.44±0.05 | 0.40±0.08 | 2.0×10^5 | 2.8×10^5 | 7.3×10^5 |
| LORD1→2 | 0.59±0.04* | 0.57±0.06 | 0.50±0.08 | 0.58±0.04* | 0.56±0.07 | 0.49±0.08 | 8.7×10^4 | 5.1×10^4 | 6.5×10^4 |
| LORD1→3 | 0.56±0.04 | 0.53±0.03 | 0.51±0.03 | 0.55±0.04 | 0.52±0.03 | 0.50±0.03 | 4.3×10^4 | 1.4×10^5 | 8.8×10^4 |
| LORD2→3 | 0.40±0.05 | 0.40±0.08 | 0.40±0.04 | 0.38±0.05 | 0.38±0.08 | 0.37±0.02 | 1.1×10^5 | 1.5×10^5 | 3.6×10^4 |
| | P=32 | 64 | 256 | 32 | 64 | 256 | 32 | 64 | 256 |
| SelfRegulationSCP2 | ODE-RNN | 0.55±0.05 | 0.58±0.01 | 0.56±0.04 | 0.54±0.06 | 0.46±0.05 | 0.48±0.04 | 5.7×10^4 | 4.1×10^4 | 1.4×10^5 |
| NCDE | 0.59±0.07 | 0.52±0.08 | 0.54±0.06 | 0.47±0.12 | 0.46±0.16 | 0.54±0.09 | 4.2×10^4 | 2.2×10^5 | 3.2×10^5 |
| ANCDE | 0.60±0.06 | 0.54±0.04 | 0.49±0.05 | 0.55±0.05 | 0.49±0.05 | 0.43±0.07 | 3.9×10^5 | 1.3×10^5 | 2.1×10^5 |
| NRDE2 | 0.52±0.11 | 0.56±0.09 | 0.52±0.11 | 0.51±0.06 | 0.45±0.06 | 0.50±0.07 | 3.2×10^5 | 6.2×10^5 | 6.2×10^5 |
| NRDE3 | 0.54±0.05 | 0.56±0.06 | 0.50±0.07 | 0.56±0.05 | 0.50±0.12 | 0.48±0.07 | 3.4×10^6 | 1.7×10^6 | 3.4×10^6 |
| DE-NRDE2 | 0.59±0.10 | 0.55±0.06 | 0.53±0.08 | 0.53±0.13 | 0.50±0.08 | 0.50±0.08 | 1.1×10^5 | 2.0×10^5 | 2.0×10^5 |
| DE-NRDE3 | 0.55±0.11 | 0.51±0.08 | 0.51±0.10 | 0.57±0.07 | 0.54±0.06 | 0.55±0.03 | 1.1×10^6 | 5.4×10^5 | 1.1×10^6 |
| LORD1→2 | 0.57±0.10 | 0.58±0.12 | 0.53±0.08 | 0.57±0.06 | 0.61±0.06* | 0.51±0.08 | 2.4×10^4 | 1.4×10^5 | 7.5×10^4 |
| LORD1→3 | 0.57±0.06 | 0.62±0.10* | 0.53±0.10 | 0.50±0.06 | 0.59±0.11 | 0.56±0.04 | 1.4×10^5 | 1.2×10^5 | 1.6×10^5 |
| LORD2→3 | 0.61±0.06 | 0.61±0.10 | 0.60±0.07 | 0.55±0.09 | 0.56±0.07 | 0.53±0.06 | 2.2×10^5 | 5.3×10^5 | 2.6×10^5 |
| | R2 | MSE | #Params |
| P=8 | 128 | 512 | 8 | 128 | 512 | 8 | 128 | 512 |
| BIDMC32HR | ODE-RNN | 0.57±0.29 | 0.92±0.01 | 0.81±0.02 | 0.41±0.28 | 0.07±0.01 | 0.18±0.02 | 4×10^3 | 1.5×10^4 | 5.2×10^4 |
| NCDE | 0.39±0.04 | 0.23±0.04 | 0.19±0.04 | 0.59±0.04 | 0.74±0.04 | 0.78±0.04 | 5.0×10^4 | 5.0×10^4 | 5.0×10^4 |
| ANCDE | 0.44±0.03 | 0.17±0.06 | 0.26±0.01 | 0.54±0.03 | 0.80±0.06 | 0.71±0.01 | 4.7×10^4 | 4.7×10^4 | 4.7×10^4 |
| NRDE2 | 0.63±0.04 | 0.67±0.07 | 0.64±0.07 | 0.36±0.04 | 0.32±0.07 | 0.34±0.07 | 7.5×10^4 | 7.5×10^4 | 7.5×10^4 |
| NRDE3 | 0.65±0.08 | 0.58±0.13 | 0.40±0.13 | 0.34±0.08 | 0.40±0.13 | 0.58±0.13 | 1.4×10^5 | 1.4×10^5 | 1.4×10^5 |
| DE-NRDE2 | 0.82±0.08 | 0.76±0.05 | 0.64±0.02 | 0.17±0.07 | 0.23±0.05 | 0.35±0.02 | 6.3×10^4 | 6.0×10^4 | 5.9×10^4 |
| DE-NRDE3 | 0.89±0.05 | 0.93±0.02 | 0.81±0.09 | 0.11±0.05 | 0.07±0.02 | 0.18±0.08 | 1.2×10^5 | 1.0×10^5 | 1.0×10^5 |
| LORD1→2 | 0.98±0.01* | 0.94±0.01 | 0.44±0.04 | 0.02±0.01* | 0.06±0.01 | 0.54±0.04 | 2.7×10^4 | 3.4×10^4 | 3.4×10^4 |
| LORD1→3 | 0.98±0.01* | 0.92±0.01 | 0.45±0.03 | 0.02±0.01* | 0.07±0.01 | 0.53±0.03 | 2.7×10^4 | 6.5×10^4 | 5.5×10^4 |
| LORD2→3 | 0.98±0.01* | 0.95±0.01 | 0.85±0.04 | 0.02±0.01* | 0.04±0.01 | 0.15±0.04 | 3.6×10^4 | 5.2×10^4 | 5.4×10^4 |
| BIDMC32RR | P=54 | 256 | 512 | 8 | 128 | 512 | 8 | 128 | 512 |
| BIDMC32SP2 | ODE-RNN | 0.55±0.11 | 0.90±0.03 | 0.75±0.02 | 0.46±0.11 | 0.10±0.03 | 0.26±0.03 | 4×10^3 | 1.5×10^4 | 5.2×10^4 |
| NCDE | 0.24±0.07 | 0.21±0.07 | 0.33±0.04 | 0.79±0.07 | 0.81±0.08 | 0.69±0.05 | 8.7×10^4 | 8.7×10^4 | 8.7×10^4 |
| ANCDE | 0.31±0.03 | 0.33±0.05 | 0.37±0.03 | 0.71±0.03 | 0.70±0.05 | 0.65±0.03 | 4.7×10^4 | 4.7×10^4 | 4.7×10^4 |
| NRDE2 | 0.22±0.08 | 0.47±0.10 | 0.61±0.18 | 0.81±0.08 | 0.55±0.10 | 0.41±0.19 | 1.2×10^5 | 1.2×10^5 | 1.2×10^5 |
| NRDE3 | 0.13±0.09 | 0.68±0.15 | 0.60±0.18 | 0.90±0.09 | 0.33±0.15 | 0.42±0.19 | 2.2×10^5 | 2.2×10^5 | 2.2×10^5 |
| DE-NRDE2 | 0.85±0.01 | 0.74±0.05 | 0.59±0.04 | 0.15±0.01 | 0.27±0.05 | 0.43±0.04 | 8.8×10^4 | 1.0×10^5 | 1.0×10^5 |
| DE-NRDE3 | 0.90±0.08 | 0.93±0.03 | 0.76±0.07 | 0.10±0.08 | 0.08±0.03 | 0.25±0.07 | 1.4×10^5 | 1.6×10^5 | 1.6×10^5 |
| LORD1→2 | 0.97±0.00 | 0.91±0.01 | 0.58±0.05 | 0.03±0.00 | 0.09±0.01 | 0.43±0.05 | 2.7×10^4 | 3.4×10^4 | 6.2×10^4 |
| LORD1→3 | 0.98±0.01* | 0.89±0.03 | 0.52±0.04 | 0.02±0.01* | 0.12±0.03 | 0.49±0.05 | 2.7×10^4 | 2.7×10^4 | 3.8×10^4 |
| LORD2→3 | 0.98±0.01* | 0.94±0.01 | 0.83±0.03 | 0.02±0.01* | 0.06±0.01 | 0.18±0.03 | 3.6×10^4 | 5.6×10^4 | 6.9×10^4 |
+
+# 6 ACKNOWLEDGEMENTS
+
+Noseong Park is the corresponding author. This work was supported by the Yonsei University Research Fund of 2021, and the Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korean government (MSIT) (No. 2020-0-01361, Artificial Intelligence Graduate School Program (Yonsei University), and No. 2021-0-00155, Context and Activity Analysis-based Solution for Safe Childcare).
+
+# REFERENCES
+
+Christopher Aicher, Nicholas J Foti, and Emily B Fox. Adaptively truncating backpropagation through time to control gradient bias. In Uncertainty in Artificial Intelligence, pp. 799-808. PMLR, 2020.
+Adebiyi A. Ariyo, Adewumi O. Adewumi, and Charles K. Ayo. Stock price prediction using the arima model. 2014.
+Lei Bai, Lina Yao, Can Li, Xianzhi Wang, and Can Wang. Adaptive graph convolutional recurrent network for traffic forecasting. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), NeurIPS, volume 33, pp. 17804-17815, 2020.
+Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Convolutional sequence modeling revisited. 2018.
+Edward De Brouwer, Jaak Simm, Adam Arany, and Yves Moreau. Gru-ode-bayes: Continuous modeling of sporadically-observed time series. In NeurIPS, 2019.
+Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In NeurIPS. 2018.
+Zheng Fang, Qingqing Long, Guojie Song, and Kunqing Xie. Spatial-temporal graph ode networks for traffic flow forecasting. arXiv preprint arXiv:2106.12931, 2021.
+Tak-chung Fu. A review on time series data mining. Engineering Applications of Artificial Intelligence, 24(1):164-181, 2011.
+Xi Geng. Reconstruction for the signature of a rough path. Proceedings of the London Mathematical Society, 114(3):495-526, 2017.
+Sheo Yon Jhin, Heejoo Shin, Seoyoung Hong, Minju Jo, Solhee Park, and Noseong Park. Attentive neural controlled differential equations for time-series classification and forecasting. In ICDM, 2021.
+Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. In NeurIPS, 2020.
+Terry Lyons and Weijun Xu. Inverting the signature of a path, 2018.
+Terry Lyons, M. Caruana, and T. Lévy. Differential Equations Driven by Rough Paths. Springer, 2004. École D'Eté de Probabilités de Saint-Flour XXXIV - 2004.
+James Morrill, Christopher Salvi, Patrick Kidger, James Foster, and Terry Lyons. Neural rough differential equations for long time series. 2021.
+Gregory C Reinsel. Elements of multivariate time series analysis. Springer Science & Business Media, 2003.
+Xiaoli Ren, Xiaoyong Li, Kaijun Ren, Junqiang Song, Zichen Xu, Kefeng Deng, and Xiang Wang. Deep learning-based weather prediction: A survey. Big Data Research, 23, 2021.
+Sungyong Seo, Arash Mohegh, George Ban-Weiss, and Yan Liu. Automatically inferring data quality for spatiotemporal forecasting. In International Conference on Learning Representations, 2018.
+
+Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. NeurIPS, 28, 2015.
+Sima Siami-Namini, Neda Tavakoli, and Akbar Siami Namin. A comparison of arima and lstm in forecasting time series. 2018.
+Daniel Stoller, Mi Tian, Sebastian Ewert, and Simon Dixon. Seq-u-net: A one-dimensional causal u-net for efficient sequence modelling. arXiv preprint arXiv:1911.06393, 2019.
+Bagnall A. Bergmeir C. Keogh E. Petitjean F. Tan, C. W. and G. I. Monash Webb. Uea classification/regression datasets. http://www.timeseriesregression.org/, http://www.timeseriesclassification.com/.
+Trieu Trinh, Andrew Dai, Thang Luong, and Quoc Le. Learning longer-term dependencies in rnns with auxiliary losses. In International Conference on Machine Learning, pp. 4965-4974. PMLR, 2018.
+
+Table 5: The best hyperparameter in ODE-RNN
+
+| Data | P | Hidden Path Size |
| Counter-MovementJump | 64 | 64 |
| 128 | 256 |
| 512 | 64 |
| Self-RegulationSCP2 | 32 | 128 |
| 64 | 64 |
| 256 | 64 |
+
+Table 6: The best hyperparameter in NCDE and NRDE
+
+| Data | P | Hidden | CDE Function's | #Hidden Layers |
| Path Size | Hidden Size |
| D=1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
| Counter-MovementJump | 64 | 64 | 64 | 128 | 128 | 128 | 128 | 3 | 2 | 3 |
| 128 | 64 | 256 | 256 | 64 | 64 | 64 | 3 | 2 | 3 |
| 512 | 128 | 64 | 256 | 64 | 64 | 256 | 3 | 2 | 3 |
| Self-RegulationSCP2 | 32 | 64 | 64 | 128 | 64 | 128 | 128 | 2 | 2 | 2 |
| 64 | 64 | 256 | 128 | 256 | 64 | 64 | 3 | 2 | 2 |
| 256 | 256 | 256 | 64 | 128 | 64 | 256 | 3 | 2 | 3 |
+
+Table 7: The best hyperparameter in ANCDE
+
+| Data | P | Hidden Path Size | #Hidden Layers | Attention Channel Size |
| EigenWorms | 4 | 128 | 3 | 64 |
| 32 | 128 | 3 | 64 |
| 128 | 64 | 2 | 32 |
| Counter-MovementJump | 64 | 128 | 2 | 128 |
| 128 | 256 | 3 | 128 |
| 512 | 64 | 2 | 256 |
| Self-RegulationSCP2 | 32 | 256 | 3 | 128 |
| 64 | 64 | 2 | 128 |
| 256 | 128 | 2 | 128 |
| BIDMC32HR | 8 | 128 | 2 | 64 |
| 128 | 128 | 2 | 64 |
| 512 | 128 | 2 | 64 |
| BIDMC32RR | 8 | 128 | 2 | 64 |
| 128 | 128 | 2 | 64 |
| 512 | 128 | 3 | 64 |
| BIDMC32SpO2 | 8 | 128 | 2 | 64 |
| 128 | 128 | 2 | 64 |
| 512 | 128 | 2 | 64 |
+
+Table 8: The best hyperparameter in DE-NRDE
+
+| Data | P | Compression Ratio | #Hidden Layers | Hidden Size |
| D=2 | 3 | 2 | 3 | 2 | 3 |
| EigenWorms | 4 | 0.5 | 0.5 | 1 | 1 | 128 | 128 |
| 32 | 0.5 | 0.5 | 1 | 1 | 128 | 128 |
| 128 | 0.7 | 0.7 | 1 | 1 | 64 | 128 |
| Counter-MovementJump | 64 | 0.3 | 0.3 | 1 | 2 | 128 | 128 |
| 128 | 0.3 | 0.5 | 2 | 2 | 128 | 64 |
| 512 | 0.7 | 0.3 | 1 | 1 | 64 | 128 |
| Self-RegulationSCP2 | 32 | 0.3 | 0.3 | 1 | 2 | 64 | 128 |
| 64 | 0.3 | 0.3 | 2 | 2 | 64 | 64 |
| 256 | 0.3 | 0.3 | 2 | 2 | 64 | 128 |
| BIDMC32HR | 8 | 0.7 | 0.7 | 2 | 2 | 64 | 128 |
| 128 | 0.7 | 0.7 | 1 | 1 | 128 | 128 |
| 512 | 0.7 | 0.7 | 1 | 1 | 64 | 128 |
| BIDMC32RR | 8 | 0.5 | 0.5 | 1 | 1 | 128 | 128 |
| 128 | 0.7 | 0.7 | 1 | 1 | 128 | 128 |
| 512 | 0.7 | 0.7 | 1 | 1 | 64 | 64 |
| BIDMC32SpO2 | 8 | 0.5 | 0.5 | 1 | 1 | 128 | 128 |
| 128 | 0.7 | 0.7 | 1 | 1 | 64 | 64 |
| 512 | 0.7 | 0.7 | 1 | 1 | 64 | 64 |
+
+# A BEST HYPERPARAMETERS
+
+Our software and hardware environments are as follows: UBUNTU 18.04 LTS, PYTHON 3.7.10, PYTORCH 1.8.1, CUDA 11.4, and NVIDIA Driver 470.42.01, i9 CPU, and NVIDIA RTX A6000.
+
+# A.1 BASELINE
+
+There are 5 baselines in our experiments. Each model has its own hyperparameters. ODE-RNN method has a hyperparameter of hidden path size. NCDE and NRDE have also the same hyperparameter, and in addition, the size of hidden dimension and the number of hidden layers in their CDE and RDE functions. The Attentive NCDE (ANCDE) has all of those hyperparameters and in addition, the attention channel size. In DE-NRDE, there are addition hyperparameters related to embedding, which are the embedding compression ratio, the size of hidden dimension, and the number of hidden layers in the embedding layer.
+
+In (Morrill et al., 2021), there are three models, ODE-RNN, NCDE and NRDE, and four datasets, EigenWorms, BIDMC32HR, BIDMC32RR, and BIDMC32Sp02. For these combinations, we set the hyperparameters as reported in (Morrill et al., 2021). In other cases, we find the best hyperparameters in the following range. All kinds of hidden size in ODE-RNN, NCDE, ANCDE, and NRDE are in $\{32,64,128,256\}$ . The number of hidden layers in those is in $\{2,3\}$ . In DE-NRDE, the embedding compression ratio, the hidden size, and the number of hidden layers in the embedding layer are in $\{0.3,0.5,0.7\}$ , $\{64,128\}$ , and $\{1,2\}$ , respectively. Tables 5 to 8 show the best hyperparameters of the baselines.
+
+# A.2 LORD-NRDE
+
+Table 9 shows the best hyperparameter configuration of our method in each dataset.
+
+Table 9: The best hyperparameter in LORD
+
+| Method | Data | P | \(N_{f}\) | \(N_{g}\) | \(N_{o}\) | \(h_{f}\) | \(h_{g}\) | \(h_{o}\) | \(c_{AE}\) | \(c_{TASK}\) | \(c_{e}\) | max_iter |
| \(AE\) | \(TASK\) |
| \(LORD_{1\rightarrow 2}\) | EigenWorms | 4 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 400 | 400 |
| 32 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 2000 | 400 |
| 128 | 3 | 2 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 2000 | 400 |
| Counter-MovementJump | 64 | 2 | 3 | 2 | 32 | 128 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 128 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 512 | 2 | 2 | 2 | 64 | 128 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 1500 | 400 |
| Self-RegulationSCP2 | 32 | 3 | 3 | 3 | 32 | 32 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 1000 | 400 |
| 64 | 3 | 2 | 3 | 128 | 128 | 128 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 256 | 3 | 3 | 3 | 128 | 32 | 128 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC32HR | 128 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC32RR | 128 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC332SpO2 | 128 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| \(LORD_{1\rightarrow 3}\) | EigenWorms | 4 | 3 | 2 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 400 | 400 |
| 32 | 3 | 2 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 2000 | 400 |
| 128 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 0 | 2000 | 400 |
| Counter-MovementJump | 64 | 2 | 3 | 2 | 32 | 64 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 128 | 3 | 3 | 3 | 128 | 128 | 128 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 512 | 3 | 2 | 3 | 32 | 128 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| Self-RegulationSCP2 | 32 | 2 | 3 | 2 | 32 | 128 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 64 | 3 | 3 | 3 | 32 | 128 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 1500 | 400 |
| 256 | 3 | 3 | 3 | 128 | 128 | 128 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 1500 | 400 |
| 8 | 3 | 3 | 3 | 128 | 64 | 128 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC32HR | 128 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500. |
| 512 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^-5\) | 0 | 400 | 2000 |
| BIDMC32RR | 128 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 64 | 64 | 64 | \(\mathbf{1}\times\mathbf{10^{-5}}\) | \(\mathbf{1}\times\mathbf{10^{-5}}\) | 0 | 1000 | 500 |
| Self-RegulationSCP2 | 32 | 3 | 2 | 3 | 32 | 64 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 64 | 2 | 3 | 2 | 128 | 128 | 128 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 1000 | 400 |
| 256 | 2 | 3 | 2 | 32 | 128 | 32 | \(1\times 10^{-6}\) | \(1\times 10^{-6}\) | 1 | 500 | 400 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC32BR | 128 | 3 | 3 | 3 | 32 | 64 | 32 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}.\) | 0 | 1000 | 500 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC32RR | 128 | 3 | 3 | 3 | 64 | 192 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 128 | 64 | 128 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 8 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 400 | 2000 |
| BIDMC3ZSpO2 | 128 | 3 | 3 | 3 | 64 | 64 | 64 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
| 512 | 3 | 3 | 3 | 128 | 64 | 128 | \(1\times 10^{-5}\) | \(1\times 10^{-5}\) | 0 | 1000 | 500 |
+
+# B DATASET
+
+EigenWorms has a time-series length of 17,984 and a channel of 7 which contains the movement data of roundworms. The goal is to classify each worm among 5 worm types. CounterMovementJump has 4,250 length and 4 channels which means accelerations data of each 3D-axis. Using accelerations data, the type of jump is predicted among 3 types. The object of SelfRegulationSCP2 is to classify whether the subject moves the computer's cursor up or down, using 8 channels of the EEG data. Its time-series length is 1,153.
+
+For forecasting, three Beth Israel Deaconess Medical Centre (BIDMC) datasets are used. Using the PPG and ECG information, each task is to predict a person's heart rate (HR), respiratory rate (RR), or oxygen saturation $(\mathrm{SpO2})$ , respectively. The time-series length is 4,000.
+
+# C VISUALIZATION
+
+We show other PCA based visualizations of the log-signatures. Using PCA, we extract the distributions of the most important principle components of $\{LogSig_{r_i,r_{i + 1}}^{D_1}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ , $\{LogSig_{r_i,r_{i + 1}}^{D_2}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ , and $d\mathbf{e}(t)$ . If two paths have similar distributions on those components, the information contained by the two paths is similar. In Fig. 5, the distribution of $d\mathbf{e}(t)$ is somewhere in between the distributions of $\{LogSig_{r_i,r_{i + 1}}^{D_2}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ and $\{LogSig_{r_i,r_{i + 1}}^{D_1}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ . From the encoder-decoder learning, $d\mathbf{e}(t)$ can learn the information of $\{LogSig_{r_i,r_{i + 1}}^{D_2}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ .
+
+
+(a) EigenWorms
+
+
+(b) EigenWorms
+
+
+(c) EigenWorms
+
+
+(d) EigenWorms
+
+
+(e) BIDMC32HR
+
+
+(f) BIDMC32HR
+
+
+(g) BIDMC32HR
+
+
+(h) BIDMC32HR
+
+
+(i) BIDMC32RR
+
+
+(j) BIDMC32RR
+
+
+(k) BIDMC32RR
+
+
+(1) BIDMC32RR
+
+
+(m) BIDMC32SpO2
+
+
+(n) BIDMC32SpO2
+
+
+(o) BIDMC32SpO2
+
+
+(p) BIDMC32SpO2
+Figure 5: Visualization of $\{LogSig_{r_i,r_i + 1}^{D_1}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ , $\{LogSig_{r_i,r_i + 1}^{D_2}(X)\}_{i = 0}^{\lfloor \frac{T}{P}\rfloor -1}$ , and $d\mathbf{e}(t)$ in EigenWorms and BIDMC.
+
+Table 10: EigenWorms
+
+| Method | P | Accuracy | Macro F1 | Weighted F1 | ROCAUC | #Params(D) | #Params(R) |
| ODE-RNN | 4 | 0.354±0.011 | 0.107±0.002 | 0.193±0.004 | 0.511±0.054 | Not Applicable | 28707 |
| 32 | 0.349±0.029 | 0.150±0.065 | 0.232±0.064 | 0.439±0.027 | Not Applicable | 53795 |
| 128 | 0.395±0.043 | 0.249±0.110 | 0.304±0.095 | 0.517±0.068 | Not Applicable | 139811 |
| NCDE | 4 | 0.677±0.099 | 0.610±0.122 | 0.665±0.105 | 0.913±0.018 | Not Applicable | 21253 |
| 32 | 0.759±0.047 | 0.690±0.065 | 0.756±0.052 | 0.907±0.016 | Not Applicable | 21253 |
| 128 | 0.456±0.046 | 0.415±0.066 | 0.458±0.051 | 0.678±0.055 | Not Applicable | 21253 |
| ANCDE | 4 | 0.815±0.046 | 0.770±0.065 | 0.810±0.046 | 0.957±0.012 | Not Applicable | 92726 |
| 32 | 0.774±0.033 | 0.727±0.060 | 0.770±0.033 | 0.925±0.021 | Not Applicable | 92726 |
| 128 | 0.497±0.064 | 0.456±0.074 | 0.501±0.063 | 0.705±0.038 | Not Applicable | 22806 |
| NRDE2 | 4 | 0.744±0.044 | 0.655±0.076 | 0.725±0.059 | 0.915±0.032 | Not Applicable | 64933 |
| 32 | 0.779±0.029 | 0.713±0.044 | 0.774±0.027 | 0.934±0.011 | Not Applicable | 64933 |
| 128 | 0.728±0.088 | 0.661±0.106 | 0.726±0.092 | 0.908±0.037 | Not Applicable | 64933 |
| NRDE3 | 4 | 0.718±0.083 | 0.616±0.127 | 0.695±0.101 | 0.914±0.023 | Not Applicable | 297893 |
| 32 | 0.810±0.043 | 0.787±0.051 | 0.814±0.044 | 0.911±0.020 | Not Applicable | 297893 |
| 128 | 0.610±0.117 | 0.544±0.142 | 0.600±0.120 | 0.862±0.063 | Not Applicable | 297893 |
| DE-NRDE2 | 4 | 0.436±0.048 | 0.230±0.073 | 0.303±0.066 | 0.538±0.045 | Not Applicable | 41331 |
| 32 | 0.728±0.074 | 0.631±0.141 | 0.711±0.095 | 0.918±0.026 | Not Applicable | 41331 |
| 128 | 0.769±0.068 | 0.723±0.078 | 0.770±0.070 | 0.939±0.016 | Not Applicable | 49304 |
| DE-NRDE3 | 4 | 0.421±0.074 | 0.206±0.096 | 0.281±0.091 | 0.583±0.086 | Not Applicable | 179371 |
| 32 | 0.626±0.047 | 0.528±0.038 | 0.585±0.054 | 0.878±0.036 | Not Applicable | 179371 |
| 128 | 0.841±0.042 | 0.810±0.029 | 0.840±0.038 | 0.960±0.022 | Not Applicable | 241223 |
| LORD1→2 | 4 | 0.795±0.051 | 0.744±0.051 | 0.787±0.053 | 0.948±0.009 | 24299 | 38973 |
| 32 | 0.841±0.053 | 0.841±0.058 | 0.843±0.051 | 0.957±0.016 | 24299 | 38973 |
| 128 | 0.759±0.064 | 0.748±0.082 | 0.760±0.061 | 0.900±0.009 | 24299 | 34813 |
| LORD1→3 | 4 | 0.774±0.088 | 0.733±0.122 | 0.759±0.101 | 0.944±0.023 | 86907 | 34813 |
| 32 | 0.862±0.053 | 0.855±0.058 | 0.861±0.054 | 0.963±0.021 | 86907 | 34813 |
| 128 | 0.744±0.081 | 0.716±0.087 | 0.737±0.076 | 0.892±0.044 | 86907 | 38973 |
| LORD2→3 | 4 | 0.821±0.054 | 0.783±0.062 | 0.815±0.056 | 0.960±0.011 | 278679 | 132465 |
| 32 | 0.841±0.021 | 0.793±0.053 | 0.835±0.027 | 0.963±0.008 | 278679 | 132465 |
| 128 | 0.841±0.038 | 0.823±0.055 | 0.835±0.049 | 0.949±0.023 | 278679 | 128305 |
+
+Table 11: CounterMovementJump
+
+| Method | P | Accuracy | Macro F1 | Weighted F1 | ROCAUC | #Params(D) | #Params(R) |
| ODE-RNN | 64 | 0.474±0.023 | 0.453±0.027 | 0.455±0.026 | 0.589±0.018 | Not Applicable | 24737 |
| 128 | 0.470±0.093 | 0.458±0.094 | 0.459±0.094 | 0.617±0.055 | Not Applicable | 213537 |
| 512 | 0.449±0.032 | 0.436±0.037 | 0.436±0.039 | 0.593±0.031 | Not Applicable | 139425 |
| NCDE | 64 | 0.351±0.057 | 0.317±0.091 | 0.318±0.091 | 0.473±0.024 | Not Applicable | 58371 |
| 128 | 0.404±0.064 | 0.350±0.050 | 0.352±0.050 | 0.520±0.007 | Not Applicable | 25475 |
| 512 | 0.411±0.047 | 0.379±0.064 | 0.378±0.065 | 0.496±0.026 | Not Applicable | 46723 |
| ANCDE | 64 | 0.355±0.041 | 0.342±0.034 | 0.342±0.035 | 0.526±0.033 | Not Applicable | 135852 |
| 128 | 0.467±0.060 | 0.457±0.065 | 0.457±0.065 | 0.604±0.031 | Not Applicable | 252332 |
| 512 | 0.458±0.073 | 0.428±0.102 | 0.428±0.102 | 0.588±0.074 | Not Applicable | 285740 |
| NRDE2 | 64 | 0.396±0.116 | 0.391±0.118 | 0.391±0.118 | 0.560±0.089 | Not Applicable | 107907 |
| 128 | 0.396±0.076 | 0.379±0.079 | 0.379±0.078 | 0.513±0.052 | Not Applicable | 189059 |
| 512 | 0.396±0.091 | 0.388±0.092 | 0.388±0.092 | 0.546±0.076 | Not Applicable | 50435 |
| NRDE3 | 64 | 0.465±0.088 | 0.462±0.093 | 0.463±0.093 | 0.616±0.062 | Not Applicable | 529411 |
| 128 | 0.409±0.084 | 0.399±0.081 | 0.400±0.081 | 0.573±0.070 | Not Applicable | 521859 |
| 512 | 0.465±0.055 | 0.453±0.050 | 0.453±0.051 | 0.618±0.045 | Not Applicable | 2107395 |
| DE-NRDE2 | 64 | 0.398±0.075 | 0.390±0.076 | 0.389±0.075 | 0.573±0.076 | Not Applicable | 51910 |
| 128 | 0.384±0.058 | 0.334±0.071 | 0.334±0.071 | 0.567±0.054 | Not Applicable | 90886 |
| 512 | 0.375±0.054 | 0.359±0.064 | 0.359±0.064 | 0.525±0.055 | Not Applicable | 39114 |
| DE-NRDE3 | 64 | 0.409±0.072 | 0.373±0.073 | 0.373±0.074 | 0.568±0.068 | Not Applicable | 204300 |
| 128 | 0.474±0.038 | 0.437±0.053 | 0.437±0.054 | 0.626±0.030 | Not Applicable | 279378 |
| 512 | 0.425±0.069 | 0.396±0.076 | 0.398±0.076 | 0.571±0.059 | Not Applicable | 730892 |
| LORD1→2 | 64 | 0.589±0.038 | 0.580±0.041 | 0.580±0.041 | 0.717±0.023 | 3262 | 87191 |
| 128 | 0.566±0.061 | 0.563±0.066 | 0.563±0.066 | 0.676±0.058 | 12158 | 51063 |
| 512 | 0.501±0.080 | 0.495±0.082 | 0.495±0.082 | 0.638±0.053 | 7998 | 65399 |
| LORD1→3 | 64 | 0.555±0.041 | 0.551±0.042 | 0.550±0.042 | 0.688±0.038 | 7282 | 43127 |
| 128 | 0.528±0.029 | 0.523±0.027 | 0.523±0.027 | 0.656±0.024 | 53746 | 137879 |
| 512 | 0.508±0.033 | 0.499±0.028 | 0.499±0.028 | 0.637±0.020 | 8338 | 88439 |
| LORD2→3 | 64 | 0.396±0.049 | 0.383±0.052 | 0.383±0.052 | 0.540±0.061 | 77158 | 113265 |
| 128 | 0.396±0.078 | 0.384±0.083 | 0.385±0.083 | 0.542±0.068 | 27110 | 146737 |
| 512 | 0.400±0.044 | 0.374±0.022 | 0.375±0.022 | 0.537±0.047 | 31270 | 36369 |
+
+# D FULL EXPERIMENTAL RESULTS
+
+In Tables 10 to 15, all experimental results are shown. #Params(D) and #Params(R) denote the number of parameters in the decoder part and in the rest parts except the decoder, respectively.
+
+Table 12: SelfRegulationSCP2
+
+| Method | P | Accuracy | F1 | ROCAUC | #Params(D) | #Params(R) |
| ODE-RNN | 32 | 0.551±0.054 | 0.540±0.064 | 0.603±0.041 | Not Applicable | 57375 |
| 64 | 0.579±0.012 | 0.462±0.051 | 0.564±0.019 | Not Applicable | 40991 |
| 256 | 0.558±0.045 | 0.480±0.039 | 0.533±0.055 | Not Applicable | 139295 |
| NCDE | 32 | 0.586±0.071 | 0.471±0.124 | 0.577±0.130 | Not Applicable | 42241 |
| 64 | 0.516±0.079 | 0.459±0.156 | 0.557±0.129 | Not Applicable | 214657 |
| 256 | 0.544±0.058 | 0.537±0.087 | 0.578±0.086 | Not Applicable | 316161 |
| ANCDE | 32 | 0.604±0.064 | 0.552±0.048 | 0.646±0.041 | Not Applicable | 391698 |
| 64 | 0.544±0.039 | 0.490±0.048 | 0.575±0.074 | Not Applicable | 134034 |
| 256 | 0.488±0.052 | 0.427±0.067 | 0.461±0.073 | Not Applicable | 208914 |
| NRDE2 | 32 | 0.519±0.110 | 0.513±0.058 | 0.572±0.092 | Not Applicable | 322689 |
| 64 | 0.561±0.090 | 0.449±0.062 | 0.575±0.071 | Not Applicable | 622209 |
| 256 | 0.516±0.110 | 0.498±0.071 | 0.564±0.096 | Not Applicable | 622209 |
| NRDE3 | 32 | 0.537±0.052 | 0.560±0.050 | 0.561±0.049 | Not Applicable | 3402753 |
| 64 | 0.558±0.059 | 0.504±0.118 | 0.586±0.107 | Not Applicable | 1710977 |
| 256 | 0.498±0.066 | 0.483±0.074 | 0.543±0.079 | Not Applicable | 3438465 |
| DE-NRDE2 | 32 | 0.589±0.095 | 0.525±0.130 | 0.596±0.072 | Not Applicable | 111051 |
| 64 | 0.551±0.063 | 0.496±0.081 | 0.566±0.073 | Not Applicable | 196747 |
| 256 | 0.530±0.078 | 0.501±0.078 | 0.538±0.088 | Not Applicable | 196747 |
| DE-NRDE3 | 32 | 0.551±0.109 | 0.570±0.074 | 0.655±0.076 | Not Applicable | 1092158 |
| 64 | 0.505±0.076 | 0.539±0.059 | 0.566±0.110 | Not Applicable | 542462 |
| 256 | 0.512±0.100 | 0.547±0.031 | 0.591±0.069 | Not Applicable | 1137022 |
| LORD1→2 | 32 | 0.570±0.105 | 0.566±0.058 | 0.652±0.059 | 14572 | 24361 |
| 64 | 0.582±0.119 | 0.613±0.057 | 0.681±0.071 | 76684 | 139433 |
| 256 | 0.530±0.081 | 0.512±0.081 | 0.536±0.087 | 76684 | 74857 |
| LORD1→3 | 32 | 0.572±0.058 | 0.501±0.056 | 0.584±0.036 | 70132 | 138761 |
| 64 | 0.618±0.099 | 0.591±0.109 | 0.659±0.094 | 71188 | 123241 |
| 256 | 0.526±0.105 | 0.558±0.038 | 0.607±0.061 | 278452 | 161161 |
| LORD2→3 | 32 | 0.607±0.059 | 0.552±0.087 | 0.645±0.093 | 260580 | 216405 |
| 64 | 0.607±0.095 | 0.555±0.072 | 0.619±0.060 | 999684 | 534037 |
| 256 | 0.596±0.075 | 0.529±0.055 | 0.623±0.064 | 259524 | 254549 |
+
+Table 13: BIDMC32HR
+
+| Method | P | R2 | Explained Variance | MSE | MAE | #Params(D) | #Params(R) |
| ODE-RNN | 8 | 0.569±0.290 | 0.570±0.290 | 0.415±0.279 | 0.457±0.172 | Not Applicable | 3871 |
| 128 | 0.924±0.011 | 0.925±0.011 | 0.073±0.011 | 0.167±0.009 | Not Applicable | 15391 |
| 512 | 0.811±0.024 | 0.811±0.025 | 0.182±0.024 | 0.285±0.019 | Not Applicable | 52255 |
| NCDE | 8 | 0.388±0.042 | 0.388±0.042 | 0.590±0.041 | 0.552±0.023 | Not Applicable | 49921 |
| 128 | 0.227±0.042 | 0.231±0.046 | 0.745±0.040 | 0.638±0.017 | Not Applicable | 49921 |
| 512 | 0.191±0.041 | 0.192±0.041 | 0.779±0.039 | 0.654±0.018 | Not Applicable | 49921 |
| ANCDE | 8 | 0.437±0.031 | 0.440±0.031 | 0.542±0.030 | 0.527±0.019 | Not Applicable | 47194 |
| 128 | 0.173±0.062 | 0.174±0.062 | 0.796±0.060 | 0.666±0.019 | Not Applicable | 47194 |
| 512 | 0.264±0.011 | 0.270±0.012 | 0.709±0.011 | 0.628±0.016 | Not Applicable | 47194 |
| NRDE2 | 8 | 0.630±0.044 | 0.631±0.044 | 0.356±0.042 | 0.452±0.030 | Not Applicable | 74689 |
| 128 | 0.665±0.072 | 0.665±0.072 | 0.323±0.069 | 0.409±0.047 | Not Applicable | 74689 |
| 512 | 0.642±0.071 | 0.643±0.071 | 0.344±0.069 | 0.419±0.054 | Not Applicable | 74689 |
| NRDE3 | 8 | 0.650±0.082 | 0.650±0.082 | 0.337±0.079 | 0.430±0.054 | Not Applicable | 140737 |
| 128 | 0.582±0.131 | 0.583±0.131 | 0.402±0.126 | 0.458±0.085 | Not Applicable | 140737 |
| 512 | 0.395±0.131 | 0.396±0.131 | 0.582±0.126 | 0.535±0.039 | Not Applicable | 140737 |
| DE-NRDE2 | 8 | 0.822±0.077 | 0.822±0.077 | 0.171±0.074 | 0.279±0.080 | Not Applicable | 63045 |
| 128 | 0.758±0.051 | 0.759±0.052 | 0.233±0.049 | 0.332±0.045 | Not Applicable | 59589 |
| 512 | 0.640±0.024 | 0.643±0.023 | 0.346±0.023 | 0.412±0.016 | Not Applicable | 58885 |
| DE-NRDE3 | 8 | 0.885±0.049 | 0.885±0.049 | 0.111±0.048 | 0.222±0.050 | Not Applicable | 119050 |
| 128 | 0.927±0.016 | 0.928±0.016 | 0.070±0.016 | 0.176±0.024 | Not Applicable | 102538 |
| 512 | 0.810±0.085 | 0.810±0.086 | 0.183±0.082 | 0.299±0.080 | Not Applicable | 102538 |
| LORD1→2 | 8 | 0.979±0.006 | 0.979±0.006 | 0.020±0.005 | 0.084±0.014 | 10285 | 27277 |
| 128 | 0.937±0.009 | 0.937±0.009 | 0.061±0.008 | 0.119±0.005 | 3277 | 34189 |
| 512 | 0.441±0.039 | 0.443±0.041 | 0.538±0.038 | 0.479±0.033 | 3277 | 34189 |
| LORD1→3 | 8 | 0.982±0.005 | 0.982±0.005 | 0.018±0.005 | 0.079±0.008 | 12645 | 27277 |
| 128 | 0.922±0.012 | 0.923±0.013 | 0.075±0.012 | 0.129±0.013 | 40997 | 65293 |
| 512 | 0.450±0.031 | 0.452±0.029 | 0.530±0.030 | 0.474±0.007 | 4613 | 54925 |
| LORD2→3 | 8 | 0.978±0.006 | 0.979±0.006 | 0.021±0.006 | 0.078±0.009 | 15471 | 35563 |
| 128 | 0.954±0.006 | 0.954±0.006 | 0.045±0.006 | 0.121±0.007 | 6095 | 51915 |
| 512 | 0.848±0.043 | 0.849±0.043 | 0.146±0.041 | 0.216±0.028 | 15471 | 54283 |
+
+Table 14: BIDMC32RR
+
+| Method | P | R2 | Explained Variance | MSE | MAE | #Params(D) | #Params(R) |
| ODE-RNN | 8 | 0.536±0.195 | 0.540±0.193 | 0.447±0.188 | 0.494±0.124 | Not Applicable | 53791 |
| 128 | 0.721±0.010 | 0.722±0.011 | 0.269±0.010 | 0.360±0.006 | Not Applicable | 122911 |
| 512 | 0.651±0.018 | 0.652±0.017 | 0.337±0.018 | 0.413±0.016 | Not Applicable | 344095 |
| NCDE | 8 | 0.215±0.028 | 0.215±0.028 | 0.757±0.027 | 0.663±0.010 | Not Applicable | 86913 |
| 128 | 0.337±0.053 | 0.339±0.053 | 0.639±0.051 | 0.595±0.015 | Not Applicable | 86913 |
| 512 | 0.236±0.026 | 0.237±0.026 | 0.736±0.025 | 0.626±0.008 | Not Applicable | 86913 |
| ANCDE | 8 | 0.298±0.062 | 0.302±0.064 | 0.677±0.060 | 0.625±0.033 | Not Applicable | 47194 |
| 128 | 0.386±0.097 | 0.387±0.098 | 0.592±0.094 | 0.576±0.036 | Not Applicable | 47194 |
| 512 | 0.270±0.028 | 0.271±0.028 | 0.704±0.027 | 0.619±0.010 | Not Applicable | 55514 |
| NRDE2 | 8 | 0.274±0.037 | 0.274±0.037 | 0.700±0.035 | 0.637±0.019 | Not Applicable | 123969 |
| 128 | 0.521±0.082 | 0.521±0.082 | 0.462±0.079 | 0.500±0.035 | Not Applicable | 123969 |
| 512 | 0.498±0.162 | 0.498±0.162 | 0.484±0.156 | 0.512±0.075 | Not Applicable | 123969 |
| NRDE3 | 8 | 0.337±0.035 | 0.338±0.035 | 0.639±0.034 | 0.600±0.019 | Not Applicable | 222785 |
| 128 | 0.646±0.138 | 0.647±0.138 | 0.341±0.133 | 0.403±0.087 | Not Applicable | 222785 |
| 512 | 0.424±0.130 | 0.424±0.130 | 0.556±0.126 | 0.537±0.071 | Not Applicable | 222785 |
| DE-NRDE2 | 8 | 0.644±0.013 | 0.647±0.012 | 0.343±0.013 | 0.388±0.017 | Not Applicable | 88196 |
| 128 | 0.584±0.061 | 0.586±0.060 | 0.401±0.059 | 0.440±0.036 | Not Applicable | 100677 |
| 512 | 0.552±0.063 | 0.554±0.061 | 0.432±0.061 | 0.474±0.033 | Not Applicable | 99973 |
| DE-NRDE3 | 8 | 0.699±0.055 | 0.699±0.055 | 0.290±0.053 | 0.351±0.041 | Not Applicable | 139144 |
| 128 | 0.703±0.017 | 0.703±0.017 | 0.287±0.016 | 0.352±0.015 | Not Applicable | 164106 |
| 512 | 0.574±0.053 | 0.575±0.054 | 0.411±0.051 | 0.454±0.025 | Not Applicable | 162570 |
| LORD1→2 | 8 | 0.808±0.021 | 0.809±0.022 | 0.185±0.020 | 0.272±0.011 | 10285 | 27277 |
| 128 | 0.662±0.007 | 0.664±0.007 | 0.326±0.006 | 0.386±0.012 | 10285 | 27277 |
| 512 | 0.448±0.044 | 0.450±0.044 | 0.532±0.042 | 0.522±0.012 | 10285 | 39757 |
| LORD1→3 | 8 | 0.798±0.017 | 0.799±0.017 | 0.195±0.016 | 0.277±0.014 | 12645 | 27277 |
| 128 | 0.671±0.016 | 0.672±0.015 | 0.318±0.015 | 0.376±0.012 | 12645 | 44973 |
| 512 | 0.451±0.026 | 0.453±0.023 | 0.530±0.025 | 0.520±0.012 | 12645 | 44973 |
| LORD2→3 | 8 | 0.800±0.007 | 0.801±0.007 | 0.192±0.007 | 0.281±0.008 | 15471 | 35563 |
| 128 | 0.744±0.011 | 0.744±0.011 | 0.247±0.010 | 0.315±0.010 | 15471 | 136459 |
| 512 | 0.662±0.015 | 0.664±0.014 | 0.326±0.014 | 0.386±0.011 | 46511 | 103531 |
+
+Table 15: BIDMC32Sp02
+
+| Method | P | R2 | Explained Variance | MSE | MAE | #Params(D) | #Params(R) |
| ODE-RNN | 8 | 0.551±0.108 | 0.552±0.108 | 0.464±0.112 | 0.487±0.082 | Not Applicable | 3871 |
| 128 | 0.899±0.025 | 0.901±0.023 | 0.104±0.026 | 0.225±0.035 | Not Applicable | 15391 |
| 512 | 0.749±0.024 | 0.749±0.024 | 0.259±0.025 | 0.365±0.021 | Not Applicable | 52255 |
| NCDE | 8 | 0.240±0.071 | 0.245±0.067 | 0.785±0.073 | 0.686±0.034 | Not Applicable | 86913 |
| 128 | 0.215±0.074 | 0.217±0.072 | 0.811±0.077 | 0.694±0.035 | Not Applicable | 86913 |
| 512 | 0.328±0.045 | 0.332±0.045 | 0.694±0.046 | 0.639±0.037 | Not Applicable | 86913 |
| ANCDE | 8 | 0.311±0.034 | 0.313±0.035 | 0.712±0.035 | 0.662±0.014 | Not Applicable | 47194 |
| 128 | 0.327±0.049 | 0.327±0.049 | 0.696±0.050 | 0.631±0.017 | Not Applicable | 47194 |
| 512 | 0.372±0.033 | 0.374±0.034 | 0.648±0.034 | 0.592±0.013 | Not Applicable | 47194 |
| NRDE2 | 8 | 0.218±0.078 | 0.219±0.078 | 0.807±0.080 | 0.694±0.036 | Not Applicable | 123969 |
| 128 | 0.470±0.100 | 0.471±0.100 | 0.547±0.103 | 0.559±0.048 | Not Applicable | 123969 |
| 512 | 0.607±0.180 | 0.607±0.180 | 0.406±0.186 | 0.455±0.123 | Not Applicable | 123969 |
| NRDE3 | 8 | 0.131±0.091 | 0.134±0.090 | 0.898±0.094 | 0.720±0.027 | Not Applicable | 222785 |
| 128 | 0.681±0.147 | 0.681±0.147 | 0.330±0.151 | 0.410±0.126 | Not Applicable | 222785 |
| 512 | 0.596±0.181 | 0.596±0.181 | 0.417±0.187 | 0.463±0.139 | Not Applicable | 222785 |
| DE-NRDE2 | 8 | 0.854±0.013 | 0.854±0.013 | 0.151±0.013 | 0.252±0.015 | Not Applicable | 88196 |
| 128 | 0.740±0.047 | 0.740±0.048 | 0.269±0.049 | 0.313±0.039 | Not Applicable | 99973 |
| 512 | 0.586±0.042 | 0.586±0.042 | 0.428±0.043 | 0.453±0.033 | Not Applicable | 99973 |
| DE-NRDE3 | 8 | 0.903±0.079 | 0.903±0.079 | 0.100±0.082 | 0.192±0.090 | Not Applicable | 139144 |
| 128 | 0.926±0.026 | 0.927±0.026 | 0.076±0.027 | 0.164±0.024 | Not Applicable | 162570 |
| 512 | 0.759±0.067 | 0.761±0.067 | 0.249±0.069 | 0.357±0.061 | Not Applicable | 162570 |
| LORD1→2 | 8 | 0.975±0.003 | 0.976±0.002 | 0.025±0.003 | 0.096±0.009 | 10285 | 27277 |
| 128 | 0.909±0.009 | 0.910±0.009 | 0.094±0.009 | 0.172±0.013 | 3277 | 34189 |
| 512 | 0.583±0.047 | 0.583±0.047 | 0.431±0.048 | 0.435±0.024 | 10285 | 61549 |
| LORD1→3 | 8 | 0.981±0.005 | 0.981±0.004 | 0.020±0.005 | 0.086±0.006 | 12645 | 27277 |
| 128 | 0.889±0.025 | 0.889±0.025 | 0.115±0.026 | 0.186±0.029 | 12645 | 27277 |
| 512 | 0.521±0.045 | 0.522±0.044 | 0.495±0.046 | 0.459±0.024 | 4613 | 38349 |
| LORD2→3 | 8 | 0.981±0.005 | 0.981±0.005 | 0.019±0.005 | 0.088±0.007 | 15471 | 35563 |
| 128 | 0.940±0.007 | 0.940±0.007 | 0.062±0.007 | 0.145±0.004 | 15471 | 56395 |
| 512 | 0.829±0.027 | 0.830±0.027 | 0.177±0.028 | 0.236±0.016 | 46511 | 69323 |
+
+Table 16: Sensitivity of max_iter_AE in EigenWorms (P = 128)
+
+| Method | max_iterAE | Accuracy | Macro F1 | Weighted F1 | ROCAUC |
| LORD1→2 | 0 | 0.656±0.094 | 0.588±0.107 | 0.649±0.100 | 0.847±0.056 |
| 100 | 0.713±0.042 | 0.716±0.058 | 0.713±0.046 | 0.862±0.023 |
| 300 | 0.744±0.048 | 0.727±0.059 | 0.744±0.051 | 0.893±0.029 |
| 500 | 0.733±0.105 | 0.725±0.104 | 0.738±0.111 | 0.889±0.035 |
| 700 | 0.774±0.049 | 0.773±0.070 | 0.777±0.056 | 0.908±0.026 |
| 900 | 0.723±0.091 | 0.702±0.092 | 0.722±0.083 | 0.891±0.054 |
| LORD1→3 | 0 | 0.600±0.140 | 0.513±0.215 | 0.561±0.188 | 0.820±0.068 |
| 100 | 0.713±0.056 | 0.636±0.139 | 0.694±0.085 | 0.884±0.030 |
| 300 | 0.733±0.069 | 0.725±0.053 | 0.730±0.063 | 0.868±0.036 |
| 500 | 0.733±0.039 | 0.722±0.054 | 0.730±0.046 | 0.872±0.035 |
| 700 | 0.744±0.031 | 0.730±0.043 | 0.741±0.034 | 0.872±0.021 |
| 900 | 0.744±0.048 | 0.724±0.040 | 0.740±0.053 | 0.884±0.015 |
| LORD2→3 | 0 | 0.477±0.059 | 0.338±0.105 | 0.420±0.078 | 0.764±0.051 |
| 100 | 0.667±0.091 | 0.591±0.127 | 0.642±0.106 | 0.888±0.044 |
| 300 | 0.790±0.042 | 0.754±0.060 | 0.783±0.050 | 0.927±0.017 |
| 500 | 0.826±0.071 | 0.789±0.113 | 0.825±0.072 | 0.951±0.029 |
| 700 | 0.846±0.101 | 0.816±0.126 | 0.847±0.103 | 0.928±0.046 |
| 900 | 0.856±0.067 | 0.833±0.087 | 0.857±0.067 | 0.949±0.027 |
+
+# E SENSITIVITY EXPERIMENTS
+
+Fig. 6 and Table 16 show that in general, the performance of LORD is improved as max_iterAE gets larger in EigenWorms $(P = 128)$ . Our encoder-decoder structure can successfully integrate the lower-depth log-signature and the higher-depth log-signature information into the embedding vector e, and the well-integrated information helps the model perform better. In general, the lower-depth and the higher-depth log-signature information are blended better as the encoder-decoder structure is more trained.
+
+
+(a) $\mathrm{LORD}_{1\rightarrow 2}$
+
+
+(b) $\mathsf{LORD}_{1\to 3}$
+
+
+(c) $\mathrm{LORD}_{2\to 3}$
+Figure 6: Sensitivity to max_iter_AE
+
+# F TRAIN LOSS
+
+Fig. 7 visualizes several training cases for our method and the original NRDE design. In general, our method shows much better stability across the entire training period.
+
+# G END-TO-END TRAINING
+
+LORD has two distinguished characteristics in its training process. First, LORD uses a two-phase training strategy, a pre-training and a main training processes. Second, the training process of LORD is not end-to-end. In other words, the decoder is not used and the encoder is fixed in the main training phase. In this section, we test with various end-to-end-training settings for LORD.
+
+There are three possible configurations for the end-to-end-training. The first configuration is training the encoder (rather than fixing it) with $L_{TASK}$ in the main training phase, which is denoted as FineTuning. The second one is Co-Train where both $L_{AE}$ and $L_{TASK}$ are used for training the encoder, the decoder and the main NRDE — recall that in FineTuning, we use only $L_{TASK}$
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+
+
+(e)
+
+
+(f)
+Figure 7: Train loss of $\mathrm{NRDE}_3$ and $\mathrm{LORD}_{2\rightarrow 3}$
+
+Table 17: Comparison between LORD and its various end-to-end training variations in EigenWorms $(P = 128)$
+
+ | Method | Accuracy | Macro F1 | Weighted F1 | ROCAUC |
| LORD1→2 | LORD | 0.759±0.064 | 0.748±0.082 | 0.760±0.061 | 0.900±0.009 |
| FineTuning | 0.744±0.075 | 0.726±0.086 | 0.740±0.077 | 0.882±0.042 |
| Co-Train | 0.718±0.021 | 0.686±0.025 | 0.715±0.014 | 0.865±0.030 |
| Co-Train(w.o. pre) | 0.679±0.033 | 0.650±0.031 | 0.669±0.029 | 0.832±0.013 |
| LORD1→3 | LORD | 0.744±0.081 | 0.716±0.087 | 0.737±0.076 | 0.892±0.044 |
| FineTuning | 0.692±0.055 | 0.649±0.049 | 0.680±0.069 | 0.865±0.018 |
| Co-Train | 0.744±0.036 | 0.723±0.059 | 0.741±0.037 | 0.868±0.022 |
| Co-Train(w.o. pre) | 0.692±0.069 | 0.674±0.083 | 0.694±0.064 | 0.839±0.066 |
| LORD2→3 | LORD | 0.841±0.038 | 0.823±0.055 | 0.835±0.049 | 0.949±0.023 |
| FineTuning | 0.731±0.061 | 0.687±0.075 | 0.714±0.062 | 0.919±0.005 |
| Co-Train | 0.808±0.061 | 0.772±0.074 | 0.803±0.071 | 0.948±0.021 |
| Co-Train(w.o. pre) | 0.583±0.112 | 0.499±0.145 | 0.557±0.117 | 0.804±0.065 |
+
+to train the encoder. The last method is Co-Train (w.o. pre) which is the same as Co-Train without any pre-training process. The same hyperparameters are used for all end-to-end models.
+
+We experiment with EigenWorms $(P = 128)$ . Table 16 shows the results. Among the three end-to-end models, Co-Train shows the best performance. Co-Train (w.o. pre) has the worst performance in general. These results prove that the pre-training makes the main training easier.
+
+Table 18: The best hyperparameter in ODE-RNN
+
+| Data | P | Hidden
+Path Size |
| Character-
+Trajectory | 1 | 128 |
| 4 | 128 |
| 16 | 256 |
| 32 | 64 |
| LiveFuel-
+MoistureContent | 1 | 128 |
| 4 | 64 |
| 16 | 64 |
| 32 | 128 |
+
+Table 19: The best hyperparameter in NCDE and NRDE
+
+| Data | P | Hidden | CDE Function's | #Hidden Layers |
| Path Size | Hidden Size |
| D=1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
| Character- Trajectory | 1 | 64 | - | - | 256 | - | - | 3 | - | - |
| 4 | 128 | 256 | 64 | 256 | 256 | 128 | 3 | 3 | 2 |
| 16 | 256 | 256 | 128 | 64 | 64 | 256 | 2 | 3 | 2 |
| 32 | 256 | 128 | 128 | 64 | 64 | 128 | 2 | 3 | 2 |
| LiveFuel- MoistureContent | 1 | 64 | - | - | 64 | - | - | 3 | - | - |
| 4 | 64 | 128 | 128 | 128 | 256 | 64 | 3 | 3 | 2 |
| 16 | 64 | 256 | 64 | 64 | 256 | 256 | 2 | 3 | 2 |
| 32 | 256 | 256 | 64 | 256 | 128 | 64 | 3 | 3 | 2 |
+
+Table 20: The best hyperparameter in ANCDE
+
+| Data | P | Hidden Path Size | #Hidden Layers | Attention Channel Size |
| Character- Trajectory | 1 | 256 | 3 | 256 |
| 4 | 256 | 2 | 64 |
| 16 | 256 | 3 | 64 |
| 32 | 256 | 2 | 64 |
| LiveFuel- MoistureContent | 1 | 128 | 3 | 64 |
| 4 | 128 | 3 | 128 |
| 16 | 128 | 2 | 64 |
| 32 | 256 | 3 | 64 |
+
+Table 21: The best hyperparameter in DE-NRDE
+
+| Data | P | Compression Ratio | #Hidden Layers | Hidden Size |
| D=2 | 3 | 2 | 3 | 2 | 3 |
| Character- Trajectory | 4 | 0.7 | 0.3 | 1 | 1 | 64 | 128 |
| 16 | 0.5 | 0.5 | 1 | 1 | 128 | 64 |
| 32 | 0.7 | 0.5 | 1 | 2 | 128 | 128 |
| LiveFuel- MoistureContent | 4 | 0.7 | 0.7 | 2 | 2 | 64 | 128 |
| 16 | 0.3 | 0.3 | 2 | 1 | 64 | 64 |
| 32 | 0.7 | 0.5 | 2 | 2 | 128 | 64 |
+
+Table 22: The best hyperparameter in LORD
+
+| Method | Data | P | Nf | Ng | No | hf | hg | ho | cAE | cTASK | ce | max_iter |
| AE | TASK |
| LORD1→2 | Character- Trajectory | 4 | 3 | 3 | 3 | 64 | 256 | 64 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 16 | 3 | 3 | 3 | 64 | 128 | 64 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 32 | 3 | 3 | 3 | 128 | 256 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| LiveFuel- MoistureContent | 4 | 3 | 3 | 3 | 128 | 128 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 16 | 3 | 3 | 3 | 256 | 256 | 256 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 32 | 3 | 3 | 3 | 256 | 256 | 256 | 1 × 10-6 | 1 × 10-6 | 0 | 1500 | 400 |
| LORD1→3 | Character- Trajectory | 4 | 3 | 3 | 3 | 128 | 128 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 16 | 3 | 3 | 3 | 128 | 128 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 32 | 3 | 3 | 3 | 128 | 64 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| LiveFuel- MoistureContent | 4 | 3 | 3 | 3 | 256 | 256 | 256 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 16 | 3 | 3 | 3 | 64 | 64 | 64 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 32 | 3 | 3 | 3 | 128 | 64 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1500 | 400 |
| LORD2→3 | Character- Trajectory | 4 | 3 | 3 | 3 | 128 | 256 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 16 | 3 | 3 | 3 | 256 | 256 | 256 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| 32 | 3 | 3 | 3 | 128 | 256 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 1000 | 400 |
| LiveFuel- MoistureContent | 4 | 3 | 3 | 3 | 256 | 64 | 256 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 16 | 3 | 3 | 3 | 128 | 256 | 128 | 1 × 10-6 | 1 × 10-6 | 0 | 2000 | 400 |
| 32 | 3 | 3 | 3 | 64 | 256 | 64 | 1 × 10-6 | 1 × 10-6 | 0 | 1500 | 400 |
+
+# H ADDITIONAL EXPERIMENTS WITH SHORT TIME-SERIES
+
+In this section, we experiment with short time-series datasets. We use CharacterTrajectory and LiveFuelMoistureContent from (Tan & Webb). The object of CharacterTrajectory is to classify 20 characters using the trajectory information of writing on a tablet. Its length is 182. LiveFuelMoistureContent consists of daily reflectance data at 7 spectral bands for predicting moisture rate in vegetation. Its length is 365. In Tables 18 to 22, we summarize hyperparameters. Because of the short time-series lengths, we test $P = 1$ for all except NRDE-based models.
+
+In Table 23, NRDE achieves the best scores among baseline models and LORD achieves the best scores among all methods. In Table 24, DE-NRDE $_2$ is the best. Except DE-NRDE $_2$ , ODE-RNN is the best. However, LORD also has comparable scores. From these results, NRDE and NRDE-based models are empirically useful for short-time series as well.
+
+Table 23: CharacterTrajectory
+
+| Method | P | Accuracy | Macro F1 | Weighted F1 | ROCAUC | #Params(D) | #Params(R) |
| ODE-RNN | 1 | 0.716±0.036 | 0.697±0.041 | 0.712±0.038 | 0.969±0.007 | Not Applicable | 27570 |
| 4 | 0.950±0.012 | 0.947±0.013 | 0.950±0.012 | 0.998±0.001 | Not Applicable | 29106 |
| 16 | 0.968±0.004 | 0.967±0.005 | 0.968±0.004 | 0.999±0.000* | Not Applicable | 103218 |
| 32 | 0.962±0.009 | 0.959±0.010 | 0.962±0.009 | 0.997±0.001 | Not Applicable | 17650 |
| NCDE | 1 | 0.954±0.004 | 0.952±0.004 | 0.954±0.004 | 0.998±0.000 | Not Applicable | 149844 |
| 4 | 0.951±0.005 | 0.948±0.005 | 0.951±0.005 | 0.998±0.000 | Not Applicable | 233620 |
| 16 | 0.905±0.020 | 0.901±0.020 | 0.905±0.020 | 0.994±0.002 | Not Applicable | 93588 |
| 32 | 0.829±0.012 | 0.818±0.013 | 0.828±0.012 | 0.983±0.002 | Not Applicable | 93588 |
| ANCDE | 1 | 0.959±0.007 | 0.958±0.007 | 0.959±0.007 | 0.998±0.000 | Not Applicable | 669757 |
| 4 | 0.952±0.008 | 0.950±0.008 | 0.952±0.008 | 0.998±0.000 | Not Applicable | 286845 |
| 16 | 0.897±0.009 | 0.893±0.011 | 0.896±0.010 | 0.994±0.001 | Not Applicable | 538173 |
| 32 | 0.777±0.020 | 0.762±0.020 | 0.774±0.021 | 0.981±0.001 | Not Applicable | 103293 |
| NRDE2 | 4 | 0.970±0.004 | 0.968±0.005 | 0.970±0.004 | 0.999±0.000* | Not Applicable | 795924 |
| 16 | 0.951±0.008 | 0.949±0.009 | 0.951±0.008 | 0.998±0.001 | Not Applicable | 193428 |
| 32 | 0.950±0.007 | 0.948±0.008 | 0.950±0.007 | 0.998±0.000 | Not Applicable | 98836 |
| NRDE3 | 4 | 0.966±0.006 | 0.965±0.006 | 0.966±0.006 | 0.999±0.000* | Not Applicable | 274132 |
| 16 | 0.960±0.006 | 0.960±0.006 | 0.961±0.006 | 0.999±0.000* | Not Applicable | 531604 |
| 32 | 0.961±0.002 | 0.959±0.002 | 0.961±0.002 | 0.999±0.000* | Not Applicable | 1088916 |
| DE-NRDE2 | 4 | 0.898±0.077 | 0.890±0.084 | 0.897±0.078 | 0.994±0.007 | Not Applicable | 599707 |
| 16 | 0.907±0.013 | 0.900±0.012 | 0.906±0.012 | 0.996±0.002 | Not Applicable | 112281 |
| 32 | 0.897±0.018 | 0.890±0.018 | 0.896±0.017 | 0.995±0.001 | Not Applicable | 76187 |
| DE-NRDE3 | 4 | 0.933±0.031 | 0.926±0.035 | 0.932±0.032 | 0.997±0.001 | Not Applicable | 105885 |
| 16 | 0.947±0.014 | 0.943±0.015 | 0.947±0.014 | 0.998±0.000 | Not Applicable | 286883 |
| 32 | 0.913±0.013 | 0.907±0.014 | 0.912±0.013 | 0.996±0.001 | Not Applicable | 617891 |
| LORD1→2 | 4 | 0.977±0.002* | 0.976±0.003* | 0.977±0.002* | 0.999±0.000* | 12158 | 235880 |
| 16 | 0.955±0.010 | 0.953±0.010 | 0.955±0.010 | 0.998±0.001 | 12158 | 96232 |
| 32 | 0.829±0.069 | 0.817±0.077 | 0.826±0.074 | 0.985±0.011 | 40126 | 261928 |
| LORD1→3 | 4 | 0.976±0.005 | 0.975±0.006 | 0.976±0.005 | 0.999±0.000* | 53746 | 98568 |
| 16 | 0.959±0.006 | 0.957±0.006 | 0.959±0.006 | 0.998±0.001 | 53746 | 98568 |
| 32 | 0.810±0.069 | 0.796±0.074 | 0.808±0.071 | 0.983±0.013 | 53746 | 63560 |
| LORD2→3 | 4 | 0.971±0.008 | 0.969±0.009 | 0.971±0.008 | 0.999±0.000* | 77158 | 372418 |
| 16 | 0.971±0.003 | 0.969±0.003 | 0.971±0.003 | 0.999±0.000* | 218086 | 391650 |
| 32 | 0.964±0.008 | 0.963±0.008 | 0.964±0.008 | 0.999±0.000* | 77158 | 372418 |
+
+Table 24: LiveFuelMoistureContent
+
+| Method | P | R2 | Explained Variance | MSE | MAE | #Params(D) | #Params(R) |
| ODE-RNN | 1 | 0.026±0.005 | 0.026±0.005 | 1.064±0.005 | 0.775±0.001 | Not Applicable | 25631 |
| 4 | 0.029±0.003 | 0.029±0.003 | 1.062±0.003 | 0.774±0.002 | Not Applicable | 10271 |
| 16 | 0.032±0.003 | 0.033±0.003 | 1.058±0.004 | 0.775±0.004 | Not Applicable | 16415 |
| 32 | 0.031±0.004 | 0.031±0.004 | 1.059±0.004 | 0.774±0.003 | Not Applicable | 57375 |
| NCDE | 1 | -0.009±0.037 | -0.008±0.037 | 1.102±0.040 | 0.787±0.010 | Not Applicable | 42241 |
| 4 | -0.004±0.020 | -0.003±0.020 | 1.098±0.022 | 0.785±0.007 | Not Applicable | 91521 |
| 16 | -0.043±0.031 | -0.043±0.031 | 1.140±0.034 | 0.794±0.011 | Not Applicable | 42241 |
| 32 | 0.009±0.029 | 0.009±0.029 | 1.083±0.032 | 0.779±0.005 | Not Applicable | 660481 |
| ANCDE | 1 | -0.025±0.078 | -0.024±0.079 | 1.120±0.086 | 0.785±0.009 | Not Applicable | 101714 |
| 4 | 0.014±0.007 | 0.015±0.007 | 1.077±0.007 | 0.781±0.003 | Not Applicable | 241938 |
| 16 | 0.003±0.030 | 0.004±0.030 | 1.089±0.033 | 0.781±0.010 | Not Applicable | 93394 |
| 32 | 0.006±0.017 | 0.006±0.017 | 1.087±0.019 | 0.784±0.009 | Not Applicable | 177746 |
| NRDE2 | 4 | -0.010±0.043 | -0.009±0.043 | 1.103±0.047 | 0.785±0.004 | Not Applicable | 1284353 |
| 16 | -0.373±0.274 | -0.373±0.274 | 1.501±0.299 | 0.824±0.020 | Not Applicable | 2502657 |
| 32 | -0.151±0.166 | -0.151±0.166 | 1.258±0.182 | 0.816±0.023 | Not Applicable | 1240833 |
| NRDE3 | 4 | -0.480±0.311 | -0.480±0.311 | 1.618±0.340 | 0.830±0.012 | Not Applicable | 1710977 |
| 16 | -1.308±2.265 | -1.307±2.264 | 2.522±2.475 | 0.863±0.089 | Not Applicable | 3438465 |
| 32 | -2.183±4.622 | -2.182±4.621 | 3.478±5.051 | 0.896±0.174 | Not Applicable | 857601 |
| DE-NRDE2 | 4 | 0.040±0.007 | 0.040±0.007 | 1.049±0.007 | 0.770±0.005 | Not Applicable | 930650 |
| 16 | 0.042±0.006 | 0.042±0.006 | 1.047±0.007 | 0.768±0.005 | Not Applicable | 799243 |
| 32 | 0.043±0.005* | 0.043±0.005* | 1.046±0.006* | 0.767±0.006* | Not Applicable | 902042 |
| DE-NRDE3 | 4 | -0.778±1.599 | -0.776±1.599 | 1.943±1.747 | 0.796±0.039 | Not Applicable | 1256207 |
| 16 | -0.037±0.046 | -0.036±0.046 | 1.133±0.051 | 0.790±0.010 | Not Applicable | 1103486 |
| 32 | -0.657±0.831 | -0.651±0.822 | 1.810±0.908 | 0.829±0.045 | Not Applicable | 457191 |
| LORD1→2 | 4 | 0.017±0.015 | 0.018±0.014 | 1.074±0.016 | 0.784±0.011 | 76684 | 120937 |
| 16 | 0.019±0.007 | 0.020±0.008 | 1.072±0.008 | 0.781±0.007 | 216844 | 441481 |
| 32 | 0.013±0.007 | 0.014±0.007 | 1.078±0.007 | 0.784±0.002 | 216844 | 441481 |
| LORD1→3 | 4 | 0.018±0.010 | 0.018±0.011 | 1.074±0.011 | 0.782±0.006 | 612148 | 441481 |
| 16 | 0.002±0.009 | 0.003±0.009 | 1.091±0.010 | 0.790±0.003 | 136180 | 70153 |
| 32 | 0.005±0.011 | 0.005±0.010 | 1.087±0.012 | 0.788±0.007 | 278452 | 99529 |
| LORD2→3 | 4 | -0.025±0.037 | -0.025±0.038 | 1.120±0.041 | 0.793±0.004 | 2081028 | 648629 |
| 16 | -0.015±0.027 | -0.014±0.027 | 1.109±0.030 | 0.793±0.004 | 1016196 | 957557 |
| 32 | 0.008±0.002 | 0.008±0.002 | 1.085±0.003 | 0.788±0.002 | 508356 | 540181 |
\ No newline at end of file
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/images.zip b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e3ff41f589dabb26c058a32d9db4d286627d9ee2
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b0c22c8a1b214871b29ff80223beed9efbe625e30e2adb8135d31d1e0a9073c6
+size 3184218
diff --git a/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/layout.json b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a87b0a8707c2550bb9a51e23fe031412ff44c50e
--- /dev/null
+++ b/lordlowerdimensionalembeddingoflogsignatureinneuralroughdifferentialequations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:86c870d0a2f6b333d9eebf7654a0789c6ca612771a1c3f458ee7917efc00011e
+size 748490
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_content_list.json b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..86ff208e5d0e386726d4e7257d290bbf65234962
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:73620a18a9f71cdb51791113b1f36c1ec9df13cdbb487b7f00fe7055ad6fffb1
+size 259044
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_model.json b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..796eb3929a80e0cc89bed964f11eac095b01724a
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8be871b0e474d63f321eaa22b6570d4a4c417b06b93441338a74b7b764ef704
+size 295215
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_origin.pdf b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9f54caa97ceb214ff5860c2b919051b6f5d8588f
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/d3ee75f2-c334-489b-8ee7-52fa4eb042b8_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:960e9cd1e4e03758f7de75c11ce0a1737c920ed9065d5938e5e5364008b23a2d
+size 1928662
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/full.md b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..557cc75a74d3c7af04d2cb40f2a47b40baaa21ba
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/full.md
@@ -0,0 +1,1391 @@
+# LOSSY COMPRESSION WITH DISTRIBUTION SHIFT AS ENTROPY CONSTRAINED OPTIMAL TRANSPORT
+
+Huan Liu $^{1*}$ , George Zhang $^{2*}$ , Jun Chen $^{1}$ , Ashish Khisti $^{2}$
+
+1McMaster University, 2University of Toronto
+
+{liuh127, chenjun}@mcmaster.ca
+
+gq.zhang@mail.utoronto.ca, akhisti@ece.utoronto.ca
+
+# ABSTRACT
+
+We study an extension of lossy compression where the reconstruction distribution is different from the source distribution in order to account for distributional shift due to processing. We formulate this as a generalization of optimal transport with an entropy bottleneck to account for the rate constraint due to compression. We provide expressions for the tradeoff between compression rate and the achievable distortion with and without shared common randomness between the encoder and decoder. We study the examples of binary, uniform and Gaussian sources (in an asymptotic setting) in detail and demonstrate that shared randomness can strictly improve the tradeoff. For the case without common randomness and squared-Euclidean distortion, we show that the optimal solution partially decouples into the problem of optimal compression and transport and also characterize the penalty associated with fully decoupling them. We provide experimental results by training deep learning end-to-end compression systems for performing denoising on SVHN and super-resolution on MNIST suggesting consistency with our theoretical results.
+
+# 1 INTRODUCTION
+
+Using deep neural networks for lossy image compression has proven to be effective, with rate-distortion performance capable of dominating general-purpose image CODEs like JPEG, WebP or BPG (Rippel & Bourdev, 2017; Agustsson et al., 2017; Mentzer et al., 2018). More recently, many of these works have included generative aspects within the compression to synthesize realistic elements when the rate is otherwise too low to represent fine-grained details (Tschannen et al., 2018; Agustsson et al., 2019; Mentzer et al., 2020). Though this has been found to deteriorate rate-distortion performance, it has generally resulted in more perceptually-pleasing image reconstruction by reducing artifacts such as pixelation and blur. Using a distributional constraint as a proxy for perceptual measure, several works have subsequently formalized this in a mathematical framework known as the rate-distortion-perception tradeoff (Blau & Michaeli, 2018; 2019; Matsumoto, 2018; 2019; Theis & Wagner, 2021; Yan et al., 2021; Zhang et al., 2021). As is conventional in lossy compression, these works address the scenario in which both low distortion, whereby each individual image reconstruction resembles the ground truth image, and closeness in distribution in which it is not easy to discriminate between image samples from the data-generating distribution and reconstruction distribution, are desirable.
+
+The underlying ideal in conventional compression systems is to have perfect reconstruction with respect to some ground truth input. However this is not the case in applications such as denoising, deblurring, or super-resolution (SR), which require restoration from a degraded input image. In fact, in these cases a ground truth may not even be available. In such applications naturally the reconstruction distribution must match the original source rather than the degraded input distribution. A large body of literature has been devoted to various image restoration tasks, including several methods based on deep learning including both supervised (e.g., (Blau & Michaeli, 2018)) and unsupervised learning methods (e.g., (Wang et al., 2021b)). Although most of the literature exclusively treats compression
+
+and restoration separately, in many applications they can co-occur. For example, the encoder which records a degraded image may not be co-located with the decoder, but must transmit a compressed version of the image over a digital network. In turn, the decoder must perform both decompression and restoration simultaneously.
+
+To that end, we study an extension of lossy compression in which the reconstruction distribution is different than the source distribution to account for distributional shift due to processing. The problem can be described as a transformation from some source domain to a new target domain under a rate constraint, which generalizes optimal transport. This readily extends other works which view image restoration under the perception-distortion tradeoff (Blau & Michaeli, 2018) or under optimal transport (Wang et al., 2021b). It also provides a generalization of the rate-distortion-perception problem (Blau & Michaeli, 2019) where the reconstruction distribution must be close to the input distribution. Following (Theis & Agustsson, 2021; Theis & Wagner, 2021), we also utilize common randomness as a tool for compression in our setting. Our results are summarized as follows:
+
+- We provide a formulation of lossy compression with distribution shift as a generalization of optimal transport with an entropy constraint and identify the tradeoff between the compression rate and minimum achievable distortion both with and without common randomness at the encoder and decoder. We identify conditions under which the structure of the optimal solution partially decouples the problems of compression and transport, and discuss their architectural implications. We study the examples of binary, uniform and Gaussian sources (in asymptotic regime) in detail and demonstrate the utility of our theoretical bounds.
+- We train deep learning end-to-end compression systems for performing super-resolution on MNIST and denoising on SVHN. Our setup is unsupervised and to the best of our knowledge the first to integrate both compression and restoration at once using deep learning. We first demonstrate that by having common randomness at the encoder and decoder the achievable distortion-rate tradeoffs are lower than when such randomness is not present. Furthermore, we provide experimental validation of the architectural principle suggested by our theoretical analysis.
+
+# 2 THEORETICAL FORMULATION
+
+We consider a setting where an input $X \sim p_{X}$ is observed at the encoder, which is a degraded (e.g., noisy, lower resolution, etc) version of the original source. It must be restored to an output $Y \sim p_{Y}$ at the decoder, where $p_{Y}$ denotes the target distribution of interest. For example, if $X$ denotes a noise-corrupted image and $Y$ denotes the associated clear reconstruction, then $p_{Y}$ can be selected to match the distribution of the original source. We will assume $p_{X}$ and $p_{Y}$ are probability distributions over $\mathcal{X}, \mathcal{Y} \subseteq \mathbb{R}^{n}$ and require $X$ and $Y$ to be close with respect to some fidelity metric, which will be measured using a non-negative cost function $d(x,y)$ over $\mathcal{X} \times \mathcal{Y}$ . We will refer to $d(\cdot ,\cdot)$ as the distortion measure and assume that it satisfies $d(x,y) = 0$ if and only if $x = y$ . We further assume that $X$ cannot be directly revealed to the decoder, but instead must be transmitted over a bit interface with an average rate constraint. Such a scenario occurs naturally in many practical systems when the encoder and decoder are not co-located such as communication systems or storage systems. As one potential application, when aerial photographs are produced for remote sensing purposes, blurs are introduced by atmospheric
+
+turbulence, aberrations in the optical system and relative motion between camera and ground. In such scenarios unsupervised restoration is preferred as it is often intractable to accurately model such degradation processes and collection of paired training data can be time consuming or require significant human intervention. Unsupervised image restoration has been studied recently in Zhang et al. (2017); Pan et al. (2021); Wang et al. (2021b); Menon et al. (2020). These works also fix the reconstruction distribution $Y \sim p_{Y}$ and propose to minimize a distortion metric between the output and the degraded input as in our present work, but do not consider compression.
+
+
+Figure 1: Illustration of Theorem 1 (no common randomness). Given source distribution $p_{X}$ , target reconstruction distribution $p_{Y}$ and rate $R$ , we can find quantizations $\hat{X}$ of $X$ and $\hat{Y}$ of $Y$ and consider transport between them.
+
+# 2.1 OPTIMAL TRANSPORT AND EXTENSIONS
+
+Definition 1 (Optimal Transport). Let $\Gamma(p_X, p_Y)$ be the set of all joint distributions $p_{X,Y}$ with marginals $p_X$ and $p_Y$ . The classical optimal transport problem is defined as
+
+$$
+D \left(p _ {X}, p _ {Y}\right) = \inf _ {p _ {X}, Y \in \Gamma \left(p _ {X}, p _ {Y}\right)} \mathbb {E} [ d (X, Y) ], \tag {1}
+$$
+
+where we refer to each $p_{X,Y} \in \Gamma(p_X, p_Y)$ as a transport plan.
+
+Operationally the optimal transport plan in (1) minimizes the average distortion between the input and output while keeping the output distribution fixed to $p_{Y}$ . This may generate a transport plan with potentially unbounded entropy, which may not be amenable in a rate-constrained setting. We therefore suggest a generalization to Definition 1 which constrains the entropy of the transport plan. It turns out that having common randomness at the encoder and decoder can help in this setting, so we will distinguish between when it is available and unavailable.
+
+Definition 2 (Optimal Transport with Entropy Bottleneck — no Common Randomness). Let $M_{\mathrm{ncr}}(p_X, p_Y)$ denote the set of joint distributions $p_{X,Z,Y}$ compatible with the given marginal distributions $p_X, p_Y$ satisfying $p_{X,Z,Y} = p_X p_{Z|X} p_{Y|Z}$ . The optimal transport from $p_X$ to $p_Y$ with an entropy bottleneck of $R$ and without common randomness is defined as
+
+$$
+D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {X, Z, Y} \in M _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}\right)} \mathbb {E} [ d (X, Y) ] \tag {2}
+$$
+
+$$
+\begin{array}{l l} \text {s . t .} & H (Z) \leq R, \end{array}
+$$
+
+where $H(\cdot)$ denotes the Shannon entropy of a random variable.
+
+We note that when the rate constraint $R$ is sufficiently large such that one can select $Z = X$ or $Z = Y$ in (2), then $D_{\mathrm{ncr}}(p_X, p_Y, R) = D(p_X, p_Y)$ in (1). More generally, $D(p_X, p_Y)$ serves as a lower bound for $D_{\mathrm{ncr}}(p_X, p_Y, R)$ for any $R > 0$ . Definition 2 also has a natural operational interpretation in our setting. We can view the encoder as implementing the conditional distribution $p_{Z|X}$ to output a representation $Z$ given the input $X$ , and the decoder as implementing the conditional distribution $p_{Y|Z}$ to output the reconstruction $Y$ given the representation $Z$ . The entropy constraint $H(Z) \leq R$ essentially guarantees that the representation $Z$ can be losslessly transmitted at a rate close to $R^1$ .
+
+Of particular interest to us is the squared Euclidean distance $d(X, Y) = ||X - Y||^2$ . As it turns out, when we specialize to this distance function we can without loss of optimality also impose a more structured architecture for implementing the encoder and the decoder. Let $W_2^2(\cdot, \cdot)$ be the squared quadratic Wasserstein distance, by using the squared loss in Definition 1.
+
+# Theorem 1. Let
+
+$$
+D _ {\mathrm {m s e}} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {\hat {X} | X}, p _ {\hat {Y} | Y}} \mathbb {E} \left[ \| X - \hat {X} \| ^ {2} \right] + \mathbb {E} \left[ \| Y - \hat {Y} \| ^ {2} \right] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right) \tag {3}
+$$
+
+$$
+s. t. \quad \mathbb {E} [ X | \hat {X} ] = \hat {X}, \quad \mathbb {E} [ Y | \hat {Y} ] = \hat {Y}, \quad H (\hat {X}) \leq R, \quad H (\hat {Y}) \leq R,
+$$
+
+and
+
+$$
+D _ {\mathrm {m s e}} \left(p _ {X}, R\right) \triangleq \inf _ {p _ {\hat {X} | X}} \mathbb {E} \left[ \| X - \hat {X} \| ^ {2} \right] \tag {4}
+$$
+
+$$
+s. t. \quad H (\hat {X}) \leq R.
+$$
+
+Moreover, let
+
+$$
+\bar {D} _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \triangleq D _ {\mathrm {m s e}} \left(p _ {X}, R\right) + D _ {\mathrm {m s e}} \left(p _ {Y}, R\right) + W _ {2} ^ {2} \left(p _ {\hat {X} ^ {*}}, p _ {\hat {Y} ^ {*}}\right), \tag {5}
+$$
+
+$$
+\underline {{D}} _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \triangleq D _ {\mathrm {m s e}} \left(p _ {X}, R\right) + D _ {\mathrm {m s e}} \left(p _ {Y}, R\right), \tag {6}
+$$
+
+where $p_{\hat{X}^*}$ and $p_{\hat{Y}^*}$ are the marginal distributions induced by the minimizers $p_{\hat{X}^*|X}$ and $p_{\hat{Y}^*|Y}$ that attain $D_{\mathrm{mse}}(p_X, R)$ and $D_{\mathrm{mse}}(p_Y, R)$ , respectively (assuming the existence of such minimizers). Then under the squared Euclidean distortion measure,
+
+$$
+D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) = D _ {\mathrm {m s e}} \left(p _ {X}, p _ {Y}, R\right). \tag {7}
+$$
+
+In addition, we have
+
+$$
+\bar {D} _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \geq D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \geq \underline {{D}} _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right), \tag {8}
+$$
+
+and both inequalities are tight when $p_X = p_Y$ .
+
+Theorem 1 deconstructs $Z$ into the quantizations $\hat{X}$ of $X$ and $\hat{Y}$ of $Y$ , and decomposes the overall distortion in (2) in terms of the losses due to quantization, transport, and dequantization in (3). It also suggests a natural architecture that partially decouples compression and transport without loss of optimality. First, the sender uses the distribution $p_{\hat{X} |X}$ to produce the compressed representation $\hat{X}$ from $X$ . This is then passed through a "converter" $p_{\hat{Y} | \hat{X}}$ to transform $\hat{X}$ to an optimal representation $\hat{Y}$ of $Y$ . Finally, the receiver maps $\hat{Y}$ back to $Y$ using the conditional distribution $p_{Y|\hat{Y}}$ . This is illustrated in Figure 1. The entropy constraint $H(\hat{X}) \leq R$ in (2) essentially guarantees that $\hat{X}$ can be losslessly transmitted to the decoder where the converter can be applied to map $\hat{X}$ to $\hat{Y}$ before outputting $Y$ . Alternatively the constraint $H(\hat{Y}) \leq R$ guarantees that the converter could also be implemented at the encoder and then $\hat{Y}$ can be compressed and transmitted to the decoder. Finally note that our proposed architecture is symmetric with respect to the encoder and the decoder and in particular the procedure to transport $Y$ to $X$ would simply be the inverse of transporting $X$ to $Y$ , and indeed the distortion incurred by dequantizing $p_{Y|\hat{Y}}$ is the same as the distortion incurred by quantizing $p_{\hat{Y} |Y}$ .
+
+For the special case of same source and target distribution, we have $D_{\mathrm{mse}}(p_X,p_X,R) = 2D_{\mathrm{mse}}(p_X,R)$ , implying that the rate required to achieve distortion $D$ under no output distribution constraint (and with the output alphabet relaxed to $\mathbb{R}^n$ ) achieves distortion $2D$ under the constraint that $Y$ equals $X$ in distribution. This recovers the result of Theorem 2 in Yan et al. (2021) for the one-shot setting. More generally, (8) shows that we may lower bound $D_{\mathrm{mse}}(p_X,p_Y,R)$ by the distortion incurred when compressing $X$ and $Y$ individually, each at rate $R$ , through ignoring the cost of transport. On the other hand, the upper bound corresponds to choosing the optimal rate-distortion representations $\hat{X}^{*},\hat{Y}^{*}$ for $X,Y$ , then considering transport between them. The advantage of this approach is that knowledge of the other respective distribution is not necessary for design. Although not optimal in general, we will, in fact, provide an example where this is optimal in Section 2.2.
+
+Finally, the following result implies that under mild regularity conditions, the optimal converter $p_{\hat{Y}|\hat{X}}$ can be realized as a (deterministic) bijection, and in the scalar case it can basically only take the form as illustrated in Figure 1.
+
+Theorem 2. Assume that $D_{\mathrm{ncr}}(p_X, p_Y, R)$ is a strictly decreasing function in a neighborhood of $R = R^*$ and $D_{\mathrm{ncr}}(p_X, p_Y, R^*)$ is attained by $p_{X,Z,Y}$ . Let $\hat{X} \triangleq \mathbb{E}[X|Z]$ and $\hat{Y} \triangleq \mathbb{E}[Y|Z]$ . Then
+
+$$
+H (\hat {X}) = H (\hat {Y}) = R ^ {*}, \tag {9}
+$$
+
+$$
+\mathbb {E} \left[ \| \hat {X} - \hat {Y} \| ^ {2} \right] = W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right), \tag {10}
+$$
+
+and there is a bijection between $\hat{X}$ and $\hat{Y}$ .
+
+We remark that in general computing the optimal transport map is not straightforward. For the case of binary sources we can compute an exact characterization for $D_{\mathrm{ncr}}$ as discussed in Section 2.2. Furthermore as discussed in Appendix A.6, $W_2^2 (p_{\hat{X}},p_{\hat{Y}})$ can be computed in closed form when $\hat{X}$ and $\hat{Y}$ are scalar valued, which can be used to obtain upper bounds on $D_{\mathrm{ncr}}$ . In our experimental results in Section 3 we use deep learning based methods to learn approximately optimal mappings.
+
+
+
+
+Figure 2: Architectures. Top left: Definition 2. Bottom left: Theorem 1. Top right: Definition 3. Bottom right: Theorem 3. Entropy coding of intermediate representations $Z, \hat{X}, \hat{Y}$ is not shown. For Theorem 3, the division between sender and receiver is across an encoder $C = f(X,U)$ and decoder $Y = g(C,U)$ performing entropy coding along $p_{Y|X,U}$ .
+
+So far we have focused on the setting when there is no shared common randomness between the encoder and the decoder. We will now consider the setting when a shared random variable denoted by $U$ is present at the encoder and decoder. We assume that the variable $U$ is independent of the input $X$ so that the decoder has no apriori information of the input. In practice the sender and receiver can agree on a pseudo-random number generator ahead of time and some kind of seed could be transmitted, after which both sides can generate the same $U$ . We further discuss how shared randomness is used in practice in the experimental section.
+
+Definition 3 (Optimal Transport with Entropy Bottleneck — with Common Randomness). Let $M_{\mathrm{cr}}(p_X, p_Y)$ denote the set of joint distributions $p_{U,X,Z,Y}$ compatible with the given marginal distributions $p_X$ , $p_Y$ and satisfying $p_{U,X,Z,Y} = p_U p_X p_{Z|X,U} p_{Y|Z,U}$ , where $p_U$ represents the distribution of shared randomness. The optimal transport from $p_X$ to $p_Y$ with entropy bottleneck $R$ and common randomness is defined as
+
+$$
+D _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {U, X, Z, Y} \in M _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}\right)} \mathbb {E} [ d (X, Y) ] \tag {11}
+$$
+
+$$
+\begin{array}{l l} \text {s . t .} & H (Z | U) \leq R. \end{array}
+$$
+
+Note that we optimize over $p_U$ (the distribution associated with shared randomness), in addition to $p_{Z|X,U}$ and $p_{Y|Z,U}$ in (11). Furthermore, $D_{\mathrm{cr}}(p_X,p_Y,R)\leq D_{\mathrm{ncr}}(p_X,p_Y,R)$ in general, as we do not have access to shared randomness in Definition 2. Also from the same argument that was made following Definition 2, we have that $D_{\mathrm{cr}}(p_X,p_Y,R)\geq D(p_X,p_Y)$ in Definition 1. As with Definition 2, we can also provide a natural operational interpretation. In particular, given the input $X$ and common randomness $U$ the encoder can output a compressed representation $Z$ using the conditional distribution $p_{Z|X,U}$ . The representation $Z$ can be losslessly compressed approximately to an average rate of $R$ again by exploiting the shared randomness $U$ . Finally the decoder, given $Z$ and $U$ can output the reconstruction $Y$ using the conditional distribution $p_{Y|Z,U}$ . An interesting difference with Definition 2 is that the setup is no longer symmetric between encoder and decoder, as $X$ is independent of $U$ but $Y$ is not. The following result provides a simplification to the architecture in Definition 3.
+
+Theorem 3. Let $Q_{cr}(p_X, p_Y)$ denote the set of joint distributions $p_{U,X,Y}$ compatible with the given marginals $p_X, p_Y$ satisfying $p_{U,X,Y} = p_U p_X p_{Y|U,X}$ as well as $H(Y|U,X) = 0$ . Then
+
+$$
+D _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}, R\right) = \inf _ {p _ {U, X, Y} \in Q _ {c r} \left(p _ {X}, p _ {Y}\right)} \mathbb {E} [ d (X, Y) ] \tag {12}
+$$
+
+$$
+s. t. \quad H (Y | U) \leq R.
+$$
+
+Before discussing the implications of Theorem 3 we remark on a technical point. Because the Shannon entropy is defined only for discrete random variables, $U$ must be chosen in a way such that $Y|U = u$ is discrete for each $u$ , even for continuous $(X,Y)$ . This is known to be possible, e.g., Li & El Gamal (2018) have provided a general construction for a $U$ with this property, with additional quantitative guarantees to ensure that $U$ is informative of $Y$ . In the finite alphabet case we show in Appendix A.3 that optimization of $U$ can be formulated as a linear program.
+
+We next discuss the implication of Theorem 3. First note that the problem can be modelled with only $p_{Y|U,X}$ producing a reconstruction $Y$ without the need for the intermediate representation $Z$ , much like the conventional optimal transport in Definition 1. The condition $H(Y|U,X) = 0$ also implies that the transport plan is deterministic when conditioned on the shared randomness, which plays the role of stochasticity. Furthermore in this architecture the encoder should compute the representation
+
+
+(a)
+
+
+(b)
+Figure 3: Binary case distortion-rate tradeoffs. (a) $q_{X} = q_{Y} = 0.3$ , where $\overline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ and $\underline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ coincide with $D_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ ; (b) $q_{X} = 0.3,q_{Y} = 0.5$ , where $\overline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ is tight but $\underline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ is loose; (c) $q_{X} = 0.3,q_{Y} = 0.6$ , where both bounds are loose. Moreover, it can be seen from all these examples that common randomness can indeed help improve the distortion-rate tradeoff.
+
+
+(c)
+
+$Y$ given the source $X$ and the shared random-variable $U$ (which corresponds to the transport problem) and then compress it losslessly at a rate close to $H(Y|U)$ (which corresponds to the compression problem). The receiver only needs to decompress and reconstruct $Y$ . This is in contrast to the case without common randomness in Theorem 1 where the $Y$ must be generated at the decoder.
+
+# 2.2 NUMERICAL EXAMPLES
+
+We present how the results in Theorem 1 & 3 can be evaluated for some specific source models. We first consider the example of Binary sources. Let $X \sim \mathcal{B}(q_X)$ and $Y \sim \mathcal{B}(q_Y)$ be two Bernoulli random variables with $q_{X}, q_{Y} \in (0,1)$ , and let $d(\cdot, \cdot)$ be the Hamming distortion measure $d_{H}(\cdot, \cdot)$ (i.e., $d_{H}(x,y) = 0$ if $x = y$ and $d_{H}(x,y) = 1$ otherwise), which coincides with the squared error distortion in Theorem 1 for binary variables. The explicit expressions of $D_{\mathrm{cr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ , $D_{\mathrm{ncr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ as well as $\overline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ and $\underline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ are provided by Theorem 4 in Appendix A.4, from which the following observations can be made. In general, we have $D_{\mathrm{ncr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R) > D_{\mathrm{cr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ , i.e., common randomness strictly improves the distortion-rate tradeoff (except at some extreme point(s)). Moreover, as long as $\mathcal{B}(q_X)$ and $\mathcal{B}(q_Y)$ are biased toward the same symbol (namely, $q_{X}, q_{Y} \leq 1/2$ or $q_{X}, q_{Y} \geq 1/2$ ), the upper bound $\overline{D}_{\mathrm{ncr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ is tight, which implies that blindly using optimal quantizer and dequantizer in the conventional rate-distortion sense incurs no penalty. Some illustrative examples are shown in Figure 3.
+
+In Appendix A.6 we consider the case when $X$ and $Y$ are continuous valued sources from a uniform distribution and establish an upper bound on $D_{\mathrm{ncr}}(\cdot)$ that is shown to be tight as the rate $R \to \infty$ . For Gaussian distributions in the asymptotic optimal transport setting (see Appendix A.7 for relevant definitions and results) we present results qualitatively similar to the binary case in Appendix A.8.
+
+# 3 EXPERIMENTAL RESULTS
+
+We use two sets of results to illustrate that the principles derived from our theoretical results are applicable to practical compression with deep learning. Importantly, we assume an unsupervised setting in which we have only unpaired noisy and clean images available to us, as in Wang et al. (2021b). Our first experiment is, to the best of our knowledge, the first in which restoration and compression are performed jointly using deep learning. We will furthermore demonstrate the utility of common randomness in this setting. The second set of experiments are designed on the principle of Theorem 1. In addition to the generator trained from our first experiment, we will construct a helper network to allow us to estimate the decomposition (3). This is then compared with the direct loss between the noisy image and rate-constrained denoising reconstruction. If the losses are close, this would suggest that the decomposition is not only without loss of optimality but also effective.
+
+# 3.1 RATE-DISTORTION COMPARISON WITH COMMON RANDOMNESS
+
+Let $p_X$ be a degraded source distribution that we wish to restore and $p_Y$ be the target distribution. Our goal is to compress $X$ so that the reconstruction semantically resembles $X$ within target distribution $p_Y$ . For our application, we will use MSE loss as a fidelity criterion. Let $f$ be an encoder, $Q$ a quantizer, and $g$ a decoder. For a given rate $R$ with common randomness $U$ available, we have a
+
+
+(a)
+(b)
+Figure 4: Illustration of our experimental setup. (a) shows the end-to-end learning system with common randomness, where the encoder and decoder have access to the same randomness $u$ . (b) presents the network setup for verifying the architecture principle given in Theorem 1.
+
+problem of the form
+
+$$
+\min _ {f, g, Q} \| X - g (Q (f (X, U))) \| _ {2} ^ {2} \tag {13}
+$$
+
+$$
+\begin{array}{r l} \text {s . t .} & p _ {g (Q (f (X, U)))} = p _ {Y}, H (Q (f (X, U)) | U) \leq R, \end{array}
+$$
+
+which uses parameterized neural networks to implement (11). We also fix $Q$ such that a hard constraint on the rate is satisfied and assume $f$ and $g$ are sufficiently expressive to map to these fixed quantization points. Let $\tilde{Y} \triangleq g(Q(f(X,U)))$ . We will use a penalty on the Wasserstein-1 distance between $p_{\tilde{Y}}$ and $p_{Y}$ in accordance with the Wasserstein GAN (Arjovsky et al., 2017) framework, so that our system is a stochastic rate-constrained autoencoder with GAN regularization. Specifically, we follow the network shown in Figure 4(a) which in addition to $f$ , $Q$ , and $g$ contains critic $h$ .
+
+For the realization of common randomness in Definition 3, we adopt the universal quantization scheme of Ziv (1985); Theis & Agustsson (2021). Given trained $f$ and $g$ and degraded image $X$ , we generate restored image $\tilde{Y}$ through
+
+$$
+\tilde {Y} = g (Q (f (X) + U) - U), \tag {14}
+$$
+
+where $U$ is the stochastic noise shared by the sender and receiver. Details about the quantization are provided in Appendix B.2. To find an appropriate $f$ and $g$ , we use the relaxed objective
+
+$$
+L _ {1} = \mathbb {E} [ \| X - \hat {Y} \| ^ {2} ] + \lambda W _ {1} \left(p _ {Y}, p _ {\hat {Y}}\right), \tag {15}
+$$
+
+which is the sum of the MSE and Wasserstein-1 losses weighted by $\lambda$ . By optimizing our network using this objective, we see two favorable properties. First, the Wasserstein-1 loss ensures the distribution of output is close to that of target images, i.e. $p_{\tilde{Y}} \approx p_{Y}$ for sufficiently large $\lambda$ . Moreover, the MSE loss that pushes the output $\tilde{Y}$ to input $X$ ensures that the output structurally resembles $X$ . Consequently, the training objective allows the output $\tilde{Y}$ to be clear and preserves content from input.
+
+To generate a rate-distortion trade-off curve, we modify the encoder to produce a different number of symbols ranging from low bit rate to high bit rate and record the MSE distortion loss between noisy inputs and denoised outputs. Figure 5(a) and Figure 5(c) show the curves for image super-resolution and image denoising. We also show some qualitative results in Figure 5(b) and 5(d). As the rate increases, the generated high-quality images are clearer.
+
+As exemplified by the numerical results in Section 2.2, common randomness can help reduce the rate that is needed for reconstruction given a specific distortion. Equivalently, given a fixed rate, a system with common randomness can perform better than one without common randomness. To demonstrate this in practice, we conduct the following experiment. We remove the common randomness setup from the framework in Section 3.1 and alternatively add two independent noises $U_{1}$ and $U_{2}$ to the encoder and decoder sides. Concretely, under the new setting, (14) becomes
+
+$$
+\tilde {Y} = g \left(Q \left(f (X) + U _ {1}\right) - U _ {2}\right) \tag {16}
+$$
+
+Then we conduct training using the objective (15) as in the common randomness. The tradeoff curve without common randomness for both tasks are shown in Figure 5(a) and 5(c) with orange dots. Performance of the framework is better when there is common randomness.
+
+
+(a)
+
+
+
+
+(b)
+
+
+
+
+
+
+(c)
+
+
+Figure 5: (a)(b) The experimental results of 4 times image super-resolution. (c)(d) The experimental results of image denoising. The noise pattern is synthesized by additive Gaussian noise with standard deviation set to 20. (a)(c) Rate-distortion trade-offs. Blue points are the MSE distortion loss for a particular rate under the setting of using common randomness, while orange points illustrate the same trade-off without using common randomness. For both tasks, at any rate, the performance of using common randomness is better than the case without common randomness. (b)(d) Examples for outputs from several models with different rates. As the rate increases, the outputs become clearer.
+
+
+(d)
+
+
+
+
+
+# 3.2 ARCHITECTURAL PRINCIPLE
+
+In the case without common randomness, Theorem 1 implies that (under the rate constraint) the overall distortion $\mathbb{E}[\| X - Y\|^2]$ can be decomposed to the summation of the three distortion terms
+
+$$
+\mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right), \tag {17}
+$$
+
+where $\hat{X}$ and $\hat{Y}$ are some representations of $X$ and $Y$ under MSE distortion. The chosen rate-distortion representations $\hat{X}$ for $X$ and $\hat{Y}$ for $Y$ must not only be representative of $X$ and $Y$ , but also enjoy low cost of transport between one another. We now seek to estimate the overhead of this decomposition in practice.
+
+However, due to the nature of the deep learning framework, the distortion measure between images and compressed representations cannot be explicitly measured. Thus, we alternatively develop a two-branch network to compare the summation of the three distortion components (17) to the overall distortion. First, we take trained $f$ and $g$ from the previous experiment and freeze their weights. Given noisy input $X$ , we encode it through $f$ , then decoder $g_{1}$ is trained to minimize the distortion with $X$ , and decoder $g_{2}$ is trained to minimize the distortion with $\tilde{Y} = f(g(X))$ which distributionally approximates a clean restoration (we use $\tilde{Y}$ instead of ground truth because we assume an unsupervised setting). Let
+
+$$
+\tilde {Y} _ {1} = g _ {1} (f (X)), \quad \tilde {Y} _ {2} = g _ {2} (f (X)).
+$$
+
+The idea here is that $\tilde{Y}_1$ is a rate-constrained reconstruction of $X$ and $\tilde{Y}_2$ is a rate-constrained reconstruction of $\tilde{Y}$ , both of which are produced from compressing $X$ using $f$ . We assume this is reasonable as in light of Theorem 2, there is no loss of optimality in doing so given sufficiently expressive neural networks. The overall decomposed loss is then given by
+
+$$
+L _ {2} = \underbrace {\mathbb {E} [ \| X - \tilde {Y} _ {1} \| ^ {2} ]} _ {\text {(a)}} + \underbrace {\mathbb {E} [ \| \tilde {Y} - \tilde {Y} _ {2} \| ^ {2} ]} _ {\text {(b)}} + \underbrace {\mathbb {E} [ \| \tilde {Y} _ {1} - \tilde {Y} _ {2} \| ^ {2} ]} _ {\text {(c)}}, \tag {18}
+$$
+
+Table 1: Results of architecture principle in Theorem 1. The end-to-end loss and decomposed loss are very close for different rates.
+
+ | Super-resolution | Denoising |
| Rate | 4 | 10 | 20 | 30 | 12 | 30 | 60 | 90 |
| End-to-end Loss | 0.0558 | 0.0435 | 0.0351 | 0.0308 | 0.0230 | 0.0175 | 0.0140 | 0.0123 |
| Decomposed Loss | 0.0586 | 0.0453 | 0.0349 | 0.0309 | 0.0243 | 0.0192 | 0.0158 | 0.0139 |
+
+in which $\tilde{Y}_1$ approximates $\hat{X}$ and $\tilde{Y}_2$ approximates $\hat{Y}$ . Training is performed jointly over $g_1$ and $g_2$ .
+
+One additional point is that $g_{1}$ and $g_{2}$ can also be trained separately, although in this case we can no longer assume that $f$ can be reused without loss of optimality, as this objective would not be equivalent to minimizing (18) (there is no control over (c)). We develop an additional experiment in which we optimize encoder-decoder pairs $f_{1}, g_{1}$ to minimize (a) and $f_{2}, g_{2}$ to minimize (b), where now $\tilde{Y}_{1}$ is produced using $f_{1}, g_{1}$ and $\tilde{Y}_{2}$ using $f_{2}, g_{2}$ . In this setting, we aim to approximate the rate-distortion optimal $\tilde{X}^{*}$ and $\tilde{Y}^{*}$ corresponding to $\overline{D}_{\mathrm{ncr}}(p_X, p_Y, \cdot)$ from Theorem 1 using $\tilde{Y}_{1}$ and $\tilde{Y}_{2}$ , and in doing this separate optimization it is clear that we will drive down (a) and (b) but increase (c). As it turns out, the resultant values (a) and (b) obtained during joint optimization are not much worse than the values from separate optimization. This provides evidence that in practice, the optimal rate-distortion representations (i.e. under objective (4)) can be leveraged for the general objective (18) without much loss of optimality, which further suggests that the encoder $f_{1}$ can be potentially trained without knowledge of $p_Y$ without much performance loss. These can be viewed in Table 2.
+
+Table 2: Comparison of separate vs. joint training for (18). See the above paragraph for explanation.
+Super-resolution
+
+| Rate | 4 | 10 | 20 | 30 |
| Method | Joint | Separate | Joint | Separate | Joint | Separate | Joint | Separate |
| E[||X - Y1||2] | 0.0355 | 0.0356 | 0.0223 | 0.0214 | 0.0136 | 0.0113 | 0.0092 | 0.0083 |
| E[||Y - Y2||2] | 0.0227 | 0.0216 | 0.0222 | 0.0206 | 0.0191 | 0.0191 | 0.0172 | 0.0155 |
+
+Denoising
+
+| Rate | 12 | 30 | 60 | 90 |
| Method | Joint | Separate | Joint | Separate | Joint | Separate | Joint | Separate |
| E[||X-Y1||2] | 0.0191 | 0.0190 | 0.0146 | 0.0145 | 0.0117 | 0.0123 | 0.0104 | 0.0107 |
| E[||Y-Y2||2] | 0.0050 | 0.0046 | 0.0044 | 0.0040 | 0.0038 | 0.0035 | 0.0032 | 0.0030 |
+
+# 4 RELATED WORKS
+
+Sinkhorn distances (Cuturi, 2013) are a formulation of optimal transport with a penalty term corresponding to the mutual information between the source and target distributions. This has been studied in information theory literature (e.g. (Bai et al., 2020; Wang et al., 2021a)). For source coding in particular, Saldi et al. (2015a;b) consider common randomness with constrained output distribution. Blau & Michaeli (2018) evaluated a number of deep image restoration techniques and somewhat counter-intuitively demonstrated a tradeoff between optimizing for distortion and "perceptual quality", i.e. realism. Wang et al. (2021b) model the shift in distribution due to degradation as an optimal transport problem. However this work does not consider compression and their results are qualitatively different from ours. Meanwhile, output-constrained lossy compression has also been shown to improve perceptual quality (Tschannen et al., 2018), leading to the rate-distortion-perception framework (Blau & Michaeli, 2019). An analysis of the one-shot distortion-rate function was studied recently by (Elkayam & Feder, 2020). Our problem formulation is different as we assume the output distribution is fixed.
+
+# 5 CONCLUSION AND FUTURE WORK
+
+We consider the setting of lossy compression in which we compress across different source and target distributions. We formulate this as an entropy-constrained optimal transport problem and provide expressions for characterizing the tradeoff between compression rate and the minimum achievable distortion with and without shared common randomness. We also develop a number of architectural principles through our theoretical results and provide experimental validations by training deep learning models for super-resolution and denoising tasks over compressed representations. On the theory side it will be interesting to consider the case where there are either rate constraints on the amount of shared common randomness between the encoder and decoder or consider the case when the shared randomness is correlated with the source input, which can arise in many practical applications. On the practical side it will be interesting to experimentally study the a broader set of tasks under distribution shift where our theory could be applicable.
+
+# REFERENCES
+
+Eirikur Agustsson, Fabian Mentzer, Michael Tschannen, Lukas Cavigelli, Radu Timofte, Luca Benini, and Luc Van Gool. Soft-to-hard vector quantization for end-to-end learning compressible representations. pp. 1142-1152, 2017.
+Eirikur Agustsson, Michael Tschannen, Fabian Mentzer, Radu Timofte, and Luc Van Gool. Generative adversarial networks for extreme learned image compression. In Proceedings of the IEEE International Conference on Computer Vision, pp. 221-231, 2019.
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pp. 214-223, 2017.
+Yikun Bai, Xiugang Wu, and Ayfer Özgür. Information constrained optimal transport: From talagrand, to marton, to cover. In 2020 IEEE International Symposium on Information Theory (ISIT), pp. 2210-2215. IEEE, 2020.
+Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6228-6237, 2018.
+Yochai Blau and Tomer Michaeli. Rethinking lossy compression: The rate-distortion-perception tradeoff. In International Conference on Machine Learning, pp. 675-685, 2019.
+Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26:2292-2300, 2013.
+Abbas El Gamal and Young-Han Kim. Network information theory. Cambridge university press, 2011.
+Nir Elkayam and Meir Feder. One shot approach to lossy source coding under average distortion constraints. In 2020 IEEE International Symposium on Information Theory (ISIT), pp. 2389-2393. IEEE, 2020.
+Robert M Gray and Thomas G Stockham. Dithered quantizers. IEEE Transactions on Information Theory, 39(3):805-812, 1993.
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pp. 5767-5777, 2017.
+Andras Gyorgy and Tamás Linder. Optimal entropy-constrained scalar quantization of a uniform source. IEEE Transactions on Information Theory, 46(7):2704-2711, 2000.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Cheuk Ting Li and Abbas El Gamal. Strong functional representation lemma and applications to coding theorems. IEEE Transactions on Information Theory, 64(11):6967-6978, 2018.
+Ryutaroh Matsumoto. Introducing the perception-distortion tradeoff into the rate-distortion theory of general information sources. IEICE Communications Express, 7(11):427-431, 2018.
+Ryutaroh Matsumoto. Rate-distortion-perception tradeoff of variable-length source coding for general information sources. IEICE Communications Express, 8(2):38-42, 2019.
+Sachit Menon, Alexandru Damian, Shijia Hu, Nikhil Ravi, and Cynthia Rudin. Pulse: Self-supervised photo upsampling via latent space exploration of generative models. In Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, pp. 2437-2445, 2020.
+Fabian Mentzer, Eirikur Agustsson, Michael Tschannen, Radu Timofte, and Luc Van Gool. Conditional probability models for deep image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4394-4402, 2018.
+
+Fabian Mentzer, George D Toderici, Michael Tschannen, and Eirikur Agustsson. High-fidelity generative image compression. In Advances in Neural Information Processing Systems, volume 33, 2020.
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
+Xingang Pan, Xiaohang Zhan, Bo Dai, Dahua Lin, Chen Change Loy, and Ping Luo. Exploiting deep generative prior for versatile image restoration and manipulation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021.
+Gabriel Peyre and Marco Cuturi. Computational optimal transport. Foundations and Trends in Machine Learning, 11(5-6), 2019.
+Oren Rippel and Lubomir Bourdev. Real-time adaptive image compression. In International Conference on Machine Learning, pp. 2922-2930, 2017.
+Naci Saldi, Tamás Linder, and Serdar Yüksel. Randomized quantization and source coding with constrained output distribution. IEEE Transactions on Information Theory, 61(1):91-106, 2015a.
+Naci Saldi, Tamás Linder, and Serdar Yüksel. Output constrained lossy source coding with limited common randomness. IEEE Transactions on Information Theory, 61(9):4984-4998, 2015b.
+Shibani Santurkar, David Budden, and Nir Shavit. Generative compression. In 2018 Picture Coding Symposium (PCS), pp. 258-262. IEEE, 2018.
+Lucas Theis and Eirikur Agustsson. On the advantages of stochastic encoders. arXiv preprint arXiv:2102.09270, 2021.
+Lucas Theis and Aaron B Wagner. A coding theorem for the rate-distortion-perception function. arXiv preprint arXiv:2104.13662, 2021.
+Michael Tschannen, Eirikur Agustsson, and Mario Lucic. Deep generative models for distribution-preserving lossy compression. In Advances in Neural Information Processing Systems, pp. 5929-5940, 2018.
+Cédric Villani. Optimal transport: old and new, volume 338. Springer, 2009.
+Shuchan Wang, Photios A Stavrou, and Mikael Skoglund. Generalized talagrand inequality for sinkhorn distance using entropy power inequality. arXiv preprint arXiv:2109.08430, 2021a.
+Wei Wang, Fei Wen, Zeyu Yan, Rendong Ying, and Peilin Liu. Optimal transport for unsupervised restoration learning. arXiv preprint arXiv:2108.02574, 2021b.
+Zeyu Yan, Fei Wen, Rendong Ying, Chao Ma, and Peilin Liu. On perceptual lossy compression: The cost of perceptual reconstruction and an optimal training framework. In International Conference on Machine Learning, 2021.
+George Zhang, Jingjing Qian, Jun Chen, and Ashish Khisti. Universal rate-distortion-perception representations for lossy compression. arXiv preprint arXiv:2106.10311, 2021.
+Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3929-3938, 2017.
+Jacob Ziv. On universal quantization. IEEE Transactions on Information Theory, 31(3):344-347, 1985.
+
+# A THEORETICAL RESULTS
+
+# A.1 DISTORTION-RATE VS RATE-DISTORTION FORMULATION
+
+In addition to Definitions 2 and 3, we can equivalently define
+
+$$
+\begin{array}{l} R _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, D\right) \triangleq \inf _ {p _ {X}, Z, Y \in M _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}\right)} H (Z) \tag {19} \\ \begin{array}{l} \text {s . t .} \quad \mathbb {E} [ d (X, Y) ] \leq D, \end{array} \\ \end{array}
+$$
+
+$$
+R _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}, D\right) \triangleq \inf _ {p _ {U, X, Z, Y} \in M _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}\right)} H (Z | U) \tag {20}
+$$
+
+$$
+\begin{array}{l} \text {s . t .} \quad \mathbb {E} [ d (X, Y) ] \leq D. \end{array}
+$$
+
+$D_{\mathrm{ncr / cr}}(p_X,p_Y,R)$ and $R_{\mathrm{ncr / cr}}(p_X,p_Y,D)$ are monotonically decreasing in $R$ and $D$ , respectively, so they are the inverse of each other. Sometimes it is more convenient to work with this rate-distortion formulation.
+
+# A.2 PROOFS OF THEORETICAL RESULTS
+
+Proof of Theorem 1. For any $p_{X,Z,Y} \in M_{\mathrm{ncr}}(p_X, p_Y)$ with $H(Z) \leq R$ ,
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \mathbb {E} [ X | Z ] \| ^ {2} ] + \mathbb {E} [ \| Y - \mathbb {E} [ Y | Z ] \| ^ {2} ] + \mathbb {E} [ \| \mathbb {E} [ X | Z ] - \mathbb {E} [ Y | Z ] \| ^ {2} ] \\ \geq D _ {\mathrm {m s e}} \left(p _ {X}, p _ {Y}, R\right), \\ \end{array}
+$$
+
+where the last inequality follows from the definition of $D_{\mathrm{mse}}(p_X,p_Y,R)$ and the fact that
+
+$$
+\max \{H (\mathbb {E} [ X | Z ]), H (\mathbb {E} [ Y | Z ] \} \leq H (Z) \leq R.
+$$
+
+As a consequence, we must have $D_{\mathrm{ncr}}(p_X,p_Y,R) \geq D_{\mathrm{mse}}(p_X,p_Y,R)$ . On the other hand, for any $p_{\hat{X} |X}, p_{\hat{Y} |Y}$ with $\mathbb{E}[X|\hat{X}] = \hat{X}$ , $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ , $H(\hat{X}) \leq R$ , and $H(\hat{Y}) \leq R$ , we can construct a joint distribution $p_{X,\hat{X},\hat{Y},Y}$ such that $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain, $p_{X,\hat{X}} = p_{X}p_{\hat{X} |X}$ , $p_{Y,\hat{Y}} = p_{Y}p_{\hat{Y} |Y}$ , and $p_{\hat{X},\hat{Y}}$ satisfying $\mathbb{E}[\| \hat{X} - \hat{Y} \|^2] = W_2^2(p_{\hat{X}},p_{\hat{Y}})$ . Note that
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \\ = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right). \tag {21} \\ \end{array}
+$$
+
+Let $Z \triangleq \hat{X}$ . It can be verified that $p_{X,Z,Y} \in M_{\mathrm{ncr}}(p_X,p_Y)$ and $H(Z) = H(\hat{X}) \leq R$ , which, together with (21), implies $D_{\mathrm{ncr}}(p_X,p_Y,R) \leq D_{\mathrm{mse}}(p_X,p_Y,R)$ . This completes the proof of (7).
+
+Dropping the term $W_2^2(p_{\hat{X}}, p_{\hat{Y}})$ in (3) yields
+
+$$
+D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \geq \tilde {D} _ {\mathrm {m s e}} \left(p _ {X}, R\right) + \tilde {D} _ {\mathrm {m s e}} \left(p _ {Y}, R\right),
+$$
+
+where
+
+$$
+\tilde {D} _ {\mathrm {m s e}} \left(p _ {X}, R\right) \triangleq \inf _ {p _ {\hat {X} | X}} \mathbb {E} \left[ \| X - \hat {X} \| ^ {2} \right]
+$$
+
+$$
+\begin{array}{l l} \text {s . t .} & \mathbb {E} [ X | \hat {X} ] = \hat {X}, \quad H (\hat {X}) \leq R. \end{array}
+$$
+
+and $\tilde{D}_{\mathrm{mse}}(p_Y,R)$ is definitely analogously. On the other hand, choosing $p_{\hat{X} |X} = p_{\hat{X}'|X}$ and $p_{\hat{Y} |Y} = p_{\hat{Y}'|Y}$ in (3) gives
+
+$$
+D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) \leq \tilde {D} _ {\mathrm {m s e}} \left(p _ {X}, R\right) + \tilde {D} _ {\mathrm {m s e}} \left(p _ {Y}, R\right) + W _ {2} ^ {2} \left(p _ {\hat {X} ^ {\prime}}, p _ {\hat {Y} ^ {\prime}}\right),
+$$
+
+where $p_{\hat{X}^{\prime}|X}$ and $p_{\hat{Y}^{\prime}|Y}$ are the minimizers that attain $\tilde{D}_{\mathrm{mse}}(p_X,R)$ and $\tilde{D}_{\mathrm{mse}}(p_Y,R)$ respectively while $p_{\hat{X}^{\prime}}$ and $p_{\hat{Y}^{\prime}}$ are their induced marginal distributions. It is clear that $p_{\hat{X}^{\prime}|X}$ and $p_{\hat{Y}^{\prime}|Y}$ coincide
+
+with $p_{\hat{X}^*|X}$ and $p_{\hat{Y}^*|Y}$ respectively as the constraints $\mathbb{E}[X|\hat{X}] = \hat{X}$ and $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ are automatically satisfied by $p_{\hat{X}^*|X}$ and $p_{\hat{Y}^*|Y}$ . This proves (8). For the special case $p_X = p_Y$ , we have $p_{\hat{X}^*|X} = p_{\hat{Y}^*|Y}$ and consequently the upper bound and the lower bound in (8) coincide.
+
+Note that due to the involvement of conditional expectation, $\hat{X}$ is not necessarily defined over $\mathcal{X}$ if $\mathcal{X}$ is a strict subset of $\mathbb{R}^n$ (for the same reason, $\hat{Y}$ is not necessarily defined over $\mathcal{V}$ ). In other words, the output of the quantizer is not constrained to the input alphabet and needs to be relaxed to $\mathbb{R}^n$ . As such, $D_{\mathrm{mse}}(p_X,R)$ should be interpreted as the one-shot distortion-rate function with the reconstruction alphabet being $\mathbb{R}^n$ , which is in general strictly below its counterpart with the reconstruction alphabet being $\mathcal{X}$ (also known as the distortion-rate-perception function with an inactive perception constraint) if $\mathcal{X}$ is a strictly subset of $\mathbb{R}^n$ . This subtle issue, which is often overlooked in the literature, arises when one deals with discrete $X$ and $Y$ (see the binary example in Section 2.2 and Appendix A.4).
+
+Proof of Theorem 2. We have that $\max \{H(\hat{X}), H(\hat{Y})\} \leq R^*$ . If one of them, say $H(Y)$ , is less than $R^*$ , this will lead to a contradiction by the following argument. Note that
+
+$$
+D ^ {*} = \mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ],
+$$
+
+which depends on $p_{X,\hat{X},\hat{Y},Y}$ only through $p_{X,\hat{X}}$ , $p_{\hat{X},\hat{Y}}$ , and $p_{Y,\hat{Y}}$ . We can construct a new joint distribution $p_{X,\hat{X}^{\prime},\hat{Y}^{\prime},Y}$ such that $p_{X,\hat{X}^{\prime}} = p_{X,\hat{X}}$ , $p_{\hat{X}^{\prime},\hat{Y}^{\prime}} = p_{\hat{X},\hat{Y}}$ , $p_{Y,\hat{Y}^{\prime}} = p_{Y,\hat{Y}}$ , and $X \leftrightarrow \hat{X}^{\prime} \leftrightarrow \hat{Y}^{\prime} \leftrightarrow Y$ form a Markov chain. Denote $\hat{X}^{\prime}$ by $Z^{\prime}$ . It is clear that the induced $p_{X,Z^{\prime},Y}$ belongs to $M_{\mathrm{ncr}}(p_X,p_Y)$ , preserves $\mathbb{E}[\| X - Y\|^2]$ , and $H(Z^{\prime}) < R^{*}$ , which is contradictory with the fact that $D_{\mathrm{ncr}}(p_X,p_{\hat{X}},R)$ is a strictly decreasing function in a neighborhood of $R = R^{*}$ since $R$ can be set slightly below $R^{*}$ without violating the constraint $H(Z^{\prime}) \leq R$ . This proves (9), which further implies the existence of a bijection between $\hat{X}$ and $\hat{Y}$ .
+
+It remains to prove (10). If (10) does not hold, then we can find some $p_{\hat{X}^{\prime \prime},\hat{Y}^{\prime \prime}}$ with $p_{\hat{X}^{\prime \prime}} = p_{\hat{X}}$ and $p_{\hat{Y}^{\prime \prime}} = p_{\hat{Y}}$ such that $\mathbb{E}[\| \hat{X}^{\prime \prime} - \hat{Y}^{\prime \prime}\| ^2 ] < \mathbb{E}[\| \hat{X} -\hat{Y}\| ^2 ]$ . Leverage this $p_{\hat{X}^{\prime \prime},\hat{Y}^{\prime \prime}}$ to construct a new joint distribution $p_{X,\hat{X}^{\prime \prime},\hat{Y}^{\prime \prime},Y}$ such that $p_{X,\hat{X}^{\prime \prime}} = p_{X,\hat{X}},p_{Y,\hat{Y}^{\prime \prime}} = p_{Y,\hat{Y}}$ , and $X\leftrightarrow \hat{X}^{\prime \prime}\leftrightarrow \hat{Y}^{\prime \prime}\leftrightarrow Y$ form a Markov chain. Denote $\hat{X}''$ by $Z''$ . It is clear that the induced $p_{X,Z^{\prime \prime},Y}$ belongs to $M_{\mathrm{ncr}}(p_X,p_Y)$ $H(Z^{\prime \prime}) = R^{*}$ , and
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \hat {X} ^ {\prime \prime} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} ^ {\prime \prime} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} ^ {\prime \prime} - \hat {Y} ^ {\prime \prime} \| ^ {2} ] \\ < \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \\ = D ^ {*}, \\ \end{array}
+$$
+
+which is contradictory with the fact that $R_{\mathrm{ncr}}(p_X, p_Y, D)$ is a strictly decreasing function in a neighborhood of $D = D^* \triangleq D_{\mathrm{ncr}}(p_X, p_{\hat{X}}, R^*)$ since $D$ can be set slightly below $D^*$ without violating the constraint $\mathbb{E}[\| X - Y\|^2] \leq D$ . So in conclusion, the converter is a one-to-one mapping, which induces an optimal coupling that attains $W_2^2(p_{\hat{X}}, p_{\hat{Y}})$ .
+
+Proof of Theorem 3. Choosing $p_{U,X,Y}$ from $W_2^2(p_X, p_Y)$ and setting $Z = Y$ shows that
+
+$$
+\begin{array}{l} D _ {\operatorname {c r}} \left(p _ {X}, p _ {Y}, R\right) \leq \inf _ {p _ {U, X, Y} \in W \left(p _ {X}, p _ {Y}\right)} \mathbb {E} [ d (X, Y) ] \\ \begin{array}{l l} \text {s . t .} & H (Y | U) \leq R. \end{array} \\ \end{array}
+$$
+
+So it remains to prove that this upper bound is tight. In the light of the functional representation lemma, for any $(U,X,Z,Y)$ with $p_{U,X,Z,Y}\in M_{\mathrm{cr}}(p_X,p_Y)$ , there exist $V_{1}$ , independent of $(U,X)$ , and $V_{2}$ , independent of $(U,X,V_{1})$ , as well as deterministic mappings $\phi_1$ and $\phi_2$ such that $Z = \phi_2(U,X,V_1)$ and $Y = \phi_2(Z,V_2)$ . Let $U^{\prime}\triangleq (U,V_{1},V_{2})$ . Clearly, $p_{U^{\prime},X,Y} = p_{U^{\prime}}p_{X}p_{Y|U^{\prime},X}$ and $H(Y|U^{\prime},X) = 0$ . Moreover, we have
+
+$$
+\begin{array}{l} H (Z | U) \geq H (Z | U ^ {\prime}) \\ \geq H (Y | U ^ {\prime}), \\ \end{array}
+$$
+
+where the last inequality is due to the fact that $Y$ is determined by $(Z, U')$ . Therefore,
+
+$$
+D_{\operatorname {cr}}(p_{X},p_{Y},R)\geq \inf_{p_{U^{\prime},X,Y}\in W(p_{X},p_{Y})}\mathbb{E}[d(X,Y)]
+$$
+
+$$
+\begin{array}{l l} \text {s . t .} & H (Y | U ^ {\prime}) \leq R. \end{array}
+$$
+
+This completes the proof of (12).
+
+Note that each realization of $U$ is associated with a deterministic function from $\mathcal{X}$ to $\mathcal{Y}$ . As a consequence, the problem boils down to optimizing the probability distribution defined over this collection of functions. For the finite alphabet case, there are totally $|\mathcal{Y}|^{|\mathcal{X}|}$ such functions. In fact, a simple application of the support lemma shows that only $|\mathcal{Y}| + 1$ functions need to be assigned with a positive probability.
+
+# A.3 LINEAR PROGRAM FORMULATION FOR COMMON RANDOMNESS
+
+In the finite alphabet case, we can formulate Theorem 3 as follows:
+
+$$
+D _ {\mathrm {c r}} \left(p _ {X}, p _ {Y}, R\right) = \min _ {p _ {U}} \sum_ {u \in \mathcal {U}} p _ {U} (u) \mathbb {E} \left[ d \left(X, f _ {u} (X)\right) \right]
+$$
+
+$$
+\begin{array}{l} \text {s . t .} \sum_ {u \in \mathcal {U}} p _ {U} (u) H \left(f _ {u} (X)\right) \leq R, \end{array}
+$$
+
+$$
+\sum_ {u \in \mathcal {U}} p _ {U} (u) \mathbb {P} \left(f _ {u} (X) = y\right) = p _ {Y} (y), \quad y \in \mathcal {Y},
+$$
+
+where $p_U$ is defined over $\mathcal{U} \triangleq \{1, 2, \dots, |\mathcal{Y}|^{|\mathcal{X}|}\}$ , and $\{f_u : u \in \mathcal{U}\}$ is the set of all distinct functions from $\mathcal{X}$ to $\mathcal{Y}$ . By the support lemma (Appendix C on page 631 of El Gamal & Kim (2011)), only $|\mathcal{Y}| + 1$ functions need to be assigned with a positive probability.
+
+# A.4 BINARY CASE
+
+Let $D_{\mathrm{min}}^{(B)} \triangleq |q_X - q_Y|$ and $D_{\mathrm{max}}^{(B)} \triangleq q_X + q_Y - 2q_Xq_Y$ . Note that $D_{\mathrm{min}}^{(B)}$ is the total variation distance between $\mathcal{B}(q_X)$ and $\mathcal{B}(q_Y)$ , which is the minimum $\mathbb{E}[d_H(X,Y)]$ achievable by coupling $X$ and $Y$ . On the other hand, we have $\mathbb{E}[d_H(X,Y)] = D_{\mathrm{max}}^{(B)}$ for $X, Y$ independent. It is clear that $D_{\mathrm{min}}^{(B)}$ and $D_{\mathrm{max}}^{(B)}$ are the infimum and supremum of $D_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ (as well as $D_{\mathrm{cr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ ), respectively.
+
+Theorem 4. Assume Hamming distortion measure. Under no common randomness, we have
+
+$$
+D _ {\mathrm {n c r}} \left(\mathcal {B} \left(q _ {X}\right), \mathcal {B} \left(q _ {Y}\right), R\right) = \left\{ \begin{array}{l l} - \frac {2 \left(1 - q _ {X}\right) \left(1 - q _ {Y}\right)}{1 - H _ {b} ^ {- 1} (R)} + 2 - q _ {X} - q _ {Y}, & q _ {X} + q _ {Y} \leq 1, \\ - \frac {2 q _ {X} q _ {Y}}{1 - H _ {b} ^ {- 1} (R)} + q _ {X} + q _ {Y}, & q _ {X} + q _ {Y} > 1, \end{array} \right. \tag {22}
+$$
+
+for $R\in [0,\min \{H_b(q_X),H_b(q_Y)\} ]$ , and $= D_{\mathrm{min}}^{(B)}$ for $R > \min \{H_b(q_X),H_b(q_Y)\}$ . Moreover,
+
+$$
+\begin{array}{l} \overline {{D}} _ {\mathrm {n c r}} \left(\mathcal {B} \left(q _ {X}\right), \mathcal {B} \left(q _ {Y}\right), R\right) \\ = \left\{ \begin{array}{l l} - \frac {2 (1 - q _ {X}) (1 - q _ {Y})}{1 - H _ {b} ^ {- 1} (R)} + 2 - q _ {X} - q _ {Y}, & q _ {X}, q _ {Y} \leq \frac {1}{2}, \\ - \frac {2 q _ {X} q _ {Y}}{1 - H _ {b} ^ {- 1} (R)} + q _ {X} + q _ {Y}, & q _ {X}, q _ {Y} \geq \frac {1}{2}, \\ - \frac {(1 - q _ {X}) ^ {2} + q _ {Y} ^ {2} - (q _ {Y} - q _ {X} + H _ {b} ^ {- 1} (R)) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + H _ {b} ^ {- 1} (R) - \frac {2 q _ {Y} (1 - q _ {X}) H _ {b} ^ {- 1} (R)}{(1 - H _ {b} ^ {- 1} (R)) ^ {2}}, & q _ {X} < \frac {1}{2}, q _ {Y} > \frac {1}{2}, \\ - \frac {q _ {X} ^ {2} + (1 - q _ {Y}) ^ {2} - (q _ {X} - q _ {Y} + H _ {b} ^ {- 1} (R)) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + H _ {b} ^ {- 1} (R) - \frac {2 q _ {X} (1 - q _ {Y}) H _ {b} ^ {- 1} (R)}{(1 - H _ {b} ^ {- 1} (R)) ^ {2}}, & q _ {X} > \frac {1}{2}, q _ {Y} < \frac {1}{2}, \end{array} \right. \tag {23} \\ \end{array}
+$$
+
+for $R\in [0,\min \{H_b(q_X),H_b(q_Y)\} ]$ , and
+
+$$
+\underline {{D}} _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R) = \left\{ \begin{array}{l l} - \frac {(1 - q _ {X}) ^ {2} + (1 - q _ {Y}) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + 2 - q _ {X} - q _ {Y}, & q _ {X}, q _ {Y} \leq \frac {1}{2}, \\ - \frac {q _ {X} ^ {2} + q _ {Y} ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + q _ {X} + q _ {Y}, & q _ {X}, q _ {Y} \geq \frac {1}{2}, \\ - \frac {(1 - q _ {X}) ^ {2} + q _ {Y} ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + 1 - q _ {X} + q _ {Y}, & q _ {X} < \frac {1}{2}, q _ {Y} > \frac {1}{2}, \\ - \frac {q _ {X} ^ {2} + (1 - q _ {Y}) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + 1 + q _ {X} - q _ {Y}, & q _ {X} > \frac {1}{2}, q _ {Y} < \frac {1}{2}, \end{array} \right. \tag {24}
+$$
+
+for $R \in [0, \min\{H_b(q_X), H_b(q_Y)\}]$ . Here, $H_b^{-1}(R)$ denotes the inverse of the binary entropy function on $[0, 1/2]$ . With common randomness,
+
+$$
+D _ {\mathrm {c r}} \left(\mathcal {B} \left(q _ {X}\right), \mathcal {B} \left(q _ {Y}\right), R\right) = - \frac {2 \left(1 - q _ {X}\right) q _ {X} R}{H _ {b} \left(q _ {X}\right)} + D _ {\max } ^ {(B)} \tag {25}
+$$
+
+for $R\in [0,\rho H_b(q_X)]$ , and $= D_{\mathrm{min}}^{(B)}$ for $R > \rho H_{b}(q_{X})$ . Here, $\rho \triangleq \min \{q_Y / q_X,(1 - q_Y) / (1 - q_X)\}$
+
+Proof of (25). There are totally 4 distinct functions from $\{0,1\}$ to $\{0,1\}$ :
+
+$$
+f _ {1} (x) = x, \quad f _ {2} (x) = 1 - x, \quad f _ {3} (x) = 0, \quad f _ {4} (x) = 1, \quad x \in \{0, 1 \}.
+$$
+
+Therefore, we have
+
+$$
+\sum_ {u \in \mathcal {U}} p _ {U} (u) H (f _ {u} (X)) = H _ {b} (q _ {X}) (p _ {U} (1) + p _ {U} (2)),
+$$
+
+$$
+\sum_ {u \in \mathcal {U}} p _ {U} (u) \mathbb {E} \left[ d _ {H} \left(X, f _ {u} (X)\right) \right] = p _ {U} (2) + q _ {X} p _ {U} (3) + \left(1 - q _ {X}\right) p _ {U} (4),
+$$
+
+$$
+\sum_ {u \in \mathcal {U}} p _ {U} (u) \mathbb {P} \left(f _ {u} (X) = 1\right) = p _ {U} (1) q _ {X} + (1 - q _ {X}) p _ {U} (2) + p _ {U} (4).
+$$
+
+In light of Theorem 3,
+
+$$
+R _ {\mathrm {c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), D) = \min _ {p _ {U} (1), \dots , p _ {U} (4)} H _ {b} (q _ {X}) (p _ {U} (1) + p _ {U} (2))
+$$
+
+$$
+\text {s . t .} \quad p _ {U} (2) + q _ {X} p _ {U} (3) + (1 - q _ {X}) p _ {U} (4) \leq D, \tag {26}
+$$
+
+$$
+q _ {X} p _ {U} (1) + (1 - q _ {X}) p _ {U} (2) + p _ {U} (4) = q _ {Y}, \tag {27}
+$$
+
+$$
+p _ {U} (1) + p _ {U} (2) + p _ {U} (3) + p _ {U} (4) = 1, \tag {28}
+$$
+
+$$
+p _ {U} (1), p _ {U} (2), p _ {U} (3), p _ {U} (4) \geq 0. \tag {29}
+$$
+
+Note that
+
+$$
+p _ {U} (2) + q _ {X} p _ {U} (3) + (1 - q _ {X}) p _ {U} (4)
+$$
+
+$$
+= p _ {U} (2) + q _ {X} p _ {U} (3) + \left(1 - q _ {X}\right) \left(1 - p _ {U} (1) - p _ {U} (2) - p _ {U} (3)\right) \tag {30}
+$$
+
+$$
+= - \left(1 - q _ {X}\right) p _ {U} (1) + q _ {X} p _ {U} (2) + \left(2 q _ {X} - 1\right) p _ {U} (3) + 1 - q _ {X}, \tag {31}
+$$
+
+where (30) is due to (28). Moreover, it follows by (27) and (28) that
+
+$$
+p _ {U} (3) = - \left(1 - q _ {X}\right) p _ {U} (1) - q _ {X} p _ {U} (2) + 1 - q _ {Y}. \tag {32}
+$$
+
+Substituting (32) into (31) and invoking the fact that $p_U(2) \geq 0$ gives
+
+$$
+\begin{array}{l} p _ {U} (2) + q _ {X} p _ {U} (3) + (1 - q _ {X}) p _ {U} (4) \\ = - 2 (1 - q _ {X}) q _ {X} \left(p _ {U} (1) + p _ {U} (2)\right) + 4 (1 - q _ {X}) q _ {X} p _ {U} (2) + D _ {\max } ^ {(B)} \\ \geq - 2 \left(1 - q _ {X}\right) q _ {X} \left(p _ {U} (1) + p _ {U} (2)\right) + D _ {\max } ^ {(B)}, \\ \end{array}
+$$
+
+which, together with (26), implies
+
+$$
+p _ {U} (1) + p _ {U} (2) \geq \frac {1}{2 (1 - q _ {X}) q _ {X}} (D _ {\max} ^ {(B)} - D).
+$$
+
+As a consequence, we must have
+
+$$
+R _ {\mathrm {c r}} \left(\mathcal {B} \left(q _ {X}\right), \mathcal {B} \left(q _ {Y}\right), D\right) \geq \frac {H _ {b} \left(q _ {X}\right)}{2 \left(1 - q _ {X}\right) q _ {X}} \left(D _ {\max } ^ {(B)} - D\right).
+$$
+
+One can readily verify that this lower bound is tight as it is attained by $p_U^*$ with
+
+$$
+p _ {U} ^ {*} (1) = \frac {1}{2 (1 - q _ {X}) q _ {X}} (D _ {\max} ^ {(B)} - D),
+$$
+
+$$
+p _ {U} ^ {*} (2) = 0,
+$$
+
+$$
+p _ {U} ^ {*} (3) = - \frac {1}{2 q _ {X}} (D _ {\max} ^ {(B)} - D) + 1 - q _ {Y},
+$$
+
+$$
+p _ {U} ^ {*} (4) = - \frac {1}{2 (1 - q _ {X})} (D _ {\mathrm {m a x}} ^ {(B)} - D) + q _ {Y},
+$$
+
+which satisfies (26)-(29) for $D \in [D_{\min}^{(B)}, D_{\max}^{(B)}]$ . The expression of $D_{\mathrm{cr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), R)$ can be obtained by taking the inverse of $R_{\mathrm{cr}}(\mathcal{B}(q_X), \mathcal{B}(q_Y), D)$ .
+
+Proof of (22). We will rely on some results which will come after this proof.
+
+Note that Hamming distortion coincides with squared error distortion when $\mathcal{X} = \mathcal{Y} = \{0,1\}$ . So Theorem 1, Lemma 1, and Lemma 2 are applicable here. In particular, in light of Lemmas 1 and 2, for any $R \geq 0$ and $\epsilon > 0$ , there exists a joint distribution $p_{X \hat{X} \hat{Y} Y}$ compatible with the given marginal distributions $p_X$ and $p_Y$ such that $\hat{X}$ and $\hat{Y}$ are deterministically related finite-support random variables with $H(\hat{X}) = H(\hat{Y}) \leq R$ and $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain; moreover, $\hat{X} = \mathbb{E}[X|\hat{X}], \hat{Y} = \mathbb{E}[Y|\hat{Y}]$ , and
+
+$$
+\mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \leq D _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R) + \epsilon . \tag {33}
+$$
+
+Without loss of generality, we assume $\hat{X}$ and $\hat{Y}$ take value from $\{\hat{x}_i\}_{i=1}^N$ and $\{\hat{y}_i\}_{i=1}^N$ , respectively, and $\hat{Y} = \psi(\hat{X})$ , where $\psi$ is a bijection from $\{\hat{x}_i\}_{i=1}^N$ to $\{\hat{y}_i\}_{i=1}^N$ with $\hat{y}_i = \psi(\hat{x}_i)$ , $i = 1, \dots, N$ . Let $\theta_i \triangleq p_{\hat{X}}(\hat{x}_i)$ , or equivalently, $\theta_i \triangleq p_{\hat{Y}}(\hat{y}_i)$ , $i = 1, \dots, N$ . Note that $\hat{X} = \mathbb{E}[X|\hat{X}]$ and $\hat{Y} = \mathbb{E}[Y|\hat{Y}]$ if and only if $p_{X|\hat{X}}(1|\hat{x}_i) = \hat{x}_i$ and $p_{Y|\hat{Y}}(1|\hat{y}_i) = \hat{y}_i$ for $\theta_i > 0$ , $i = 1, \dots, N$ . So the constraints $\sum_{i=1}^{N} p_{\hat{X}}(\hat{x}_i)p_{X|\hat{X}}(1|\hat{x}_i) = q_X$ and $\sum_{i=1}^{N} p_{\hat{Y}}(\hat{y}_i)p_{Y|\hat{Y}}(1|\hat{y}_i) = q_Y$ can be written equivalently as $\sum_{i=1}^{N} \theta_i \hat{x}_i = q_X$ and $\sum_{i=1}^{N} \theta_i \hat{y}_i = q_Y$ . Moreover, it is easy to verify that
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \\ = \sum_ {i = 1} ^ {N} \theta_ {i} (1 - \hat {x} _ {i}) \hat {x} _ {i} + \sum_ {i = 1} ^ {N} \theta_ {i} (1 - \hat {y} _ {i}) \hat {y} _ {i} + \sum_ {i = 1} ^ {n} \theta_ {i} (\hat {x} _ {i} - \hat {y} _ {i}) ^ {2} \\ = \sum_ {i = 1} ^ {N} \theta_ {i} \left(\hat {x} _ {i} + \hat {y} _ {i} - 2 \hat {x} _ {i} \hat {y} _ {i}\right). \\ \end{array}
+$$
+
+In light of Theorem 1 and (33), the following optimization problem (P) yields an upper bound on $D_{\mathrm{ncr}}(p_X, p_Y, R)$ with a gap at most $\epsilon$ :
+
+$$
+\min _ {\left(\theta_ {i}, \hat {x} _ {i}, \hat {y} _ {i},\right) _ {i = 1} ^ {N}} \sum_ {i = 1} ^ {N} \theta_ {i} \left(\hat {x} _ {i} + \hat {y} _ {i} - 2 \hat {x} _ {i} \hat {y} _ {i}\right) \quad (\mathrm {P})
+$$
+
+$$
+\text {s . t .} \quad \sum_ {i = 1} ^ {N} \theta_ {i} \log \frac {1}{\theta_ {i}} \leq R, \quad \sum_ {i = 1} ^ {N} \theta_ {i} = 1, \quad \sum_ {i = 1} ^ {N} \theta_ {i} \hat {x} _ {i} = q _ {X}, \quad \sum_ {i = 1} ^ {N} \theta_ {i} \hat {y} _ {i} = q _ {Y},
+$$
+
+$$
+\theta_ {i} \geq 0, \quad \hat {x} _ {i} \in [ 0, 1 ], \quad \hat {y} _ {i} \in [ 0, 1 ], \quad i = 1, \dots , N.
+$$
+
+Given $(\theta_i,\hat{y}_i)_i^N$ , (P) degenerates to a linear programming problem with respect $(\hat{x}_i)_{i = 1}^N$ over hyper- rectangle $[0,1]^N$ subject to the constraint $\sum_{i = 1}^{N}\theta_{i}\hat{x}_{i} = q_{X}$ , for which the minimum is attained at
+
+a point on an edge of $[0,1]^N$ . Therefore, it suffices to consider $(\hat{x}_i)_{i=1}^N$ with at most one element different from 0 and 1. By a similar argument, it can be shown that there is no loss of optimality in assuming that at most one of $\hat{y}_i$ , $i = 1,\dots ,N$ , takes value other than 0 or 1. Due to the merge of different elements, the one-to-one relationship might not be preserved. Nevertheless, by Lemma 2, we just need to consider deterministically related $\hat{X}$ and $\hat{Y}$ with support size at most 3. Applying the linear programming argument to (P) with $N = 3$ shows that, at the cost of potentially compromising the one-to-one relationship, at most one element in the support of $\hat{X}$ as well as the support of $\hat{Y}$ need to take value different from 0 and 1. In the case that the bijection is lost, $\hat{X}$ or $\hat{Y}$ must have a reduced support size. One can restore the bijection by invoking Lemma 2, then use the linear programming argument to assign extreme values to all but at most one element in the support. Following this line of reasoning, we can conclude that the attention can be restricted to deterministically related $\hat{X}$ and $\hat{Y}$ with support size at most 3 and at most one element in the support different from 0 and 1. Moreover, the following configurations can be excluded.
+
+1. Support size $= 3$ and the existence of pairs $(\hat{x},\hat{y})$ and $(\hat{x}^{\prime},\hat{y}^{\prime})$ for some $\hat{x} >\hat{x}^{\prime}$ and $\hat{y} < \hat{y}^{\prime}$ $((\hat{x},\hat{y})$ is said to be a pair if $\hat{X} = \hat{x}\Leftrightarrow \hat{Y} = \hat{y})$ : Since
+
+$$
+\begin{array}{l} (\hat {x} - \hat {y}) ^ {2} + (\hat {x} ^ {\prime} - \hat {y} ^ {\prime}) ^ {2} - (\hat {x} - \hat {y} ^ {\prime}) ^ {2} - (\hat {x} ^ {\prime} - \hat {y}) ^ {2} \\ = - 2 \hat {x} \hat {y} - 2 \hat {x} ^ {\prime} \hat {y} ^ {\prime} + 2 \hat {x} \hat {y} ^ {\prime} + 2 \hat {x} ^ {\prime} \hat {y} \\ = 2 (\hat {x} - \hat {x} ^ {\prime}) (\hat {y} ^ {\prime} - \hat {y}) \\ > 0, \\ \end{array}
+$$
+
+it follows that $\mathbb{E}[\| \hat{X} -\hat{Y}\| ^2 ]$ can be strictly reduced by moving the same amount of probability from $\{\hat{X} = \hat{x},\hat{Y} = \hat{y}\}$ to $\{\hat{X} = \hat{x},\hat{Y} = \hat{y} '\}$ and from $\{\hat{X} = \hat{x}^{\prime},\hat{Y} = \hat{y}^{\prime}\}$ to $\{\hat{X} = \hat{x}^{\prime},\hat{Y} = \hat{y}\}$ . This modification does not affect $p_{\hat{X}}$ and $p_{\hat{Y}}$ , and consequently $H(\hat{X}),H(\hat{Y})$ , $\mathbb{E}[\| X - \hat{X}\| ^2 ],\mathbb{E}[\| Y - \hat{Y}\| ^2 ]$ remain the same. So the distortion-rate performance of this configuration is strictly suboptimal.
+
+2. Support size $= 2$ and the existence of pairs $(\hat{x},\hat{y})$ and $(\hat{x}^{\prime},\hat{y}^{\prime})$ for some $\hat{x} >\hat{x}^{\prime}$ and $\hat{y} < \hat{y}^{\prime}$ Same as configuration 1).
+3. Support size $= 2$ and existence of pairs $(\hat{x},1)$ and $(0,\hat{y})$ for some $\hat{x}\in (0,1)$ and $\hat{y}\in (0,1)$ : It follows by $\mathbb{E}[X|\hat{X}] = \hat{X}$ and $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ that
+
+$$
+\begin{array}{l} p _ {\hat {X}, \hat {Y}} (\hat {x}, 1) = \frac {q _ {X}}{\hat {x}}, \\ p _ {\hat {X}, \hat {Y}} (0, \hat {y}) = 1 - \frac {q x}{\hat {x}}, \\ \hat {y} = 1 - \frac {1 - q _ {Y}}{1 - \frac {q _ {X}}{\hat {x}}}. \\ \end{array}
+$$
+
+Clearly, $H(\hat{X}) = H(\hat{Y}) = H_{b}(\frac{q_{X}}{\hat{x}})$ . Since $\hat{x} \in (0,1)$ and $\hat{y} \in (0,1)$ , we must have $q_{X} < \frac{q_{X}}{\hat{x}} < q_{Y}$ , which implies $H(\hat{X}) = H(\hat{Y}) > \min \{H(X), H(Y)\}$ . Furthermore, it can be verified that
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| X - \hat {X} \| ^ {2} \right] + \mathbb {E} \left[ \| Y - \hat {Y} \| ^ {2} \right] + \mathbb {E} \left[ \| \hat {X} - \hat {Y} \| ^ {2} \right] \\ = \frac {q _ {X}}{\hat {x}} \hat {x} (1 - \hat {x}) + \left(1 - \frac {q _ {X}}{\hat {x}}\right) \hat {y} (1 - \hat {y}) + \frac {q _ {X}}{\hat {x}} (1 - \hat {x}) ^ {2} + \left(1 - \frac {q _ {X}}{\hat {x}}\right) \hat {y} ^ {2} \\ = q _ {Y} - q _ {X}. \\ \end{array}
+$$
+
+However, this end-to-end distortion is obviously achievable when $R = \min \{H(X), H(Y)\}$ . So the rate-distortion performance of this configuration is strictly suboptimal.
+
+4. Support size $= 2$ and the existence of pairs $(\hat{x},0)$ and $(1,\hat{y})$ for some $\hat{x} \in (0,1)$ and $\hat{y} \in (0,1)$ : Same as configuration 3).
+
+In view of the excluded configurations, we are left with the case where $p_{\hat{X}\hat{Y}}$ assigns all probabilities to $\{\hat{X} = 0,\hat{Y} = 0\}$ , $\{\hat{X} = 1,\hat{Y} = 1\}$ , and $\{\hat{X} = \hat{x},\hat{Y} = \hat{y}\}$ for some $\hat{x}\in [0,1]$ and $\hat{y}\in [0,1]$ . So it suffices to consider the $N = 3$ version of (P) with $\hat{x}_1 = \hat{y}_1 = 0$ , $\hat{x}_3 = \hat{y}_3 = 1$ , $\hat{x}_2 = \hat{x}$ , and $\hat{y}_2 = \hat{y}$ . The constraints $\sum_{i = 1}^{3}\theta_{i} = 1$ , $\sum_{i = 1}^{3}\theta_{i}\hat{x}_{i} = q_{X}$ , and $\sum_{i = 1}^{3}\theta_{i}\hat{y}_{i} = q_{Y}$ imply
+
+$$
+\theta_ {1} = 1 - q _ {X} - (1 - \hat {x}) \theta ,
+$$
+
+$$
+\theta_ {3} = q _ {X} - \hat {x} \theta ,
+$$
+
+$$
+\hat {y} = \frac {q _ {Y} - q _ {X}}{\theta} + \hat {x}.
+$$
+
+In this way, we get a simplified optimization problem $(\mathbf{P}^{\prime})$
+
+$$
+\min _ {\theta , \hat {x}} 2 \hat {x} (1 - \hat {x}) \theta + (1 - 2 \hat {x}) \left(q _ {Y} - q _ {X}\right) \quad (\mathbf {P} ^ {\prime})
+$$
+
+s.t. $(1 - q_{X} - (1 - \hat{x})\theta)\log \frac{1}{1 - q_{X} - (1 - \hat{x})\theta} +\theta \log \frac{1}{\theta} +(q_{X} - \hat{x}\theta)\log \frac{1}{q_{X} - \hat{x}\theta}\leq R,$
+
+$$
+\hat {x} \in [ 0, 1 ], \quad \theta \in [ 0, 1 ], \quad (1 - \hat {x}) \theta \in \left[ q _ {Y} - q _ {X}, 1 - q _ {X} \right], \quad \hat {x} \theta \in \left[ q _ {X} - q _ {Y}, q _ {X} \right].
+$$
+
+Note that $(\mathbf{P}^{\prime})$ does not depend on $\epsilon$ and consequently yields the exact characterization of $D_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),R)$ . Therefore, $R_{\mathrm{ncr}}(\mathcal{B}(q_X),\mathcal{B}(q_Y),D)$ is characterized by the following optimization problem $(\mathbf{P}^{\prime \prime})$ :
+
+$$
+\min _ {\theta , \hat {x}} (1 - q _ {X} - (1 - \hat {x}) \theta) \log \frac {1}{1 - q _ {X} - (1 - \hat {x}) \theta} + \theta \log \frac {1}{\theta} + (q _ {X} - \hat {x} \theta) \log \frac {1}{q _ {X} - \hat {x} \theta} \quad (\mathrm {P} ^ {\prime \prime})
+$$
+
+s.t. $2\hat{x} (1 - \hat{x})\theta +(1 - 2\hat{x})(q_{Y} - q_{X})\leq D,$
+
+$$
+\hat {x} \in [ 0, 1 ], \quad \theta \in [ 0, 1 ], \quad (1 - \hat {x}) \theta \in [ q _ {Y} - q _ {X}, 1 - q _ {X} ], \quad \hat {x} \theta \in [ q _ {X} - q _ {Y}, q _ {X} ].
+$$
+
+Given $\hat{x}$ , the objective function of (P") is concave in $\theta$ and consequently its minimum is attained at an endpoint of $[\underline{\theta},\overline{\theta}]$ , where
+
+$$
+\underline {{\theta}} \triangleq \max \left\{0, \frac {q _ {Y} - q _ {X}}{1 - \hat {x}}, \frac {q _ {X} - q _ {Y}}{\hat {x}} \right\},
+$$
+
+$$
+\bar {\theta} \triangleq \min \left\{1, \frac {1 - q _ {X}}{1 - \hat {x}}, \frac {q _ {X}}{\hat {x}}, \frac {D - (1 - 2 \hat {x}) (q _ {Y} - q _ {X})}{2 \hat {x} (1 - \hat {x})} \right\}.
+$$
+
+Without loss of generality, we assume $q_{Y^{\prime}} \geq q_{X}$ and $q_{X} + q_{Y^{\prime}} \leq 1$ . The following statements can be easily verified.
+
+1. For $\hat{x}\in [0,\frac{D + q_X - q_Y}{2(1 - q_Y)} ],$
+
+$$
+\underline {{\theta}} = \frac {q _ {Y} - q _ {X}}{1 - \hat {x}},
+$$
+
+$$
+\overline {{\theta}} = \frac {1 - q _ {X}}{1 - \hat {x}}.
+$$
+
+2. For $\hat{x}\in \left(\frac{D + q_X - q_Y}{2(1 - q_Y)},\frac{q_X + q_Y - D}{2q_Y}\right],$
+
+$$
+\underline {{\theta}} = \frac {q _ {Y} - q _ {X}}{1 - \hat {x}},
+$$
+
+$$
+\overline {{\theta}} = \frac {D - (1 - 2 \hat {x}) (q _ {Y} - q _ {X})}{2 \hat {x} (1 - \hat {x})}.
+$$
+
+3. For $\hat{x} \in \left(\frac{q_X + q_Y - D}{2q_Y}, \frac{q_X}{q_Y}\right]$ ,
+
+$$
+\underline {{\theta}} = \frac {q _ {Y} - q _ {X}}{1 - \hat {x}},
+$$
+
+$$
+\overline {{\theta}} = \frac {q _ {X}}{\hat {x}}.
+$$
+
+4. For $\hat{x} >\frac{q_X}{q_Y}$ $[\underline{\theta},\overline{\theta} ]$ is empty.
+
+Note that when $\hat{x} \in [0, \frac{q_X}{q_Y}]$ and $\theta = \underline{\theta}$ ,
+
+$$
+\begin{array}{l} (1 - q _ {X} - (1 - \hat {x}) \theta) \log {\frac {1}{1 - q _ {X} - (1 - \hat {x}) \theta}} + \theta \log {\frac {1}{\theta}} + (q _ {X} - \hat {x} \theta) \log {\frac {1}{q _ {X} - \hat {x} \theta}} \\ = (1 - q _ {Y}) \log \frac {1}{1 - q _ {Y}} + \underline {{\theta}} \log \frac {1}{\underline {{\theta}}} + (q _ {X} - \hat {x} \underline {{\theta}}) \log \frac {1}{q _ {X} - \hat {x} \underline {{\theta}}} \\ \geq H _ {b} \left(q _ {Y}\right) \\ = H (Y). \\ \end{array}
+$$
+
+So it suffices to consider the case $\hat{x} \in [0, \frac{q_X}{q_Y}]$ and $\theta = \overline{\theta}$ , for which (P") is reduced to the following form:
+
+$$
+\min_{\hat{x}\in [0,\frac{q_{X}}{q_{Y}} ]}\eta (\hat{x}),
+$$
+
+where
+
+$$
+\eta (\hat {x}) \triangleq \left\{ \begin{array}{l l} \frac {1 - q _ {X}}{1 - \hat {x}} \log \frac {1 - \hat {x}}{1 - q _ {X}} + \frac {q _ {X} - \hat {x}}{1 - \hat {x}} \log \frac {1 - \hat {x}}{q _ {X} - \hat {x}}, & \hat {x} \in [ 0, \frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})} ], \\ \frac {2 \hat {x} - q _ {X} + (1 - 2 \hat {x}) q _ {Y} - D}{2 \hat {x}} \log \frac {2 \hat {x}}{2 \hat {x} - q _ {X} + (1 - 2 \hat {x}) q _ {Y} - D} \\ + \frac {D - (1 - 2 \hat {x}) (q _ {Y} - q _ {X})}{2 \hat {x} (1 - \hat {x})} \log \frac {2 \hat {x} (1 - \hat {x})}{D - (1 - 2 \hat {x}) (q _ {Y} - q _ {X})} \\ + \frac {q _ {X} + (1 - 2 \hat {x}) q _ {Y} - D}{2 (1 - \hat {x})} \log \frac {2 (1 - \hat {x})}{q _ {X} + (1 - 2 \hat {x}) q _ {Y} - D}, & \hat {x} \in (\frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})}, \frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}} ], \\ \frac {\hat {x} - q _ {X}}{\hat {x}} \log \frac {\hat {x}}{\hat {x} - q _ {X}} + \frac {q _ {X}}{\hat {x}} \log \frac {\hat {x}}{q _ {X}}, & \hat {x} \in (\frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}}, \frac {q _ {X}}{q _ {Y}} ]. \end{array} \right.
+$$
+
+Note that $\eta(\hat{x})$ is a continuous function over $[0, \frac{q_X}{q_Y}]$ . Moreover, $\eta(\hat{x})$ decreases monotonically from $H_b(q_X)$ to $H_b\left(\frac{D_{\max}^{(B)} - D}{2 - q_X - q_Y - D}\right)$ as $\hat{x}$ varies from 0 to $\frac{D + q_X - q_Y}{2(1 - q_Y)}$ . Since $\eta(\hat{x})$ is a concave function of $\frac{q_X}{\hat{x}}$ for $\hat{x} \in \left[\frac{q_X + q_Y - D}{2q_Y}, \frac{q_X}{q_Y}\right]$ , it follows that
+
+$$
+\min _ {\hat {x} \in [ \frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}}, \frac {q _ {X}}{q _ {Y}} ]} \eta (\hat {x}) = \min \left\{\eta (\frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}}), \eta (\frac {q _ {X}}{q _ {Y}}) \right\} = \min \left\{H _ {b} (\frac {2 q _ {X} q _ {Y}}{q _ {X} + q _ {Y} - D}), H _ {b} (q _ {Y}) \right\}.
+$$
+
+So we have
+
+$$
+\begin{array}{l} \min _ {\hat {x} \in [ 0, \frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})} ] \cup \left[ \frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}}, \frac {q _ {X}}{q _ {Y}} \right]} \eta (\hat {x}) \\ = \min \left\{H _ {b} \left(\frac {D _ {\operatorname* {m a x}} ^ {(B)} - D}{2 - q _ {X} - q _ {Y} - D}\right), H _ {b} \left(\frac {2 q _ {X} q _ {Y}}{q _ {X} + q _ {Y} - D}\right), H _ {b} (q _ {Y}) \right\} \\ = \min \left\{H _ {b} \left(\frac {D _ {\max } ^ {(B)} - D}{2 - q _ {X} - q _ {Y} - D}\right), H _ {b} \left(\frac {2 q _ {X} q _ {Y}}{q _ {X} + q _ {Y} - D}\right) \right\} \tag {34} \\ = \min \left\{\eta \left(\frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})}\right), \eta \left(\frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}}\right) \right\} \\ \geq \min _ {\hat {x} \in [ \frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})}, \frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}} ]} \eta (\hat {x}), \\ \end{array}
+$$
+
+where (34) is due to the fact that $H_{b}(q_{Y}) \geq H_{b}(q_{X}) \geq H_{b}\left(\frac{D_{\max}^{(B)} - D}{2 - q_{X} - q_{Y} - D}\right)$ (with the first inequality being a consequence of $q_{X} \leq q_{Y}$ and $q_{X} + q_{Y} \leq 1$ ). So the problem boils down to solving
+
+$$
+\min _ {\hat {x} \in [ \frac {D + q _ {X} - q _ {Y}}{2 (1 - q _ {Y})}, \frac {q _ {X} + q _ {Y} - D}{2 q _ {Y}} ]} \eta (\hat {x}).
+$$
+
+It can be verified that the minimum is attained at $\hat{x} = \frac{D + q_X - q_Y}{2(1 - q_Y)}$ . This completes the proof of (22). A graphical illustration of the entropy-constrained optimal transport plan for the binary case can be found in Figure 6.
+
+Proof of (23). Note that
+
+$$
+\begin{array}{l} D _ {\mathrm {m s e}} (\mathcal {B} (q _ {X}), R) = \frac {1}{2} D _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {X}), R) \\ = \left\{ \begin{array}{l l} - \frac {(1 - q _ {X}) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + 1 - q _ {X}, & q _ {X} \leq \frac {1}{2}, \\ - \frac {q _ {X} ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + q _ {X}, & q _ {X} > \frac {1}{2}, \end{array} \right. R \in [ 0, H _ {b} (q _ {X}) ], \\ \end{array}
+$$
+
+$$
+\begin{array}{l} D _ {\mathrm {m s e}} (\mathcal {B} (q _ {Y}), R) = \frac {1}{2} D _ {\mathrm {n c r}} (\mathcal {B} (q _ {Y}), \mathcal {B} (q _ {Y}), R) \\ = \left\{ \begin{array}{l l} - \frac {(1 - q _ {Y}) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + 1 - q _ {Y}, & q _ {Y} \leq \frac {1}{2}, \\ - \frac {q _ {Y} ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + q _ {Y}, & q _ {Y} > \frac {1}{2}, \end{array} \right. R \in [ 0, H _ {b} (q _ {Y}) ]. \\ \end{array}
+$$
+
+Moreover, we have
+
+$$
+\left\{ \begin{array}{l} p _ {\hat {X} ^ {*}} (\frac {q _ {X} - H _ {b} ^ {- 1} (R)}{1 - H _ {b} ^ {- 1} (R)}) = 1 - H _ {b} ^ {- 1} (R), \\ p _ {\hat {X} ^ {*}} (1) = H _ {b} ^ {- 1} (R), \end{array} \right. R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} \leq \frac {1}{2},
+$$
+
+$$
+\left\{ \begin{array}{l} p _ {\hat {X} ^ {*}} (0) = H _ {b} ^ {- 1} (R), \\ p _ {\hat {X} ^ {*}} (\frac {q _ {X}}{1 - H _ {b} ^ {- 1} (R)}) = 1 - H _ {b} ^ {- 1} (R), \end{array} \right. R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} \geq \frac {1}{2},
+$$
+
+$$
+\left\{ \begin{array}{l} p _ {\hat {Y} *} (\frac {q _ {Y} - H _ {b} ^ {- 1} (R)}{1 - H _ {b} ^ {- 1} (R)}) = 1 - H _ {b} ^ {- 1} (R), \\ p _ {\hat {Y} *} (1) = H _ {b} ^ {- 1} (R), \end{array} \right. R \in [ 0, H _ {b} (q _ {Y}) ], q _ {Y} \leq \frac {1}{2},
+$$
+
+$$
+\left\{ \begin{array}{l} p _ {\hat {Y} ^ {*}} (0) = H _ {b} ^ {- 1} (R), \\ p _ {\hat {Y} ^ {*}} (\frac {q _ {Y}}{1 - H _ {b} ^ {- 1} (R)}) = 1 - H _ {b} ^ {- 1} (R), \end{array} \right. R \in [ 0, H _ {b} (q _ {Y}) ], q _ {Y} \geq \frac {1}{2}.
+$$
+
+So
+
+$$
+\begin{array}{l} W _ {2} ^ {2} (p _ {\hat {X} ^ {*}}, p _ {\hat {Y} ^ {*}}) \\ = \left\{ \begin{array}{l l} \frac {(q _ {X} - q _ {Y}) ^ {2}}{1 - H _ {b} ^ {- 1} (R)}, & q _ {X}, q _ {Y} \leq \frac {1}{2} \text {o r} q _ {X}, q _ {Y} \geq \frac {1}{2}, \\ \frac {(q _ {Y} - q _ {X} + H _ {b} ^ {- 1} (R)) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + H _ {b} ^ {- 1} (R) - \frac {2 q _ {Y} (1 - q _ {X}) H _ {b} ^ {- 1} (R)}{(1 - H _ {b} ^ {- 1} (R)) ^ {2}}, & q _ {X} < \frac {1}{2}, q _ {Y} > \frac {1}{2}, \\ \frac {(q _ {X} - q _ {Y} + H _ {b} ^ {- 1} (R)) ^ {2}}{1 - H _ {b} ^ {- 1} (R)} + H _ {b} ^ {- 1} (R) - \frac {2 q _ {X} (1 - q _ {Y}) H _ {b} ^ {- 1} (R)}{(1 - H _ {b} ^ {- 1} (R)) ^ {2}}, & q _ {X} > \frac {1}{2}, q _ {Y} < \frac {1}{2}. \end{array} \right. \\ \end{array}
+$$
+
+Based on the above expressions, one can easily verify (23) and (24). In particular, it is worth noting that when $q_{X}, q_{Y} \leq \frac{1}{2}$ or $q_{X}, q_{Y} \geq \frac{1}{2}$ ,
+
+$$
+\overline {{D}} _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R) = D _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R), \quad R \in [ 0, \min \{H _ {b} (q _ {X}), H _ {b} (q _ {Y}) \} ],
+$$
+
+i.e., there is no penalty for using optimal quantizer and dequantizer in the conventional rate-distortion sense.
+
+Remark: It is easy to verify that
+
+$$
+\begin{array}{l} D _ {\mathrm {c r}} (\mathcal {B} (q _ {X}), R) \triangleq \min _ {q _ {Y} \in [ 0, 1 ]} D _ {\mathrm {c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R) \\ = \left\{ \begin{array}{l l} q _ {X} \left(1 - \frac {R}{H _ {b} (q _ {X})}\right), & R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} \leq \frac {1}{2}, \\ (1 - q _ {X}) \left(1 - \frac {R}{H _ {b} (q _ {X})}\right), & R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} > \frac {1}{2}, \end{array} \right. \\ \end{array}
+$$
+
+$$
+\begin{array}{l} D _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), R) \triangleq \min _ {q _ {Y} \in [ 0, 1 ]} D _ {\mathrm {n c r}} (\mathcal {B} (q _ {X}), \mathcal {B} (q _ {Y}), R) \\ = \left\{ \begin{array}{l l} q _ {X} - H _ {b} ^ {- 1} (R), & R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} \leq \frac {1}{2}, \\ 1 - q _ {X} - H _ {b} ^ {- 1} (R), & R \in [ 0, H _ {b} (q _ {X}) ], q _ {X} > \frac {1}{2}, \end{array} \right. \\ \end{array}
+$$
+
+which are respectively the conventional one-shot distortion-distortion function (or equivalently, one-shot distortion-rate-perception function with an inactive perception constraint) for $\mathcal{B}(q_X)$ with and without common randomness. In general, $D_{\mathrm{ncr}}(\mathcal{B}(q_X),R)$ is different from $D_{\mathrm{mse}}(\mathcal{B}(q_X),R)$ (the former is strictly above the latter). The reason is as follows: even though the output distribution constraint is removed in the definition of $D_{\mathrm{ncr}}(\mathcal{B}(q_X),R)$ , the output alphabet remains to be $\{0,1\}$ ; in contrast, for $D_{\mathrm{mse}}(\mathcal{B}(q_X),R)$ , the output alphabet is relaxed to $\mathbb{R}$ .
+
+# A.5 AUXILIARY RESULTS
+
+Lemma 1 (Finite Support Approximation). For any $R \geq 0$ and $\epsilon > 0$ , there exists a joint distribution $p_{X,\hat{X},\hat{Y},Y}$ compatible with the given marginal distributions $p_X$ and $p_Y$ such that $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain and $\hat{X}$ is a finite-support random variable with $H(\hat{X}) \leq R$ (or $\hat{Y}$ is a finite-support random variable with $H(\hat{Y}) \leq R$ ); moreover, $\mathbb{E}[X|\hat{X}] = \hat{X}$ , $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ , and
+
+$$
+\mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \leq D _ {\mathrm {n c r}} (p _ {X}, p _ {Y}, R) + \epsilon .
+$$
+
+Proof. In light of Theorem 1, we can find $p_{X,\hat{X},\hat{Y},Y}$ such that $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain, $H(\hat{X}) \leq R$ , $\mathbb{E}[X|\hat{X}] = \hat{X}$ , $\mathbb{E}[Y|\hat{Y}]$ , and
+
+$$
+\mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \leq D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) + \frac {\epsilon}{2}. \tag {35}
+$$
+
+The proof is complete if $\hat{X}$ is a finite-support random variable. So it suffices to consider the case where $\hat{X}$ takes value from some countably infinite set $\{\hat{x}_i\}_{i=1}^{\infty}$ . Since $\mathbb{E}[\|X\|^2] < \infty$ and $\mathbb{E}[\|Y\|^2] < \infty$ , it follows that there exists a positive integer $N$ such that
+
+$$
+\mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X \| ^ {2} + \| Y \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \leq \frac {\epsilon}{4}.
+$$
+
+Let $\hat{X}^{\prime}\triangleq \hat{X}$ if $\hat{X}\in \{\hat{x}_i\}_{i = 1}^{N - 1}$ and $\hat{X}^{\prime}\triangleq \mathbb{E}[X|\hat{X}\in \{\hat{x}_i\}_{i = N}^{\infty}]$ if $\hat{X}\in \{\hat{x}_i\}_{i = N}^{\infty}$ . Note that
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} ^ {\prime} - \hat {Y} \| ^ {2} ] \\ = \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} \} \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} + \| \hat {X} ^ {\prime} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} ] \\ + \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} + \| \hat {X} ^ {\prime} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \\ = \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} \} \mathbb {E} [ \| X - \hat {X} \| ^ {2} + \| \hat {X} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} ] \\ + \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} + \| \hat {X} ^ {\prime} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \\ \leq \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} \} \mathbb {E} [ \| X - \hat {X} \| ^ {2} + \| \hat {X} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} ] \\ + \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} + 2 \| \hat {X} ^ {\prime} \| ^ {2} + 2 \| \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \\ \leq \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} \} \mathbb {E} [ \| X - \hat {X} \| ^ {2} + \| \hat {X} - \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = 1} ^ {N - 1} ] \\ + \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X \| ^ {2} + \| \hat {X} ^ {\prime} \| ^ {2} + 2 \| \hat {Y} \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \\ \leq \mathbb {E} [ \| X - \hat {X} \| ^ {2} + \| \hat {X} - \hat {Y} \| ^ {2} ] + 2 \mathbb {P} \{\hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} \} \mathbb {E} [ \| X \| ^ {2} + \| Y \| ^ {2} | \hat {X} \in \{\hat {x} _ {i} \} _ {i = N} ^ {\infty} ] \\ \leq \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] + \frac {\epsilon}{2}. \tag {36} \\ \end{array}
+$$
+
+Now define a new joint distribution $p_{X,\hat{X}^{\prime \prime},\hat{Y}^{\prime \prime},Y}$ such that $p_{X,\hat{X}^{\prime \prime}} = p_{X,\hat{X}^{\prime}},p_{\hat{X}^{\prime \prime},\hat{Y}^{\prime \prime}} = p_{\hat{X}^{\prime},\hat{Y}},$ $p_{Y,\hat{Y}^{\prime \prime}} = p_{Y,\hat{Y}}$ , and $X\leftrightarrow \hat{X}^{\prime \prime}\leftrightarrow \hat{Y}^{\prime \prime}\leftrightarrow Y$ form a Markov chain. It is clear that $\hat{X}''$ is a finite-support random variable with $H(\hat{X}^{\prime \prime}) = H(\hat{X}^{\prime})\leq H(\hat{X})\leq R,\mathbb{E}[X|\hat{X}^{\prime \prime}] = \hat{X}^{\prime \prime},\mathbb{E}[Y|\hat{Y}^{\prime \prime}] = \hat{Y}^{\prime \prime},$ and
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - \hat {X} ^ {\prime \prime} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} ^ {\prime \prime} \| ] + \mathbb {E} [ \| \hat {X} ^ {\prime \prime} - \hat {Y} ^ {\prime \prime} \| ^ {2} ] \\ \leq \mathbb {E} [ \| X - \hat {X} ^ {\prime} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ] + \mathbb {E} [ \| \hat {X} ^ {\prime} - \hat {Y} \| ^ {2} ] \\ \leq \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] + \frac {\epsilon}{2} (37) \\ \leq D _ {\mathrm {n c r}} \left(p _ {X}, p _ {Y}, R\right) + \epsilon , (38) \\ \end{array}
+$$
+
+where (37) and (38) are due to (35) and (36), respectively. This completes the proof of Lemma 1.
+
+Lemma 2 (Deterministic on Finite Support). Let $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ be a Markov chain with $\mathbb{E}[X|\hat{X}] = \hat{X}, \mathbb{E}[Y|\hat{Y}] = \hat{Y}$ , and assume that $\hat{X}$ (or $\hat{Y}$ ) is a finite-support random variable. There exist deterministically related random variables $\hat{X}'$ and $\hat{Y}'$ , with the support size no greater than that of
+
+
+Figure 6: Illustration of the entropy-constrained optimal transport plan for the binary case (assuming $q_{X} + q_{Y} \leq 1$ ), where $p_{\hat{X}}(\hat{x}) = p_{\hat{Y}}(\hat{y}) = 1 - H_b^{-1}(R)$ with $\hat{x} = \frac{q_X - H_b^{-1}(R)}{1 - H_b^{-1}(R)}$ and $\hat{y} = \frac{q_Y - H_b^{-1}(R)}{1 - H_b^{-1}(R)}$ . It is interesting to note that the quantizer $p_{\hat{X}|X}$ does not depend on $p_{Y}$ while the dequantizer $p_{Y|\hat{Y}}$ does not depend on $p_{X}$ . So they are decoupled in a certain sense. Moreover, $p_{\hat{X}|X}$ and $p_{Y|\hat{Y}}$ coincide respectively with optimal quantizer $p_{\hat{X}^*|X}$ and dequantizer $p_{Y|\hat{Y}^*}$ in the conventional rate-distortion sense when $q_{X}, q_{Y} \leq 1/2$ .
+
+$\hat{X}$ and $H(\hat{X}^{\prime}) = H(\hat{Y}^{\prime}) \leq H(\hat{X})$ (or $H(\hat{X}^{\prime}) = H(\hat{Y}^{\prime}) \leq H(\hat{Y})$ ), such that $X \leftrightarrow \hat{X}^{\prime} \leftrightarrow \hat{Y}^{\prime} \leftrightarrow Y$ form a Markov chain, $\mathbb{E}[X|\hat{X}^{\prime}] = \hat{X}^{\prime}, \mathbb{E}[Y|\hat{Y}^{\prime}] = \hat{Y}^{\prime}$ , and
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \| X - \hat {X} ^ {\prime} \| ^ {2} \right] + \mathbb {E} \left[ \| Y - \hat {Y} ^ {\prime} \| \right] + \mathbb {E} \left[ \| \hat {X} ^ {\prime} - \hat {Y} ^ {\prime} \| ^ {2} \right] \\ = \mathbb {E} \left[ \left\| X - \hat {X} \right\| ^ {2} \right] + \mathbb {E} \left[ \left\| Y - \hat {Y} \right\| \right] + \mathbb {E} \left[ \left\| \hat {X} - \hat {Y} \right\| ^ {2} \right]. \\ \end{array}
+$$
+
+Proof. Let $\tilde{Y} \triangleq \mathbb{E}[Y|\hat{X}]$ . Since $\tilde{Y} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain and $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ , we have $\tilde{Y} = \mathbb{E}[\hat{Y}|\hat{X}]$ . Construct a new joint distribution $p_{X,\hat{X}',\hat{Y}',Y}$ such that $p_{X,\hat{X}'} = p_{X,\hat{X}}$ , $p_{\hat{X}',\hat{Y}'} = p_{\hat{X},\tilde{Y}}$ , $p_{Y,\hat{Y}'} = p_{Y,\tilde{Y}}$ , and $X \leftrightarrow \hat{X}' \leftrightarrow \hat{Y}' \leftrightarrow Y$ form a Markov chain. It is clear that $\mathbb{E}[X|\hat{X}'] = \hat{X}'$ , $\mathbb{E}[Y|\hat{Y}'] = \hat{Y}'$ , and
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \left\| X - \hat {X} ^ {\prime} \right\| ^ {2} \right] + \mathbb {E} \left[ \left\| Y - \hat {Y} ^ {\prime} \right\| ^ {2} \right] + \mathbb {E} \left[ \left\| \hat {X} ^ {\prime} - \hat {Y} ^ {\prime} \right\| ^ {2} \right] \\ = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \tilde {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \tilde {Y} \| ^ {2} ] \\ = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {Y} - \tilde {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \tilde {Y} \| ^ {2} ] \\ = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ], \\ \end{array}
+$$
+
+where the last equality is due to $\hat{Y} = \mathbb{E}[\hat{Y}|\hat{X}]$ . If the function that maps $\hat{X}'$ to $\hat{Y}'$ (or equivalently, maps $\hat{X}$ to $\hat{Y}$ ) is invertible, then $\hat{X}, \hat{X}', \hat{Y}'$ have the same support size and $H(\hat{X}) = H(X') = H(Y')$ , which completes the proof. Otherwise, the support size of $\hat{Y}'$ must be strictly smaller than that of $\hat{X}'$ (which is the same as that of $\hat{X}$ ) and $H(\hat{Y}') < H(\hat{X}') = H(\hat{X})$ . We can alternately reduce the support sizes of $\hat{X}'$ and $\hat{Y}'$ using this argument until they are deterministically related (and consequently have the same support size and the same entropy). This can be accomplished in a finite number of steps because the reduction in support size cannot continue forever.
+
+
+
+# A.6 UNIFORM DISTRIBUTION
+
+Let $X \sim \mathrm{Unif}[0, a]$ and $Y \sim \mathrm{Unif}[0, b]$ be uniformly distributed random variables, where $a, b > 0$ . Note that the density functions are given as: $p_{X}(x) = \frac{1}{a}, 0 \leq x \leq a$ and $p_{Y}(y) = \frac{1}{b}, 0 \leq y \leq b$ and $p_{X}(x)$ and $p_{Y}(y)$ are zero outside these intervals. The cumulative density functions of $X$ and $Y$ are
+
+given as follows:
+
+$$
+C _ {X} (x) = \left\{ \begin{array}{l l} 0, & x \leq 0, \\ \frac {x}{a}, & 0 \leq x \leq a, \\ 1, & x \geq a, \end{array} \right. \qquad C _ {Y} (y) = \left\{ \begin{array}{l l} 0, & y \leq 0, \\ \frac {y}{b}, & 0 \leq y \leq b, \\ 1, & y \geq b. \end{array} \right.
+$$
+
+Following Peyre & Cuturi (2019, Remark 2.30) we have that the optimal transport (without rate constraint) is given by:
+
+$$
+W _ {2} ^ {2} \left(p _ {X}, p _ {Y}\right) = \int_ {0} ^ {1} \left(C _ {X} ^ {- 1} (r) - C _ {Y} ^ {- 1} (r)\right) ^ {2} d r = \frac {(b - a) ^ {2}}{3}, \tag {39}
+$$
+
+where $C_X^{-1}(\cdot)$ and $C_Y^{-1}(\cdot)$ are the pseudo-inverse of the CDF functions for $X$ and $Y$ as defined in Peyre & Cuturi (2019, Remark 2.30).
+
+We will next develop an upper bound on $D_{\mathrm{ncr}}(p_X, p_Y, R)$ using Theorem 1 when the rate is of the form $R = \log_2(N)$ for any $N \in \{1, 2, \ldots\}$ , by considering the following choice for $\hat{X}$ and $\hat{Y}$ :
+
+$$
+\hat {X} \in \hat {\mathcal {X}} = \left\{\frac {a}{2 N}, \frac {3 a}{2 N}, \frac {5 a}{2 N}, \dots , \frac {(2 N - 1) a}{2 N} \right\}, \tag {40}
+$$
+
+$$
+\hat {Y} \in \hat {\mathcal {Y}} = \left\{\frac {b}{2 N}, \frac {3 b}{2 N}, \frac {5 b}{2 N}, \dots , \frac {(2 N - 1) b}{2 N} \right\}. \tag {41}
+$$
+
+To compute the upper bound we select $p_{\hat{X} |X}$ to correspond to scalar quantization of $X$ i.e., given $X$ we select $\hat{X}$ as a point in $\hat{\mathcal{X}}$ closest to $X$ . The distribution $p_{\hat{Y} |Y}$ is defined in an analogous manner3. Our upper bound can be computed as:
+
+$$
+D _ {\mathrm {n c r}} ^ {+} \left(p _ {X}, p _ {Y}, R\right) = \mathbb {E} \left[ \left(X - \hat {X}\right) ^ {2} \right] + \mathbb {E} \left[ \left(Y - \hat {Y}\right) ^ {2} \right] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right). \tag {42}
+$$
+
+Note that with $\Delta = \frac{1}{N}$ we have that $\mathbb{E}[(X - \hat{X})^2] = \frac{a^2\Delta^2}{12}$ and $\mathbb{E}[(Y - \hat{Y})^2] = \frac{b^2\Delta^2}{12}$ . Thus we only need to compute the third term. Following Peyré & Cuturi (2019, Remark 2.28) we have that:
+
+$$
+W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right) = \frac {(b - a) ^ {2} \Delta^ {2}}{4 N} \sum_ {i = 1} ^ {N} (2 i - 1) ^ {2} = \frac {(b - a) ^ {2}}{3} \left(1 - \frac {\Delta^ {2}}{4}\right). \tag {43}
+$$
+
+Thus using $\Delta^2 = 2^{-2R}$ , we have that
+
+$$
+D _ {\mathrm {n c r}} ^ {+} \left(p _ {X}, p _ {Y}, R\right) = \frac {(b - a) ^ {2}}{3} + \frac {a \cdot b}{6} 2 ^ {- 2 R}. \tag {44}
+$$
+
+Note that the upper bound approaches the lower bound in (39) as $R \to \infty$ , with exponential rate of convergence.
+
+For the case of general $R$ , we let $N = \lceil 2^R \rceil$ and following Gyorgy & Linder (2000, Theorem 1), we select
+
+$$
+\hat {X} \in \hat {\mathcal {X}} = \left\{\underbrace {\frac {a c}{2}} _ {\hat {x} _ {1}}, \underbrace {a \left(c + \frac {c ^ {\prime}}{2}\right)} _ {\hat {x} _ {2}}, \underbrace {a \left(c + 3 \frac {c ^ {\prime}}{2}\right)} _ {\hat {x} _ {3}}, \dots , \underbrace {a \left(c + (2 N - 3) \frac {c ^ {\prime}}{2}\right)} _ {\hat {x} _ {N}} \right\}, \tag {45}
+$$
+
+$$
+\hat {Y} \in \hat {\mathcal {Y}} = \left\{\underbrace {\frac {b c}{2}} _ {\hat {y} _ {1}}, \underbrace {b \left(c + \frac {c ^ {\prime}}{2}\right)} _ {\hat {y} _ {2}}, \underbrace {b \left(c + 3 \frac {c ^ {\prime}}{2}\right)} _ {\hat {y} _ {3}}, \ldots , \underbrace {b \left(c + (2 N - 3) \frac {c ^ {\prime}}{2}\right)} _ {\hat {y} _ {N}} \right\},
+$$
+
+
+Figure 7: Example of Uniform sources with $a = 2$ and $b = 5$ . The left plot shows the lower bound $W_2^2 (p_X,p_Y)$ in (39) and the upper bound $D_{\mathrm{ncr}}^{+}(p_{X},p_{Y},R)$ which is the sum of the right hand side in (46), (47) and (50). For comparison we also show the value of $W_2^2 (p_{\hat{X}},p_{\hat{Y}})$ . The right plot shows the distortions associated with the quantization and dequantization steps.
+
+
+
+where $c$ is the unique solution in the interval $(0, 1/N]$ to the equation:
+
+$$
+- c \log c - (1 - c) \log \frac {(1 - c)}{N - 1} = R,
+$$
+
+and $c' = \frac{(1 - c)}{N - 1}$ holds. Note that the length of the first interval is $c$ and the length of all other intervals is $c'$ . In the special case where $R = \log_2 N$ we will have that $c = c' = \frac{1}{N}$ and our construction for $\hat{X}$ and $\hat{Y}$ is consistent with the previous case.
+
+As before we use $p_{\hat{X} |X}$ and $p_{\hat{Y} |Y}$ to be the distributions associated with scalar quantization. Thus we have that:
+
+$$
+\mathbb {E} \left[ (X - \hat {X}) ^ {2} \right] = c \frac {a ^ {2} c ^ {2}}{1 2} + (1 - c) \frac {a ^ {2} c ^ {\prime 2}}{1 2}, \tag {46}
+$$
+
+$$
+\mathbb {E} \left[ (Y - \hat {Y}) ^ {2} \right] = c \frac {b ^ {2} c ^ {2}}{1 2} + (1 - c) \frac {b ^ {2} c ^ {\prime 2}}{1 2}. \tag {47}
+$$
+
+Furthermore using the result stated in Peyre & Cuturi (2019, Remark 2.30) we have that
+
+$$
+\begin{array}{l} W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right) = c \left(\hat {x} _ {1} - \hat {y} _ {1}\right) ^ {2} + c ^ {\prime} \sum_ {j = 2} ^ {N} \left(\hat {x} _ {j} - \hat {y} _ {j}\right) ^ {2} (48) \\ = (b - a) ^ {2} \frac {c ^ {3}}{4} + (b - a) ^ {2} c ^ {\prime} \sum_ {j = 1} ^ {N - 1} \left(c + \frac {2 j - 1}{2} c ^ {\prime}\right) ^ {2} (49) \\ = (b - a) ^ {2} \left(\frac {c ^ {3}}{4} + c ^ {2} c ^ {\prime} (N - 1) + c c ^ {\prime 2} (N - 1) ^ {2} + \frac {1}{1 2} c ^ {\prime 3} (2 N - 1) (2 N - 3) (N - 1)\right). (50) \\ \end{array}
+$$
+
+Finally, the upper bound $D_{\mathrm{ncr}}^{+}(p_{X}, p_{Y}, R)$ can be obtained by summing the right hand side of (46), (47) and (50). We provide a numerical evaluation of this upper bound in Fig. 7.
+
+# A.7 ASYMPTOTIC OPTIMAL TRANSPORT
+
+Let $X_{1}, X_{2}, \dots$ and $Y_{1}, Y_{2}, \dots$ be i.i.d. processes with marginal distributions $p_{X}$ and $p_{Y}$ , respectively.
+
+Definition 4 (Asymptotic Optimal Transport with Entropy Bottleneck — no common randomness). The asymptotic optimal transport from $p_X$ to $p_Y$ with an entropy bottleneck of $R$ and without common randomness is defined as
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} (p _ {X}, p _ {Y}, R) \triangleq \inf _ {n \geq 1} D _ {\mathrm {n c r}} ^ {(n)} (p _ {X}, p _ {Y}, R),
+$$
+
+where
+
+$$
+\begin{array}{l} D _ {\mathrm {n c r}} ^ {(n)} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {X} ^ {n}, Z, Y ^ {n} \in M _ {\mathrm {n c r}} \left(\otimes_ {i = 1} ^ {n} p _ {X}, \otimes_ {i = 1} ^ {n} p _ {Y}\right)} \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \left[ d \left(X _ {i}, Y _ {i}\right) \right] \\ \begin{array}{l} \text {s . t .} \quad \frac {1}{n} H (Z) \leq R. \end{array} \\ \end{array}
+$$
+
+Remark: It is clear that $D_{\mathrm{ncr}}^{(1)}(p_X, p_Y, R) = D_{\mathrm{ncr}}(p_X, p_Y, R)$ . Moreover, one can readily show that $\{nD_{\mathrm{ncr}}^{(n)}(p_X, p_Y, R)\}_{n=1}^{\infty}$ is a subadditive sequence and consequently $D_{\mathrm{ncr}}^{(\infty)}(p_X, p_Y, R) = \lim_{n \to \infty} D_{\mathrm{ncr}}^{(n)}(p_X, p_Y, R)$ .
+
+Theorem 5. We have
+
+$$
+\begin{array}{l} D_{\mathrm{ncr}}^{(\infty)}(p_{X},p_{Y},R) = \inf_{p_{X,Z,Y}\in M_{\mathrm{ncr}}(p_{X},p_{Y})}\mathbb{E}[d(X,Y)] \\ s. t. \quad \max \{I (X; Z), I (Y; Z) \} \leq R. \\ \end{array}
+$$
+
+Proof. This result can be specialized from Theorem 1 in Saldi et al. (2015b).
+
+
+
+The following result is the counterpart of Theorem 1 in the asymptotic setting.
+
+Theorem 6. Let
+
+$$
+D _ {\text {m s e}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {\hat {X} | X}, p _ {\hat {Y} | Y}} \mathbb {E} \left[ \| X - \hat {X} \| ^ {2} \right] + \mathbb {E} \left[ \| Y - \hat {Y} \| ^ {2} \right] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right) \tag {51}
+$$
+
+$$
+s. t. \quad \mathbb {E} [ X | \hat {X} ] = \hat {X}, \quad \mathbb {E} [ Y | \hat {Y} ] = \hat {Y}, \quad I (X; \hat {X}) \leq R, \quad I (Y; \hat {Y}) \leq R,
+$$
+
+and
+
+$$
+D _ {\mathrm {m s e}} \left(p _ {X}, R\right) \triangleq \inf _ {p _ {\hat {X} | X}} \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] \tag {52}
+$$
+
+$$
+s. t. \quad I (X; \hat {X}) \leq R.
+$$
+
+Moreover, let
+
+$$
+\bar {D} _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) \triangleq D _ {\mathrm {m s e}} ^ {(\infty)} \left(p _ {X}, R\right) + D _ {\mathrm {m s e}} ^ {(\infty)} \left(p _ {Y}, R\right) + W _ {2} ^ {2} \left(p _ {\hat {X} ^ {*}}, p _ {\hat {Y} ^ {*}}\right), \tag {53}
+$$
+
+$$
+\underline {{D}} _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) \triangleq D _ {\mathrm {m s e}} ^ {(\infty)} \left(p _ {X}, R\right) + D _ {\mathrm {m s e}} ^ {(\infty)} \left(p _ {Y}, R\right), \tag {54}
+$$
+
+where $p_{\hat{X}^*}$ and $p_{\hat{Y}^*}$ are the marginal distributions induced by the minimizers $p_{\hat{X}^*|X}$ and $p_{\hat{Y}^*|Y}$ that attain $D_{\mathrm{mse}}^{(\infty)}(p_X, R)$ and $D_{\mathrm{mse}}^{(\infty)}(p_Y, R)$ , respectively (assuming the existence and uniqueness of such minimizers). Then under the squared Euclidean distortion measure,
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) = D _ {\mathrm {m s e}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right). \tag {55}
+$$
+
+In addition, we have
+
+$$
+\bar {D} _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) \geq D _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right) \geq \underline {{D}} _ {\mathrm {n c r}} ^ {(\infty)} \left(p _ {X}, p _ {Y}, R\right), \tag {56}
+$$
+
+and both inequalities are tight when $p_X = p_Y$ .
+
+Proof. For any $p_{X,Z,Y} \in M_{\mathrm{ncr}}(p_X, p_Y)$ with $\max \{I(X;Z), I(Y;Z)\} \leq R$ ,
+
+$$
+\mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \mathbb {E} [ X | Z ] \| ^ {2} ] + \mathbb {E} [ \| Y - \mathbb {E} [ Y | Z ] \| ^ {2} ] + \mathbb {E} [ \| \mathbb {E} [ X | Z ] - \mathbb {E} [ Y | Z ] \| ^ {2} ]
+$$
+
+$$
+\geq D _ {\mathrm {m s e}} ^ {(\infty)} (p _ {X}, p _ {Y}, R),
+$$
+
+where the last inequality follows from the definition of $D_{\mathrm{mse}}^{(\infty)}(p_X,p_Y,R)$ and the fact that
+
+$$
+\max \{I (X; \mathbb {E} [ X | Z ]), I (Y; \mathbb {E} [ Y | Z ] \} \leq \max \{I (X; Z), I (Y; Z) \} \leq R.
+$$
+
+In view of Theorem 5, we must have $D_{\mathrm{ncr}}^{(\infty)}(p_X,p_Y,R) \geq D_{\mathrm{mse}}^{(\infty)}(p_X,p_Y,R)$ . On the other hand, for any $p_{\hat{X} |X}, p_{\hat{Y} |Y}$ with $\mathbb{E}[X|\hat{X}] = \hat{X}$ , $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ , $I(X;\hat{X}) \leq R$ , and $I(Y;\hat{Y}) \leq R$ , we can construct a joint distribution $p_{X,\hat{X},\hat{Y},Y}$ such that $X \leftrightarrow \hat{X} \leftrightarrow \hat{Y} \leftrightarrow Y$ form a Markov chain, $p_{X,\hat{X}} = p_Xp_{\hat{X} |X}, p_{Y,\hat{Y}} = p_Yp_{\hat{Y} |Y}$ , and $p_{\hat{X},\hat{Y}}$ satisfying $\mathbb{E}[\| \hat{X} -\hat{Y}\| ^2 ] = W_2^2 (p_{\hat{X}},p_{\hat{Y}})$ . Note that
+
+$$
+\begin{array}{l} \mathbb {E} [ \| X - Y \| ^ {2} ] = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + \mathbb {E} [ \| \hat {X} - \hat {Y} \| ^ {2} ] \\ = \mathbb {E} [ \| X - \hat {X} \| ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {\hat {Y}}\right). \tag {57} \\ \end{array}
+$$
+
+Let $Z \triangleq \hat{X}$ . It can be verified that $p_{X,Z,Y} \in M_{\mathrm{ncr}}(p_X, p_Y)$ and $\max \{I(X;Z), I(Y;Z)\} = \max \{I(X; \hat{X}), I(Y; \hat{X})\} \leq \max \{I(X; \hat{X}), I(Y; \hat{Y})\} \leq R$ , which, together with (57), implies $D_{\mathrm{ncr}}^{(\infty)}(p_X, p_Y, R) \leq D_{\mathrm{mse}}^{(\infty)}(p_X, p_Y, R)$ . This completes the proof of (55).
+
+Dropping the term $W_2^2(p_{\hat{X}}, p_{\hat{Y}})$ in (51) yields
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} (p _ {X}, p _ {Y}, R) \geq \tilde {D} _ {\mathrm {m s e}} ^ {(\infty)} (p _ {X}, R) + \tilde {D} _ {\mathrm {m s e}} ^ {(\infty)} (p _ {Y}, R),
+$$
+
+where
+
+$$
+\tilde {D} _ {\mathrm {m s e}} ^ {(\infty)} (p _ {X}, R) \triangleq \inf _ {p _ {\hat {X} | X}} \mathbb {E} [ \| X - \hat {X} \| ^ {2} ]
+$$
+
+$$
+\begin{array}{l l} \text {s . t .} & \mathbb {E} [ X | \hat {X} ] = \hat {X}, \quad I (X; \hat {X}) \leq R. \end{array}
+$$
+
+and $\tilde{D}_{\mathrm{mse}}(p_Y,R)$ is definitely analogously. On the other hand, choosing $p_{\hat{X} |X} = p_{\hat{X}'|X}$ and $p_{\hat{Y} |Y} = p_{\hat{Y}'|Y}$ in (51) gives
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} (p _ {X}, p _ {Y}, R) \leq \tilde {D} _ {\mathrm {m s e}} ^ {(\infty)} (p _ {X}, R) + \tilde {D} _ {\mathrm {m s e}} ^ {(\infty)} (p _ {Y}, R) + W _ {2} ^ {2} (p _ {\hat {X} ^ {\prime}}, p _ {\hat {Y} ^ {\prime}}),
+$$
+
+where $p_{\hat{X}^{\prime}|X}$ and $p_{\hat{Y}^{\prime}|Y}$ are the minimizers that attain $\tilde{D}_{\mathrm{mse}}^{(\infty)}(p_X,R)$ and $\tilde{D}_{\mathrm{mse}}^{(\infty)}(p_Y,R)$ respectively while $p_{\hat{X}^{\prime}}$ and $p_{\hat{Y}^{\prime}}$ are their induced marginal distributions. It is clear that $p_{\hat{X}^{\prime}|X}$ and $p_{\hat{Y}^{\prime}|Y}$ coincide with $p_{\hat{X}^{*}|X}$ and $p_{\hat{Y}^{*}|Y}$ respectively as the constraints $\mathbb{E}[X|\hat{X}] = \hat{X}$ and $\mathbb{E}[Y|\hat{Y}] = \hat{Y}$ are automatically satisfied by $p_{\hat{X}^{*}|X}$ and $p_{\hat{Y}^{*}|Y}$ . This proves (56). For the special case $p_X = p_Y$ , we have $p_{\hat{X}^{*}|X} = p_{\hat{Y}^{*}|Y}$ and consequently the upper bound and the lower bound in (56) coincide.
+
+Definition 5 (Asymptotic Optimal Transport with Entropy Bottleneck — with Common Randomness). The asymptotic optimal transport from $p_X$ to $p_Y$ with entropy bottleneck $R$ and common randomness is defined as
+
+$$
+D _ {\mathrm {c r}} ^ {(\infty)} (p _ {X}, p _ {Y}, R) \triangleq \inf _ {n \geq 1} D _ {\mathrm {c r}} ^ {(n)} (p _ {X}, p _ {Y}, R),
+$$
+
+where
+
+$$
+\begin{array}{l} D _ {\mathrm {c r}} ^ {(n)} \left(p _ {X}, p _ {Y}, R\right) \triangleq \inf _ {p _ {U, X} n, Z, Y ^ {n} \in M _ {\mathrm {c r}} \left(\otimes_ {i = 1} ^ {n} p _ {X}, \otimes_ {i = 1} ^ {n} p _ {Y}\right)} \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \left[ d \left(X _ {i}, Y _ {i}\right) \right] \\ \begin{array}{l} \text {s . t .} \quad \frac {1}{n} H (Z | U) \leq R. \end{array} \\ \end{array}
+$$
+
+Remark: It is clear that $D_{\mathrm{cr}}^{(1)}(p_X, p_Y, R) = D_{\mathrm{cr}}(p_X, p_Y, R)$ . Moreover, one can readily show that $\{nD_{\mathrm{cr}}^{(n)}(p_X, p_Y, R)\}_{n=1}^{\infty}$ is a subadditive sequence and consequently $D_{\mathrm{cr}}^{(\infty)}(p_X, p_Y, R) = \lim_{n \to \infty} D_{\mathrm{ncr}}^{(n)}(p_X, p_Y, R)$ .
+
+Theorem 7. We have
+
+$$
+D_{\operatorname{cr}}^{(\infty)}(p_{X},p_{Y},R) = \inf_{p_{X,Y}\in \Gamma (p_{X},p_{Y})}\mathbb{E}[d(X,Y)]
+$$
+
+$$
+s. t. \quad I (X; Y) \leq R.
+$$
+
+Proof. This result is known (see Theorem 7 in Saldi et al. (2015a)). It is possible to give a simpler proof of the achievability part by leveraging Theorem 3 and the strong data processing inequality Li & El Gamal (2018). The converse is based on standard information-theoretic arguments. $\square$
+
+# A.8 GAUSSIAN CASE
+
+Let $X \sim \mathcal{N}(\mu_X, \sigma_X^2)$ and $Y \sim \mathcal{N}(\mu_Y, \sigma_Y^2)$ be two Gaussian random variables, and let $d(\cdot, \cdot)$ be the squared distortion measure (i.e., $d(x, y) = (x - y)^2$ ). Let $D_{\min}^{(G)} \triangleq (\mu_X - \mu_Y)^2 + (\sigma_X - \sigma_Y)^2$ and $D_{\max}^{(G)} \triangleq (\mu_X - \mu_Y)^2 + \sigma_X^2 + \sigma_Y^2$ . Note that $D_{\min}^{(G)}$ is the squared Wasserstein-2 distance between $\mathcal{N}(\mu_X, \sigma_X^2)$ and $\mathcal{N}(\mu_Y, \sigma_Y)$ , which is the minimum $\mathbb{E}[(X - Y)^2]$ achievable by coupling $X$ and $Y$ . On the other hand, we have $\mathbb{E}[(X - Y)^2] = D_{\max}^{(G)}$ for $X, Y$ independent. It is clear that $D_{\min}^{(G)}$ and $D_{\max}^{(G)}$ are the infimum and supremum of $D_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X, \sigma_X^2), \mathcal{N}(\mu_Y, \sigma_Y^2), R)$ (as well as $D_{\mathrm{cr}}^{(\infty)}(\mathcal{N}(\mu_X, \sigma_X^2), \mathcal{N}(\mu_Y, \sigma_Y^2), R)$ ), respectively.
+
+Theorem 8. Assume squared distortion measure. Under no common randomness, we have
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right) = D _ {\min } ^ {(G)} + 2 \sigma_ {X} \sigma_ {Y} 2 ^ {- 2 R}, \quad R \in [ 0, \infty). \tag {58}
+$$
+
+Moreover,
+
+$$
+\bar {D} _ {\mathrm {n c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right) = D _ {\mathrm {n c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right), \quad R \in [ 0, \infty), \tag {59}
+$$
+
+$$
+\underline {{D}} _ {\mathrm {n c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right) = \left(\sigma_ {X} ^ {2} + \sigma_ {Y} ^ {2}\right) 2 ^ {- 2 R}, \quad R \in [ 0, \infty). \tag {60}
+$$
+
+With common randomness,
+
+$$
+D _ {\mathrm {c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right) = D _ {\max } ^ {(G)} - 2 \sigma_ {X} \sigma_ {Y} \sqrt {1 - 2 ^ {- 2 R}}, \quad R \in [ 0, \infty). \tag {61}
+$$
+
+Proof. Consider $p_{\hat{X} |X}$ and $p_{\hat{Y} |Y}$ such that $\mathbb{E}[X|\hat{X}]$ , $\mathbb{E}[Y|\hat{Y}]$ , $I(X; \hat{X}) \leq R$ , and $I(Y; \hat{Y}) \leq R$ . Denote the mean and the variance of $\hat{X}$ by $\mu_{\hat{X}}$ and $\sigma_{\hat{X}}^2$ , respectively. Similarly, denote the mean and the variance of $\hat{Y}$ by $\mu_{\hat{Y}}$ and $\sigma_{\hat{Y}}^2$ , respectively. Clearly, $\mu_{\hat{X}} = \mu_X$ , $\mu_{\hat{Y}} = \mu_Y$ , $\sigma_{\hat{X}}^2 = \sigma_X^2 - \mathbb{E}[(X - \hat{X})^2]$ , and $\sigma_{\hat{Y}}^2 = \sigma_Y^2 - \mathbb{E}[(Y - \hat{Y})^2]$ . Moreover,
+
+$$
+\begin{array}{l} W _ {2} ^ {2} (p _ {\hat {X}}, p _ {\hat {Y}}) \geq W _ {2} ^ {2} (\mathcal {N} (\mu_ {\hat {X}}, \sigma_ {\hat {X}} ^ {2}), \mathcal {N} (\mu_ {\hat {Y}}, \sigma_ {\hat {Y}} ^ {2})) \\ = \left(\mu_ {\hat {X}} - \mu_ {\hat {Y}}\right) ^ {2} + \left(\sigma_ {\hat {X}} - \sigma_ {\hat {Y}}\right) ^ {2} \\ = (\mu_ {X} - \mu_ {Y}) ^ {2} + (\sigma_ {\hat {X}} - \sigma_ {\hat {Y}}) ^ {2}. \\ \end{array}
+$$
+
+So we have
+
+$$
+\begin{array}{l} \mathbb {E} [ (X - \hat {X}) ^ {2} ] + \mathbb {E} [ \| Y - \hat {Y} \| ^ {2} ] + W _ {2} ^ {2} (p _ {\hat {X}}, p _ {\hat {Y}}) \\ \geq \sigma_ {X} ^ {2} - \sigma_ {\hat {X}} ^ {2} + \sigma_ {Y} ^ {2} - \sigma_ {\hat {Y}} ^ {2} + (\mu_ {X} - \mu_ {Y}) ^ {2} + (\sigma_ {\hat {X}} - \sigma_ {\hat {Y}}) ^ {2} \\ = D _ {\max } ^ {(G)} - 2 \sigma_ {\hat {X}} \sigma_ {\hat {Y}}. \tag {62} \\ \end{array}
+$$
+
+It can be verified that
+
+$$
+\begin{array}{l} R \geq I (X; \hat {X}) \\ = \frac {1}{2} \log (2 \pi e \sigma_ {X} ^ {2}) - h (X | \hat {X}) \\ \geq \frac {1}{2} \log (2 \pi e \sigma_ {X} ^ {2}) - h (X - \hat {X}) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \geq \frac {1}{2} \log \left(2 \pi e \sigma_ {X} ^ {2}\right) - \frac {1}{2} \log \left(2 \pi e \mathbb {E} \left[ (X - \hat {X}) ^ {2} \right]\right) \\ = \frac {1}{2} \log \frac {\sigma_ {X} ^ {2}}{\sigma_ {X} ^ {2} - \sigma_ {\hat {X}} ^ {2}}, \\ \end{array}
+$$
+
+which implies
+
+$$
+\sigma_ {\hat {X}} \leq \sigma_ {X} \sqrt {1 - 2 ^ {- 2 R}}. \tag {63}
+$$
+
+Similarly,
+
+$$
+\sigma_ {\hat {Y}} \leq \sigma_ {Y} \sqrt {1 - 2 ^ {- 2 R}}. \tag {64}
+$$
+
+Substituting (63) and (64) into (62) and invoking (55) in Theorem 6 shows
+
+$$
+D _ {\mathrm {n c r}} ^ {(\infty)} \left(\mathcal {N} \left(\mu_ {X}, \sigma_ {X} ^ {2}\right), \mathcal {N} \left(\mu_ {Y}, \sigma_ {Y} ^ {2}\right), R\right) \geq D _ {\min } ^ {(G)} + 2 \sigma_ {X} \sigma_ {Y} 2 ^ {- 2 R}.
+$$
+
+To see that this lower bound is tight, we can let
+
+$$
+X = \hat {X} + N, \tag {65}
+$$
+
+$$
+Y = \hat {Y} + \hat {N}, \tag {66}
+$$
+
+where $\hat{X} \sim \mathcal{N}(\mu_X, \sigma_X^2 (1 - 2^{-2R}))$ is independent of $N \sim \mathcal{N}(0, \sigma_X^2 2^{-2R})$ while $\hat{Y} \sim \mathcal{N}(\mu_Y, \sigma_Y^2 (1 - 2^{-2R}))$ is independent of $\hat{N} \sim \mathcal{N}(0, \sigma_Y^2 2^{-2R})$ . This completes the proof of (58).
+
+To prove (59) and (60), it suffices to note the well-known fact that $p_{\hat{X} |X}$ and $p_{\hat{Y} |Y}$ associated with (65) and (66) attain $D_{\mathrm{mse}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),R)$ and $D_{\mathrm{mse}}^{(\infty)}(\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ , respectively.
+
+Now we proceed to prove (61). Consider $p_{X,Y} \in \Gamma(\mathcal{N}(\mu_X, \sigma_X^2), \mathcal{N}(\mu_Y, \sigma_Y^2))$ with $I(X;Y) \leq R$ . Let $\xi \triangleq \mathbb{E}[(X - \mu_X)(Y - \mu_Y)]$ . We have
+
+$$
+\mathbb {E} \left[ (X - Y) ^ {2} \right] = D _ {\max } ^ {(G)} - 2 \xi . \tag {67}
+$$
+
+Moreover,
+
+$$
+\begin{array}{l} R \geq I (X; Y) \\ = \frac {1}{2} \log (2 \pi e \sigma_ {X} ^ {2}) + \frac {1}{2} \log (2 \pi e \sigma_ {Y} ^ {2}) - h (X, Y) \\ \geq \frac {1}{2} \log (2 \pi e \sigma_ {X} ^ {2}) + \frac {1}{2} \log (2 \pi e \sigma_ {Y} ^ {2}) - \frac {1}{2} \log ((2 \pi e) ^ {2} (\sigma_ {X} ^ {2} \sigma_ {Y} ^ {2} - \xi)) \\ = \frac {1}{2} \log \frac {\sigma_ {X} ^ {2} \sigma_ {Y} ^ {2}}{\sigma_ {X} ^ {2} \sigma_ {Y} ^ {2} - \xi^ {2}}, \\ \end{array}
+$$
+
+which implies
+
+$$
+\xi \leq \sigma_ {X} \sigma_ {Y} \sqrt {1 - 2 ^ {- 2 R}}. \tag {68}
+$$
+
+Substituting (68) into (67) and invoking Theorem 7 shows
+
+$$
+D _ {\mathrm {c r}} ^ {(\infty)} (\mathcal {N} (\mu_ {X}, \sigma_ {X} ^ {2}), \mathcal {N} (\mu_ {Y}, \sigma_ {Y} ^ {2}), R) \geq D _ {\max} ^ {(G)} - 2 \sigma_ {X} \sigma_ {Y} \sqrt {1 - 2 ^ {- 2 R}}.
+$$
+
+To see that this lower bound is tight, we can let $X$ and $Y$ be jointly Gaussian with $\xi = \sigma_X\sigma_Y\sqrt{1 - 2^{-2R}}$ . This completes the proof of Theorem 8. We acknowledge that the expression of $D_{\mathrm{cr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ was established in (Saldi et al., 2015b, Section IV-B) for the special case when the Gaussian distributions have zero mean. However, to the best of our understanding, they only provided an upper bound for the case of no common randomness.
+
+In Figure 8, We plot $D_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ , $\overline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ , $\underline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ , and $D_{\mathrm{cr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ for two illustrative examples.
+
+
+(a)
+
+
+(b)
+Figure 8: Gaussian case distortion-rate tradeoffs. (a) $\mu_{X} = \mu_{Y} = 0$ , $\sigma_{X} = \sigma_{Y} = 1$ , where $\overline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ and $\underline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ coincide with $D_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ ; (b) $\mu_{X} = 0, \sigma_{X} = 1$ , $\mu_{Y} = 1$ , $\sigma_{Y} = 2$ , where $\overline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ is tight but $\underline{D}_{\mathrm{ncr}}^{(\infty)}(\mathcal{N}(\mu_X,\sigma_X^2),\mathcal{N}(\mu_Y,\sigma_Y^2),R)$ is loose. Moreover, it can be seen from both examples that common randomness can indeed help improve the distortion-rate tradeoff.
+
+# B EXPERIMENTAL RESULTS
+
+# B.1 DATASET
+
+Image super-resolution is conducted on MNIST (LeCun et al., 1998). For synthesizing low-resolution images, we perform bilinear downsampling on the original image from $28 \times 28$ to $7 \times 7$ . The samples in Figure 5(b) show that the low resolution digits are blurry and some of them are hard to recognize. Image denoising is conducted on SVHN (Netzer et al., 2011). In our experiments, we synthesize the noisy image with additive Gaussian noise. The standard deviation is set to 20.
+
+# B.2 UNIVERSAL QUANTIZATION
+
+Let $\mathcal{C}$ be our codebook for quantization. Recall that the encoder uses a tanh activation so its output lies in $(-1,1)^d$ . Given dimension $d$ and $L$ quantization levels per dimension as parameters, $\mathcal{C}$ will consist of $L$ uniformly spaced intervals across all $d$ dimensions. The upper bound of model rate is given by $d\log (L)$ . With this codebook, universal quantization (Ziv, 1985; Gray & Stockham, 1993; Theis & Agustsson, 2021) is implemented as follows. We assume the sender and receiver have access to the same $u\sim U[-1 / (L - 1), + 1 / (L - 1)]^d$ . The sender computes
+
+$$
+z = \operatorname *{arg min}_{c\in \mathcal{C}}\| f(x) + u - c\|
+$$
+
+and sends $z$ to the receiver. The receiver decodes the image by passing $z - u$ through the decoder. This is also known as a subtractive dither in literature (Gray & Stockham, 1993). For super-resolution and image denoising, the interval $L$ is respectively fixed at 4 and 8.
+
+# B.3 TRAINING DETAILS
+
+To induce distributional shift, we use the Wasserstein GAN for our experiments. We alternate between training the encoder/decoder $f, g$ , and the critic $h$ . By Kantorovich-Rubinstein duality (Villani, 2009), the critic is used to approximate
+
+$$
+W _ {1} \left(p _ {Y}, p _ {\tilde {Y}}\right) = \sup _ {\| \nabla h \| \leq 1} \mathbb {E} [ h (Y) ] - \mathbb {E} [ h (\tilde {Y}) ], \tag {69}
+$$
+
+where $\tilde{Y} = g(Q(f(X) + U) - U)$ for $U$ as in Appendix B.2. The Lipschitz constraint is implemented with a gradient penalty (Gulrajani et al., 2017) in practice.
+
+Super-resolution. The training for end-to-end network lasts for 50 epochs. $\lambda$ in (15) is fixed at $1e - 3$ across all rates. The learning rate initialized to be 0.0001 and is decayed by a factor of 5 after 30 epochs. The Adam (Kingma & Ba, 2014) optimizer is used. Table 3 illustrates the detailed training setting. For the helper two-branch network at a specific rate constraint, we load the pre-trained encoder weight of the corresponding end-to-end network, as well as two randomly initialized decoders $g_{1}, g_{2}$ . Note that only theese two decoders are trainable. During training, we use the Adam optimizer with the learning rate initialized at 0.0001. There are a total of 100 epochs until the convergence of the two decoders. The learning rate is decayed once at 50 epochs by a factor of 5. Detailed training settings are shown in Table 4.
+
+Image Denoising. The experiments for image denoising share many settings with image superresolution. Tables 3 and 4 can be reused to reproduce the experiments on image denoising. Here, we list the difference between them. For denoising, the end-to-end model is trained for 100 epochs with $\lambda$ fixed at $3e - 3$ across all rates. The learning rate is decayed by a factor of 5 after 40 epochs. The two-branch model is trained for total 200 epochs and we decay the learning rate at 100 epochs by a factor of 5.
+
+Table 3: Hyperparameters used for training end-to-end model in Fig. 4(a). $\alpha$ is the learning rate, $(\beta_{1},\beta_{2})$ are the parameters for Adam, and $\lambda_{\mathrm{GP}}$ is the gradient penalty coefficient.
+
+ | α | β1 | β2 | λGP |
| Encoder | 10-4 | 0.5 | 0.999 | - |
| Decoder | 10-4 | 0.5 | 0.999 | - |
| Critic | 10-4 | 0.5 | 0.999 | 10 |
+
+Table 4: Hyperparameters used for training two-branch model in Fig. 4(b). $\alpha$ is the learning rate, $(\beta_{1},\beta_{2})$ are the parameters for Adam, and $\lambda_{\mathrm{GP}}$ is the gradient penalty coefficient.
+
+ | α | β1 | β2 | λGP |
| Encoder | 0 | - | - | - |
| Decoder-1 | 10-4 | 0.5 | 0.999 | - |
| Decoder-2 | 10-4 | 0.5 | 0.999 | - |
| Critic | 10-4 | 0.5 | 0.999 | 10 |
+
+# B.4 DETAILED RESULTS IN FIGURE. 5
+
+In Fig. 5(a)(c), we have provided a comparison between the case with or without common randomness in the form of a scatter chart. Here, we present detailed quantities of each point in Fig. 5(a)(c). Table 5 shows the number of each dot for super-resolution experiments, and Table 6 presents the value of each dot for image denoising. From the two tables, we can further see the utility of common randomness quantitatively.
+
+# B.5 COMPARISON WITH BASELINE
+
+To illustrate the effectiveness of our system, we compare with a baseline method that separately deal with the tasks of image restoration and compression. For the restoration (image super-resolution and denoising), we respectively build two U-Nets with skip connections and train them in the unsupervised manner by adopting the Eq. 15 as objective i.e.,
+
+$$
+L _ {1} = \mathbb {E} [ \| X - \tilde {Y} \| ^ {2} ] + \lambda_ {1} W _ {1} \left(p _ {Y}, p _ {\tilde {Y}}\right). \tag {70}
+$$
+
+After the restoration networks are trained to converge, we fix their weights and use them to produce restored images $\tilde{Y}$ given degraded one $X$ . Afterwards, we adopt our end-to-end network as compression network by minimizing the following loss at different rates:
+
+Table 5: The detailed number of MSE distortion loss in Fig. 5(a).
+Super-resolution with Common Randomness
+
+| Rate | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
| MSE | 0.0515 | 0.0457 | 0.0420 | 0.0394 | 0.0372 | 0.0353 | 0.0339 | 0.0324 |
| Rate | 20 | 22 | 24 | 26 | 28 | 30 | 32 | - |
| MSE | 0.0313 | 0.0300 | 0.0297 | 0.0285 | 0.0280 | 0.0277 | 0.0269 | - |
+
+Super-resolution without Common Randomness
+
+| Rate | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
| MSE | 0.0558 | 0.0506 | 0.0463 | 0.0435 | 0.0415 | 0.0396 | 0.0383 | 0.0367 |
| Rate | 20 | 22 | 24 | 26 | 28 | 30 | 32 | - |
| MSE | 0.0351 | 0.0337 | 0.0331 | 0.0328 | 0.0315 | 0.0308 | 0.0300 | - |
+
+Table 6: The detailed number of MSE distortion loss in Fig. 5(c).
+Image Denoising with Common Randomness
+
+| Rate | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
| MSE | 0.0219 | 0.0195 | 0.0175 | 0.01634 | 0.0154 | 0.0147 | 0.0138 | 0.0135 | 0.0129 |
| Rate | 66 | 72 | 78 | 84 | 90 | 96 | 102 | 108 | 114 |
| MSE | 0.0126 | 0.0123 | 0.0118 | 0.0117 | 0.0115 | 0.0112 | 0.0109 | 0.0107 | 0.0106 |
+
+Image Denoising without Common Randomness
+
+| Rate | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
| MSE | 0.0230 | 0.0208 | 0.0189 | 0.0175 | 0.0165 | 0.0157 | 0.0151 | 0.0145 | 0.014 |
| Rate | 66 | 72 | 78 | 84 | 90 | 96 | 102 | 108 | 114 |
| MSE | 0.0137 | 0.0133 | 0.0130 | 0.0127 | 0.0123 | 0.0120 | 0.0118 | 0.0116 | 0.0114 |
+
+$$
+L _ {1} = \mathbb {E} [ \| \tilde {Y} - Y ^ {+} \| ^ {2} ] + \lambda W _ {1} \left(p _ {Y}, p _ {Y ^ {+}}\right), \tag {71}
+$$
+
+where $Y^{+}$ is the outputs of compression network. Note that, to guarantee the distribution of reconstructed $Y^{+}$ is close to that of target images, we implement a penalty on the Wasserstein-1 distance in (70) and (71). For the image super-resolution, we experimentally selected $\lambda_{1} = 0.05$ and $\lambda_{2} = 0.01$ . For the image denoising, we experimentally selected $\lambda_{1} = 0.03$ and $\lambda_{2} = 0.005$ . Once the compression network is converged, we report the final MSE distortion between $Y^{+}$ and $X$ using $\mathbb{E}[\|X - Y^{+}\|^2]$ .
+
+The detailed results for entropy-constrained image super-resolution and denoising are respectively shown in Table 7 and Table 8. It can easily check throughout the tables that our end-to-end systems outperform the baselines.
+
+# B.6 COMPARISON WITH GROUND TRUTH
+
+In order to illustrate the rate-distortion trade-offs, we report the MSE distortion that is measured between degraded input images and decoder outputs in Figure 5. Since the input and output distributions are different, we do not expect $\mathrm{MSE} \to 0$ as the rate increases. The MSE distortion between degraded input and restored output is still able to reveal how much content information of the input is preserved in output (lower is better).
+
+We now additionally show the MSE distortion between ground truth and decoder outputs in Tables 9 and 10. Concretely, we measure MSE distortion $\mathbb{E}[\| Y - \tilde{Y}\|^2]$ , where $Y$ is ground truth and $\tilde{Y}$ is the network output. Note that for training, the ground truth is only used in an unsupervised fashion
+
+Table 7: Comparison between our end-to-end system with the baseline method for image superresolution. Numbers are the MSE distortion loss for a particular rate. Best results are in bold.
+Super-resolution with Common Randomness
+
+| Rate | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
| Baseline | 0.0603 | 0.0568 | 0.0544 | 0.0530 | 0.0523 | 0.0511 | 0.0503 | 0.0498 |
| Ours | 0.0515 | 0.0457 | 0.0420 | 0.0394 | 0.0372 | 0.0353 | 0.0339 | 0.0342 |
| Rate | 20 | 22 | 24 | 26 | 28 | 30 | 32 | - |
| Baseline | 0.0489 | 0.0485 | 0.0484 | 0.0482 | 0.0478 | 0.0476 | 0.0471 | - |
| Ours | 0.0313 | 0.0300 | 0.0297 | 0.0285 | 0.0280 | 0.0277 | 0.0269 | - |
+
+Super-resolution without Common Randomness
+
+| Rate | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
| Baseline | 0.0620 | 0.0585 | 0.0573 | 0.0555 | 0.0543 | 0.0535 | 0.0532 | 0.0520 |
| Ours | 0.0558 | 0.0506 | 0.0463 | 0.0435 | 0.0415 | 0.0396 | 0.0383 | 0.0367 |
| Rate | 20 | 22 | 24 | 26 | 28 | 30 | 32 | - |
| Baseline | 0.0517 | 0.0512 | 0.0506 | 0.0505 | 0.0497 | 0.0495 | 0.0490 | - |
| Ours | 0.0351 | 0.0337 | 0.0331 | 0.0328 | 0.0315 | 0.0308 | 0.0300 | - |
+
+Table 8: Comparison between our end-to-end system with the baseline method for image denoising. Numbers are the MSE distortion loss for a particular rate. Best results are in bold.
+Image Denoising with Common Randomness
+
+| Rate | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
| Baseline | 0.0242 | 0.0213 | 0.0189 | 0.0173 | 0.0162 | 0.0154 | 0.0148 | 0.0142 | 0.0136 |
| Ours | 0.0219 | 0.0195 | 0.0175 | 0.0163 | 0.0154 | 0.0147 | 0.0138 | 0.0135 | 0.0129 |
| Rate | 66 | 72 | 78 | 84 | 90 | 96 | 102 | 108 | 114 |
| Baseline | 0.0134 | 0.0130 | 0.0127 | 0.0124 | 0.0120 | 0.0118 | 0.0116 | 0.0111 | 0.0110 |
| Ours | 0.0126 | 0.0123 | 0.0118 | 0.0117 | 0.0115 | 0.0112 | 0.0109 | 0.0107 | 0.0106 |
+
+Image Denoising without Common Randomness
+
+| Rate | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
| Baseline | 0.0252 | 0.0216 | 0.0202 | 0.0185 | 0.0178 | 0.0164 | 0.0158 | 0.0154 | 0.0149 |
| Ours | 0.0230 | 0.0208 | 0.0189 | 0.0175 | 0.0165 | 0.0157 | 0.0151 | 0.0145 | 0.014 |
| Rate | 66 | 72 | 78 | 84 | 90 | 96 | 102 | 108 | 114 |
| Baseline | 0.0147 | 0.0144 | 0.0140 | 0.0135 | 0.0133 | 0.0129 | 0.0126 | 0.0120 | 0.0117 |
| Ours | 0.0137 | 0.0133 | 0.0130 | 0.0127 | 0.0123 | 0.0120 | 0.0118 | 0.0116 | 0.0114 |
+
+with unpaired noisy images, and here the ground truth-noisy image pairs are only used for test time evaluation. Note also that the MSE distortion is correspondingly lower if common randomness is adopted.
+
+Table 9: Illustration of MSE distortion between network outputs and ground truth for super-resolution.
+Super-resolution with Common Randomness
+
+| Rate | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 |
| MSE | 0.0582 | 0.0464 | 0.0408 | 0.0380 | 0.0360 | 0.0353 | 0.0348 | 0.0343 |
+
+Super-resolution without Common Randomness
+
+| Rate | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 |
| MSE | 0.0646 | 0.0492 | 0.0426 | 0.0390 | 0.0375 | 0.0362 | 0.0353 | 0.0345 |
+
+Table 10: Illustration of MSE distortion between network outputs and ground truth for image denoising.
+
+| Image Denoising with Common Randomness |
| Rate | 12 | 24 | 36 | 48 | 60 | 72 | 84 | 96 | 108 |
| MSE | 0.0157 | 0.0114 | 0.0092 | 0.0077 | 0.0069 | 0.0062 | 0.0056 | 0.0052 | 0.0047 |
| Image Denoising without Common Randomness |
| Rate | 12 | 24 | 36 | 48 | 60 | 72 | 84 | 96 | 108 |
| MSE | 0.0169 | 0.0128 | 0.0104 | 0.0090 | 0.0080 | 0.0072 | 0.0066 | 0.0060 | 0.0057 |
+
+# B.7 BREAKDOWN OF THE TABLE 1
+
+It is worth reminding that the each number in Table 1 is the total distortion 18. Here, we provide a breakdown of total distortion in each of the three term for joint training, i.e, $\mathbb{E}[\| X - \tilde{Y}_1\|^2]$ , $\mathbb{E}[\| \tilde{Y} - \tilde{Y}_2\|^2]$ and $\mathbb{E}[\| \tilde{Y}_1 - \tilde{Y}_2\|^2]$ .
+
+# B.8 NETWORK ARCHITECTURE
+
+Super-resolution. The detailed network structure for end-to-end model and two-branch model are respectively presented in Table 12 and Table 13. The last linear layer of the encoder controls the number of output symbols.
+
+**Denoising.** The detailed network structure for end-to-end model and two-branch model are respectively presented in Table 14 and Table 15. The last linear layer of the encoder controls the number of output symbols.
+
+Table 11: Breakdown of the Table 1. At any rate, it can be observed that the total losses of our approximation system $(L_{2})$ are very close to that of end-to-end learning system under the setting without common randomness $(\mathbb{E}[\| X - \tilde{Y}\|^2])$ .
+
+Image Super-resolution Using Joint Training
+
+| Rate | E[||X-Ŷ1||2] | E[||Ŷ-Ŷ2||2] | E[||Ŷ1-Ŷ2||2] | L2 | E[||X-Ŷ||2] |
| 4 | 0.0355 | 0.0227 | 0.0004 | 0.0586 | 0.0558 |
| 10 | 0.0223 | 0.0222 | 0.0008 | 0.0453 | 0.0435 |
| 20 | 0.0136 | 0.0191 | 0.00013 | 0.0349 | 0.0351 |
| 30 | 0.00122 | 0.0172 | 0.0015 | 0.0309 | 0.0308 |
+
+Image Denoising Using Joint Training
+
+| Rate | E[||X-Ŷ1||2] | E[||Ŷ-Ŷ2||2] | E[||Ŷ1-Ŷ2||2] | L2 | E[||X-Ŷ||2] |
| 12 | 0.01911 | 0.00497 | 0.00020 | 0.02428 | 0.02302 |
| 30 | 0.01458 | 0.00435 | 0.00026 | 0.01919 | 0.01746 |
| 60 | 0.01168 | 0.00378 | 0.00032 | 0.01578 | 0.01401 |
| 90 | 0.01035 | 0.00323 | 0.00028 | 0.01386 | 0.01229 |
+
+Table 12: Model architectures of end-to-end network used in super-resolution.
+
+| Encoder | Decoder | Critic |
| Input | Input | Input |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU | Conv2D, l-ReLU |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU | Conv2D, l-ReLU |
| Flatten | Un flatten | Conv2D, l-ReLU |
| Linear, l-ReLU | ConvT2D, BatchNorm2D, l-ReLU | Linear |
| Linear, l-ReLU | ConvT2D, BatchNorm2D, l-ReLU | |
| Linear, Tanh | ConvT2D, BatchNorm2D, Sigmoid | |
| Quantizer | | |
+
+Table 13: Model architectures of two-branch network used in super-resolution.
+
+| Encoder | Decoder1 and 2 |
| Input | Input |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU |
| Flatten | Un flatten |
| Linear, l-ReLU | ConvT2D, BatchNorm2D, l-ReLU |
| Linear, l-ReLU | ConvT2D, BatchNorm2D, l-ReLU |
| Linear, Tanh | ConvT2D, Sigmoid |
| Quantizer | |
+
+Table 14: Model architectures of end-to-end network used in image denoising.
+
+| Encoder | Decoder | Critic |
| Input | Input | Input |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU | Conv2D, l-ReLU |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU | Conv2D, l-ReLU |
| Conv2D, l-ReLU | Un flatten | Conv2D, l-ReLU |
| Flatten | ConvT2D, BatchNorm2D, l-ReLU | Linear |
| Linear, Tanh | ConvT2D, BatchNorm2D, l-ReLU | |
| Quantizer | ConvT2D, BatchNorm2D, l-ReLU | |
| ConvT2D, BatchNorm2D, Sigmoid | |
+
+Table 15: Model architectures of two-branch network used in image denoising. ResBlock is formed using two Conv2D and skip connection.
+
+| Encoder | Decoder1 and 2 |
| Input | Input |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU |
| Conv2D, l-ReLU | Linear, BatchNorm1D, l-ReLU |
| Conv2D, l-ReLU | Unflatten |
| Flatten | ConvT2D, l-ReLU |
| Linear, Tanh | ResBlock, ConvT2D, l-ReLU |
| Quantizer | ResBlock, ConvT2D, l-ReLU |
| ResBlock, ConvT2D, Sigmoid |
\ No newline at end of file
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/images.zip b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..8368a3337b3c5d9553b1b2c940e40d52844ad461
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:939f2a448658da7355fa74c7f52856894f1d6b3e076beb3720d4981e6a794f0f
+size 2412995
diff --git a/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/layout.json b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e85cb29e71cc7994fa2731b696a9a450c90a3b6
--- /dev/null
+++ b/lossycompressionwithdistributionshiftasentropyconstrainedoptimaltransport/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:31181d6ff5ad86bfaf377760ef5e72b15eb64fa76844e4e7523309e65ee9efa3
+size 1755639